uniform Class Reference

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

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

Public Member Functions

 TypeName ("uniform")
 Runtime type information. More...
 
 uniform (const dictionary &dict, Random &rndGen)
 Construct from components. More...
 
 uniform (const uniform &p)
 Copy construct. More...
 
virtual autoPtr< distributionModelclone () const
 Construct and return a clone. More...
 
void operator= (const uniform &)=delete
 No copy assignment. More...
 
virtual ~uniform ()=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 ~distributionModel ()=default
 Destructor. More...
 
virtual scalar minValue () const
 Return the minimum of the distribution. More...
 
virtual scalar maxValue () const
 Return the maximum of the distribution. More...
 

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

Constructor & Destructor Documentation

◆ uniform() [1/2]

uniform ( const dictionary dict,
Random rndGen 
)

Construct from components.

Definition at line 46 of file uniform.C.

References Foam::check().

Referenced by uniform::clone().

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 57 of file uniform.C.

◆ ~uniform()

virtual ~uniform ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "uniform"  )

Runtime type information.

◆ clone()

virtual autoPtr<distributionModel> clone ( ) const
inlinevirtual

Construct and return a clone.

Implements distributionModel.

Definition at line 180 of file uniform.H.

References uniform::uniform().

Here is the call graph for this function:

◆ operator=()

void operator= ( const uniform )
delete

No copy assignment.

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 65 of file uniform.C.

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Return the theoretical mean of the distribution.

Implements distributionModel.

Definition at line 71 of file uniform.C.


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