The open source CFD toolbox
LISASMDCalcMethod2.H
Go to the documentation of this file.
1 {
2  // calculate the new diameter with the standard 1D Rosin Rammler
3  // distribution. Calculation of the mean radius based on SMR rs.
4  // Coefficient factorGamma depends on nExp. Note that Reitz either used
5  // (Schmidt et al., 1999-01-0496) or skipped (Senecal et al.) this factor!
6  // scalar factorGamma = 0.75*sqrt(mathematicalConstant::pi); //nExp=2
7  scalar factorGamma = 1.;
8  scalar delta = dD/factorGamma;
9
10  // dD is the SMD, and the delta is calculated using gamma
11  // function. Here we assume nExp = 2
12  scalar minValue = dD/10.0;
13  scalar maxValue = dD;
14
15  // The pdf value for 4.0*delta is already very small.
16  // scalar maxValue = delta*4.0;
17
18  if (maxValue - minValue < SMALL)
19  {
20  minValue = maxValue/20.0;
21  }
22
23  scalar range = maxValue - minValue;
24
25  scalar nExp = 3;
26  FixedList<scalar, 500> rrd;
30
32  {
33  scalar xx = minValue + range*n/500;
34  rrd[n] = (probFactorMin - exp(-pow(xx/delta, nExp)))*probFactor;
35  }
36
37
38  bool success = false;
39
40  scalar y = rndGen.sample01<scalar>();
41  label k = 0;
42
43  while(!success && (k<500))
44  {
45  if (rrd[k] > y)
46  {
47  success = true;
48  }
49  k++;
50  }
51
52  x = minValue + range*(k - 0.5)/500.0;
53 }
range
scalar range
Definition: LISASMDCalcMethod2.H:23
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
y
scalar y
Definition: LISASMDCalcMethod2.H:40
maxValue
scalar maxValue
Definition: LISASMDCalcMethod2.H:13
n
label n
Definition: TABSMDCalcMethod2.H:31
probFactor
scalar probFactor
Definition: LISASMDCalcMethod2.H:29
rrd
FixedList< scalar, 500 > rrd
Definition: LISASMDCalcMethod2.H:26
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
success
bool success
Definition: LISASMDCalcMethod2.H:38
probFactorMax
scalar probFactorMax
Definition: LISASMDCalcMethod2.H:28
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
forAll
forAll(rrd, n)
Definition: LISASMDCalcMethod2.H:31
x
x
Definition: LISASMDCalcMethod2.H:52
minValue
scalar minValue
Definition: LISASMDCalcMethod2.H:12
rndGen
Random rndGen
Definition: createFields.H:23
probFactorMin
scalar probFactorMin
Definition: LISASMDCalcMethod2.H:27
nExp
scalar nExp
Definition: LISASMDCalcMethod2.H:25