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 
24 
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 }
scalar probFactorMax
Random rndGen
Definition: createFields.H:23
forAll(rrd, n)
scalar range
scalar delta
scalar maxValue
dimensionedScalar exp(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
scalar minValue
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label n
FixedList< scalar, 100 > rrd
scalar probFactor
bool found
scalar probFactorMin
scalar random
scalar nExp