36 namespace resolutionIndexModels
47 Foam::resolutionIndexModels::PopeIndex::kNum()
const 49 const auto& kSgs = getOrReadField<volScalarField>(kName_);
50 const auto& Delta = getOrReadField<volScalarField>(deltaName_);
52 tmp<volScalarField> th =
cbrt(
V());
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;
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual bool read(const dictionary &dict)
Read top-level dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char tab
The tab '\t' character(0x09)
volVectorField UMean(UMeanHeader, mesh)
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool execute()
Calculate the result field.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
PopeIndex(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(CelikEtaIndex, 0)
virtual bool write()
Write the result field.
dimensionedScalar cbrt(const dimensionedScalar &ds)
A base class for resolutionIndex models.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Mesh data needed to do the Finite Volume discretisation.
tmp< volScalarField > V() const
Return cell volume field.
addToRunTimeSelectionTable(resolutionIndexModel, CelikEtaIndex, dictionary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
virtual bool read(const dictionary &dict)
Read top-level dictionary.