Go to the documentation of this file.
123 Info<<
"Allocating Mean Primal Fields" <<
endl;
207 Info<<
"Correcting (U,p) boundary conditions " <<
endl;
223 Info<<
"Correcting boundary conditions of turbulent fields" <<
endl;
237 solverControl_(SolverControl),
241 laminarTransportPtr_(
nullptr),
242 turbulence_(
nullptr),
243 RASModelVariables_(
nullptr),
247 phiInitPtr_(
nullptr),
251 phiMeanPtr_(
nullptr),
253 correctBoundaryConditions_
256 getOrDefault<bool>(
"reconstruct",
false)
272 pPtr_(allocateRenamedField(vs.
pPtr_)),
273 UPtr_(allocateRenamedField(vs.
UPtr_)),
274 phiPtr_(allocateRenamedField(vs.
phiPtr_)),
275 laminarTransportPtr_(
nullptr),
276 turbulence_(
nullptr),
279 pInitPtr_(allocateRenamedField(vs.
pInitPtr_)),
280 UInitPtr_(allocateRenamedField(vs.
UInitPtr_)),
283 pMeanPtr_(allocateRenamedField(vs.
pMeanPtr_)),
284 UMeanPtr_(allocateRenamedField(UMeanPtr_)),
290 <<
"Calling incompressibleVars copy constructor" <<
endl;
297 <<
"Calling incompressibleVars::clone" <<
endl;
461 Info<<
"Restoring field values to initial ones" <<
endl;
474 Info<<
"Resetting mean fields to zero" <<
endl;
494 scalar avIter(iAverageIter);
495 scalar oneOverItP1 = 1./(avIter + 1);
496 scalar mult = avIter*oneOverItP1;
546 createZeroFieldPtr<scalar>
555 createZeroFieldPtr<scalar>
564 createZeroFieldPtr<scalar>
autoPtr< surfaceScalarField > phiPtr_
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const surfaceScalarField & phiInst() const
Return const reference to volume flux.
bool storeInitValues() const
Return storeInitValues bool.
static autoPtr< IncompressibleTurbulenceModel > New(const volVectorField &U, const surfaceScalarField &phi, const TransportModel &transportModel, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
void renameTurbulenceFields()
Rename turbulence fields if necessary.
bool doAverageIter() const
autoPtr< volVectorField > UPtr_
const volScalarField & TMVar1Inst() const
return references to instantaneous turbulence fields
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
static constexpr const zero Zero
Global zero (0)
virtual void transfer(variablesSet &vars)
Transfer the fields of another variablesSet to this.
autoPtr< surfaceScalarField > phiMeanPtr_
void setInitFields()
Set initial fields if necessary.
static word timeName(const scalar t, const int precision=precision_)
autoPtr< singlePhaseTransportModel > laminarTransportPtr_
void computeMeanFields()
Compute mean fields on the fly.
const surfaceScalarField & phi() const
Return const reference to volume flux.
static void setFluxField(autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Set flux field.
void swapAndRename(autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p2)
Swap autoPtrs and rename managed fields.
Base class for solver control classes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool storeInitValues() const
Re-initialize.
A simple single-phase transport model based on viscosityModel.
const volVectorField & UInst() const
Return const reference to velocity.
const volScalarField & p() const
Return const reference to pressure.
void setFields()
Read fields and set turbulence.
virtual autoPtr< variablesSet > clone() const
Clone the incompressibleVars.
const autoPtr< incompressible::RASModelVariables > & RASModelVariables() const
Return const reference to the turbulence model variables.
void setMeanFields()
Set mean fields if necessary.
solverControl & solverControl_
Reference to the solverControl of the solver allocating the fields.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Base class for creating a set of variables.
void setFluxRequired(const word &name) const
const volScalarField & nutRefInst() const
messageStream Info
Information stream (uses stdout - output is on the master only)
void correctTurbulentBoundaryConditions()
Update boundary conditions of turbulent fields.
autoPtr< surfaceScalarField > phiInitPtr_
word name(const complex &c)
Return string representation of complex.
autoPtr< volVectorField > UInitPtr_
const singlePhaseTransportModel & laminarTransport() const
Return const reference to transport model.
autoPtr< incompressible::RASModelVariables > RASModelVariables_
bool useAveragedFields() const
static autoPtr< RASModelVariables > New(const fvMesh &mesh, const solverControl &SolverControl)
Return a reference to the selected turbulence model.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volVectorField & U() const
Return const reference to velocity.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label & averageIter()
Return average iteration index reference.
const volScalarField & TMVar2Inst() const
word solverName_
Solver name owning the variables set.
static void setField(autoPtr< GeometricField< Type, fvPatchField, volMesh >> &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Read vol fields.
fvMesh & mesh_
Reference to the mesh database.
bool hasTMVar1() const
Bools to idenify which turbulent fields are present.
Mesh data needed to do the Finite Volume discretisation.
autoPtr< volVectorField > UMeanPtr_
const autoPtr< incompressible::turbulenceModel > & turbulence() const
Return const reference to the turbulence model.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
bool correctBoundaryConditions_
Update boundary conditions upon construction.
void correctNonTurbulentBoundaryConditions()
Update boundary conditions of mean-flow.
autoPtr< incompressible::turbulenceModel > turbulence_
void correctBoundaryConditions()
Correct boundary field.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
autoPtr< volScalarField > pMeanPtr_
#define DebugInfo
Report an information message using Foam::Info.
virtual const dictionary solverDict() const
Read controls from optimisationDict.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
autoPtr< volScalarField > pInitPtr_
Keep a copy of the initial field values if necessary.
autoPtr< volScalarField > pPtr_
Fields involved in the solution of the incompressible NS equations.
const Time & time() const
Return the top-level database.
void correctBoundaryConditions()
correct boundaryconditions for all volFields
incompressibleVars(fvMesh &mesh, solverControl &SolverControl)
Construct from mesh.
void restoreInitValues()
Restore field values to the initial ones.
void renameTurbulenceField(GeometricField< Type, fvPatchField, volMesh > &baseField, const word &solverName)
bool useSolverNameForFields_
Append the solver name to the variables names?
defineTypeNameAndDebug(combustionModel, 0)
bool average() const
Whether averaging is enabled or not.
Base class for solution control classes.
const volScalarField & pInst() const
Return const reference to pressure.
void resetMeanFields()
Reset mean fields to zero.