normal Class Reference

Particle-size distribution model wherein random samples are drawn from the doubly-truncated univariate normal probability density function: More...

Inheritance diagram for normal:
[legend]
Collaboration diagram for normal:
[legend]

Public Member Functions

 TypeName ("normal")
 Runtime type information. More...
 
 normal (const dictionary &dict, Random &rndGen)
 Construct from components. More...
 
 normal (const normal &p)
 Copy construct. More...
 
virtual autoPtr< distributionModelclone () const
 Construct and return a clone. More...
 
void operator= (const normal &)=delete
 No copy assignment. More...
 
virtual ~normal ()=default
 Destructor. More...
 
virtual scalar sample () const
 Sample the 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< distributionModelclone () 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< distributionModelNew (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...
 
RandomrndGen_
 Reference to the random number generator. More...
 
scalar minValue_
 Minimum of the distribution. More...
 
scalar maxValue_
 Maximum of the distribution. More...
 

Detailed Description

Particle-size distribution model wherein random samples are drawn from the doubly-truncated univariate normal probability density function:

\[ 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
\( B \) = Maximum of the distribution

Constraints:

  • \( \infty > B > A > 0 \)
  • \( x \in [B,A] \)
  • \( \sigma^2 > 0 \)

Random samples are generated by the inverse transform sampling technique by using the quantile function of the doubly-truncated univariate normal probability density function:

\[ 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 sample drawn from the uniform probability density function on the unit interval \( (0, 1) \).

Reference:

        Governing expressions (tag:B):
            Burkardt, J. (2014).
            The truncated normal distribution.
            Department of Scientific Computing Website,
            Florida State University, 1-35.
            URL:people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf
            (Retrieved on: 19 Feb 2021)
Usage
Minimal example by using constant/<CloudProperties>:
subModels
{
    injectionModels
    {
        <name>
        {
            ...

            sizeDistribution
            {
                type        normal;
                normalDistribution
                {
                    mu        <mean>;
                    sigma     <stardard deviation>;
                    minValue  <min>;
                    maxValue  <max>;
                }
            }
        }
    }
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: normal word yes -
normalDistribution Distribution settings dict yes -
mu

Mean of the parent general normal distribution

scalar yes -
sigma

Standard deviation of the parent general normal

distribution

scalar yes -
minValue Minimum of the distribution scalar yes -
maxValue Maximum of the distribution scalar yes -
Note
  • The mean and standard deviation of the parent general normal probability distribution function (i.e. input) are not the same with those of the truncated probability distribution function.
Source files

Definition at line 248 of file normal.H.

Constructor & Destructor Documentation

◆ normal() [1/2]

normal ( const dictionary dict,
Random rndGen 
)

Construct from components.

Definition at line 47 of file normal.C.

◆ normal() [2/2]

normal ( const normal p)

Copy construct.

Definition at line 83 of file normal.C.

◆ ~normal()

virtual ~normal ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "normal"  )

Runtime type information.

◆ clone()

virtual autoPtr< distributionModel > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements distributionModel.

Definition at line 276 of file normal.H.

◆ operator=()

void operator= ( const normal )
delete

No copy assignment.

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 93 of file normal.C.

References b, Foam::erf(), Foam::Math::erfInv(), Foam::max(), Foam::min(), p, Foam::sqrt(), and x.

Here is the call graph for this function:

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Return the theoretical mean of the distribution.

Implements distributionModel.

Definition at line 115 of file normal.C.

References b, Foam::erf(), Foam::exp(), Foam::constant::mathematical::pi(), Foam::sqr(), and Foam::sqrt().

Here is the call graph for this function:

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