37namespace distributionModels
53 lambda_(distributionModelDict_.getCompat<scalar>(
"lambda", {{
"d", 2106}})),
54 n_(distributionModelDict_.get<scalar>(
"n"))
56 if (lambda_ < VSMALL || n_ < VSMALL)
59 <<
"Scale/Shape parameter cannot be equal to or less than zero:"
60 <<
" lambda = " << lambda_
88 const scalar a = scalar(3)/n_ + scalar(1);
92 const scalar u = rndGen_.position<scalar>(cdfA, cdfB);
94 d = lambda_*
pow(
x, scalar(1)/n_);
96 }
while (std::isnan(d));
105 return lambda_*tgamma(scalar(1)/n_ + scalar(1));
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
Particle-size distribution model wherein random samples are drawn from the two-parameter Rosin-Rammle...
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
virtual scalar sample() const
Sample the distribution.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar invIncGamma(const scalar a, const scalar P)
Inverse of regularised lower incomplete gamma function.
scalar incGamma_P(const scalar a, const scalar x)
Lower incomplete gamma function.
static void check(const int retVal, const char *what)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
errorManipArg< error, int > exit(error &err, const int errNo=1)