47 void Foam::LESModels::vanDriestDelta::calcDelta()
61 mesh.time().constant(),
74 if (isA<wallFvPatch>(
patches[patchi]))
78 const scalarField& nuSgsw = nuSgs().boundaryField()[patchi];
81 nuw/
sqrt((nuw + nuSgsw)*
mag(Uw.snGrad()) + VSMALL);
89 const auto&
y = wDist.y();
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();
138 static_cast<const volScalarField&>(geometricDelta_()),
140 (kappa_/Cdelta_)*((scalar(1) + SMALL) -
exp(-ystar/Aplus_))*
y 147 Foam::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_))
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();
const fvMesh & mesh() const
fvPatchField< vector > fvPatchVectorField
addToRunTimeSelectionTable(LESfluidThermoCompressibleTurbulenceModel, SmagorinskyLESfluidThermoCompressibleTurbulenceModel, dictionary)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volVectorField & U() const
Access function to velocity field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static const wallDistAddressing & New(const fvMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
Abstract base class for LES deltas.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
dimensionedScalar sqrt(const dimensionedScalar &ds)
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.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Abstract base class for turbulence models (RAS, LES and laminar).
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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...
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
defineTypeNameAndDebug(cubeRootVolDelta, 0)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const polyBoundaryMesh & patches
virtual void read(const dictionary &)
Read the LESdelta dictionary.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
const turbulenceModel & turbulenceModel_
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Do not request registration (bool: false)
PtrList< fvPatch > fvPatchList
Store lists of fvPatch as a PtrList.