![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <qmom_field_function.h>
Public Member Functions | |
| QMOMFieldFunction (const Parameters::QMOMFunctions< dim > &functions, const unsigned int n_scalars, const unsigned int n_moments, const std::string &description) | |
| double | value (const Point< dim > &p, const unsigned int component) const override |
| void | vector_value (const Point< dim > &p, Vector< double > &values) const override |
| void | scalar_values (const Point< dim > &p, Vector< double > &values) const |
| void | moment_values (const Point< dim > &p, Vector< double > &values) const |
| void | set_time (const double new_time) override |
Private Member Functions | |
| std::vector< double > | compute_moments (const Point< dim > &p) const |
Private Attributes | |
| Parameters::QMOMFunctions< dim > | functions |
| const unsigned int | n_scalars |
| const unsigned int | n_moments |
Function of all the QMOM fields, built from the functions of the scalars and from the particle size distribution.
It has one component per field, n_scalars + n_moments components in total. The scalars come first, then the moments:
For example, with 2 scalars and 4 moments, components 0 and 1 are the scalars 0 and 1, and components 2, 3, 4 and 5 are the moments M_0, M_1, M_2 and M_3. Without scalars, component c is the moment M_c.
Scalar c is given by expression c of the scalars function, so the scalar expressions must be given in the same order as the scalar names.
The moments are the raw moments of the particle size distribution, scaled by the number density: M_k = n E[L^k], where n is the number density in particles per m^3 and L the particle size in m. They are computed analytically by QMOMKit, and are all zero if the distribution type is none.
| dim | Number of spatial dimensions. |
Definition at line 62 of file qmom_field_function.h.
| QMOMFieldFunction< dim >::QMOMFieldFunction | ( | const Parameters::QMOMFunctions< dim > & | functions, |
| const unsigned int | n_scalars, | ||
| const unsigned int | n_moments, | ||
| const std::string & | description ) |
Constructor. Verifies that the scalars function has one component per scalar, unless there are no scalars, and that QMOMKit is available if the moments are computed from a particle size distribution.
| [in] | functions | Functions of the scalars and particle size distribution. |
| [in] | n_scalars | Number of scalars transported by the QMOM physics. |
| [in] | n_moments | Number of moments transported by the QMOM physics. |
| [in] | description | Description of the functions (e.g. "initial conditions"), used in the error message. |
Definition at line 38 of file qmom_field_function.cc.
References functions, n_moments, n_scalars, and Parameters::none.
|
private |
Compute the raw moments of the particle size distribution at a point.
| [in] | p | Point at which the distribution is evaluated. |
Definition at line 126 of file qmom_field_function.cc.
| void QMOMFieldFunction< dim >::moment_values | ( | const Point< dim > & | p, |
| Vector< double > & | values ) const |
Evaluate the moments only, indexed from 0 regardless of the scalars. The moments are computed once for all of them.
| [in] | p | Point at which the function is evaluated. |
| [out] | values | Values of the moments at p, of size n_moments: values[k] is the moment M_k. |
Definition at line 106 of file qmom_field_function.cc.
References compute_moments(), and n_moments.
| void QMOMFieldFunction< dim >::scalar_values | ( | const Point< dim > & | p, |
| Vector< double > & | values ) const |
Evaluate the scalars only, indexed from 0 regardless of the moments.
| [in] | p | Point at which the function is evaluated. |
| [out] | values | Values of the scalars at p, of size n_scalars: values[i] is scalar i. |
Definition at line 95 of file qmom_field_function.cc.
|
override |
Set the time of the function and of the underlying functions.
| [in] | new_time | New time. |
Definition at line 118 of file qmom_field_function.cc.
References functions.
|
override |
Evaluate one component of the function: scalar component if component < n_scalars, moment M_{component - n_scalars} otherwise.
Evaluating a moment computes all the moments at p. Use vector_value() to evaluate several moments at the same point.
| [in] | p | Point at which the function is evaluated. |
| [in] | component | Index of the field, between 0 and n_scalars + n_moments - 1 (see the class description). |
Definition at line 65 of file qmom_field_function.cc.
References compute_moments(), functions, and n_scalars.
|
override |
Evaluate all the components of the function. The moments are computed once for all of them.
| [in] | p | Point at which the function is evaluated. |
| [out] | values | Values of all the components at p, of size n_scalars + n_moments: values[i] is scalar i for i < n_scalars and values[n_scalars + k] is the moment M_k. |
Definition at line 80 of file qmom_field_function.cc.
References compute_moments(), functions, n_moments, and n_scalars.
|
private |
Functions of the scalars and particle size distribution.
Definition at line 153 of file qmom_field_function.h.
|
private |
Number of moments.
Definition at line 159 of file qmom_field_function.h.
|
private |
Number of scalars.
Definition at line 156 of file qmom_field_function.h.