Public Member Functions | Static Public Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for binned:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("binned")
 
 binned (const dictionary &dict, Random &rndGen)
 
 binned (const UList< scalar > &sampleData, const scalar binWidth, Random &rndGen)
 
 binned (const binned &p)
 
virtual autoPtr< distributionModelclone () const
 
void operator= (const binned &)=delete
 
virtual ~binned ()=default
 
virtual scalar sample () const
 
virtual scalar meanValue () const
 
virtual void writeData (Ostream &os) const
 
virtual void readData (Istream &os)
 
virtual dictionary writeDict (const word &dictName) const
 
virtual void readDict (const dictionary &dict)
 
- Public Member Functions inherited from distributionModel
 TypeName ("distributionModel")
 
 declareRunTimeSelectionTable (autoPtr, distributionModel, dictionary,(const dictionary &dict, Random &rndGen),(dict, rndGen))
 
 distributionModel (const word &name, const dictionary &dict, Random &rndGen)
 
 distributionModel (const distributionModel &p)
 
virtual ~distributionModel ()=default
 
virtual scalar minValue () const
 
virtual scalar maxValue () const
 

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)
 
- Protected Member Functions inherited from distributionModel
virtual void check () const
 
- Protected Attributes inherited from distributionModel
const dictionary distributionModelDict_
 
RandomrndGen_
 
scalar minValue_
 
scalar maxValue_
 

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 149 of file binned.H.

Constructor & Destructor Documentation

◆ binned() [1/3]

binned ( const dictionary dict,
Random rndGen 
)

Definition at line 87 of file binned.C.

References Foam::check().

Referenced by binned::clone().

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

◆ binned() [2/3]

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

Definition at line 106 of file binned.C.

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

Here is the call graph for this function:

◆ binned() [3/3]

binned ( const binned p)

Definition at line 171 of file binned.C.

◆ ~binned()

virtual ~binned ( )
virtualdefault

Member Function Documentation

◆ TypeName()

TypeName ( "binned"  )

◆ clone()

virtual autoPtr<distributionModel> clone ( ) const
inlinevirtual

Implements distributionModel.

Definition at line 196 of file binned.H.

References binned::binned().

Here is the call graph for this function:

◆ operator=()

void operator= ( const binned )
delete

◆ sample()

Foam::scalar sample ( ) const
virtual

Implements distributionModel.

Definition at line 181 of file binned.C.

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Implements distributionModel.

Definition at line 197 of file binned.C.

◆ writeData()

void writeData ( Ostream os) const
virtual

Definition at line 210 of file binned.C.

References os().

Here is the call graph for this function:

◆ readData()

void readData ( Istream os)
virtual

Definition at line 203 of file binned.C.

◆ writeDict()

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

Definition at line 218 of file binned.C.

References dict, and dictName().

Here is the call graph for this function:

◆ readDict()

void readDict ( const dictionary dict)
virtual

Definition at line 230 of file binned.C.

References dict.

Member Data Documentation

◆ header

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

Definition at line 175 of file binned.H.


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