binned Class Reference

Particle-size distribution model wherein random samples are drawn from a given discrete set of (bin, probability) pairs, where in terms of its meaning, bins correspond to particle sizes and probabilities correspond to (relative) probability of occurrences. More...

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

Public Member Functions

 TypeName ("binned")
 Runtime type information. More...
 
 binned (const dictionary &dict, Random &rndGen)
 Construct from dictionary. More...
 
 binned (const UList< scalar > &sampleData, const scalar binWidth, Random &rndGen)
 Construct from components. More...
 
 binned (const binned &p)
 Copy construct. More...
 
virtual autoPtr< distributionModelclone () const
 Construct and return a clone. More...
 
void operator= (const binned &)=delete
 No copy assignment. More...
 
virtual ~binned ()=default
 Destructor. More...
 
virtual scalar sample () const
 Sample the distribution. More...
 
virtual scalar meanValue () const
 Return the arithmetic mean of the distribution data. More...
 
virtual void writeData (Ostream &os) const
 Write data to stream. More...
 
virtual void readData (Istream &os)
 Read data from stream. More...
 
virtual dictionary writeDict (const word &dictName) const
 Write data in dictionary format. More...
 
virtual void readDict (const dictionary &dict)
 Read data from dictionary. 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
 

Static Public Attributes

static const char * header
 

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 a given discrete set of (bin, probability) pairs, where in terms of its meaning, bins correspond to particle sizes and probabilities correspond to (relative) probability of occurrences.

The second column (i.e. probability) are normalised by the sum of all its values, resulting in a normalised column in the domain of [0,1]. To generate a sample, first a sample drawn from the uniform probability density function on the unit interval (i.e. u), and then, the bin corresponding to the first probability larger than u is fetched as the particle size to be further processed.

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

            sizeDistribution
            {
                type        binned;
                binnedDistribution
                {
                    distribution
                    (
                        (<bin1>    <probability1>)
                        (<bin2>    <probability2>)
                        ...
                        (<binN>    <probabilityN>)
                    );
                }
            }
        }
    }
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: binned word yes -
binnedDistribution Distribution settings dict yes -
distribution <bin>-<probability> pairs dict yes -
<bin> Particle size scalar yes -
<probability> Probability of occurrence scalar yes -
Source files

Definition at line 153 of file binned.H.

Constructor & Destructor Documentation

◆ binned() [1/3]

binned ( const dictionary dict,
Random rndGen 
)

Construct from dictionary.

Definition at line 93 of file binned.C.

References distributionModel::check(), distributionModel::maxValue_, and distributionModel::minValue_.

Here is the call graph for this function:

◆ binned() [2/3]

binned ( const UList< scalar > &  sampleData,
const scalar  binWidth,
Random rndGen 
)

Construct from components.

Allows negative entries

Definition at line 112 of file binned.C.

References Foam::endl(), forAll, Foam::mag(), Foam::max(), distributionModel::maxValue_, Foam::min(), distributionModel::minValue_, Foam::nl, and WarningInFunction.

Here is the call graph for this function:

◆ binned() [3/3]

binned ( const binned p)

Copy construct.

Definition at line 178 of file binned.C.

◆ ~binned()

virtual ~binned ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "binned"  )

Runtime type information.

◆ clone()

virtual autoPtr< distributionModel > clone ( ) const
inlinevirtual

Construct and return a clone.

Implements distributionModel.

Definition at line 200 of file binned.H.

◆ operator=()

void operator= ( const binned )
delete

No copy assignment.

◆ sample()

Foam::scalar sample ( ) const
virtual

Sample the distribution.

Implements distributionModel.

Definition at line 188 of file binned.C.

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Return the arithmetic mean of the distribution data.

Implements distributionModel.

Definition at line 204 of file binned.C.

◆ writeData()

void writeData ( Ostream os) const
virtual

Write data to stream.

Definition at line 217 of file binned.C.

References os(), and binned::writeData().

Referenced by binned::writeData().

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

◆ readData()

void readData ( Istream os)
virtual

Read data from stream.

Definition at line 210 of file binned.C.

◆ writeDict()

Foam::dictionary writeDict ( const word dictName) const
virtual

Write data in dictionary format.

Definition at line 224 of file binned.C.

References dict, and dictName().

Here is the call graph for this function:

◆ readDict()

void readDict ( const dictionary dict)
virtual

Read data from dictionary.

Definition at line 237 of file binned.C.

References dict, and binned::readDict().

Referenced by binned::readDict().

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

Member Data Documentation

◆ header

const char * header
static
Initial value:
=
"(bin probability)"

Definition at line 179 of file binned.H.


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