47Foam::resolutionIndexModels::PopeIndex::kNum()
const
55 return Cn_*
sqr(th/Delta)*kSgs;
89 includeKnum_ =
dict.getOrDefault<
bool>(
"includeKnum",
true);
92 Cn_ =
dict.getOrDefault<scalar>(
"Cnu", 1.0);
94 UName_ =
dict.getOrDefault<word>(
"U",
"U");
95 UMeanName_ =
dict.getOrDefault<word>(
"UMean",
"UMean");
97 deltaName_ =
dict.getOrDefault<
word>(
"delta",
"delta");
106 const auto&
U = getOrReadField<volVectorField>(UName_);
107 const auto&
UMean = getOrReadField<volVectorField>(UMeanName_);
111 const auto& kSgs = getOrReadField<volScalarField>(kName_);
117 tkTot.
ref() +=
mag(kNum());
122 auto& index = getOrReadField<volScalarField>(resultName());
127 index = kRes/
max(kMin, tkTot);
128 index.correctBoundaryConditions();
136 const auto& index = getOrReadField<volScalarField>(resultName());
138 Info<<
tab <<
"writing field:" << index.name() <<
endl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
volVectorField UMean(UMeanHeader, mesh)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Volume discretisation.
A base class for resolutionIndex models.
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
tmp< volScalarField > V() const
Return cell volume field.
resolutionIndexModel(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
GeoFieldType & getOrReadField(const word &fieldName) const
Return requested field from the object registry or read+register the field to the object registry.
const word & resultName() const noexcept
Return const reference to the result name.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Computes a single-mesh resolution index according to Pope's index, which is used as a LES/DES quality...
PopeIndex(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
A namespace for various resolutionIndex model implementations.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool read(const char *buf, int32_t &val)
Same as readInt32.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
dimensionedScalar cbrt(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char tab
The tab '\t' character(0x09).