Public Member Functions | List of all members
general Class Reference

Particle-size distribution model wherein random samples are drawn from a given arbitrary probability density function or cumulative distribution function. Input distributions are specified as pairs of (size, probability) (i.e. (point, value) ). More...

Inheritance diagram for general:
Inheritance graph
[legend]
Collaboration diagram for general:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("general")
 
 general (const dictionary &dict, Random &rndGen)
 
 general (const UList< scalar > &sampleData, const scalar binWidth, Random &rndGen)
 
 general (const general &p)
 
virtual autoPtr< distributionModelclone () const
 
void operator= (const general &)=delete
 
virtual ~general ()=default
 
virtual tmp< scalarFieldx () const
 
virtual tmp< scalarFieldy () const
 
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
 

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 arbitrary probability density function or cumulative distribution function. Input distributions are specified as pairs of (size, probability) (i.e. (point, value) ).

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

            sizeDistribution
            {
                type        general;
                generalDistribution
                {
                    cumulative      false;

                    distribution
                    (
                        (<size1>    <probability1>)
                        (<size2>    <probability2>)
                        ...
                        (<sizeN>    <probabilityN>)
                    );
                }
            }
        }
    }
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: general word yes -
generalDistribution Distribution settings dict yes -
distribution <size>-<probability> pairs dict yes -
<size> Particle size scalar yes -
<probability> Volume fraction/probability scalar yes -
cumulative Flag to determine if input distribution is specified as cumulative or as density bool no false
Note
  • An example for a pair within distribution subdictionary can be given as follows: "(1e-07 1.3)" means 1.3% of particles are modelled with a particle diameter of "1e-7" [m], and so on.
  • Variation between input pairs is assumed to be linear.
  • Elements in the second column (i.e. probability) are normalised.
  • Elements in the second column for cumulative distribution functions must start from zero and must be non-decreasing (i.e. monotonic).
  • Elements in the first column (i.e. size) must be specified in an ascending order.
  • Input pairs cannot contain any negative element.
Source files

Definition at line 169 of file general.H.

Constructor & Destructor Documentation

◆ general() [1/3]

general ( const dictionary dict,
Random rndGen 
)

Definition at line 90 of file general.C.

References Foam::check(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::type().

Referenced by general::clone().

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

◆ general() [2/3]

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

Definition at line 160 of file general.C.

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

Here is the call graph for this function:

◆ general() [3/3]

general ( const general p)

Definition at line 216 of file general.C.

◆ ~general()

virtual ~general ( )
virtualdefault

Member Function Documentation

◆ TypeName()

TypeName ( "general"  )

◆ clone()

virtual autoPtr<distributionModel> clone ( ) const
inlinevirtual

Implements distributionModel.

Definition at line 223 of file general.H.

References general::general().

Here is the call graph for this function:

◆ operator=()

void operator= ( const general )
delete

◆ x()

Foam::tmp< Foam::Field< Foam::scalar > > x ( ) const
virtual

Definition at line 327 of file general.C.

References forAll, tmp::New(), and x.

Here is the call graph for this function:

◆ y()

Foam::tmp< Foam::Field< Foam::scalar > > y ( ) const
virtual

Definition at line 341 of file general.C.

References forAll, tmp::New(), and y.

Here is the call graph for this function:

◆ sample()

Foam::scalar sample ( ) const
virtual

Implements distributionModel.

Definition at line 229 of file general.C.

References Foam::constant::atomic::alpha, k, Foam::mag(), n, p, and Foam::sqrt().

Here is the call graph for this function:

◆ meanValue()

Foam::scalar meanValue ( ) const
virtual

Implements distributionModel.

Definition at line 274 of file general.C.

◆ writeData()

void writeData ( Ostream os) const
virtual

Definition at line 288 of file general.C.

References os().

Here is the call graph for this function:

◆ readData()

void readData ( Istream os)
virtual

Definition at line 280 of file general.C.

◆ writeDict()

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

Definition at line 296 of file general.C.

References dict, dictName(), x, and y.

Referenced by InjectedParticleDistributionInjection< CloudType >::info().

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

◆ readDict()

void readDict ( const dictionary dict)
virtual

Definition at line 309 of file general.C.

References dict, forAll, x, and y.


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