57 scalar t =
rndGen.globalPosition<scalar>(-1, 1);
70int main(
int argc,
char *argv[])
74 "Create a box of isotropic turbulence based on a user-specified"
81 "create the block mesh and exit"
89 if (
args.found(
"createBlockMesh"))
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;
174 Info<<
"min/max/average k = "
179 Info<<
"Generating div(U) field" <<
endl;
186 Info<<
"min/max/average div(U) = "
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
constexpr scalar pi(M_PI)
constexpr scalar twoPi(2 *M_PI)
Different types of constants.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar sin(const dimensionedScalar &ds)
const dimensionSet dimVelocity
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)
Field< vector > vectorField
Specialisation of Field<T> for vector.
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
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))