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 () |
tmp< volScalarField > | nut () const |
const volScalarField & | d () const |
volScalarField & | d () |
tmp< scalarField > | TMVar1 (const label patchi) const |
tmp< scalarField > | TMVar2 (const label patchi) const |
tmp< scalarField > | nut (const label patchi) const |
tmp< fvPatchScalarField > | nutPatchField (const label patchi) const |
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 kEpsilon, and 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 kEpsilon::allocateMeanFields(), and 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.
Reimplemented in laminar, and LaunderSharmaKE.
Definition at line 49 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::restoreInitValues(), RASModelVariables::TMVar1(), and RASModelVariables::transfer().
|
inlinevirtual |
Reimplemented in laminar, and LaunderSharmaKE.
Definition at line 55 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::restoreInitValues(), RASModelVariables::TMVar2(), and RASModelVariables::transfer().
|
inlinevirtual |
Reimplemented in laminar, and LaunderSharmaKE.
Definition at line 61 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), RASModelVariables::computeMeanFields(), RASModelVariables::nut(), RASModelVariables::nutPatchField(), incompressibleVars::renameTurbulenceFields(), 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().
Referenced by RASModelVariables::TMVar1().
|
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 kEpsilon::computeG(), kOmegaSST::computeG(), and RASModelVariables::TMVar2().
|
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().
Referenced by RASModelVariables::nut(), and RASModelVariables::nutPatchField().
|
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 Foam::dimViscosity, RASModelVariables::hasNut(), RASModelVariables::mesh_, GeometricField< scalar, fvPatchField, volMesh >::New(), IOobjectOption::NO_REGISTER, RASModelVariables::nutRef(), and Foam::Zero.
Referenced by incompressibleAdjointSolver::accumulateBCSensitivityIntegrand().
|
inline |
Definition at line 154 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
Referenced by RASModelVariables::transfer().
|
inline |
Definition at line 160 of file RASModelVariablesI.H.
References RASModelVariables::distPtr_.
|
inline |
Definition at line 166 of file RASModelVariablesI.H.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), RASModelVariables::hasTMVar1(), RASModelVariables::mesh_, tmp< T >::New(), UPtrList< T >::size(), RASModelVariables::TMVar1(), and Foam::Zero.
|
inline |
Definition at line 177 of file RASModelVariablesI.H.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), RASModelVariables::hasTMVar2(), RASModelVariables::mesh_, tmp< T >::New(), UPtrList< T >::size(), RASModelVariables::TMVar2(), and Foam::Zero.
|
inline |
Definition at line 188 of file RASModelVariablesI.H.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), RASModelVariables::hasNut(), RASModelVariables::mesh_, tmp< T >::New(), RASModelVariables::nutRef(), UPtrList< T >::size(), and Foam::Zero.
|
inline |
Definition at line 200 of file RASModelVariablesI.H.
References fvMesh::boundary(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), RASModelVariables::hasNut(), RASModelVariables::mesh_, tmp< T >::New(), RASModelVariables::nutRef(), fvMesh::V(), and Foam::Zero.
|
inline |
Return references to instantaneous turbulence fields.
Definition at line 213 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 219 of file RASModelVariablesI.H.
References RASModelVariables::TMVar1Ptr_.
|
inline |
Definition at line 225 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kEpsilon::computeG(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 231 of file RASModelVariablesI.H.
References RASModelVariables::TMVar2Ptr_.
|
inline |
Definition at line 237 of file RASModelVariablesI.H.
References RASModelVariables::nutPtr_.
Referenced by RASModelVariables::allocateInitValues(), RASModelVariables::allocateMeanFields(), kEpsilon::computeG(), kOmegaSST::computeG(), RASModelVariables::computeMeanFields(), incompressibleVars::renameTurbulenceFields(), RASModelVariables::resetMeanFields(), RASModelVariables::restoreInitValues(), and RASModelVariables::transfer().
|
inline |
Definition at line 243 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(), GeometricField< scalar, fvPatchField, volMesh >::New(), IOobjectOption::NO_REGISTER, WarningInFunction, and Foam::Zero.
|
virtual |
Definition at line 312 of file RASModelVariables.C.
References Foam::dimless, Foam::endl(), GeometricField< scalar, fvPatchField, volMesh >::New(), IOobjectOption::NO_REGISTER, WarningInFunction, and Foam::Zero.
|
inlinevirtual |
Return the turbulence production term.
Reimplemented in kEpsilon, and kOmegaSST.
Definition at line 245 of file RASModelVariables.H.
References NotImplemented.
void restoreInitValues | ( | ) |
Restore turbulent fields to their initial values.
Definition at line 330 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 350 of file RASModelVariables.C.
References solverControl::average(), Foam::endl(), 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 kEpsilon, and kOmegaSST.
Definition at line 376 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 kEpsilon::computeMeanFields(), and kOmegaSST::computeMeanFields().
tmp< volSymmTensorField > devReff | ( | const singlePhaseTransportModel & | laminarTransport, |
const volVectorField & | U | ||
) | const |
Return stress tensor based on the mean flow variables.
Definition at line 405 of file RASModelVariables.C.
References Foam::devTwoSymm(), Foam::fvc::grad(), laminarTransport(), GeometricField< symmTensor, fvPatchField, volMesh >::New(), IOobjectOption::NO_REGISTER, nut, and U.
|
virtual |
correct bounday conditions of turbulent fields
Reimplemented in kOmegaSST.
Definition at line 420 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 453 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 kEpsilon::allocateMeanFields(), kOmegaSST::allocateMeanFields(), RASModelVariables::allocateMeanFields(), RASModelVariables::cloneRefPtr(), kOmegaSST::computeG(), kEpsilon::computeG(), RASModelVariables::nut(), RASModelVariables::nutPatchField(), RASModelVariables::TMVar1(), and RASModelVariables::TMVar2().
|
protected |
Definition at line 62 of file RASModelVariables.H.
Referenced by RASModelVariables::allocateInitValues(), kOmegaSST::allocateMeanFields(), kEpsilon::allocateMeanFields(), RASModelVariables::allocateMeanFields(), kOmegaSST::computeMeanFields(), kEpsilon::computeMeanFields(), RASModelVariables::computeMeanFields(), kEpsilon::G(), 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().