incompressibleVars Class Reference

Base class for solution control classes. More...

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

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...
 
virtual void transfer (variablesSet &vars)
 Transfer the fields of another variablesSet to this. More...
 
bool write () const
 
- 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 autoPtr< variablesSetclone () const
 Clone the variablesSet. 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)
 
tmp< surfaceScalarFieldallocateFluxField (const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 
virtual void transfer (variablesSet &vars)
 Transfer the fields of another variablesSet to this. More...
 

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_
 
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 54 of file incompressibleVars.H.

Constructor & Destructor Documentation

◆ incompressibleVars() [1/2]

incompressibleVars ( fvMesh mesh,
solverControl SolverControl 
)

Construct from mesh.

Definition at line 230 of file incompressibleVars.C.

References incompressibleVars::setFields(), incompressibleVars::setInitFields(), and incompressibleVars::setMeanFields().

Here is the call 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 265 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()

void setInitFields ( )
protected

Set initial fields if necessary.

Definition at line 99 of file incompressibleVars.C.

References Foam::name(), incompressibleVars::phiInitPtr_, incompressibleVars::phiInst(), incompressibleVars::pInitPtr_, incompressibleVars::pInst(), incompressibleVars::solverControl_, solverControl::storeInitValues(), incompressibleVars::UInitPtr_, and incompressibleVars::UInst().

Referenced by incompressibleVars::incompressibleVars().

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

◆ setMeanFields()

void setMeanFields ( )
protected

Set mean fields if necessary.

Definition at line 116 of file incompressibleVars.C.

References IOobject::AUTO_WRITE, solverControl::average(), incompressibleVars::correctBoundaryConditions_, Foam::endl(), Foam::Info, variablesSet::mesh_, Foam::name(), incompressibleVars::phiInst(), incompressibleVars::phiMeanPtr_, incompressibleVars::pInst(), incompressibleVars::pMeanPtr_, IOobject::READ_IF_PRESENT, incompressibleVars::solverControl_, fvMesh::time(), Time::timeName(), incompressibleVars::UInst(), and incompressibleVars::UMeanPtr_.

Referenced by incompressibleVars::incompressibleVars().

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

◆ renameTurbulenceFields()

void renameTurbulenceFields ( )
protected

Rename turbulence fields if necessary.

Definition at line 180 of file incompressibleVars.C.

References RASModelVariables::hasNut(), RASModelVariables::hasTMVar1(), RASModelVariables::hasTMVar2(), RASModelVariables::nutRefInst(), incompressibleVars::RASModelVariables_, variablesSet::renameTurbulenceField(), variablesSet::solverName_, RASModelVariables::TMVar1Inst(), RASModelVariables::TMVar2Inst(), and variablesSet::useSolverNameForFields_.

Referenced by incompressibleVars::setFields().

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

◆ correctNonTurbulentBoundaryConditions()

void correctNonTurbulentBoundaryConditions ( )
protected

Update boundary conditions of mean-flow.

Definition at line 205 of file incompressibleVars.C.

References solverControl::average(), GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), Foam::endl(), Foam::Info, incompressibleVars::pInst(), incompressibleVars::pMeanPtr_, incompressibleVars::solverControl_, incompressibleVars::UInst(), and incompressibleVars::UMeanPtr_.

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

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

◆ correctTurbulentBoundaryConditions()

void correctTurbulentBoundaryConditions ( )
protected

Update boundary conditions of turbulent fields.

Definition at line 218 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 294 of file incompressibleVars.C.

References DebugInfo, and Foam::endl().

Here is the call graph for this function:

◆ p() [1/2]

const volScalarField & p ( ) const

Return const reference to pressure.

Definition at line 305 of file incompressibleVars.C.

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

Referenced by sensitivitySurface::accumulateIntegrand(), sensitivitySurfacePoints::accumulateIntegrand(), incompressiblePrimalSolver::correctBoundaryConditions(), boundaryAdjointContributionIncompressible::pb(), objectivePtLosses::update_boundarydJdv(), objectivePtLosses::update_boundarydJdvn(), objectiveForce::update_dSdbMultiplier(), objectiveMoment::update_dSdbMultiplier(), objectiveMoment::update_dxdbDirectMultiplier(), objectiveForce::update_dxdbMultiplier(), and objectiveMoment::update_dxdbMultiplier().

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

◆ p() [2/2]

volScalarField & p ( )

Return reference to pressure.

Definition at line 318 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 331 of file incompressibleVars.C.

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

Referenced by sensitivitySurface::accumulateIntegrand(), sensitivitySurfacePoints::accumulateIntegrand(), ATCstandard::addATC(), ATCUaGradU::addATC(), adjointkOmegaSST::addWallFunctionTerms(), adjointkOmegaSST::adjointMeanFlowSource(), adjointkOmegaSST::convectionMeanFlowSource(), adjointkOmegaSST::correct(), incompressiblePrimalSolver::correctBoundaryConditions(), adjointkOmegaSST::diffusionNutMeanFlowMult(), adjointSpalartAllmaras::distanceSensitivities(), adjointkOmegaSST::divUMeanFlowSource(), adjointkOmegaSST::dR_dF1(), adjointkOmegaSST::dR_dnut(), adjointkOmegaSST::FISensitivityTerm(), adjointSpalartAllmaras::FISensitivityTerm(), ATCstandard::getFISensitivityTerm(), ATCUaGradU::getFISensitivityTerm(), adjointkOmegaSST::GMeanFlowSource(), adjointRASModel::New(), adjointTurbulenceModel::New(), adjointkOmegaSST::nutMeanFlowSource(), boundaryAdjointContributionIncompressible::Ub(), objectiveForce::update_boundarydJdnut(), objectiveMoment::update_boundarydJdnut(), objectivePtLosses::update_boundarydJdp(), objectivePtLosses::update_boundarydJdv(), objectivePtLosses::update_boundarydJdvn(), objectivePtLosses::update_boundarydJdvt(), objectiveForce::update_dSdbMultiplier(), objectiveForce::update_dxdbMultiplier(), objectiveMoment::update_dxdbMultiplier(), objectiveMoment::update_meanValues(), ATCstandard::updatePrimalBasedQuantities(), adjointkOmegaSST::updatePrimalRelatedFields(), and adjointSpalartAllmaras::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 344 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]

const surfaceScalarField & phi ( ) const

Return const reference to volume flux.

Definition at line 357 of file incompressibleVars.C.

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

Referenced by ATCstandard::addATC(), ATCUaGradU::addATC(), adjointkOmegaSST::convectionScheme(), adjointkOmegaSST::correct(), adjointSpalartAllmaras::correct(), incompressiblePrimalSolver::correctBoundaryConditions(), adjointkOmegaSST::dR_dF1(), boundaryAdjointContributionIncompressible::phib(), and ATCstandard::updatePrimalBasedQuantities().

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

◆ phi() [2/2]

surfaceScalarField & phi ( )

Return reference to volume flux.

Definition at line 369 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]

const Foam::volScalarField & pInst ( ) const
inline

◆ pInst() [2/2]

Foam::volScalarField & pInst ( )
inline

Return reference to pressure.

Definition at line 37 of file incompressibleVarsI.H.

◆ UInst() [1/2]

const Foam::volVectorField & UInst ( ) const
inline

Return const reference to velocity.

Definition at line 43 of file incompressibleVarsI.H.

Referenced by incompressibleVars::computeMeanFields(), incompressibleVars::correctNonTurbulentBoundaryConditions(), objectivePtLosses::J(), incompressibleVars::resetMeanFields(), incompressibleVars::restoreInitValues(), incompressibleVars::setFields(), incompressibleVars::setInitFields(), and incompressibleVars::setMeanFields().

Here is the caller graph for this function:

◆ UInst() [2/2]

Foam::volVectorField & UInst ( )
inline

Return reference to velocity.

Definition at line 49 of file incompressibleVarsI.H.

◆ phiInst() [1/2]

const Foam::surfaceScalarField & phiInst ( ) const
inline

Return const reference to volume flux.

Definition at line 56 of file incompressibleVarsI.H.

Referenced by incompressibleVars::computeMeanFields(), adjointkOmegaSST::convectionScheme(), objectivePtLosses::initialize(), incompressibleVars::resetMeanFields(), incompressibleVars::restoreInitValues(), incompressibleVars::setFields(), incompressibleVars::setInitFields(), and incompressibleVars::setMeanFields().

Here is the caller graph for this function:

◆ phiInst() [2/2]

Foam::surfaceScalarField & phiInst ( )
inline

Return reference to volume flux.

Definition at line 62 of file incompressibleVarsI.H.

◆ laminarTransport() [1/2]

const Foam::singlePhaseTransportModel & laminarTransport ( ) const
inline

◆ laminarTransport() [2/2]

Foam::singlePhaseTransportModel & laminarTransport ( )
inline

Return reference to transport model.

Definition at line 76 of file incompressibleVarsI.H.

◆ turbulence() [1/2]

const Foam::autoPtr< Foam::incompressible::turbulenceModel > & turbulence ( ) const
inline

Return const reference to the turbulence model.

Definition at line 83 of file incompressibleVarsI.H.

Referenced by adjointkOmegaSST::addWallFunctionTerms(), adjointkOmegaSST::adjointMeanFlowSource(), incompressiblePrimalSolver::correctBoundaryConditions(), objectiveForce::J(), objectiveMoment::J(), boundaryAdjointContributionIncompressible::laminarDiffusivity(), and boundaryAdjointContributionIncompressible::wallDistance().

Here is the caller graph for this function:

◆ turbulence() [2/2]

Return reference to the turbulence model.

Definition at line 90 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 104 of file incompressibleVarsI.H.

◆ restoreInitValues()

void restoreInitValues ( )

Restore field values to the initial ones.

Definition at line 382 of file incompressibleVars.C.

References Foam::endl(), Foam::Info, incompressibleVars::phiInitPtr_, incompressibleVars::phiInst(), incompressibleVars::pInitPtr_, incompressibleVars::pInst(), incompressibleVars::RASModelVariables_, incompressibleVars::solverControl_, solverControl::storeInitValues(), incompressibleVars::UInitPtr_, and incompressibleVars::UInst().

Here is the call graph for this function:

◆ resetMeanFields()

void resetMeanFields ( )

Reset mean fields to zero.

Definition at line 395 of file incompressibleVars.C.

References solverControl::average(), solverControl::averageIter(), Foam::endl(), Foam::Info, incompressibleVars::phiInst(), incompressibleVars::phiMeanPtr_, incompressibleVars::pInst(), incompressibleVars::pMeanPtr_, incompressibleVars::RASModelVariables_, incompressibleVars::solverControl_, incompressibleVars::UInst(), incompressibleVars::UMeanPtr_, and Foam::Zero.

Here is the call graph for this function:

◆ computeMeanFields() [1/2]

void computeMeanFields ( )

Compute mean fields on the fly.

Definition at line 413 of file incompressibleVars.C.

References solverControl::averageIter(), solverControl::doAverageIter(), Foam::endl(), Foam::Info, incompressibleVars::phiInst(), incompressibleVars::phiMeanPtr_, incompressibleVars::pInst(), incompressibleVars::pMeanPtr_, incompressibleVars::RASModelVariables_, incompressibleVars::solverControl_, incompressibleVars::UInst(), and incompressibleVars::UMeanPtr_.

Referenced by objectiveIncompressible::objectiveIncompressible().

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

◆ correctBoundaryConditions()

void correctBoundaryConditions ( )

correct boundaryconditions for all volFields

Definition at line 431 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 438 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 444 of file incompressibleVars.C.

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

Here is the call graph for this function:

◆ transfer()

void transfer ( variablesSet vars)
virtual

Transfer the fields of another variablesSet to this.

Reimplemented from variablesSet.

Definition at line 450 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 464 of file incompressibleVars.C.

References variablesSet::mesh_, incompressibleVars::RASModelVariables_, variablesSet::useSolverNameForFields_, and incompressibleVars::write().

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

Here is the call graph for this function:
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 66 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 69 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_

◆ 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 88 of file incompressibleVars.H.

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


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