48 const word& sourceName,
49 const word& modelType,
54 fv::cellSetOption(sourceName, modelType,
dict,
mesh),
56 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho")),
62 coeffs_.getCheckOrDefault<scalar>
66 [&](const scalar
k){
return k > -VSMALL; }
87 coeffs_.getOrDefault<scalar>
98 mesh_.findObject<turbulenceModel>
106 <<
"Unable to find a turbulence model."
110 fieldNames_.resize(2);
112 tmp<volScalarField> tepsilon = turbPtr->epsilon();
113 tmp<volScalarField> tomega = turbPtr->omega();
115 if (tepsilon.is_reference())
118 fieldNames_[0] = tepsilon().name();
120 const dictionary& turbDict = turbPtr->coeffDict();
122 C2_.read(
"C2", turbDict);
124 else if (tomega.is_reference())
127 fieldNames_[0] = tomega().name();
129 const dictionary& turbDict = turbPtr->coeffDict();
131 Cmu_.read(
"betaStar", turbDict);
132 C2_.read(
"C2", turbDict);
137 <<
"Needs either epsilon or omega field."
141 fieldNames_[1] = turbPtr->k()().
name();
145 Log <<
" Applying atmAmbientTurbSource to: "
161 atmAmbientTurbSourceK
173 atmAmbientTurbSourceEpsilon
183 atmAmbientTurbSourceOmega
209 atmAmbientTurbSourceEpsilon(geometricOneField(),
rho, eqn, fieldi);
228 atmAmbientTurbSourceK(
alpha,
rho, eqn, fieldi);
234 atmAmbientTurbSourceEpsilon(
alpha,
rho, eqn, fieldi);
238 atmAmbientTurbSourceOmega(
alpha,
rho, eqn, fieldi);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool read(Istream &is)
Read dictionary from Istream (discards the header). Reads entries until EOF or when the first token i...
static dimensioned< Type > getOrDefault(const word &name, const dictionary &dict, const dimensionSet &dims=dimless, const Type &deflt=Type(Zero))
Construct dimensioned from dictionary, with default value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Applies sources on k and either epsilon or omega to prevent them droping below a specified ambient va...
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to epsilon or omega equation for incompressible flow computations.
atmAmbientTurbSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
cellSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Base abstract class for handling finite volume options (i.e. fvOption).
wordList fieldNames_
Field names to apply source to - populated by derived models.
dictionary coeffs_
Dictionary containing source coefficients.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for managing temporary objects.
bool is_reference() const noexcept
True if this is a reference (not a pointer).
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Namespace for finite-volume.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.