Go to the documentation of this file.
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) = "
const vector L(dict.get< vector >("L"))
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
static constexpr const zero Zero
const dimensionSet dimVelocity
Type gAverage(const FieldField< Field, Type > &f)
Different types of constants.
dimensionedScalar sin(const dimensionedScalar &ds)
static void addNote(const string ¬e)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
constexpr scalar twoPi(2 *M_PI)
tmp< scalarField > Ek(const scalar Ea, const scalar k0, const scalarField &k)
Vector< scalar > vector
A scalar version of the templated Vector.
GeometricField< vector, fvPatchField, volMesh > volVectorField
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
constexpr scalar pi(M_PI)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Type gMin(const FieldField< Field, Type > &f)
Foam::argList args(argc, argv)
Type gMax(const FieldField< Field, Type > &f)
bool found(const word &optName) const
dimensionedScalar cos(const dimensionedScalar &ds)