57 void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceEpsilon
67 const dictionary& turbDict = turbPtr->coeffDict();
77 const vector gHat(g_.value()/
mag(g_.value()));
91 void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceOmega
114 void 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 =
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: " 209 << fieldNames_[0] <<
" and " << fieldNames_[1]
224 buoyancyTurbSourceK(eqn);
230 buoyancyTurbSourceEpsilon(eqn);
234 buoyancyTurbSourceOmega(eqn);
264 buoyancyTurbSourceK(
alpha,
rho, eqn, fieldi);
dimensionedScalar tanh(const dimensionedScalar &ds)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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...
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...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvMesh & mesh_
Reference to the mesh database.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to k and epsilon/omega equation for incompressible flow computations...
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Ostream & endl(Ostream &os)
Add newline and flush stream.
label k
Boltzmann constant.
const dimensionSet dimless
Dimensionless.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
const dimensionedScalar e
Elementary charge.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
buoyancyTurbSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
static const gravity & New(const word &name, const Time &runTime)
Return named gravity field cached or construct on Time.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Intermediate abstract class for handling cell-set options for the derived fvOptions.
A class for managing temporary objects.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
const dimensionSet dimVelocity