37 namespace incompressible
52 Info<<
"Storing initial values of turbulence variables" <<
endl;
85 Info<<
"Allocating mean values of turbulence variables" <<
endl;
189 solverControl_(SolverControl),
200 TMVar1InitPtr_(nullptr),
201 TMVar2InitPtr_(nullptr),
202 nutInitPtr_(nullptr),
204 TMVar1MeanPtr_(nullptr),
205 TMVar2MeanPtr_(nullptr),
216 solverControl_(rmv.solverControl_),
218 TMVar1BaseName_(rmv.TMVar1BaseName_),
219 TMVar2BaseName_(rmv.TMVar2BaseName_),
220 nutBaseName_(rmv.nutBaseName_),
222 TMVar1Ptr_(cloneRefPtr(rmv.TMVar1Ptr_)),
223 TMVar2Ptr_(cloneRefPtr(rmv.TMVar2Ptr_)),
224 nutPtr_(cloneRefPtr(rmv.nutPtr_)),
225 distPtr_(cloneRefPtr(rmv.distPtr_)),
227 TMVar1InitPtr_(nullptr),
228 TMVar2InitPtr_(nullptr),
229 nutInitPtr_(nullptr),
231 TMVar1MeanPtr_(nullptr),
232 TMVar2MeanPtr_(nullptr),
256 mesh.time().constant(),
264 word modelType(
"laminar");
271 dictptr->
readCompat(
"model", {{
"RASModel", -2006}}, modelType);
278 Info<<
"Creating references for RASModel variables : " << modelType <<
endl;
280 auto* ctorPtr = dictionaryConstructorTable(modelType);
289 *dictionaryConstructorTablePtr_
305 <<
"jutJacobianVar1 not implemented for the current turbulence model." 306 <<
"Returning zero field" <<
endl;
324 <<
"nutJacobianVar2 not implemented for the current turbulence model." 325 <<
"Returning zero field" <<
endl;
361 Info<<
"Resetting mean turbulent fields to zero" <<
endl;
388 const scalar avIter(iAverageIter);
389 const scalar oneOverItP1 = 1./(avIter + 1);
390 const scalar mult = avIter*oneOverItP1;
472 if (rmv.hasNut() &&
hasNut())
477 if (rmv.hasDist() &&
hasDist())
bool readCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val using any compatibility names if needed. FatalIOError if there are exc...
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
refPtr< volScalarField > TMVar1InitPtr_
errorManipArg< error, int > exit(error &err, const int errNo=1)
refPtr< volScalarField > cloneRefPtr(const refPtr< volScalarField > &obj) const
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const volScalarField & TMVar1Inst() const
Return references to instantaneous turbulence fields.
const word & name() const noexcept
Return the object name.
virtual tmp< volScalarField > nutJacobianVar2(const singlePhaseTransportModel &laminarTransport) const
static refPtr< T > New(Args &&... args)
Construct refPtr with forwarding arguments.
virtual tmp< volScalarField > nutJacobianVar1(const singlePhaseTransportModel &laminarTransport) const
Return nut Jacobian wrt the TM vars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const solverControl & solverControl_
const volScalarField & d() const
virtual void transfer(RASModelVariables &rmv)
Transfer turbulence fields from an another object.
virtual bool hasTMVar1() const
Bools to identify which turbulent fields are present.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
virtual void allocateInitValues()
GeometricField< vector, fvPatchField, volMesh > volVectorField
virtual bool hasTMVar2() const
A class for managing references or pointers (no reference counting)
Macros for easy insertion into run-time selection tables.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
static autoPtr< RASModelVariables > New(const fvMesh &mesh, const solverControl &SolverControl)
Return a reference to the selected turbulence model.
refPtr< volScalarField > nutInitPtr_
refPtr< volScalarField > TMVar2InitPtr_
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Templated abstract base class for single-phase incompressible turbulence models.
singlePhaseTransportModel laminarTransport(U, phi)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
RASModelVariables(const fvMesh &mesh, const solverControl &SolverControl)
Construct from components.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
void resetMeanFields()
Reset mean fields to zero.
Base class for solver control classes.
Reading is optional [identical to LAZY_READ].
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
void restoreInitValues()
Restore turbulent fields to their initial values.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
virtual void allocateMeanFields()
defineTypeNameAndDebug(RASModelVariables, 0)
refPtr< volScalarField > nutMeanPtr_
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
void copyAndRename(volScalarField &f1, volScalarField &f2)
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
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))
defineRunTimeSelectionTable(RASModelVariables, dictionary)
virtual void rename(const word &newName)
Rename.
bool doAverageIter() const
Whether or not to add fields of the current iteration to the average fields.
const volScalarField & TMVar2Inst() const
refPtr< volScalarField > TMVar2MeanPtr_
const volScalarField & nutRefInst() const
#define WarningInFunction
Report a warning using Foam::Warning.
bool average() const
Whether averaging is enabled or not.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Automatically write from objectRegistry::writeObject()
autoPtr< RASModelVariables > clone() const
Clone.
virtual bool hasNut() const
void correctBoundaryConditions()
Correct boundary field.
tmp< volSymmTensorField > devReff(const singlePhaseTransportModel &laminarTransport, const volVectorField &U) const
Return stress tensor based on the mean flow variables.
messageStream Info
Information stream (stdout output on master, null elsewhere)
tmp< volScalarField > nut() const
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
label & averageIter()
Return average iteration index reference.
A class for managing temporary objects.
refPtr< volScalarField > TMVar1MeanPtr_
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A simple single-phase transport model based on viscosityModel.
bool storeInitValues() const
Re-initialize.
Defines the attributes of an object for which implicit objectRegistry management is supported...
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Do not request registration (bool: false)
virtual void correctBoundaryConditions(const incompressible::turbulenceModel &turbulence)
correct bounday conditions of turbulent fields
SymmTensor< Cmpt > devTwoSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of twice the symmetric part of a SymmTensor.
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
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)
virtual void computeMeanFields()
Compute mean fields on the fly.