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 55 of file RASModelVariables.H.
RASModelVariables | ( | const fvMesh & | mesh, |
const solverControl & | SolverControl | ||
) |
Construct from components.
Definition at line 176 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 204 of file RASModelVariables.C.
|
virtualdefault |
|
protectedvirtual |
Definition at line 41 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().
|
protectedvirtual |
Reimplemented in kOmegaSST.
Definition at line 74 of file RASModelVariables.C.
References IOobjectOption::AUTO_WRITE, solverControl::average(), Foam::endl(), RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), Foam::Info, RASModelVariables::mesh_, Foam::name(), RASModelVariables::nutMeanPtr_, RASModelVariables::nutRefInst(), IOobjectOption::READ_IF_PRESENT, RASModelVariables::solverControl_, fvMesh::time(), Time::timeName(), RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar2Inst(), and RASModelVariables::TMVar2MeanPtr_.
Referenced by kOmegaSST::allocateMeanFields().
|
protected |
Definition at line 141 of file RASModelVariables.C.
References RASModelVariables::mesh_, IOobject::name(), refPtr< T >::New(), fvMesh::time(), timeName, and Time::timeName().
|
protected |
Definition at line 157 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 230 of file RASModelVariables.C.
References autoPtr< T >::New().
|
static |
Return a reference to the selected turbulence model.
Definition at line 239 of file RASModelVariables.C.
References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::findDict(), Foam::Info, mesh, IOobjectOption::MUST_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, dictionary::null, turbulenceModel::propertiesName, and dictionary::readCompat().
Referenced by incompressibleVars::setFields().
|
inline |
Turbulence field names.
Definition at line 31 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1BaseName_.
|
inline |
Definition at line 37 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2BaseName_.
|
inline |
Definition at line 43 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 kOmegaSST, kEpsilon, laminar, LaunderSharmaKE, and SpalartAllmaras.
Definition at line 49 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inlinevirtual |
Reimplemented in kOmegaSST, kEpsilon, laminar, LaunderSharmaKE, and SpalartAllmaras.
Definition at line 55 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inlinevirtual |
Reimplemented in kOmegaSST, kEpsilon, laminar, LaunderSharmaKE, and SpalartAllmaras.
Definition at line 61 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 67 of file RASModelVariablesI.H.
References 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 73 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar1Ptr_, and solverControl::useAveragedFields().
|
inline |
Definition at line 84 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar1MeanPtr_, RASModelVariables::TMVar1Ptr_, and solverControl::useAveragedFields().
|
inline |
Definition at line 95 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().
Referenced by kOmegaSST::computeG().
|
inline |
Definition at line 105 of file RASModelVariablesI.H.
References RASModelVariables::solverControl_, RASModelVariables::TMVar2MeanPtr_, RASModelVariables::TMVar2Ptr_, and solverControl::useAveragedFields().
|
inline |
Definition at line 115 of file RASModelVariablesI.H.
References RASModelVariables::nutMeanPtr_, RASModelVariables::nutPtr_, RASModelVariables::solverControl_, and solverControl::useAveragedFields().
|
inline |
Definition at line 126 of file RASModelVariablesI.H.
References RASModelVariables::nutMeanPtr_, RASModelVariables::nutPtr_, RASModelVariables::solverControl_, and solverControl::useAveragedFields().
|
inline |
Definition at line 137 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
Referenced by RASModelVariables::transfer().
|
inline |
Definition at line 143 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
|
inline |
return references to instantaneous turbulence fields
Definition at line 149 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 155 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
|
inline |
Definition at line 161 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 167 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
|
inline |
Definition at line 173 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 179 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
|
virtual |
Return nut Jacobian wrt the TM vars.
Reimplemented in SpalartAllmaras.
Definition at line 293 of file RASModelVariables.C.
References Foam::dimless, Foam::endl(), tmp< T >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, WarningInFunction, and Foam::Zero.
|
virtual |
Definition at line 318 of file RASModelVariables.C.
References Foam::dimless, Foam::endl(), tmp< T >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, WarningInFunction, and Foam::Zero.
|
inlinevirtual |
Return the turbulence production term.
Reimplemented in kOmegaSST.
Definition at line 244 of file RASModelVariables.H.
References NotImplemented.
void restoreInitValues | ( | ) |
Restore turbulent fields to their initial values.
Definition at line 342 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 362 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 388 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 417 of file RASModelVariables.C.
References Foam::devTwoSymm(), Foam::fvc::grad(), laminarTransport(), tmp< T >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, and U.
|
virtual |
correct bounday conditions of turbulent fields
Reimplemented in kOmegaSST.
Definition at line 438 of file RASModelVariables.C.
Referenced by kOmegaSST::correctBoundaryConditions().
|
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 471 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 61 of file RASModelVariables.H.
Referenced by kOmegaSST::allocateMeanFields(), RASModelVariables::allocateMeanFields(), RASModelVariables::cloneRefPtr(), and kOmegaSST::computeG().
|
protected |
Definition at line 62 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), kOmegaSST::allocateMeanFields(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeMeanFields(), RASModelVariables::computeMeanFields(), kOmegaSST::G(), RASModelVariables::nutRef(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), RASModelVariables::TMVar1(), and RASModelVariables::TMVar2().
|
protected |
Definition at line 65 of file RASModelVariables.H.
Referenced by RASModelVariables::TMVar1BaseName().
|
protected |
Definition at line 66 of file RASModelVariables.H.
Referenced by RASModelVariables::TMVar2BaseName().
|
protected |
Definition at line 67 of file RASModelVariables.H.
Referenced by RASModelVariables::nutBaseName().
|
protected |
Definition at line 69 of file RASModelVariables.H.
Referenced by RASModelVariables::hasTMVar1(), RASModelVariables::TMVar1(), and RASModelVariables::TMVar1Inst().
|
protected |
Definition at line 70 of file RASModelVariables.H.
Referenced by RASModelVariables::hasTMVar2(), RASModelVariables::TMVar2(), and RASModelVariables::TMVar2Inst().
|
protected |
Definition at line 71 of file RASModelVariables.H.
Referenced by RASModelVariables::hasNut(), RASModelVariables::nutRef(), and RASModelVariables::nutRefInst().
|
protected |
Definition at line 72 of file RASModelVariables.H.
Referenced by RASModelVariables::d(), and RASModelVariables::hasDist().
|
protected |
Definition at line 76 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 77 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 78 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), and RASModelVariables::restoreInitValues().
|
protected |
Definition at line 81 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::resetMeanFields(), and RASModelVariables::TMVar1().
|
protected |
Definition at line 82 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::resetMeanFields(), and RASModelVariables::TMVar2().
|
protected |
Definition at line 83 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::nutRef(), and RASModelVariables::resetMeanFields().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.