OpenFOAM
v2406
The open source CFD toolbox
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
}
probFactorMax
scalar probFactorMax
Definition:
TABSMDCalcMethod2.H:22
rndGen
Random rndGen
Definition:
createFields.H:23
forAll
forAll(rrd, n)
Definition:
TABSMDCalcMethod2.H:25
range
scalar range
Definition:
TABSMDCalcMethod2.H:10
delta
scalar delta
Definition:
TABSMDCalcMethod2.H:5
rNew
rNew
Definition:
TABSMDCalcMethod2.H:45
maxValue
scalar maxValue
Definition:
TABSMDCalcMethod2.H:8
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition:
dimensionedScalar.C:254
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition:
hashSets.C:26
minValue
scalar minValue
Definition:
TABSMDCalcMethod2.H:7
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition:
dimensionedScalar.C:68
n
label n
Definition:
TABSMDCalcMethod2.H:31
rrd
FixedList< scalar, 100 > rrd
Definition:
TABSMDCalcMethod2.H:19
probFactor
scalar probFactor
Definition:
TABSMDCalcMethod2.H:23
found
bool found
Definition:
TABSMDCalcMethod2.H:32
probFactorMin
scalar probFactorMin
Definition:
TABSMDCalcMethod2.H:21
random
scalar random
Definition:
TABSMDCalcMethod2.H:33
nExp
scalar nExp
Definition:
TABSMDCalcMethod2.H:18
src
lagrangian
spray
submodels
BreakupModel
TAB
TABSMDCalcMethod2.H
Generated by
1.8.14