exponential Class Reference

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

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

Public Member Functions

 TypeName ("exponential")
 Runtime type information. More...
 
 exponential (const dictionary &dict, Random &rndGen)
 Construct from components. More...
 
 exponential (const exponential &p)
 Copy construct. More...
 
virtual autoPtr< distributionModelclone () const
 Construct and return a clone. More...
 
void operator= (const exponential &)=delete
 No copy assignment. More...
 
virtual ~exponential ()=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 exponential probability density function:

\[ f(x; \lambda, A, B) = \lambda \frac{\exp(-\lambda (x - A))}{1 - \exp(-\lambda(B-A))} \]

where

\( f(x; \lambda, A, B) \) = Exponential probability density function
\( \lambda \) = Rate parameter
\( x \) = Sample
\( A \) = Minimum of the distribution
\( B \) = Maximum of the distribution

Constraints:

  • \( \infty > B > A > 0 \)
  • \( x \in [B,A] \)
  • \( \lambda > 0 \)

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

\[ x = - \frac{1}{\lambda} \ln (r) \]

with

\[ r = q_{min} + u (q_{max} - q_{min}) \]

\[ q_{min} = \exp(-\lambda A) \]

\[ q_{max} = \exp(-\lambda B) \]

where \( u \) is a sample drawn from the uniform probability density function on the unit interval \( (0, 1) \).

Usage
Minimal example by using constant/<CloudProperties>:
subModels
{
    injectionModels
    {
        <name>
        {
            ...

            sizeDistribution
            {
                type        exponential;
                exponentialDistribution
                {
                    lambda      <lambdaValue>;
                    minValue    <minValue>;
                    maxValue    <maxValue>;
                }
            }
        }
    }
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: exponential word yes -
exponentialDistribution Distribution settings dict yes -
lambda Rate parameter scalar yes -
minValue Minimum of the distribution scalar yes -
maxValue Maximum of the distribution scalar yes -
Source files

Definition at line 189 of file exponential.H.

Constructor & Destructor Documentation

◆ exponential() [1/2]

exponential ( const dictionary dict,
Random rndGen 
)

Construct from components.

Definition at line 45 of file exponential.C.

References distributionModel::check(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ exponential() [2/2]

exponential ( const exponential p)

Copy construct.

Definition at line 66 of file exponential.C.

◆ ~exponential()

virtual ~exponential ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "exponential"  )

Runtime type information.

◆ clone()

virtual autoPtr< distributionModel > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements distributionModel.

Definition at line 214 of file exponential.H.

◆ operator=()

void operator= ( const exponential )
delete

No copy assignment.

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 75 of file exponential.C.

References Foam::exp(), and Foam::log().

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 84 of file exponential.C.


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