57 scalar t =
rndGen.globalPosition<scalar>(-1, 1);
70 int main(
int argc,
char *argv[])
74 "Create a box of isotropic turbulence based on a user-specified" 81 "create the block mesh and exit" 87 #include "createFields.H" 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);
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) = " Different types of constants.
static void addNote(const string ¬e)
Add extra notes for the usage information.
dimensionedScalar acos(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vector L(dict.get< vector >("L"))
Type gMin(const FieldField< Field, Type > &f)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
constexpr char nl
The newline '\n' character (0x0a)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
label k
Boltzmann constant.
Ignore writing from objectRegistry::writeObject()
tmp< scalarField > Ek(const scalar Ea, const scalar k0, const scalarField &k)
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr scalar twoPi(2 *M_PI)
constexpr scalar pi(M_PI)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Type gMax(const FieldField< Field, Type > &f)
Type gAverage(const FieldField< Field, Type > &f)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Foam::argList args(argc, argv)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
bool found(const word &optName) const
Return true if the named option is found.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity