Loading...
Searching...
No Matches
incompressibleVars Class Reference

Base class for solution control classes. More...

#include <incompressibleVars.H>

Inheritance diagram for incompressibleVars:
Collaboration diagram for incompressibleVars:

Public Member Functions

 TypeName ("incompressibleVars")
 Run-time type information.
 incompressibleVars (fvMesh &mesh, solverControl &SolverControl)
 Construct from mesh.
 incompressibleVars (const incompressibleVars &vs)
 Copy constructor.
virtual autoPtr< variablesSet > clone () const
 Clone the incompressibleVars.
virtual ~incompressibleVars ()=default
 Destructor.
const volScalarFieldp () const
 Return const reference to pressure.
volScalarFieldp ()
 Return reference to pressure.
const volVectorFieldU () const
 Return const reference to velocity.
volVectorFieldU ()
 Return reference to velocity.
const surfaceScalarFieldphi () const
 Return const reference to volume flux.
surfaceScalarFieldphi ()
 Return reference to volume flux.
const volScalarFieldpInst () const
 Return const reference to pressure.
volScalarFieldpInst ()
 Return reference to pressure.
const volVectorFieldUInst () const
 Return const reference to velocity.
volVectorFieldUInst ()
 Return reference to velocity.
const surfaceScalarFieldphiInst () const
 Return const reference to volume flux.
surfaceScalarFieldphiInst ()
 Return reference to volume flux.
const singlePhaseTransportModellaminarTransport () const
 Return const reference to transport model.
singlePhaseTransportModellaminarTransport ()
 Return reference to transport model.
const autoPtr< incompressible::turbulenceModel > & turbulence () const
 Return const reference to the turbulence model.
autoPtr< incompressible::turbulenceModel > & turbulence ()
 Return reference to the turbulence model.
const autoPtr< incompressible::RASModelVariables > & RASModelVariables () const
 Return const reference to the turbulence model variables.
autoPtr< incompressible::RASModelVariables > & RASModelVariables ()
 Return reference to the turbulence model variables.
void restoreInitValues ()
 Restore field values to the initial ones.
void resetMeanFields ()
 Reset mean fields to zero.
void computeMeanFields ()
 Compute mean fields on the fly.
void correctBoundaryConditions ()
 correct boundaryconditions for all volFields
bool storeInitValues () const
 Return storeInitValues bool.
bool computeMeanFields () const
 Return computeMeanFields bool.
const volScalarFieldT () const
volScalarFieldT ()
 Return reference to the temperature.
*virtual void transfer (variablesSet &vars)
 Transfer the fields of another variablesSet to this.
bool write () const
 Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs.
Public Member Functions inherited from variablesSet
 TypeName ("variablesSet")
 Run-time type information.
 variablesSet (fvMesh &mesh, const dictionary &dict)
 Construct from mesh and solver name.
virtual ~variablesSet ()=default
 Destructor.
const wordsolverName () const
 Return solver name.
bool useSolverNameForFields () const
 Append solver name to fields?
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.
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.
void setInitFields ()
 Set initial fields if necessary.
void setMeanFields ()
 Set mean fields if necessary.
void renameTurbulenceFields ()
 Rename turbulence fields if necessary.
void correctNonTurbulentBoundaryConditions ()
 Update boundary conditions of mean-flow.
void correctTurbulentBoundaryConditions ()
 Update boundary conditions of turbulent fields.
void operator= (const incompressibleVars &)
 No copy assignment.
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.

Protected Attributes

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

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.
static void setFluxField (autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
 Set flux field.
static tmp< volVectorFieldautoCreateMeshMovementField (const fvMesh &mesh, const word &name, const dimensionSet &dims)
 Auto create variable for mesh movement.
template<class Type, template< class > class PatchField, class GeoMesh>
static void nullifyField (GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
 Nullify field and old times, if present.

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 226 of file incompressibleVars.C.

References correctBoundaryConditions_, laminarTransportPtr_, mesh, phiInitPtr_, phiMeanPtr_, phiPtr_, pInitPtr_, pMeanPtr_, pPtr_, RASModelVariables_, setFields(), setInitFields(), setMeanFields(), solverControl_, turbulence_, UInitPtr_, UMeanPtr_, and UPtr_.

Referenced by clone(), incompressibleVars(), operator=(), transfer(), and TypeName().

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

◆ incompressibleVars() [2/2]

incompressibleVars ( const incompressibleVars & vs)

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 261 of file incompressibleVars.C.

References variablesSet::allocateRenamedField(), clone(), correctBoundaryConditions_, DebugInfo, Foam::endl(), incompressibleVars(), laminarTransportPtr_, variablesSet::mesh_, phiInitPtr_, phiMeanPtr_, phiPtr_, pInitPtr_, pMeanPtr_, pPtr_, RASModelVariables_, solverControl_, turbulence_, UInitPtr_, UMeanPtr_, and UPtr_.

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 92 of file incompressibleVars.C.

References name, phiInitPtr_, phiInst(), pInitPtr_, pInst(), solverControl_, UInitPtr_, and UInst().

Referenced by 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 109 of file incompressibleVars.C.

References IOobjectOption::AUTO_WRITE, correctBoundaryConditions_, Foam::endl(), Foam::Info, variablesSet::mesh_, name, phiInst(), phiMeanPtr_, pInst(), pMeanPtr_, IOobjectOption::READ_IF_PRESENT, IOobjectOption::REGISTER, solverControl_, UInst(), and UMeanPtr_.

Referenced by incompressibleVars().

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

◆ renameTurbulenceFields()

void renameTurbulenceFields ( )
protected

◆ correctNonTurbulentBoundaryConditions()

void correctNonTurbulentBoundaryConditions ( )
protected

Update boundary conditions of mean-flow.

Definition at line 201 of file incompressibleVars.C.

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

Referenced by correctBoundaryConditions(), and 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 214 of file incompressibleVars.C.

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

Referenced by 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.

References incompressibleVars().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "incompressibleVars" )

Run-time type information.

References incompressibleVars(), and mesh.

Here is the call graph for this function:

◆ clone()

autoPtr< variablesSet > clone ( ) const
virtual

Clone the incompressibleVars.

Reimplemented from variablesSet.

Definition at line 290 of file incompressibleVars.C.

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

Referenced by incompressibleVars().

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

◆ p() [1/2]

const volScalarField & p ( ) const

Return const reference to pressure.

Definition at line 301 of file incompressibleVars.C.

References pMeanPtr_, pPtr_, and solverControl_.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions().

Here is the caller graph for this function:

◆ p() [2/2]

volScalarField & p ( )

Return reference to pressure.

Definition at line 314 of file incompressibleVars.C.

References pMeanPtr_, pPtr_, and solverControl_.

◆ U() [1/2]

const volVectorField & U ( ) const

Return const reference to velocity.

Definition at line 327 of file incompressibleVars.C.

References solverControl_, UMeanPtr_, and UPtr_.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions(), adjointRASModel::New(), and adjointTurbulenceModel::New().

Here is the caller graph for this function:

◆ U() [2/2]

volVectorField & U ( )

Return reference to velocity.

Definition at line 340 of file incompressibleVars.C.

References solverControl_, UMeanPtr_, and UPtr_.

◆ phi() [1/2]

const surfaceScalarField & phi ( ) const

Return const reference to volume flux.

Definition at line 353 of file incompressibleVars.C.

References phiMeanPtr_, phiPtr_, and solverControl_.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions().

Here is the caller graph for this function:

◆ phi() [2/2]

surfaceScalarField & phi ( )

Return reference to volume flux.

Definition at line 365 of file incompressibleVars.C.

References phiMeanPtr_, phiPtr_, and solverControl_.

◆ pInst() [1/2]

const Foam::volScalarField & pInst ( ) const
inline

Return const reference to pressure.

Definition at line 24 of file incompressibleVarsI.H.

References pPtr_.

Referenced by computeMeanFields(), correctNonTurbulentBoundaryConditions(), restoreInitValues(), setInitFields(), and setMeanFields().

Here is the caller graph for this function:

◆ pInst() [2/2]

Foam::volScalarField & pInst ( )
inline

Return reference to pressure.

Definition at line 30 of file incompressibleVarsI.H.

References pPtr_.

◆ UInst() [1/2]

const Foam::volVectorField & UInst ( ) const
inline

Return const reference to velocity.

Definition at line 36 of file incompressibleVarsI.H.

References UPtr_.

Referenced by computeMeanFields(), correctNonTurbulentBoundaryConditions(), restoreInitValues(), setFields(), setInitFields(), and setMeanFields().

Here is the caller graph for this function:

◆ UInst() [2/2]

Foam::volVectorField & UInst ( )
inline

Return reference to velocity.

Definition at line 42 of file incompressibleVarsI.H.

References UPtr_.

◆ phiInst() [1/2]

const Foam::surfaceScalarField & phiInst ( ) const
inline

Return const reference to volume flux.

Definition at line 49 of file incompressibleVarsI.H.

References phiPtr_.

Referenced by computeMeanFields(), restoreInitValues(), setFields(), setInitFields(), and setMeanFields().

Here is the caller graph for this function:

◆ phiInst() [2/2]

Foam::surfaceScalarField & phiInst ( )
inline

Return reference to volume flux.

Definition at line 55 of file incompressibleVarsI.H.

References phiPtr_.

◆ laminarTransport() [1/2]

const Foam::singlePhaseTransportModel & laminarTransport ( ) const
inline

Return const reference to transport model.

Definition at line 62 of file incompressibleVarsI.H.

References laminarTransportPtr_.

Referenced by setFields().

Here is the caller graph for this function:

◆ laminarTransport() [2/2]

Foam::singlePhaseTransportModel & laminarTransport ( )
inline

Return reference to transport model.

Definition at line 69 of file incompressibleVarsI.H.

References laminarTransportPtr_.

◆ turbulence() [1/2]

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

Return const reference to the turbulence model.

Definition at line 76 of file incompressibleVarsI.H.

References turbulence_.

Referenced by incompressiblePrimalSolver::correctBoundaryConditions().

Here is the caller graph for this function:

◆ turbulence() [2/2]

Return reference to the turbulence model.

Definition at line 83 of file incompressibleVarsI.H.

References turbulence_.

◆ RASModelVariables() [1/2]

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

Return const reference to the turbulence model variables.

Definition at line 90 of file incompressibleVarsI.H.

References RASModelVariables_.

Referenced by objectiveIncompressible::allocatedJdTurbulence(), and transfer().

Here is the caller graph for this function:

◆ 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.

References RASModelVariables_.

◆ restoreInitValues()

void restoreInitValues ( )

Restore field values to the initial ones.

Definition at line 378 of file incompressibleVars.C.

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

Here is the call graph for this function:

◆ resetMeanFields()

void resetMeanFields ( )

Reset mean fields to zero.

Definition at line 391 of file incompressibleVars.C.

References Foam::endl(), Foam::Info, phiMeanPtr_, pMeanPtr_, RASModelVariables_, solverControl_, 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 409 of file incompressibleVars.C.

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

Here is the call graph for this function:

◆ correctBoundaryConditions()

void correctBoundaryConditions ( )

correct boundaryconditions for all volFields

Definition at line 427 of file incompressibleVars.C.

References correctNonTurbulentBoundaryConditions(), RASModelVariables_, and 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 434 of file incompressibleVars.C.

References solverControl_.

◆ computeMeanFields() [2/2]

bool computeMeanFields ( ) const

Return computeMeanFields bool.

Definition at line 440 of file incompressibleVars.C.

References solverControl_.

◆ T() [1/2]

const volScalarField & T ( ) const

◆ T() [2/2]

volScalarField & T ( )

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 446 of file incompressibleVars.C.

References incompressibleVars(), phiPtr_, pPtr_, RASModelVariables(), RASModelVariables_, Foam::refCast(), variablesSet::swapAndRename(), and 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 460 of file incompressibleVars.C.

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

Referenced by incompressiblePrimalSolver::write(), write(), 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 64 of file incompressibleVars.H.

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

◆ UPtr_

autoPtr<volVectorField> UPtr_
protected

◆ phiPtr_

◆ laminarTransportPtr_

◆ 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(), incompressibleVars(), restoreInitValues(), and setInitFields().

◆ UInitPtr_

autoPtr<volVectorField> UInitPtr_
protected

◆ phiInitPtr_

autoPtr<surfaceScalarField> phiInitPtr_
protected

◆ pMeanPtr_

autoPtr<volScalarField> pMeanPtr_
protected

Manage mean fields. Turbulent mean fields are managed in RASModelVariables.

Definition at line 83 of file incompressibleVars.H.

Referenced by computeMeanFields(), correctNonTurbulentBoundaryConditions(), incompressibleVars(), incompressibleVars(), p(), p(), resetMeanFields(), and setMeanFields().

◆ 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(), incompressibleVars(), setFields(), and setMeanFields().


The documentation for this class was generated from the following files:
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.H
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVars.C
  • src/optimisation/adjointOptimisation/adjoint/solvers/variablesSet/incompressible/incompressibleVarsI.H