Go to the documentation of this file.
37 namespace incompressible
52 Info<<
"Storing initial values of turbulence variables" <<
endl;
85 Info<<
"Allocating mean values of turbulence variables" <<
endl;
170 const word name1 = f1.name();
171 const word name2 = f2.name();
189 solverControl_(SolverControl),
200 TMVar1InitPtr_(
nullptr),
201 TMVar2InitPtr_(
nullptr),
202 nutInitPtr_(
nullptr),
204 TMVar1MeanPtr_(
nullptr),
205 TMVar2MeanPtr_(
nullptr),
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 cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
282 if (!cstrIter.found())
289 *dictionaryConstructorTablePtr_
305 <<
"jutJacobianVar1 not implemented for the current turbulence model."
306 <<
"Returning zero field" <<
endl;
313 mesh_.time().timeName(),
330 <<
"nutJacobianVar2 not implemented for the current turbulence model."
331 <<
"Returning zero field" <<
endl;
338 mesh_.time().timeName(),
373 Info<<
"Resetting mean turbulent fields to zero" <<
endl;
400 const scalar avIter(iAverageIter);
401 const scalar oneOverItP1 = 1./(avIter + 1);
402 const scalar mult = avIter*oneOverItP1;
434 mesh_.time().timeName(),
451 TMVar1Inst().correctBoundaryConditions();
452 if (solverControl_.average())
454 TMVar1MeanPtr_.ref().correctBoundaryConditions();
460 TMVar2Inst().correctBoundaryConditions();
461 if (solverControl_.average())
463 TMVar2MeanPtr_.ref().correctBoundaryConditions();
469 nutRefInst().correctBoundaryConditions();
470 if (solverControl_.average())
472 nutMeanPtr_.ref().correctBoundaryConditions();
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
static refPtr< T > New(Args &&... args)
Construct refPtr of T with forwarding arguments.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
bool doAverageIter() const
A class for handling words, derived from Foam::string.
const volScalarField & d() const
const volScalarField & TMVar1Inst() const
return references to instantaneous turbulence fields
const solverControl & solverControl_
defineTypeNameAndDebug(adjointEikonalSolver, 0)
Info<< "Reading field U\n"<< 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\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
static word timeName(const scalar t, const int precision=precision_)
refPtr< volScalarField > TMVar1InitPtr_
static const word propertiesName
Default name of the turbulence properties dictionary.
refPtr< volScalarField > TMVar2Ptr_
refPtr< volScalarField > nutInitPtr_
void restoreInitValues()
Restore turbulent fields to their initial values.
Base class for solver control classes.
void allocateInitValues()
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool storeInitValues() const
Re-initialize.
refPtr< volScalarField > nutMeanPtr_
A simple single-phase transport model based on viscosityModel.
refPtr< volScalarField > distPtr_
virtual void correctBoundaryConditions(const incompressible::turbulenceModel &turbulence)
correct bounday conditions of turbulent fields
defineRunTimeSelectionTable(adjointSensitivity, dictionary)
RASModelVariables(const fvMesh &mesh, const solverControl &SolverControl)
Construct from components.
void computeMeanFields()
Compute mean fields on the fly.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
virtual void transfer(RASModelVariables &rmv)
Transfer turbulence fields from an another object.
const volScalarField & nutRefInst() const
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
void allocateMeanFields()
void resetMeanFields()
Reset mean fields to zero.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
refPtr< volScalarField > nutPtr_
virtual tmp< volScalarField > nutJacobianVar2(const singlePhaseTransportModel &laminarTransport) const
static autoPtr< RASModelVariables > New(const fvMesh &mesh, const solverControl &SolverControl)
Return a reference to the selected turbulence model.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
refPtr< volScalarField > TMVar1Ptr_
label & averageIter()
Return average iteration index reference.
const volScalarField & TMVar2Inst() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
bool hasTMVar1() const
Bools to idenify which turbulent fields are present.
Mesh data needed to do the Finite Volume discretisation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< volSymmTensorField > devReff(const singlePhaseTransportModel &laminarTransport, const volVectorField &U) const
Return stress tensor based on the mean flow variables.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
refPtr< volScalarField > TMVar2InitPtr_
void copyAndRename(volScalarField &f1, volScalarField &f2)
bool readCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, T &val, enum keyType::option=keyType::REGEX, bool mandatory=true) const
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
refPtr< volScalarField > TMVar1MeanPtr_
const Time & time() const
Return the top-level database.
Templated abstract base class for single-phase incompressible turbulence models.
refPtr< volScalarField > TMVar2MeanPtr_
virtual tmp< volScalarField > nutJacobianVar1(const singlePhaseTransportModel &laminarTransport) const
Return nut Jacobian wrt the TM vars.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
bool average() const
Whether averaging is enabled or not.
singlePhaseTransportModel laminarTransport(U, phi)
autoPtr< RASModelVariables > clone() const
Clone.
refPtr< volScalarField > cloneRefPtr(const refPtr< volScalarField > &obj) const
A class for managing references or pointers (no reference counting)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)