Loading...
Searching...
No Matches
uniform Class Reference

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

#include <uniform.H>

Inheritance diagram for uniform:
Collaboration diagram for uniform:

Public Member Functions

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

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

where

$      f(x; A, B)  $=Doubly-truncated uniform distribution
$      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 uniform probability density function:

\‍[        x = u \, (B - A) + A
\‍]

where $ u $ is 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        uniform;
                uniformDistribution
                {
                    minValue  <min>;
                    maxValue  <max>;
                }
            }
        }
    }
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: uniform word yes -
uniformDistribution Distribution settings dict yes -
minValue Minimum of the distribution scalar yes -
maxValue Maximum of the distribution scalar yes -
Source files

Definition at line 157 of file uniform.H.

Constructor & Destructor Documentation

◆ uniform() [1/2]

uniform ( const dictionary & dict,
Random & rndGen )

Construct from components.

Definition at line 38 of file uniform.C.

References distributionModel::check(), dict, distributionModel::distributionModel(), Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, and rndGen.

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

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

◆ uniform() [2/2]

uniform ( const uniform & p)

Copy construct.

Definition at line 50 of file uniform.C.

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

Here is the call graph for this function:

◆ ~uniform()

virtual ~uniform ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "uniform" )

Runtime type information.

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

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 184 of file uniform.H.

References uniform().

Here is the call graph for this function:

◆ operator=()

void operator= ( const uniform & )
delete

No copy assignment.

References uniform().

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 58 of file uniform.C.

References distributionModel::maxValue_, distributionModel::minValue_, and distributionModel::rndGen_.

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Return the theoretical mean of the distribution.

Implements distributionModel.

Definition at line 64 of file uniform.C.

References distributionModel::maxValue_, and distributionModel::minValue_.


The documentation for this class was generated from the following files:
  • src/lagrangian/distributionModels/uniform/uniform.H
  • src/lagrangian/distributionModels/uniform/uniform.C