57void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceEpsilon
63 mesh_.findObject<turbulenceModel>
77 const vector gHat(g_.value()/
mag(g_.value()));
91void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceOmega
114void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceK
116 fvMatrix<scalar>& eqn
131 const word& sourceName,
132 const word& modelType,
139 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho")),
140 alphatName_(coeffs_.getOrDefault<
word>(
"alphat",
"alphat")),
141 Tname_(coeffs_.getOrDefault<
word>(
"T",
"T")),
147 coeffs_.getCheckOrDefault<scalar>
151 [=](const scalar
x){
return x > SMALL; }
161 if (
mag(g_.value()) < SMALL)
164 <<
"Gravitational field cannot be equal to or less than zero"
168 const auto* turbPtr =
169 mesh_.findObject<turbulenceModel>
177 <<
"Unable to find a turbulence model."
181 fieldNames_.resize(2);
183 tmp<volScalarField> tepsilon = turbPtr->
epsilon();
184 tmp<volScalarField> tomega = turbPtr->omega();
186 if (tepsilon.is_reference())
189 fieldNames_[0] = tepsilon().name();
191 else if (tomega.is_reference())
194 fieldNames_[0] = tomega().name();
199 <<
"Unable to find an omega or epsilon field." <<
nl
200 <<
"buoyancyTurbSource needs an omega- or epsilon-based model."
204 fieldNames_[1] = turbPtr->k()().
name();
208 Log <<
" Applying buoyancyTurbSource to: "
224 buoyancyTurbSourceK(eqn);
230 buoyancyTurbSourceEpsilon(eqn);
234 buoyancyTurbSourceOmega(eqn);
264 buoyancyTurbSourceK(
alpha,
rho, eqn, fieldi);
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
DimensionedField< scalar, volMesh > Internal
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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 turbulent kinetic energy (i.e. k) and either turbulent kinetic energy dissipation ...
buoyancyTurbSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to k and epsilon/omega equation for incompressible flow computations.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
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).
const fvMesh & mesh_
Reference to the mesh database.
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...
static const gravity & New(const word &name, const Time &runTime)
Return named gravity field cached or construct on Time.
Type & lookupObjectRef(const word &name, const bool recursive=false) const
Lookup and return non-const reference to the object of the given Type. Fatal if not found or the wron...
A class for managing temporary objects.
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual const dictionary & coeffDict() const =0
Const access to the coefficients dictionary.
virtual tmp< volScalarField > epsilon() const =0
Return the turbulence kinetic energy dissipation rate.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Namespace for finite-volume.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimVelocity
dimensionedScalar tanh(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).