OpenFOAM
4.1
The OpenFOAM Foundation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
lagrangian
spray
submodels
BreakupModel
TAB
TABSMDCalcMethod2.H
Go to the documentation of this file.
1
{
2
// Calculation of the mean radius based on SMR rs. Coefficient
3
// factorGamma depends on nExp.
4
scalar factorGamma = 1.;
5
scalar delta = rs/factorGamma;
6
7
scalar minValue =
min
(d/2.0, 0.04*rs);
8
scalar maxValue = rs*4.0;
9
10
scalar range = maxValue -
minValue
;
11
12
if
(maxValue - minValue < SMALL)
13
{
14
minValue = d/20.0;
15
maxValue = d;
16
}
17
18
scalar nExp = 3.5;
19
FixedList<scalar, 100>
rrd
;
20
21
scalar probFactorMin =
exp
(-
pow
(minValue/delta, nExp));
22
scalar probFactorMax =
exp
(-
pow
(maxValue/delta, nExp));
23
scalar probFactor = 1./(probFactorMin -
probFactorMax
);
24
25
forAll
(rrd, n)
26
{
27
scalar xx = minValue + range*n/100;
28
rrd[
n
] = (probFactorMin -
exp
(-
pow
(xx/delta, nExp)))*probFactor;
29
}
30
31
label
n = 0;
32
bool
found =
false
;
33
scalar random =
rndGen
.sample01<scalar>();
34
35
while
(!found && (n<100))
36
{
37
if
(rrd[n] > random)
38
{
39
found =
true
;
40
}
41
n++;
42
43
}
44
45
rNew
= minValue + range*(n - 0.5)/100.0;
46
}
rndGen
cachedRandom rndGen(label(0),-1)
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition:
label.H:59
probFactorMax
scalar probFactorMax
Definition:
TABSMDCalcMethod2.H:22
forAll
forAll(rrd, n)
Definition:
TABSMDCalcMethod2.H:25
rNew
rNew
Definition:
TABSMDCalcMethod2.H:45
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition:
dimensionedScalar.C:252
minValue
scalar minValue
Definition:
TABSMDCalcMethod2.H:7
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition:
dimensionedScalar.C:73
n
label n
Definition:
TABSMDCalcMethod2.H:31
rrd
FixedList< scalar, 100 > rrd
Definition:
TABSMDCalcMethod2.H:19
Generated by
1.8.11