Abstract base class for objective functions. No point in making this runTime selectable since its children will have different constructors. More...
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< RASModelVariables > | clone () const |
Clone. More... | |
virtual | ~RASModelVariables ()=default |
const word & | TMVar1BaseName () const |
Turbulence field names. More... | |
const word & | TMVar2BaseName () const |
const word & | nutBaseName () 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 volScalarField & | TMVar1 () const |
Return references to turbulence fields. More... | |
volScalarField & | TMVar1 () |
const volScalarField & | TMVar2 () const |
volScalarField & | TMVar2 () |
const volScalarField & | nutRef () const |
volScalarField & | nutRef () |
const volScalarField & | d () const |
volScalarField & | d () |
const volScalarField & | TMVar1Inst () const |
return references to instantaneous turbulence fields More... | |
volScalarField & | TMVar1Inst () |
const volScalarField & | TMVar2Inst () const |
volScalarField & | TMVar2Inst () |
const volScalarField & | nutRefInst () const |
volScalarField & | nutRefInst () |
virtual tmp< volScalarField > | nutJacobianVar1 (const singlePhaseTransportModel &laminarTransport) const |
Return nut Jacobian wrt the TM vars. More... | |
virtual tmp< volScalarField > | nutJacobianVar2 (const singlePhaseTransportModel &laminarTransport) const |
virtual tmp< volScalarField::Internal > | G () |
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< volSymmTensorField > | devReff (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< RASModelVariables > | New (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< volScalarField > | cloneRefPtr (const refPtr< volScalarField > &obj) const |
void | copyAndRename (volScalarField &f1, volScalarField &f2) |
void | operator= (const RASModelVariables &)=delete |
No copy assignment. More... | |
Protected Attributes | |
const fvMesh & | mesh_ |
const solverControl & | solverControl_ |
word | TMVar1BaseName_ |
word | TMVar2BaseName_ |
word | nutBaseName_ |
refPtr< volScalarField > | TMVar1Ptr_ |
refPtr< volScalarField > | TMVar2Ptr_ |
refPtr< volScalarField > | nutPtr_ |
refPtr< volScalarField > | distPtr_ |
refPtr< volScalarField > | TMVar1InitPtr_ |
refPtr< volScalarField > | TMVar2InitPtr_ |
refPtr< volScalarField > | nutInitPtr_ |
refPtr< volScalarField > | TMVar1MeanPtr_ |
refPtr< volScalarField > | TMVar2MeanPtr_ |
refPtr< volScalarField > | nutMeanPtr_ |
Abstract base class for objective functions. No point in making this runTime selectable since its children will have different constructors.
Definition at line 59 of file RASModelVariables.H.
RASModelVariables | ( | const fvMesh & | mesh, |
const solverControl & | SolverControl | ||
) |
Construct from components.
Definition at line 182 of file RASModelVariables.C.
RASModelVariables | ( | const RASModelVariables & | rmv | ) |
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.
|
virtualdefault |
|
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().
|
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().
|
protected |
Definition at line 148 of file RASModelVariables.C.
References RASModelVariables::mesh_, IOobject::name(), Time::New(), fvMesh::time(), timeName, and Time::timeName().
|
protected |
Definition at line 163 of file RASModelVariables.C.
References IOobject::name(), and regIOobject::rename().
Referenced by RASModelVariables::transfer().
|
protecteddelete |
No copy assignment.
TypeName | ( | "RASModelVariables" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
RASModelVariables | , | ||
dictionary | , | ||
(const fvMesh &mesh, const solverControl &SolverControl) | , | ||
(mesh, SolverControl) | |||
) |
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().
|
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().
|
inline |
Turbulence field names.
Definition at line 38 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1BaseName_.
|
inline |
Definition at line 44 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2BaseName_.
|
inline |
Definition at line 50 of file RASModelVariablesI.H.
References RASModelVariables::nutBaseName_.
|
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().
|
inlinevirtual |
Reimplemented in kEpsilon, kOmegaSST, laminar, LaunderSharmaKE, and SpalartAllmaras.
Definition at line 62 of file RASModelVariablesI.H.
References bool, and RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inlinevirtual |
Reimplemented in kEpsilon, kOmegaSST, laminar, LaunderSharmaKE, and SpalartAllmaras.
Definition at line 68 of file RASModelVariablesI.H.
References bool, and RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 74 of file RASModelVariablesI.H.
References bool, and RASModelVariables::distPtr_.
Referenced by RASModelVariables::transfer().
|
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().
|
inline |
Definition at line 91 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar1Ptr_, and solverControl::useAveragedFields().
|
inline |
Definition at line 102 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().
Referenced by kOmegaSST::computeG().
|
inline |
Definition at line 112 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().
|
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().
|
inline |
Definition at line 133 of file RASModelVariablesI.H.
References RASModelVariables::nutMeanPtr_, RASModelVariables::nutPtr_, RASModelVariables::solverControl_, and solverControl::useAveragedFields().
|
inline |
Definition at line 144 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
Referenced by RASModelVariables::transfer().
|
inline |
Definition at line 150 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
|
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().
|
inline |
Definition at line 162 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
|
inline |
Definition at line 168 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 174 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
|
inline |
Definition at line 180 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 186 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
|
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.
|
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.
|
inlinevirtual |
Return the turbulence production term.
Reimplemented in kOmegaSST.
Definition at line 220 of file RASModelVariables.H.
References NotImplemented.
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().
void resetMeanFields | ( | ) |
Reset mean fields to zero.
Definition at line 369 of file RASModelVariables.C.
References solverControl::average(), Foam::endl(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), Foam::Info, RASModelVariables::nutMeanPtr_, RASModelVariables::nutRefInst(), RASModelVariables::solverControl_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar2Inst(), RASModelVariables::TMVar2MeanPtr_, and Foam::Zero.
|
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().
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.
|
virtual |
correct bounday conditions of turbulent fields
Reimplemented in kOmegaSST.
Definition at line 444 of file RASModelVariables.C.
References solverControl::average(), GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), RASModelVariables::nutMeanPtr_, RASModelVariables::nutRefInst(), RASModelVariables::solverControl_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar2Inst(), and RASModelVariables::TMVar2MeanPtr_.
|
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().
|
protected |
Definition at line 65 of file RASModelVariables.H.
Referenced by kOmegaSST::allocateMeanFields(), RASModelVariables::allocateMeanFields(), RASModelVariables::cloneRefPtr(), kOmegaSST::computeG(), RASModelVariables::devReff(), kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), LaunderSharmaKE::LaunderSharmaKE(), RASModelVariables::nutJacobianVar1(), SpalartAllmaras::nutJacobianVar1(), RASModelVariables::nutJacobianVar2(), and SpalartAllmaras::SpalartAllmaras().
|
protected |
Definition at line 66 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), kOmegaSST::allocateMeanFields(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), kOmegaSST::G(), RASModelVariables::nutRef(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), RASModelVariables::TMVar1(), and RASModelVariables::TMVar2().
|
protected |
Definition at line 69 of file RASModelVariables.H.
Referenced by kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), LaunderSharmaKE::LaunderSharmaKE(), SpalartAllmaras::SpalartAllmaras(), and RASModelVariables::TMVar1BaseName().
|
protected |
Definition at line 70 of file RASModelVariables.H.
Referenced by kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), LaunderSharmaKE::LaunderSharmaKE(), and RASModelVariables::TMVar2BaseName().
|
protected |
Definition at line 71 of file RASModelVariables.H.
Referenced by kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), LaunderSharmaKE::LaunderSharmaKE(), RASModelVariables::nutBaseName(), and SpalartAllmaras::SpalartAllmaras().
|
protected |
Definition at line 73 of file RASModelVariables.H.
Referenced by RASModelVariables::hasTMVar1(), kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), laminar::laminar(), LaunderSharmaKE::LaunderSharmaKE(), SpalartAllmaras::SpalartAllmaras(), RASModelVariables::TMVar1(), and RASModelVariables::TMVar1Inst().
|
protected |
Definition at line 74 of file RASModelVariables.H.
Referenced by RASModelVariables::hasTMVar2(), kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), laminar::laminar(), LaunderSharmaKE::LaunderSharmaKE(), SpalartAllmaras::SpalartAllmaras(), RASModelVariables::TMVar2(), and RASModelVariables::TMVar2Inst().
|
protected |
Definition at line 75 of file RASModelVariables.H.
Referenced by RASModelVariables::hasNut(), kEpsilon::kEpsilon(), kOmegaSST::kOmegaSST(), laminar::laminar(), LaunderSharmaKE::LaunderSharmaKE(), RASModelVariables::nutRef(), RASModelVariables::nutRefInst(), and SpalartAllmaras::SpalartAllmaras().
|
protected |
Definition at line 76 of file RASModelVariables.H.
Referenced by RASModelVariables::d(), RASModelVariables::hasDist(), kOmegaSST::kOmegaSST(), and SpalartAllmaras::SpalartAllmaras().
|
protected |
Definition at line 80 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 81 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 82 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 85 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), RASModelVariables::resetMeanFields(), and RASModelVariables::TMVar1().
|
protected |
Definition at line 86 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), RASModelVariables::resetMeanFields(), and RASModelVariables::TMVar2().
|
protected |
Definition at line 87 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::correctBoundaryConditions(), RASModelVariables::nutRef(), and RASModelVariables::resetMeanFields().