RASModelVariables Class Reference

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

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

Public Types

typedef autoPtr< tmp< volScalarField > > autoTmp
 

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
 
bool hasTMVar1 () const
 Bools to idenify which turbulent fields are present. More...
 
bool hasTMVar2 () const
 
bool hasNut () const
 
bool hasDist () const
 
const wordTMVar1BaseName () const
 Turbulence field names. More...
 
const wordTMVar2BaseName () const
 
const wordnutBaseName () 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
 
void restoreInitValues ()
 Restore turbulent fields to their initial values. More...
 
void resetMeanFields ()
 Reset mean fields to zero. More...
 
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

void allocateInitValues ()
 
void allocateMeanFields ()
 
autoTmp cloneAutoTmp (const autoTmp &source) const
 
void copyAndRename (volScalarField &f1, volScalarField &f2)
 

Protected Attributes

const fvMeshmesh_
 
const solverControlsolverControl_
 
bool hasTMVar1_
 
bool hasTMVar2_
 
bool hasNut_
 
bool hasDist_
 
autoTmp TMVar1Ptr_
 
autoTmp TMVar2Ptr_
 
autoTmp nutPtr_
 
autoTmp dPtr_
 
word TMVar1BaseName_
 
word TMVar2BaseName_
 
word nutBaseName_
 
autoPtr< volScalarFieldTMVar1InitPtr_
 
autoPtr< volScalarFieldTMVar2InitPtr_
 
autoPtr< volScalarFieldnutInitPtr_
 
autoPtr< volScalarFieldTMVar1MeanPtr_
 
autoPtr< volScalarFieldTMVar2MeanPtr_
 
autoPtr< volScalarFieldnutMeanPtr_
 

Detailed Description

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

Source files

Definition at line 58 of file RASModelVariables.H.

Member Typedef Documentation

◆ autoTmp

Definition at line 65 of file RASModelVariables.H.

Constructor & Destructor Documentation

◆ RASModelVariables() [1/2]

RASModelVariables ( const fvMesh mesh,
const solverControl SolverControl 
)

Construct from components.

Definition at line 194 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 222 of file RASModelVariables.C.

◆ ~RASModelVariables()

virtual ~RASModelVariables ( )
virtualdefault

Member Function Documentation

◆ allocateInitValues()

◆ allocateMeanFields()

◆ cloneAutoTmp()

RASModelVariables::autoTmp cloneAutoTmp ( const autoTmp source) const
protected

Definition at line 153 of file RASModelVariables.C.

References DebugInfo, Foam::endl(), RASModelVariables::mesh_, autoPtr< T >::reset(), fvMesh::time(), timeName, Time::timeName(), and autoPtr< T >::valid().

Here is the call graph for this function:

◆ copyAndRename()

void copyAndRename ( volScalarField f1,
volScalarField f2 
)
protected

Definition at line 175 of file RASModelVariables.C.

Referenced by RASModelVariables::transfer().

Here is the caller graph for this function:

◆ 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 249 of file RASModelVariables.C.

References autoPtr< T >::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 257 of file RASModelVariables.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, Foam::Info, mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, turbulenceModel::propertiesName, and dictionary::subOrEmptyDict().

Referenced by incompressibleVars::setFields().

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

◆ hasTMVar1()

bool hasTMVar1 ( ) const

Bools to idenify which turbulent fields are present.

Definition at line 300 of file RASModelVariables.C.

References RASModelVariables::hasTMVar1_.

Referenced by incompressibleVars::renameTurbulenceFields(), and RASModelVariables::transfer().

Here is the caller graph for this function:

◆ hasTMVar2()

bool hasTMVar2 ( ) const

Definition at line 306 of file RASModelVariables.C.

References RASModelVariables::hasTMVar2_.

Referenced by incompressibleVars::renameTurbulenceFields(), and RASModelVariables::transfer().

Here is the caller graph for this function:

◆ hasNut()

bool hasNut ( ) const

Definition at line 312 of file RASModelVariables.C.

References RASModelVariables::hasNut_.

Referenced by incompressibleVars::renameTurbulenceFields(), and RASModelVariables::transfer().

Here is the caller graph for this function:

◆ hasDist()

bool hasDist ( ) const

Definition at line 318 of file RASModelVariables.C.

References RASModelVariables::hasDist_.

Referenced by RASModelVariables::transfer().

Here is the caller graph for this function:

◆ TMVar1BaseName()

const word & TMVar1BaseName ( ) const

Turbulence field names.

Definition at line 324 of file RASModelVariables.C.

References RASModelVariables::TMVar1BaseName_.

◆ TMVar2BaseName()

const word & TMVar2BaseName ( ) const

Definition at line 330 of file RASModelVariables.C.

References RASModelVariables::TMVar2BaseName_.

◆ nutBaseName()

const word & nutBaseName ( ) const

Definition at line 336 of file RASModelVariables.C.

References RASModelVariables::nutBaseName_.

◆ TMVar1() [1/2]

const volScalarField & TMVar1 ( ) const

Return references to turbulence fields.

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

Definition at line 342 of file RASModelVariables.C.

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

Here is the call graph for this function:

◆ TMVar1() [2/2]

volScalarField & TMVar1 ( )

Definition at line 355 of file RASModelVariables.C.

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

Definition at line 368 of file RASModelVariables.C.

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

Here is the call graph for this function:

◆ TMVar2() [2/2]

volScalarField & TMVar2 ( )

Definition at line 380 of file RASModelVariables.C.

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

Definition at line 392 of file RASModelVariables.C.

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

Referenced by RASModelVariables::transfer().

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

◆ nutRef() [2/2]

volScalarField & nutRef ( )

Definition at line 405 of file RASModelVariables.C.

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

Here is the call graph for this function:

◆ d() [1/2]

const volScalarField & d ( ) const

Definition at line 418 of file RASModelVariables.C.

References RASModelVariables::dPtr_.

Referenced by RASModelVariables::transfer().

Here is the caller graph for this function:

◆ d() [2/2]

volScalarField & d ( )

Definition at line 424 of file RASModelVariables.C.

References RASModelVariables::dPtr_.

◆ TMVar1Inst() [1/2]

const volScalarField & TMVar1Inst ( ) const

return references to instantaneous turbulence fields

Definition at line 430 of file RASModelVariables.C.

References RASModelVariables::TMVar1Ptr_.

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

Here is the caller graph for this function:

◆ TMVar1Inst() [2/2]

volScalarField & TMVar1Inst ( )

Definition at line 436 of file RASModelVariables.C.

References RASModelVariables::TMVar1Ptr_.

◆ TMVar2Inst() [1/2]

const volScalarField & TMVar2Inst ( ) const

Definition at line 442 of file RASModelVariables.C.

References RASModelVariables::TMVar2Ptr_.

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

Here is the caller graph for this function:

◆ TMVar2Inst() [2/2]

volScalarField & TMVar2Inst ( )

Definition at line 448 of file RASModelVariables.C.

References RASModelVariables::TMVar2Ptr_.

◆ nutRefInst() [1/2]

const volScalarField & nutRefInst ( ) const

Definition at line 454 of file RASModelVariables.C.

References RASModelVariables::nutPtr_.

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

Here is the caller graph for this function:

◆ nutRefInst() [2/2]

volScalarField & nutRefInst ( )

Definition at line 460 of file RASModelVariables.C.

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 467 of file RASModelVariables.C.

References Foam::dimless, Foam::endl(), IOobject::NO_READ, IOobject::NO_WRITE, WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ nutJacobianVar2()

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

Definition at line 496 of file RASModelVariables.C.

References Foam::dimless, Foam::endl(), IOobject::NO_READ, IOobject::NO_WRITE, WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ restoreInitValues()

void restoreInitValues ( )

Restore turbulent fields to their initial values.

Definition at line 523 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 ( )

◆ devReff()

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

Return stress tensor based on the mean flow variables.

Definition at line 595 of file RASModelVariables.C.

References Foam::dev(), Foam::fvc::grad(), laminarTransport(), IOobject::NO_READ, IOobject::NO_WRITE, Foam::twoSymm(), and U.

Here is the call graph for this function:

◆ correctBoundaryConditions()

void correctBoundaryConditions ( const incompressible::turbulenceModel turbulence)
virtual

correct bounday conditions of turbulent fields

Reimplemented in kOmegaSST.

Definition at line 619 of file RASModelVariables.C.

Referenced by kOmegaSST::correctBoundaryConditions().

Here is the caller graph for this function:

◆ 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 652 of file RASModelVariables.C.

References RASModelVariables::copyAndRename(), RASModelVariables::d(), RASModelVariables::hasDist(), RASModelVariables::hasDist_, RASModelVariables::hasNut(), RASModelVariables::hasNut_, RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar1_, RASModelVariables::hasTMVar2(), RASModelVariables::hasTMVar2_, RASModelVariables::nutRef(), RASModelVariables::TMVar1Inst(), and RASModelVariables::TMVar2Inst().

Here is the call graph for this function:

Member Data Documentation

◆ mesh_

const fvMesh& mesh_
protected

◆ solverControl_

◆ hasTMVar1_

◆ hasTMVar2_

◆ hasNut_

◆ hasDist_

bool hasDist_
protected

Definition at line 81 of file RASModelVariables.H.

Referenced by RASModelVariables::hasDist(), and RASModelVariables::transfer().

◆ TMVar1Ptr_

autoTmp TMVar1Ptr_
protected

Definition at line 82 of file RASModelVariables.H.

Referenced by RASModelVariables::TMVar1(), and RASModelVariables::TMVar1Inst().

◆ TMVar2Ptr_

autoTmp TMVar2Ptr_
protected

Definition at line 83 of file RASModelVariables.H.

Referenced by RASModelVariables::TMVar2(), and RASModelVariables::TMVar2Inst().

◆ nutPtr_

autoTmp nutPtr_
protected

Definition at line 84 of file RASModelVariables.H.

Referenced by RASModelVariables::nutRef(), and RASModelVariables::nutRefInst().

◆ dPtr_

autoTmp dPtr_
protected

Definition at line 85 of file RASModelVariables.H.

Referenced by RASModelVariables::d().

◆ TMVar1BaseName_

word TMVar1BaseName_
protected

Definition at line 87 of file RASModelVariables.H.

Referenced by RASModelVariables::TMVar1BaseName().

◆ TMVar2BaseName_

word TMVar2BaseName_
protected

Definition at line 88 of file RASModelVariables.H.

Referenced by RASModelVariables::TMVar2BaseName().

◆ nutBaseName_

word nutBaseName_
protected

Definition at line 89 of file RASModelVariables.H.

Referenced by RASModelVariables::nutBaseName().

◆ TMVar1InitPtr_

autoPtr<volScalarField> TMVar1InitPtr_
protected

◆ TMVar2InitPtr_

autoPtr<volScalarField> TMVar2InitPtr_
protected

◆ nutInitPtr_

◆ TMVar1MeanPtr_

◆ TMVar2MeanPtr_

◆ nutMeanPtr_


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