36 namespace resolutionIndexModels
47 Foam::resolutionIndexModels::CelikEtaIndex::eta()
const 49 const auto&
nu = getOrReadField<volScalarField>(nuName_);
60 Foam::resolutionIndexModels::CelikEtaIndex::epsilon()
const 62 const auto& kSgs = getOrReadField<volScalarField>(kName_);
63 const auto& Delta = getOrReadField<volScalarField>(deltaName_);
64 tmp<volScalarField> tnuEff = nuEff();
67 return tnuEff*kSgs/(Ck_*
sqr(Delta));
72 Foam::resolutionIndexModels::CelikEtaIndex::nuEff()
const 74 const auto&
nu = getOrReadField<volScalarField>(nuName_);
75 const auto& nuSgs = getOrReadField<volScalarField>(nutName_);
76 tmp<volScalarField> tnuNum = nuNum();
79 return tnuNum + nuSgs +
nu;
84 Foam::resolutionIndexModels::CelikEtaIndex::nuNum()
const 86 const auto& Delta = getOrReadField<volScalarField>(deltaName_);
88 tmp<volScalarField> tkNum = kNum();
91 return sign(tkNum.cref())*Cnu_*Delta*
sqrt(
mag(tkNum.cref()));
96 Foam::resolutionIndexModels::CelikEtaIndex::kNum()
const 98 const auto& kSgs = getOrReadField<volScalarField>(kName_);
99 const auto& Delta = getOrReadField<volScalarField>(deltaName_);
101 tmp<volScalarField> th =
cbrt(V());
104 return Cn_*
sqr(th/Delta)*kSgs;
142 alphaEta_ =
dict.getOrDefault<scalar>(
"alphaEta", 0.05);
143 m_ =
dict.getOrDefault<scalar>(
"m", 0.5);
144 Cnu_ =
dict.getOrDefault<scalar>(
"Cnu", 0.1);
145 Cn_ =
dict.getOrDefault<scalar>(
"Cn", 1.0);
146 Ck_ =
dict.getOrDefault<scalar>(
"Ck", 0.0376);
147 kName_ =
dict.getOrDefault<
word>(
"k",
"k");
148 deltaName_ =
dict.getOrDefault<
word>(
"delta",
"delta");
150 nutName_ =
dict.getOrDefault<
word>(
"nut",
"nut");
163 auto& index = getOrReadField<volScalarField>(resultName());
166 index = 1.0/(1.0 + alphaEta_*
pow(th/teta, m_));
167 index.correctBoundaryConditions();
175 const auto& index = getOrReadField<volScalarField>(resultName());
177 Info<<
tab <<
"writing field:" << index.name() <<
endl;
virtual bool write()
Write the result field.
dimensionedScalar sign(const dimensionedScalar &ds)
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...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual bool execute()
Calculate the result field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
constexpr char tab
The tab '\t' character(0x09)
Macros for easy insertion into run-time selection tables.
CelikEtaIndex(const word &name, const fvMesh &mesh, const dictionary &dict)
Construct from components.
bool read(const char *buf, int32_t &val)
Same as readInt32.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(CelikEtaIndex, 0)
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.
virtual bool read(const dictionary &dict)
Read top-level dictionary.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar pow3(const dimensionedScalar &ds)
Mesh data needed to do the Finite Volume discretisation.
addToRunTimeSelectionTable(resolutionIndexModel, CelikEtaIndex, dictionary)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
Computes a single-mesh resolution index according to Celik et al.'s index using Kolmogorov length sca...
virtual bool read(const dictionary &dict)
Read top-level dictionary.