57 scalar t =
rndGen.globalPosition<scalar>(-1, 1);
58 scalar phim =
rndGen.globalSample01<scalar>()*mathematical::twoPi;
70int main(
int argc,
char *argv[])
74 "Create a box of isotropic turbulence based on a user-specified"
78 argList::addBoolOption
81 "create the block mesh and exit"
87 #include "createFields.H"
102 scalar kappa0 = mathematical::twoPi/
cmptMin(
L);
107 Info<<
"Wave number min/max = " << kappa0 <<
", " << kappaMax <<
endl;
109 Info<<
"Generating velocity field" <<
endl;
126 const scalar deltaKappa = (kappaMax - kappa0)/scalar(
nModes - 1);
128 for (label modei = 1; modei <=
nModes; ++modei)
131 scalar kappaM = kappa0 + deltaKappa*(modei-1);
133 Info<<
"Processing mode:" << modei <<
" kappaM:" << kappaM <<
endl;
136 scalar E =
Ek->value(kappaM);
154 vector sigmaHatm(zetaHatm^kappaTildem);
155 sigmaHatm /=
mag(kappaTildem);
158 scalar psim = 0.5*
rndGen.position(-mathematical::pi, mathematical::pi);
161 Uc += 2*qm*
cos(kappaM*(kappaHatm &
C) + psim)*sigmaHatm;
167 Info<<
"Generating kinetic energy field" <<
endl;
170 Info<<
"min/max/average k = "
176 Info<<
"Generating div(U) field" <<
endl;
179 Info<<
"min/max/average div(U) = "
185 runTime.printExecutionTime(Info);
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
Graphite solid properties.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool found(const word &optName) const
Return true if the named option is found.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Different types of constants.
dimensionedScalar sin(const dimensionedScalar &ds)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
const vector L(dict.get< vector >("L"))
autoPtr< Function1< scalar > > Ek(Function1< scalar >::New("Ek", dict, &runTime))