Loading...
Searching...
No Matches
exponential Class Reference

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

#include <exponential.H>

Inheritance diagram for exponential:
Collaboration diagram for exponential:

Public Member Functions

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

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 185 of file exponential.H.

Constructor & Destructor Documentation

◆ exponential() [1/2]

exponential ( const dictionary & dict,
Random & rndGen )

Construct from components.

Definition at line 38 of file exponential.C.

References distributionModel::check(), dict, distributionModel::distributionModel(), distributionModel::distributionModelDict_, Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, Foam::nl, and rndGen.

Referenced by clone(), exponential(), operator=(), and TypeName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exponential() [2/2]

exponential ( const exponential & p)

Copy construct.

Definition at line 59 of file exponential.C.

References distributionModel::distributionModel(), exponential(), and p.

Here is the call graph for this function:

◆ ~exponential()

virtual ~exponential ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "exponential" )

Runtime type information.

References dict, exponential(), p, and rndGen.

Here is the call graph for this function:

◆ clone()

virtual autoPtr< distributionModel > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements distributionModel.

Definition at line 220 of file exponential.H.

References exponential().

Here is the call graph for this function:

◆ operator=()

void operator= ( const exponential & )
delete

No copy assignment.

References exponential().

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 68 of file exponential.C.

References Foam::exp(), Foam::log(), distributionModel::maxValue_, distributionModel::minValue_, and distributionModel::rndGen_.

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


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