43 template<
class Type,
class WeightType = oneField>
48 const WeightType& weights =
oneField()
56 auto& scaling = tscaling.ref();
63 const label own = faceOwner[i];
64 const label nbr = faceNeighbour[i];
66 result[own] +=
field[nbr];
67 result[nbr] +=
field[own];
69 scaling[own] = scaling[own] + weights[nbr];
70 scaling[nbr] = scaling[nbr] + weights[own];
77 const auto& pf =
field.boundaryField()[
pp.index()];
82 const scalarField nbrField(pf.patchNeighbourField());
87 result[celli] += nbrField[facei];
88 scaling[celli] = scaling[celli] + weights[celli];
113 void Foam::LESModels::SLADelta::calcDelta()
126 tmp<volVectorField> tvorticity =
fvc::curl(U0);
138 *
sqrt(6.0)*
mag((S & vorticity)^vorticity)
141 vtm.correctBoundaryConditions();
157 vtmAve.primitiveFieldRef() /= tweights + 1;
168 tmp<volScalarField> trd =
171 (
nut +
nu)/(
max(tmagGradU, magGradUeps)*
sqr(kappa_*
y) + nuEps),
188 const point& cc = cellCentres[celli];
189 const vector& nv = nVecVort[celli];
191 scalar deltaMaxTmp = 0;
193 for (
const label facei : cFaces)
195 const point& fc = faceCentres[facei];
196 const scalar tmp = 2.0*
mag(nv ^ (fc - cc));
198 if (tmp > deltaMaxTmp)
212 + (FKHmax_ - FKHmin_)*(vtmAve[celli] - a1_)/(a2_ - a1_)
216 if ((shielding_ ==
true) && (fd[celli] < (1.0 - epsilon_)))
221 delta_[celli] = deltaCoeff_*deltaMaxTmp*FKH;
224 const label nD =
mesh.nGeometricD();
229 <<
"Case is 2D, LES is not strictly applicable" <<
nl 245 Foam::LESModels::SLADelta::SLADelta
256 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
264 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<bool>
272 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<bool>
280 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
288 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
296 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
304 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
312 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
320 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
328 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
336 dict.optionalSubDict(
type() +
"Coeffs").getOrDefault<scalar>
343 if (
dict.optionalSubDict(
type() +
"Coeffs").found(
"hmax"))
351 dict.optionalSubDict(
"hmaxCoeffs"),
357 Info<<
"Employing " << maxDeltaxyz::typeName <<
" for hmax" <<
endl;
365 dict.optionalSubDict(
"hmaxCoeffs")
370 if (
mag(a2_ - a1_) < SMALL)
373 <<
"Model coefficients a1 = " << a1_
374 <<
", and a2 = " << a2_ <<
" cannot be equal." 387 coeffsDict.readIfPresent<
bool>(
"requireUpdate", requireUpdate_);
388 coeffsDict.readIfPresent<scalar>(
"FKHmin", FKHmin_);
389 coeffsDict.readIfPresent<scalar>(
"FKHmax", FKHmax_);
390 coeffsDict.readIfPresent<scalar>(
"a1", a1_);
391 coeffsDict.readIfPresent<scalar>(
"a2", a2_);
392 coeffsDict.readIfPresent<scalar>(
"epsilon", epsilon_);
393 coeffsDict.readIfPresent<scalar>(
"kappa", kappa_);
394 coeffsDict.readIfPresent<scalar>(
"Cd1", Cd1_);
395 coeffsDict.readIfPresent<scalar>(
"Cd2", Cd2_);
403 if (turbulenceModel_.mesh().changing() && requireUpdate_)
static word group(const word &name)
Return group (extension part of name)
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
const polyBoundaryMesh & pbm
dimensionedScalar tanh(const dimensionedScalar &ds)
const fvMesh & mesh() const
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
List< cell > cellList
List of cell.
errorManipArg< error, int > exit(error &err, const int errNo=1)
addToRunTimeSelectionTable(LESfluidThermoCompressibleTurbulenceModel, SmagorinskyLESfluidThermoCompressibleTurbulenceModel, dictionary)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volVectorField & U() const
Access function to velocity field.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
const turbulenceModel & turbulence() const
Return turbulenceModel reference.
static const wallDist & New(const fvMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Abstract base class for LES deltas.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Generic GeometricField class.
Generic dimensioned Type class.
const dimensionSet dimless
Dimensionless.
Smooth ATC in cells next to a set of patches supplied by type.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Abstract base class for turbulence models (RAS, LES and laminar).
Macros for easy insertion into run-time selection tables.
tmp< GeometricField< Type, fvPatchField, volMesh > > curl(const GeometricField< Type, fvPatchField, volMesh > &vf)
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
tmp< scalarField > sumNeighbours(const GeometricField< Type, fvPatchField, volMesh > &field, GeometricField< Type, fvPatchField, volMesh > &result, const WeightType &weights=oneField())
Calculate the gradient of the given field.
Calculate the curl of the given volField by constructing the Hodge-dual of the symmetric part of the ...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
virtual const labelList & faceOwner() const
Return face owner.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
const volScalarField & y() const noexcept
Return reference to cached distance-to-wall field.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
void read(const dictionary &)
Read the LESdelta dictionary.
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)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
dimensionedScalar pow3(const dimensionedScalar &ds)
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
List< label > labelList
A List of labels.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
Delta calculated by taking the maximum distance between the cell centre and any face centre...
const turbulenceModel & turbulenceModel_
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)