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...
#include <binned.H>


Public Member Functions | |
| TypeName ("binned") | |
| Runtime type information. | |
| binned (const dictionary &dict, Random &rndGen) | |
| Construct from dictionary. | |
| binned (const UList< scalar > &sampleData, const scalar binWidth, Random &rndGen) | |
| Construct from components. | |
| binned (const binned &p) | |
| Copy construct. | |
| virtual autoPtr< distributionModel > | clone () const |
| Construct and return a clone. | |
| void | operator= (const binned &)=delete |
| No copy assignment. | |
| virtual | ~binned ()=default |
| Destructor. | |
| virtual scalar | sample () const |
| Sample the distribution. | |
| virtual scalar | meanValue () const |
| Return the arithmetic mean of the distribution data. | |
| virtual void | writeData (Ostream &os) const |
| Write data to stream. | |
| virtual void | readData (Istream &os) |
| Read data from stream. | |
| virtual dictionary | writeDict (const word &dictName) const |
| Write data in dictionary format. | |
| virtual void | readDict (const dictionary &dict) |
| Read data from dictionary. | |
| 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. | |
Static Public Attributes | |
| static const char * | header |
Additional Inherited Members | |
| Static Public Member Functions inherited from distributionModel | |
| static autoPtr< distributionModel > | New (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. | |
| Random & | rndGen_ |
| Reference to the random number generator. | |
| scalar | minValue_ |
| Minimum of the distribution. | |
| scalar | maxValue_ |
| Maximum of the distribution. | |
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.
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 | - |
| binned | ( | const dictionary & | dict, |
| Random & | rndGen ) |
Construct from dictionary.
Definition at line 86 of file binned.C.
References distributionModel::check(), dict, distributionModel::distributionModel(), distributionModel::distributionModelDict_, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, distributionModel::maxValue_, distributionModel::minValue_, and rndGen.
Referenced by binned(), clone(), and operator=().


Construct from components.
Allows negative entries
Definition at line 105 of file binned.C.
References distributionModel::distributionModel(), Foam::endl(), forAll, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, Foam::mag(), Foam::max(), distributionModel::maxValue_, Foam::min(), distributionModel::minValue_, Foam::nl, rndGen, and WarningInFunction.

| binned | ( | const binned & | p | ) |
Copy construct.
Definition at line 171 of file binned.C.
References binned(), distributionModel::distributionModel(), and p.

|
virtualdefault |
| TypeName | ( | "binned" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone.
Implements distributionModel.
Definition at line 208 of file binned.H.
References binned().

|
delete |
|
virtual |
Sample the distribution.
Implements distributionModel.
Definition at line 181 of file binned.C.
References distributionModel::maxValue_, and distributionModel::rndGen_.
|
virtual |
Return the arithmetic mean of the distribution data.
Implements distributionModel.
|
virtual |
|
virtual |
|
virtual |
Write data in dictionary format.
Definition at line 217 of file binned.C.
References dict, and dictName().

|
virtual |
|
static |