38 namespace distributionModels
56 distributionModelDict_.getCompat<scalar>
59 {{
"expectation", 2106}}
64 distributionModelDict_.getCompat<scalar>
74 <<
"Standard deviation cannot be zero." <<
nl 75 <<
" sigma = " << sigma_ <<
nl 95 const scalar a = (minValue_ - mu_)/sigma_;
96 const scalar
b = (maxValue_ - mu_)/sigma_;
98 const scalar aPhi = 0.5*(scalar(1) +
erf(a/
Foam::sqrt(scalar(2))));
99 const scalar bPhi = 0.5*(scalar(1) +
erf(
b/
Foam::sqrt(scalar(2))));
101 const scalar u = rndGen_.sample01<scalar>();
102 const scalar
p = u*(bPhi - aPhi) + aPhi;
111 return clamp(
x, minValue_, maxValue_);
117 const scalar a = (minValue_ - mu_)/sigma_;
118 const scalar
b = (maxValue_ - mu_)/sigma_;
129 const scalar aPhi = 0.5*(scalar(1) +
erf(a/
Foam::sqrt(scalar(2))));
130 const scalar bPhi = 0.5*(scalar(1) +
erf(
b/
Foam::sqrt(scalar(2))));
133 return mu_ - sigma_*(bphi - aphi)/(bPhi - aPhi + VSMALL);
Particle-size distribution model wherein random samples are drawn from the doubly-truncated univariat...
virtual scalar sample() const
Sample the distribution.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
dimensionedScalar sqrt(const dimensionedScalar &ds)
addToRunTimeSelectionTable(distributionModel, binned, dictionary)
scalar erfInv(const scalar y)
Inverse error function of a real-number argument.
Macros for easy insertion into run-time selection tables.
defineTypeNameAndDebug(binned, 0)
dimensionedScalar exp(const dimensionedScalar &ds)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
constexpr scalar pi(M_PI)
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
normal(const dictionary &dict, Random &rndGen)
Construct from components.
dimensionedScalar erf(const dimensionedScalar &ds)
static void check(const int retVal, const char *what)
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)