Particle-size distribution model wherein random samples are drawn from a mixture of a finite set of doubly-truncated univariate normal probability density functions: More...
Public Member Functions | |
TypeName ("multiNormal") | |
Runtime type information. More... | |
multiNormal (const dictionary &dict, Random &rndGen) | |
Construct from components. More... | |
multiNormal (const multiNormal &p) | |
Copy construct. More... | |
virtual autoPtr< distributionModel > | clone () const |
Construct and return a clone. More... | |
void | operator= (const multiNormal &)=delete |
No copy assignment. More... | |
virtual | ~multiNormal ()=default |
Destructor. More... | |
virtual scalar | sample () const |
Sample the distribution. More... | |
scalar | sample (const scalar mu, const scalar sigma) const |
Sample the normal distribution. More... | |
virtual scalar | meanValue () const |
Return the theoretical mean of the distribution. More... | |
Public Member Functions inherited from distributionModel | |
TypeName ("distributionModel") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, distributionModel, dictionary,(const dictionary &dict, Random &rndGen),(dict, rndGen)) | |
Declare runtime constructor selection table. More... | |
distributionModel (const word &name, const dictionary &dict, Random &rndGen) | |
Construct from dictionary. More... | |
distributionModel (const distributionModel &p) | |
Copy construct. More... | |
virtual autoPtr< distributionModel > | clone () const =0 |
Construct and return a clone. More... | |
virtual | ~distributionModel ()=default |
Destructor. More... | |
virtual scalar | sample () const =0 |
Sample the distribution. More... | |
virtual scalar | minValue () const |
Return the minimum of the distribution. More... | |
virtual scalar | maxValue () const |
Return the maximum of the distribution. More... | |
virtual scalar | meanValue () const =0 |
Additional Inherited Members | |
Static Public Member Functions inherited from distributionModel | |
static autoPtr< distributionModel > | New (const dictionary &dict, Random &rndGen) |
Selector. More... | |
Protected Member Functions inherited from distributionModel | |
virtual void | check () const |
Check that the distribution model is valid. More... | |
Protected Attributes inherited from distributionModel | |
const dictionary | distributionModelDict_ |
Coefficients dictionary. More... | |
Random & | rndGen_ |
Reference to the random number generator. More... | |
scalar | minValue_ |
Minimum of the distribution. More... | |
scalar | maxValue_ |
Maximum of the distribution. More... | |
Particle-size distribution model wherein random samples are drawn from a mixture of a finite set of doubly-truncated univariate normal probability density functions:
\[ g (\mathbf{x}; \mathbf{\mu}, \mathbf{\sigma}, A, B) = \sum_i w_i f(x_i; \mu_i, \sigma_i, A, B) \]
with for any distribution:
\[ f(x; \mu, \sigma, A, B) = \frac{1}{\sigma} \frac{ \phi \left( \frac{x - \mu}{\sigma} \right) }{ \Phi \left( \frac{B - \mu}{\sigma} \right) - \Phi \left( \frac{A - \mu}{\sigma} \right) } \]
where
\( f(x; \mu, \sigma, A, B) \) | = | Doubly-truncated univariate normal distribution |
\( \mu \) | = | Mean of the parent general normal distribution |
\( \sigma \) | = | Standard deviation of the parent general normal distribution |
\( \phi(\cdot) \) | = | General normal probability density function |
\( \Phi(\cdot) \) | = | General normal cumulative distribution function |
\( x \) | = | Sample |
\( A \) | = | Minimum of the distribution (the same for each distribution) |
\( B \) | = | Maximum of the distribution (the same for each distribution) |
\( w_i \) | = | Weighting factor |
Constraints:
Random samples are generated by a combination of the inverse transform sampling technique and categorical sampling in three steps:
distributionModels::normal
):\[ x = \mu + \sigma \sqrt{2} \, {erf}^{-1} \left( 2 p - 1 \right) \]
with
\[ p = u \, \left( \Phi\left( \frac{B - \mu}{\sigma} \right) - \Phi\left( \frac{A - \mu}{\sigma} \right) \right) + \Phi\left( \frac{A - \mu}{\sigma} \right) \]
\[ \Phi(\xi) = \frac{1}{2} \left( 1 + {erf}\left(\frac{\xi - \mu}{\sigma \sqrt{2} }\right) \right) \]
where \( u \) is another sample drawn from the uniform probability density function on the unit interval \( (0, 1) \).
constant/<CloudProperties>
: subModels { injectionModels { <name> { ... sizeDistribution { type multiNormal; multiNormalDistribution { minValue <min>; maxValue <max>; mu ( <mean1> <mean2> ... ); sigma ( <standard deviation1> <standard deviation2> ... ); weight ( <weight1> <weight2> ... ); } } } } }
where the entries mean:
Property | Description | Type | Reqd | Deflt |
---|---|---|---|---|
type | Type name: multiNormal | word | yes | - |
multiNormalDistribution | Distribution settings | dict | yes | - |
minValue | Minimum of the distribution | scalar | yes | - |
maxValue | Maximum of the distribution | scalar | yes | - |
mu | List of means of parent general normal distributions | scalarList | yes | - |
sigma | List of standard deviations of parent general normal distributions | scalarList | yes | - |
weight | List of weights of a given distribution in the distribution mixture | scalarList | yes | - |
Notes
minValue
and maxValue
are the same for all distributions in the distribution mixture.weight
should always be input in a non-decreasing (i.e. monotonic) order.Definition at line 285 of file multiNormal.H.
multiNormal | ( | const dictionary & | dict, |
Random & | rndGen | ||
) |
Construct from components.
Definition at line 48 of file multiNormal.C.
multiNormal | ( | const multiNormal & | p | ) |
Copy construct.
Definition at line 120 of file multiNormal.C.
|
virtualdefault |
Destructor.
TypeName | ( | "multiNormal" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone.
Implements distributionModel.
Definition at line 317 of file multiNormal.H.
|
delete |
No copy assignment.
|
virtual |
Sample the distribution.
Implements distributionModel.
Definition at line 131 of file multiNormal.C.
Foam::scalar sample | ( | const scalar | mu, |
const scalar | sigma | ||
) | const |
Sample the normal distribution.
Definition at line 149 of file multiNormal.C.
References b, Foam::erf(), Foam::Math::erfInv(), Foam::max(), Foam::min(), mu, p, Foam::sqrt(), and x.
|
virtual |
Return the theoretical mean of the distribution.
Implements distributionModel.
Definition at line 175 of file multiNormal.C.
References forAll.