37 namespace distributionModels
53 lambda_(distributionModelDict_.getCompat<scalar>(
"lambda", {{
"d", 2106}})),
54 n_(distributionModelDict_.get<scalar>(
"n"))
56 const word parcelBasisType =
57 dict.getOrDefault<word>(
"parcelBasisType",
"none");
59 if (parcelBasisType ==
"mass")
62 <<
"Selected parcel basis type: " << parcelBasisType <<
nl 63 <<
" Please consider to use massRosinRammler distribution model" 67 if (lambda_ < VSMALL || n_ < VSMALL)
70 <<
"Scale/Shape parameter cannot be equal to or less than zero:" 71 <<
" lambda = " << lambda_
92 const scalar u = rndGen_.sample01<scalar>();
93 const scalar qMin =
pow(minValue_/lambda_, n_);
94 const scalar qMax =
pow(maxValue_/lambda_, n_);
95 const scalar r = scalar(1) -
exp(-qMax + qMin);
96 return lambda_*
pow(qMin -
log(scalar(1) - u*r), scalar(1)/n_);
103 const scalar a = scalar(1)/lambda_ + scalar(1);
104 const scalar qMax =
pow(maxValue_/n_, lambda_);
105 const scalar qMin =
pow(minValue_/n_, lambda_);
dimensionedScalar log(const dimensionedScalar &ds)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
addToRunTimeSelectionTable(distributionModel, binned, dictionary)
virtual scalar sample() const
Sample the distribution.
Macros for easy insertion into run-time selection tables.
scalar incGamma_P(const scalar a, const scalar x)
Lower incomplete gamma function.
defineTypeNameAndDebug(binned, 0)
dimensionedScalar exp(const dimensionedScalar &ds)
RosinRammler(const dictionary &dict, Random &rndGen)
Construct from components.
Type gMax(const FieldField< Field, Type > &f)
static void check(const int retVal, const char *what)
Particle-size distribution model wherein random samples are drawn from the doubly-truncated two-param...
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
#define WarningInFunction
Report a warning using Foam::Warning.
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...