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...
#include <multiNormal.H>


Public Member Functions | |
| TypeName ("multiNormal") | |
| Runtime type information. | |
| multiNormal (const dictionary &dict, Random &rndGen) | |
| Construct from components. | |
| multiNormal (const multiNormal &p) | |
| Copy construct. | |
| virtual autoPtr< distributionModel > | clone () const |
| Construct and return a clone. | |
| void | operator= (const multiNormal &)=delete |
| No copy assignment. | |
| virtual | ~multiNormal ()=default |
| Destructor. | |
| virtual scalar | sample () const |
| Sample the distribution. | |
| scalar | sample (const scalar mu, const scalar sigma) const |
| Sample the normal distribution. | |
| virtual scalar | meanValue () const |
| Return the theoretical mean of the distribution. | |
| Public Member Functions inherited from distributionModel | |
| TypeName ("distributionModel") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, distributionModel, dictionary,(const dictionary &dict, Random &rndGen),(dict, rndGen)) | |
| Declare runtime constructor selection table. | |
| distributionModel (const word &name, const dictionary &dict, Random &rndGen) | |
| Construct from dictionary. | |
| distributionModel (const distributionModel &p) | |
| Copy construct. | |
| virtual | ~distributionModel ()=default |
| Destructor. | |
| virtual scalar | minValue () const |
| Return the minimum of the distribution. | |
| virtual scalar | maxValue () const |
| Return the maximum of the distribution. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from distributionModel | |
| static autoPtr< distributionModel > | New (const dictionary &dict, Random &rndGen) |
| Selector. | |
| Protected Member Functions inherited from distributionModel | |
| virtual void | check () const |
| Check that the distribution model is valid. | |
| Protected Attributes inherited from distributionModel | |
| const dictionary | distributionModelDict_ |
| Coefficients dictionary. | |
| Random & | rndGen_ |
| Reference to the random number generator. | |
| scalar | minValue_ |
| Minimum of the distribution. | |
| scalar | maxValue_ |
| Maximum of the distribution. | |
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)
\]](form_536.png)
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)
}
\]](form_537.png)
where
![]() | = | Doubly-truncated univariate normal distribution |
![]() | = | Mean of the parent general normal distribution |
![]() | = | Standard deviation of the parent general normal distribution |
![]() | = | General normal probability density function |
![]() | = | General normal cumulative distribution function |
![]() | = | Sample |
![]() | = | Minimum of the distribution (the same for each distribution) |
![]() | = | Maximum of the distribution (the same for each distribution) |
![]() | = | Weighting factor |
Constraints:

![$ x \in [B,A] $](form_512.png)


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)
\]](form_550.png)
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)
\]](form_551.png)
![\[ \Phi(\xi) =
\frac{1}{2}
\left(
1 + {erf}\left(\frac{\xi - \mu}{\sigma \sqrt{2} }\right)
\right)
\]](form_552.png)
where 

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 281 of file multiNormal.H.
| multiNormal | ( | const dictionary & | dict, |
| Random & | rndGen ) |
Construct from components.
Definition at line 41 of file multiNormal.C.
References dict, distributionModel::distributionModel(), distributionModel::distributionModelDict_, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, and rndGen.
Referenced by clone(), multiNormal(), operator=(), and TypeName().


| multiNormal | ( | const multiNormal & | p | ) |
Copy construct.
Definition at line 113 of file multiNormal.C.
References distributionModel::distributionModel(), multiNormal(), and p.

|
virtualdefault |
| TypeName | ( | "multiNormal" | ) |
Runtime type information.
References dict, multiNormal(), p, and rndGen.

|
inlinevirtual |
Construct and return a clone.
Implements distributionModel.
Definition at line 327 of file multiNormal.H.
References multiNormal().

|
delete |
|
virtual |
Sample the distribution.
Implements distributionModel.
Definition at line 124 of file multiNormal.C.
References distributionModel::rndGen_, and sample().
Referenced by sample().


| Foam::scalar sample | ( | const scalar | mu, |
| const scalar | sigma ) const |
Sample the normal distribution.
Definition at line 142 of file multiNormal.C.
References b, Foam::clamp(), Foam::erf(), Foam::Math::erfInv(), distributionModel::maxValue_, distributionModel::minValue_, mu, p, distributionModel::rndGen_, sigma(), Foam::sqrt(), and x.

|
virtual |
Return the theoretical mean of the distribution.
Implements distributionModel.
Definition at line 168 of file multiNormal.C.
References forAll.