RASModelVariables Class Reference

Abstract base class for objective functions. No point in making this runTime selectable since its children will have different constructors. More...

Inheritance diagram for RASModelVariables:
[legend]
Collaboration diagram for RASModelVariables:
[legend]

Public Member Functions

 TypeName ("RASModelVariables")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, RASModelVariables, dictionary,(const fvMesh &mesh, const solverControl &SolverControl),(mesh, SolverControl))
 
 RASModelVariables (const fvMesh &mesh, const solverControl &SolverControl)
 Construct from components. More...
 
 RASModelVariables (const RASModelVariables &rmv)
 Copy constructor. More...
 
autoPtr< RASModelVariablesclone () const
 Clone. More...
 
virtual ~RASModelVariables ()=default
 
const wordTMVar1BaseName () const
 Turbulence field names. More...
 
const wordTMVar2BaseName () const
 
const wordnutBaseName () const
 
virtual bool hasTMVar1 () const
 Bools to identify which turbulent fields are present. More...
 
virtual bool hasTMVar2 () const
 
virtual bool hasNut () const
 
bool hasDist () const
 
const volScalarFieldTMVar1 () const
 Return references to turbulence fields. More...
 
volScalarFieldTMVar1 ()
 
const volScalarFieldTMVar2 () const
 
volScalarFieldTMVar2 ()
 
const volScalarFieldnutRef () const
 
volScalarFieldnutRef ()
 
const volScalarFieldd () const
 
volScalarFieldd ()
 
const volScalarFieldTMVar1Inst () const
 return references to instantaneous turbulence fields More...
 
volScalarFieldTMVar1Inst ()
 
const volScalarFieldTMVar2Inst () const
 
volScalarFieldTMVar2Inst ()
 
const volScalarFieldnutRefInst () const
 
volScalarFieldnutRefInst ()
 
virtual tmp< volScalarFieldnutJacobianVar1 (const singlePhaseTransportModel &laminarTransport) const
 Return nut Jacobian wrt the TM vars. More...
 
virtual tmp< volScalarFieldnutJacobianVar2 (const singlePhaseTransportModel &laminarTransport) const
 
virtual tmp< volScalarField::InternalG ()
 Return the turbulence production term. More...
 
void restoreInitValues ()
 Restore turbulent fields to their initial values. More...
 
void resetMeanFields ()
 Reset mean fields to zero. More...
 
virtual void computeMeanFields ()
 Compute mean fields on the fly. More...
 
tmp< volSymmTensorFielddevReff (const singlePhaseTransportModel &laminarTransport, const volVectorField &U) const
 Return stress tensor based on the mean flow variables. More...
 
virtual void correctBoundaryConditions (const incompressible::turbulenceModel &turbulence)
 correct bounday conditions of turbulent fields More...
 
virtual void transfer (RASModelVariables &rmv)
 Transfer turbulence fields from an another object. More...
 

Static Public Member Functions

static autoPtr< RASModelVariablesNew (const fvMesh &mesh, const solverControl &SolverControl)
 Return a reference to the selected turbulence model. More...
 

Protected Member Functions

virtual void allocateInitValues ()
 
virtual void allocateMeanFields ()
 
refPtr< volScalarFieldcloneRefPtr (const refPtr< volScalarField > &obj) const
 
void copyAndRename (volScalarField &f1, volScalarField &f2)
 
void operator= (const RASModelVariables &)=delete
 No copy assignment. More...
 

Protected Attributes

const fvMeshmesh_
 
const solverControlsolverControl_
 
word TMVar1BaseName_
 
word TMVar2BaseName_
 
word nutBaseName_
 
refPtr< volScalarFieldTMVar1Ptr_
 
refPtr< volScalarFieldTMVar2Ptr_
 
refPtr< volScalarFieldnutPtr_
 
refPtr< volScalarFielddistPtr_
 
refPtr< volScalarFieldTMVar1InitPtr_
 
refPtr< volScalarFieldTMVar2InitPtr_
 
refPtr< volScalarFieldnutInitPtr_
 
refPtr< volScalarFieldTMVar1MeanPtr_
 
refPtr< volScalarFieldTMVar2MeanPtr_
 
refPtr< volScalarFieldnutMeanPtr_
 

Detailed Description

Abstract base class for objective functions. No point in making this runTime selectable since its children will have different constructors.

Source files

Definition at line 59 of file RASModelVariables.H.

Constructor & Destructor Documentation

◆ RASModelVariables() [1/2]

RASModelVariables ( const fvMesh mesh,
const solverControl SolverControl 
)

Construct from components.

Definition at line 182 of file RASModelVariables.C.

◆ RASModelVariables() [2/2]

Copy constructor.

Will allocate new fields (instead of referencing the ones in the turbulence model), so cannot be used directly to access the fields of the turbulence model. Mainly used for checkpointing in unsteady adjoint

Definition at line 210 of file RASModelVariables.C.

◆ ~RASModelVariables()

virtual ~RASModelVariables ( )
virtualdefault

Member Function Documentation

◆ allocateInitValues()

void allocateInitValues ( )
protectedvirtual

Definition at line 48 of file RASModelVariables.C.

References Foam::endl(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), Foam::Info, Foam::name(), RASModelVariables::nutInitPtr_, RASModelVariables::nutRefInst(), RASModelVariables::solverControl_, solverControl::storeInitValues(), RASModelVariables::TMVar1InitPtr_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar2InitPtr_, and RASModelVariables::TMVar2Inst().

Referenced by kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), laminar::laminar(), LaunderSharmaKE::LaunderSharmaKE(), and SpalartAllmaras::SpalartAllmaras().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocateMeanFields()

void allocateMeanFields ( )
protectedvirtual

Reimplemented in kOmegaSST.

Definition at line 81 of file RASModelVariables.C.

References IOobject::AUTO_WRITE, solverControl::average(), Foam::endl(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), Foam::Info, RASModelVariables::mesh_, Foam::name(), RASModelVariables::nutMeanPtr_, RASModelVariables::nutRefInst(), IOobject::READ_IF_PRESENT, RASModelVariables::solverControl_, fvMesh::time(), Time::timeName(), RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar2Inst(), and RASModelVariables::TMVar2MeanPtr_.

Referenced by kOmegaSST::allocateMeanFields(), kEpsilon::kEpsilon(), LaunderSharmaKE::LaunderSharmaKE(), and SpalartAllmaras::SpalartAllmaras().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cloneRefPtr()

Foam::refPtr< Foam::volScalarField > cloneRefPtr ( const refPtr< volScalarField > &  obj) const
protected

Definition at line 148 of file RASModelVariables.C.

References RASModelVariables::mesh_, IOobject::name(), Time::New(), fvMesh::time(), timeName, and Time::timeName().

Here is the call graph for this function:

◆ copyAndRename()

void copyAndRename ( volScalarField f1,
volScalarField f2 
)
protected

Definition at line 163 of file RASModelVariables.C.

References IOobject::name(), and regIOobject::rename().

Referenced by RASModelVariables::transfer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const RASModelVariables )
protecteddelete

No copy assignment.

◆ TypeName()

TypeName ( "RASModelVariables"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
RASModelVariables  ,
dictionary  ,
(const fvMesh &mesh, const solverControl &SolverControl)  ,
(mesh, SolverControl)   
)

◆ clone()

autoPtr< RASModelVariables > clone ( ) const

Clone.

Will allocate new fields (instead of referencing the ones in the turbulence model), so cannot be used directly to access the fields of the turbulence model. Mainly used for checkpointing in unsteady adjoint

Definition at line 237 of file RASModelVariables.C.

References Time::New().

Here is the call graph for this function:

◆ New()

autoPtr< RASModelVariables > New ( const fvMesh mesh,
const solverControl SolverControl 
)
static

Return a reference to the selected turbulence model.

Definition at line 245 of file RASModelVariables.C.

References TimePaths::constant(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::findDict(), Foam::Info, mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, dictionary::null, phaseSystem::propertiesName, dictionary::readCompat(), and fvMesh::time().

Here is the call graph for this function:

◆ TMVar1BaseName()

const word & TMVar1BaseName ( ) const
inline

Turbulence field names.

Definition at line 38 of file RASModelVariablesI.H.

References RASModelVariables::TMVar1BaseName_.

◆ TMVar2BaseName()

const word & TMVar2BaseName ( ) const
inline

Definition at line 44 of file RASModelVariablesI.H.

References RASModelVariables::TMVar2BaseName_.

◆ nutBaseName()

const word & nutBaseName ( ) const
inline

Definition at line 50 of file RASModelVariablesI.H.

References RASModelVariables::nutBaseName_.

◆ hasTMVar1()

bool hasTMVar1 ( ) const
inlinevirtual

Bools to identify which turbulent fields are present.

Apart from the distance pointer, all other pointers are allocated even if the the corresponding field does not exist. Hence, the pointer itself cannot be used to determine the existance of the field

Reimplemented in kEpsilon, kOmegaSST, laminar, LaunderSharmaKE, and SpalartAllmaras.

Definition at line 56 of file RASModelVariablesI.H.

References bool, and RASModelVariables::TMVar1Ptr_.

Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().

Here is the caller graph for this function:

◆ hasTMVar2()

bool hasTMVar2 ( ) const
inlinevirtual

◆ hasNut()

bool hasNut ( ) const
inlinevirtual

◆ hasDist()

bool hasDist ( ) const
inline

Definition at line 74 of file RASModelVariablesI.H.

References bool, and RASModelVariables::distPtr_.

Referenced by RASModelVariables::transfer().

Here is the caller graph for this function:

◆ TMVar1() [1/2]

const volScalarField & TMVar1 ( ) const
inline

Return references to turbulence fields.

will return the mean field if it exists, otherwise the instantaneous one

Definition at line 80 of file RASModelVariablesI.H.

References RASModelVariables::solverControl_, RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar1Ptr_, and solverControl::useAveragedFields().

Referenced by SpalartAllmaras::nutJacobianVar1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TMVar1() [2/2]

volScalarField & TMVar1 ( )
inline

Definition at line 91 of file RASModelVariablesI.H.

References RASModelVariables::solverControl_, RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar1Ptr_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ TMVar2() [1/2]

const volScalarField & TMVar2 ( ) const
inline

Definition at line 102 of file RASModelVariablesI.H.

References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().

Referenced by kOmegaSST::computeG().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TMVar2() [2/2]

volScalarField & TMVar2 ( )
inline

Definition at line 112 of file RASModelVariablesI.H.

References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ nutRef() [1/2]

const volScalarField & nutRef ( ) const
inline

Definition at line 122 of file RASModelVariablesI.H.

References RASModelVariables::nutMeanPtr_, RASModelVariables::nutPtr_, RASModelVariables::solverControl_, and solverControl::useAveragedFields().

Referenced by kOmegaSST::correctBoundaryConditions(), and RASModelVariables::devReff().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nutRef() [2/2]

volScalarField & nutRef ( )
inline

Definition at line 133 of file RASModelVariablesI.H.

References RASModelVariables::nutMeanPtr_, RASModelVariables::nutPtr_, RASModelVariables::solverControl_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ d() [1/2]

const volScalarField & d ( ) const
inline

Definition at line 144 of file RASModelVariablesI.H.

References RASModelVariables::distPtr_.

Referenced by RASModelVariables::transfer().

Here is the caller graph for this function:

◆ d() [2/2]

volScalarField & d ( )
inline

Definition at line 150 of file RASModelVariablesI.H.

References RASModelVariables::distPtr_.

◆ TMVar1Inst() [1/2]

const volScalarField & TMVar1Inst ( ) const
inline

return references to instantaneous turbulence fields

Definition at line 156 of file RASModelVariablesI.H.

References RASModelVariables::TMVar1Ptr_.

Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().

Here is the caller graph for this function:

◆ TMVar1Inst() [2/2]

volScalarField & TMVar1Inst ( )
inline

Definition at line 162 of file RASModelVariablesI.H.

References RASModelVariables::TMVar1Ptr_.

◆ TMVar2Inst() [1/2]

◆ TMVar2Inst() [2/2]

volScalarField & TMVar2Inst ( )
inline

Definition at line 174 of file RASModelVariablesI.H.

References RASModelVariables::TMVar2Ptr_.

◆ nutRefInst() [1/2]

◆ nutRefInst() [2/2]

volScalarField & nutRefInst ( )
inline

Definition at line 186 of file RASModelVariablesI.H.

References RASModelVariables::nutPtr_.

◆ nutJacobianVar1()

tmp< volScalarField > nutJacobianVar1 ( const singlePhaseTransportModel laminarTransport) const
virtual

Return nut Jacobian wrt the TM vars.

Reimplemented in SpalartAllmaras.

Definition at line 299 of file RASModelVariables.C.

References Foam::dimless, Foam::endl(), RASModelVariables::mesh_, Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, fvMesh::time(), Time::timeName(), WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ nutJacobianVar2()

tmp< volScalarField > nutJacobianVar2 ( const singlePhaseTransportModel laminarTransport) const
virtual

Definition at line 324 of file RASModelVariables.C.

References Foam::dimless, Foam::endl(), RASModelVariables::mesh_, Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, fvMesh::time(), Time::timeName(), WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ G()

virtual tmp< volScalarField::Internal > G ( )
inlinevirtual

Return the turbulence production term.

Reimplemented in kOmegaSST.

Definition at line 220 of file RASModelVariables.H.

References NotImplemented.

◆ restoreInitValues()

void restoreInitValues ( )

Restore turbulent fields to their initial values.

Definition at line 349 of file RASModelVariables.C.

References RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), RASModelVariables::nutInitPtr_, RASModelVariables::nutRefInst(), RASModelVariables::solverControl_, solverControl::storeInitValues(), RASModelVariables::TMVar1InitPtr_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar2InitPtr_, and RASModelVariables::TMVar2Inst().

Here is the call graph for this function:

◆ resetMeanFields()

void resetMeanFields ( )

◆ computeMeanFields()

void computeMeanFields ( )
virtual

Compute mean fields on the fly.

Reimplemented in kOmegaSST.

Definition at line 395 of file RASModelVariables.C.

References solverControl::averageIter(), solverControl::doAverageIter(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), RASModelVariables::nutMeanPtr_, RASModelVariables::nutRefInst(), RASModelVariables::solverControl_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar2Inst(), and RASModelVariables::TMVar2MeanPtr_.

Referenced by kOmegaSST::computeMeanFields().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ devReff()

tmp< volSymmTensorField > devReff ( const singlePhaseTransportModel laminarTransport,
const volVectorField U 
) const

Return stress tensor based on the mean flow variables.

Definition at line 423 of file RASModelVariables.C.

References Foam::dev(), Foam::fvc::grad(), laminarTransport(), RASModelVariables::mesh_, Time::New(), IOobject::NO_READ, IOobject::NO_WRITE, singlePhaseTransportModel::nu(), RASModelVariables::nutRef(), fvMesh::time(), Time::timeName(), Foam::twoSymm(), and U.

Here is the call graph for this function:

◆ correctBoundaryConditions()

void correctBoundaryConditions ( const incompressible::turbulenceModel turbulence)
virtual

◆ transfer()

void transfer ( RASModelVariables rmv)
virtual

Transfer turbulence fields from an another object.

Copies values since the ownership of the original fields is held by the turbulence model

Definition at line 478 of file RASModelVariables.C.

References RASModelVariables::copyAndRename(), RASModelVariables::d(), RASModelVariables::hasDist(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), RASModelVariables::nutRefInst(), RASModelVariables::TMVar1Inst(), and RASModelVariables::TMVar2Inst().

Here is the call graph for this function:

Member Data Documentation

◆ mesh_

◆ solverControl_

◆ TMVar1BaseName_

◆ TMVar2BaseName_

◆ nutBaseName_

◆ TMVar1Ptr_

◆ TMVar2Ptr_

◆ nutPtr_

◆ distPtr_

◆ TMVar1InitPtr_

refPtr<volScalarField> TMVar1InitPtr_
protected

◆ TMVar2InitPtr_

refPtr<volScalarField> TMVar2InitPtr_
protected

◆ nutInitPtr_

◆ TMVar1MeanPtr_

◆ TMVar2MeanPtr_

◆ nutMeanPtr_


The documentation for this class was generated from the following files: