incompressibleVars Class Reference

Base class for solution control classes. More...

Inheritance diagram for incompressibleVars:
Collaboration diagram for incompressibleVars:

Public Member Functions

 TypeName ("incompressibleVars")
 Run-time type information. More...
 
 incompressibleVars (fvMesh &mesh, solverControl &SolverControl)
 Construct from mesh. More...
 
 incompressibleVars (const incompressibleVars &vs)
 Copy constructor. More...
 
virtual autoPtr< variablesSetclone () const
 Clone the incompressibleVars. More...
 
virtual ~incompressibleVars ()=default
 Destructor. More...
 
const volScalarFieldp () const
 Return const reference to pressure. More...
 
volScalarFieldp ()
 Return reference to pressure. More...
 
const volVectorFieldU () const
 Return const reference to velocity. More...
 
volVectorFieldU ()
 Return reference to velocity. More...
 
const surfaceScalarFieldphi () const
 Return const reference to volume flux. More...
 
surfaceScalarFieldphi ()
 Return reference to volume flux. More...
 
const volScalarFieldpInst () const
 Return const reference to pressure. More...
 
volScalarFieldpInst ()
 Return reference to pressure. More...
 
const volVectorFieldUInst () const
 Return const reference to velocity. More...
 
volVectorFieldUInst ()
 Return reference to velocity. More...
 
const surfaceScalarFieldphiInst () const
 Return const reference to volume flux. More...
 
surfaceScalarFieldphiInst ()
 Return reference to volume flux. More...
 
const singlePhaseTransportModellaminarTransport () const
 Return const reference to transport model. More...
 
singlePhaseTransportModellaminarTransport ()
 Return reference to transport model. More...
 
const autoPtr< incompressible::turbulenceModel > & turbulence () const
 Return const reference to the turbulence model. More...
 
autoPtr< incompressible::turbulenceModel > & turbulence ()
 Return reference to the turbulence model. More...
 
const autoPtr< incompressible::RASModelVariables > & RASModelVariables () const
 Return const reference to the turbulence model variables. More...
 
autoPtr< incompressible::RASModelVariables > & RASModelVariables ()
 Return reference to the turbulence model variables. More...
 
void restoreInitValues ()
 Restore field values to the initial ones. More...
 
void resetMeanFields ()
 Reset mean fields to zero. More...
 
void computeMeanFields ()
 Compute mean fields on the fly. More...
 
void correctBoundaryConditions ()
 correct boundaryconditions for all volFields More...
 
bool storeInitValues () const
 Return storeInitValues bool. More...
 
bool computeMeanFields () const
 Return computeMeanFields bool. More...
 
const volScalarFieldT () const
 
volScalarFieldT ()
 Return reference to the temperature. More...
 
*virtual void transfer (variablesSet &vars)
 Transfer the fields of another variablesSet to this. More...
 
bool write () const
 Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs. More...
 
- Public Member Functions inherited from variablesSet
 TypeName ("variablesSet")
 Run-time type information. More...
 
 variablesSet (fvMesh &mesh, const dictionary &dict)
 Construct from mesh and solver name. More...
 
virtual ~variablesSet ()=default
 Destructor. More...
 
const wordsolverName () const
 Return solver name. More...
 
bool useSolverNameForFields () const
 Append solver name to fields? More...
 
template<class Type >
tmp< GeometricField< Type, fvPatchField, volMesh > > allocateField (const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 
template<class Type >
void renameTurbulenceField (GeometricField< Type, fvPatchField, volMesh > &baseField, const word &solverName)
 Turbulence model always reads fields with the prescribed name If a custom name is supplied, check whether this field exists, copy it to the field known by the turbulence model and re-name the latter. More...
 
tmp< surfaceScalarFieldallocateFluxField (const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 

Protected Member Functions

void setFields ()
 Read fields and set turbulence. More...
 
void setInitFields ()
 Set initial fields if necessary. More...
 
void setMeanFields ()
 Set mean fields if necessary. More...
 
void renameTurbulenceFields ()
 Rename turbulence fields if necessary. More...
 
void correctNonTurbulentBoundaryConditions ()
 Update boundary conditions of mean-flow. More...
 
void correctTurbulentBoundaryConditions ()
 Update boundary conditions of turbulent fields. More...
 
void operator= (const incompressibleVars &)
 No copy assignment. More...
 
- Protected Member Functions inherited from variablesSet
template<class Type , template< class > class PatchField, class GeoMesh >
autoPtr< GeometricField< Type, PatchField, GeoMesh > > allocateRenamedField (const autoPtr< GeometricField< Type, PatchField, GeoMesh >> &bf)
 
template<class Type , template< class > class PatchField, class GeoMesh >
void swapAndRename (autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p2)
 Swap autoPtrs and rename managed fields. More...
 

Protected Attributes

solverControlsolverControl_
 Reference to the solverControl of the solver allocating the fields. More...
 
autoPtr< volScalarFieldpPtr_
 Fields involved in the solution of the incompressible NS equations. More...
 
autoPtr< volVectorFieldUPtr_
 
autoPtr< surfaceScalarFieldphiPtr_
 
autoPtr< singlePhaseTransportModellaminarTransportPtr_
 
autoPtr< incompressible::turbulenceModelturbulence_
 
autoPtr< incompressible::RASModelVariablesRASModelVariables_
 
autoPtr< volScalarFieldpInitPtr_
 Keep a copy of the initial field values if necessary. More...
 
autoPtr< volVectorFieldUInitPtr_
 
autoPtr< surfaceScalarFieldphiInitPtr_
 
autoPtr< volScalarFieldpMeanPtr_
 Manage mean fields. Turbulent mean fields are managed in RASModelVariables. More...
 
autoPtr< volVectorFieldUMeanPtr_
 
autoPtr< surfaceScalarFieldphiMeanPtr_
 
bool correctBoundaryConditions_
 Update boundary conditions upon construction. More...
 
- Protected Attributes inherited from variablesSet
fvMeshmesh_
 Reference to the mesh database. More...
 
word solverName_
 Solver name owning the variables set. More...
 
bool useSolverNameForFields_
 Append the solver name to the variables names? More...
 

Additional Inherited Members

- Static Public Member Functions inherited from variablesSet
template<class Type >
static void setField (autoPtr< GeometricField< Type, fvPatchField, volMesh >> &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Read vol fields. More...
 
static void setFluxField (autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Set flux field. More...
 
static tmp< volVectorFieldautoCreateMeshMovementField (const fvMesh &mesh, const word &name, const dimensionSet &dims)
 Auto create variable for mesh movement. More...
 
template<class Type , template< class > class PatchField, class GeoMesh >
static void nullifyField (GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
 Nullify field and old times, if present. More...
 

Detailed Description

Base class for solution control classes.

Definition at line 48 of file incompressibleVars.H.

Constructor & Destructor Documentation

◆ incompressibleVars() [1/2]

incompressibleVars ( fvMesh mesh,
solverControl SolverControl 
)

Construct from mesh.

Definition at line 224 of file incompressibleVars.C.

Referenced by incompressibleVars::clone().

Here is the caller graph for this function:

◆ incompressibleVars() [2/2]

Copy constructor.

turbulence_ and laminarTransport_ are uninitialized since there is no clear way (and possibly no usage) of cloning them. The resulting incompressibleVars is hence incomplete. Additionally, copied fields have the original name, appended with the timeName, to avoid database collisions. To be used as storing space during the solutiuon of the unsteady adjoint equations

Definition at line 259 of file incompressibleVars.C.

References DebugInfo, and Foam::endl().

Here is the call graph for this function:

◆ ~incompressibleVars()

virtual ~incompressibleVars ( )
virtualdefault

Destructor.

Member Function Documentation

◆ setFields()

◆ setInitFields()

◆ setMeanFields()

◆ renameTurbulenceFields()

void renameTurbulenceFields ( )
protected

◆ correctNonTurbulentBoundaryConditions()

void correctNonTurbulentBoundaryConditions ( )
protected

◆ correctTurbulentBoundaryConditions()

void correctTurbulentBoundaryConditions ( )
protected

Update boundary conditions of turbulent fields.

Definition at line 211 of file incompressibleVars.C.

References Foam::endl(), Foam::Info, incompressibleVars::RASModelVariables_, and incompressibleVars::turbulence_.

Referenced by incompressibleVars::setFields().

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

◆ operator=()

void operator= ( const incompressibleVars )
protected

No copy assignment.

◆ TypeName()

TypeName ( "incompressibleVars"  )

Run-time type information.

◆ clone()

autoPtr< variablesSet > clone ( ) const
virtual

Clone the incompressibleVars.

Reimplemented from variablesSet.

Definition at line 287 of file incompressibleVars.C.

References DebugInfo, Foam::endl(), and incompressibleVars::incompressibleVars().

Here is the call graph for this function:

◆ p() [1/2]

◆ p() [2/2]

volScalarField & p ( )

Return reference to pressure.

Definition at line 311 of file incompressibleVars.C.

References incompressibleVars::pMeanPtr_, incompressibleVars::pPtr_, incompressibleVars::solverControl_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ U() [1/2]

const volVectorField & U ( ) const

Return const reference to velocity.

Definition at line 324 of file incompressibleVars.C.

References incompressibleVars::solverControl_, incompressibleVars::UMeanPtr_, incompressibleVars::UPtr_, and solverControl::useAveragedFields().

Referenced by ATCUaGradU::addATC(), ATCstandard::addATC(), adjointkOmegaSST::adjointMeanFlowSource(), adjointkOmegaSST::correct(), incompressiblePrimalSolver::correctBoundaryConditions(), adjointSpalartAllmaras::distanceSensitivities(), adjointkOmegaSST::dR_dF1(), adjointkOmegaSST::dR_dnut(), adjointSpalartAllmaras::FISensitivityTerm(), adjointkOmegaSST::FISensitivityTerm(), ATCUaGradU::getFISensitivityTerm(), ATCstandard::getFISensitivityTerm(), adjointTurbulenceModel::New(), adjointRASModel::New(), adjointkOmegaSST::nutJacobianTMVar1(), adjointkOmegaSST::nutJacobianTMVar2(), boundaryAdjointContributionIncompressible::Ub(), objectiveForce::update_boundarydJdnut(), objectiveMoment::update_boundarydJdnut(), objectivePtLosses::update_boundarydJdp(), objectivePtLosses::update_boundarydJdv(), objectiveUniformityPatch::update_boundarydJdv(), objectivePtLosses::update_boundarydJdvn(), objectiveUniformityPatch::update_boundarydJdvn(), objectivePtLosses::update_boundarydJdvt(), objectiveUniformityPatch::update_boundarydJdvt(), objectiveUniformityCellZone::update_divDxDbMultiplier(), objectivePowerDissipation::update_divDxDbMultiplier(), objectivePowerDissipation::update_dJdTMvar1(), objectivePowerDissipation::update_dJdTMvar2(), objectivePowerDissipation::update_dJdv(), objectiveUniformityCellZone::update_dJdv(), objectiveForce::update_dSdbMultiplier(), objectiveForce::update_dxdbMultiplier(), objectiveMoment::update_dxdbMultiplier(), objectivePowerDissipation::update_gradDxDbMultiplier(), objectiveMoment::update_meanValues(), ATCstandard::updatePrimalBasedQuantities(), adjointSpalartAllmaras::updatePrimalRelatedFields(), and adjointkOmegaSST::updatePrimalRelatedFields().

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

◆ U() [2/2]

volVectorField & U ( )

Return reference to velocity.

Definition at line 337 of file incompressibleVars.C.

References incompressibleVars::solverControl_, incompressibleVars::UMeanPtr_, incompressibleVars::UPtr_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ phi() [1/2]

◆ phi() [2/2]

surfaceScalarField & phi ( )

Return reference to volume flux.

Definition at line 362 of file incompressibleVars.C.

References incompressibleVars::phiMeanPtr_, incompressibleVars::phiPtr_, incompressibleVars::solverControl_, and solverControl::useAveragedFields().

Here is the call graph for this function:

◆ pInst() [1/2]

◆ pInst() [2/2]

Foam::volScalarField & pInst ( )
inline

Return reference to pressure.

Definition at line 30 of file incompressibleVarsI.H.

◆ UInst() [1/2]

◆ UInst() [2/2]

Foam::volVectorField & UInst ( )
inline

Return reference to velocity.

Definition at line 42 of file incompressibleVarsI.H.

◆ phiInst() [1/2]

◆ phiInst() [2/2]

Foam::surfaceScalarField & phiInst ( )
inline

Return reference to volume flux.

Definition at line 55 of file incompressibleVarsI.H.

◆ laminarTransport() [1/2]

◆ laminarTransport() [2/2]

Foam::singlePhaseTransportModel & laminarTransport ( )
inline

Return reference to transport model.

Definition at line 69 of file incompressibleVarsI.H.

◆ turbulence() [1/2]

◆ turbulence() [2/2]

Return reference to the turbulence model.

Definition at line 83 of file incompressibleVarsI.H.

◆ RASModelVariables() [1/2]

◆ RASModelVariables() [2/2]

Foam::autoPtr< Foam::incompressible::RASModelVariables > & RASModelVariables ( )
inline

Return reference to the turbulence model variables.

Definition at line 97 of file incompressibleVarsI.H.

◆ restoreInitValues()

◆ resetMeanFields()

◆ computeMeanFields() [1/2]

◆ correctBoundaryConditions()

void correctBoundaryConditions ( )

correct boundaryconditions for all volFields

Definition at line 424 of file incompressibleVars.C.

References incompressibleVars::correctNonTurbulentBoundaryConditions(), incompressibleVars::RASModelVariables_, and incompressibleVars::turbulence_.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions().

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

◆ storeInitValues()

bool storeInitValues ( ) const

Return storeInitValues bool.

Definition at line 431 of file incompressibleVars.C.

References incompressibleVars::solverControl_, and solverControl::storeInitValues().

Here is the call graph for this function:

◆ computeMeanFields() [2/2]

bool computeMeanFields ( ) const

Return computeMeanFields bool.

Definition at line 437 of file incompressibleVars.C.

References solverControl::average(), and incompressibleVars::solverControl_.

Here is the call graph for this function:

◆ T() [1/2]

const volScalarField& T ( ) const

◆ T() [2/2]

Return reference to the temperature.

◆ transfer()

void transfer ( variablesSet vars)
virtual

Transfer the fields of another variablesSet to this.

Reimplemented from variablesSet.

Definition at line 443 of file incompressibleVars.C.

References incompressibleVars::phiPtr_, incompressibleVars::pPtr_, incompressibleVars::RASModelVariables(), incompressibleVars::RASModelVariables_, variablesSet::swapAndRename(), and incompressibleVars::UPtr_.

Here is the call graph for this function:

◆ write()

bool write ( ) const

Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs.

Definition at line 457 of file incompressibleVars.C.

References variablesSet::mesh_, incompressibleVars::RASModelVariables_, and variablesSet::useSolverNameForFields_.

Referenced by incompressiblePrimalSolver::write(), incompressibleAdjointSolver::write(), incompressiblePrimalSolver::writeNow(), and incompressibleAdjointSolver::writeNow().

Here is the caller graph for this function:

Member Data Documentation

◆ solverControl_

◆ pPtr_

autoPtr<volScalarField> pPtr_
protected

Fields involved in the solution of the incompressible NS equations.

Definition at line 64 of file incompressibleVars.H.

Referenced by incompressibleVars::p(), incompressibleVars::pInst(), incompressibleVars::setFields(), and incompressibleVars::transfer().

◆ UPtr_

◆ phiPtr_

◆ laminarTransportPtr_

autoPtr<singlePhaseTransportModel> laminarTransportPtr_
protected

Definition at line 67 of file incompressibleVars.H.

Referenced by incompressibleVars::setFields().

◆ turbulence_

◆ RASModelVariables_

◆ pInitPtr_

autoPtr<volScalarField> pInitPtr_
protected

Keep a copy of the initial field values if necessary.

Definition at line 75 of file incompressibleVars.H.

Referenced by incompressibleVars::restoreInitValues(), and incompressibleVars::setInitFields().

◆ UInitPtr_

◆ phiInitPtr_

◆ pMeanPtr_

autoPtr<volScalarField> pMeanPtr_
protected

◆ UMeanPtr_

◆ phiMeanPtr_

◆ correctBoundaryConditions_

bool correctBoundaryConditions_
protected

Update boundary conditions upon construction.

Useful for cases in which information has been lost on boundary (e.g. averaging, redistribution)

Definition at line 93 of file incompressibleVars.H.

Referenced by incompressibleVars::setFields(), and incompressibleVars::setMeanFields().


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