47void Foam::LESModels::vanDriestDelta::calcDelta()
61 mesh.time().constant(),
78 const scalarField& nuSgsw = nuSgs().boundaryField()[patchi];
89 const auto&
y = wDist.y();
92 wDist.map(ystar, mapDistribute::transform());
95 constexpr scalar yPlusCutOff = 500;
98 constexpr scalar fuzzyGREAT = 0.5*GREAT;
100 ystar.dimensions().reset(
y.dimensions()/ystar.dimensions());
103 const scalar
yPlus =
y[celli]/ystar[celli];
104 if (
y[celli] > fuzzyGREAT || (
yPlus > yPlusCutOff))
107 ystar[celli] = GREAT;
111 ystar[celli] =
yPlus;
115 forAll(
y.boundaryField(), patchi)
117 const auto& yp =
y.boundaryField()[patchi];
118 auto& ystarp = ystar.boundaryFieldRef()[patchi];
122 const scalar
yPlus = yp[i]/ystarp[i];
123 if (yp[i] > fuzzyGREAT || (
yPlus > yPlusCutOff))
133 ystar.correctBoundaryConditions();
140 (kappa_/Cdelta_)*((scalar(1) + SMALL) -
exp(-ystar/Aplus_))*
y
147Foam::LESModels::vanDriestDelta::vanDriestDelta
167 kappa_(
dict.getOrDefault<scalar>(
"kappa", 0.41)),
170 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
178 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
187 if (!coeffsDict.
readIfPresent(
"calcInterval", calcInterval_))
189 coeffsDict.readIfPresent(
"updateInterval", calcInterval_);
192 delta_ = geometricDelta_();
202 geometricDelta_().read(coeffsDict);
203 dict.readIfPresent<scalar>(
"kappa", kappa_);
207 if (!coeffsDict.
readIfPresent<label>(
"calcInterval", calcInterval_))
221 && (turbulenceModel_.mesh().time().timeIndex() % calcInterval_) == 0
224 geometricDelta_().correct();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
@ NO_REGISTER
Do not request registration (bool: false).
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual void read(const dictionary &)
Read the LESdelta dictionary.
Abstract base class for LES deltas.
LESdelta(const LESdelta &)=delete
No copy construct.
static autoPtr< LESdelta > New(const word &name, const turbulenceModel &turbulence, const dictionary &dict, const word &lookupName="delta")
Return a reference to the selected LES delta.
const turbulenceModel & turbulence() const
Return turbulenceModel reference.
const turbulenceModel & turbulenceModel_
static FOAM_NO_DANGLING_REFERENCE const wallDistAddressing & New(const fvMesh &mesh, Args &&... args)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
Mesh data needed to do the Finite Volume discretisation.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
A class for managing temporary objects.
Abstract base class for turbulence models (RAS, LES and laminar).
const volVectorField & U() const
Access function to velocity field.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
const fvMesh & mesh() const
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
Namespace for LES SGS models.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
dimensionedScalar exp(const dimensionedScalar &ds)
GeometricField< vector, fvPatchField, volMesh > volVectorField
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar sqrt(const dimensionedScalar &ds)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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.
fvPatchField< vector > fvPatchVectorField
#define forAll(list, i)
Loop across all elements in list.