Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
QMOMFieldFunction< dim > Class Template Reference

#include <qmom_field_function.h>

Inheritance diagram for QMOMFieldFunction< dim >:
[legend]

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

Detailed Description

template<int dim>
class QMOMFieldFunction< dim >

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:

  • components 0 to n_scalars - 1 are the scalars: component c is scalar c;
  • components n_scalars to n_scalars + n_moments - 1 are the moments: component c is the moment M_k, with k = c - n_scalars.

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.

Template Parameters
dimNumber of spatial dimensions.

Definition at line 62 of file qmom_field_function.h.

Constructor & Destructor Documentation

◆ QMOMFieldFunction()

template<int dim>
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.

Parameters
[in]functionsFunctions of the scalars and particle size distribution.
[in]n_scalarsNumber of scalars transported by the QMOM physics.
[in]n_momentsNumber of moments transported by the QMOM physics.
[in]descriptionDescription 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.

Member Function Documentation

◆ compute_moments()

template<int dim>
std::vector< double > QMOMFieldFunction< dim >::compute_moments ( const Point< dim > & p) const
private

Compute the raw moments of the particle size distribution at a point.

Parameters
[in]pPoint at which the distribution is evaluated.
Returns
Raw moments M_0 to M_{n_moments - 1}.

Definition at line 126 of file qmom_field_function.cc.

References functions, and n_moments.

◆ moment_values()

template<int dim>
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.

Parameters
[in]pPoint at which the function is evaluated.
[out]valuesValues 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.

◆ scalar_values()

template<int dim>
void QMOMFieldFunction< dim >::scalar_values ( const Point< dim > & p,
Vector< double > & values ) const

Evaluate the scalars only, indexed from 0 regardless of the moments.

Parameters
[in]pPoint at which the function is evaluated.
[out]valuesValues of the scalars at p, of size n_scalars: values[i] is scalar i.

Definition at line 95 of file qmom_field_function.cc.

References functions, and n_scalars.

◆ set_time()

template<int dim>
void QMOMFieldFunction< dim >::set_time ( const double new_time)
override

Set the time of the function and of the underlying functions.

Parameters
[in]new_timeNew time.

Definition at line 118 of file qmom_field_function.cc.

References functions.

◆ value()

template<int dim>
double QMOMFieldFunction< dim >::value ( const Point< dim > & p,
const unsigned int component ) const
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.

Parameters
[in]pPoint at which the function is evaluated.
[in]componentIndex of the field, between 0 and n_scalars + n_moments - 1 (see the class description).
Returns
Value of the component at p.

Definition at line 65 of file qmom_field_function.cc.

References compute_moments(), functions, and n_scalars.

◆ vector_value()

template<int dim>
void QMOMFieldFunction< dim >::vector_value ( const Point< dim > & p,
Vector< double > & values ) const
override

Evaluate all the components of the function. The moments are computed once for all of them.

Parameters
[in]pPoint at which the function is evaluated.
[out]valuesValues 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.

Member Data Documentation

◆ functions

template<int dim>
Parameters::QMOMFunctions<dim> QMOMFieldFunction< dim >::functions
private

Functions of the scalars and particle size distribution.

Definition at line 153 of file qmom_field_function.h.

◆ n_moments

template<int dim>
const unsigned int QMOMFieldFunction< dim >::n_moments
private

Number of moments.

Definition at line 159 of file qmom_field_function.h.

◆ n_scalars

template<int dim>
const unsigned int QMOMFieldFunction< dim >::n_scalars
private

Number of scalars.

Definition at line 156 of file qmom_field_function.h.


The documentation for this class was generated from the following files: