33 namespace distributionModels
49 minValue_(
readScalar(distributionModelDict_.lookup(
"minValue"))),
50 maxValue_(
readScalar(distributionModelDict_.lookup(
"maxValue"))),
51 range_(maxValue_ - minValue_),
52 expectation_(distributionModelDict_.lookup(
"expectation")),
53 variance_(distributionModelDict_.lookup(
"variance")),
54 strength_(distributionModelDict_.lookup(
"strength"))
59 label n = strength_.size();
62 scalar
x = expectation_[i];
63 scalar
s = strength_[i];
68 scalar x2 = (x - expectation_[j])/variance_[j];
69 scalar
y =
exp(-0.5*x2*x2);
87 minValue_(p.minValue_),
88 maxValue_(p.maxValue_),
90 expectation_(p.expectation_),
91 variance_(p.variance_),
92 strength_(p.strength_)
119 scalar
nu = expectation_[i];
120 scalar
sigma = variance_[i];
121 scalar
s = strength_[i];
122 scalar v = (x -
nu)/sigma;
123 p += s*
exp(-0.5*v*v);
153 mean += strength_[i]*expectation_[i];
defineTypeNameAndDebug(distributionModel, 0)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject( name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE ))
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
virtual scalar maxValue() const
Return the maximum value.
virtual scalar minValue() const
Return the minimum value.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
dimensionedScalar exp(const dimensionedScalar &ds)
multiNormal(const dictionary &dict, cachedRandom &rndGen)
Construct from components.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual ~multiNormal()
Destructor.
cachedRandom & rndGen_
Reference to the random number generator.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Macros for easy insertion into run-time selection tables.
addToRunTimeSelectionTable(distributionModel, exponential, dictionary)
virtual scalar sample() const
Sample the distributionModel.
Type sample01()
Return a sample whose components lie in the range 0-1.
virtual scalar meanValue() const
Return the mean value.