123 Info<<
"Allocating Mean Primal Fields" <<
endl;
192 if (rasVars.hasTMVar1())
196 if (rasVars.hasTMVar2())
200 if (rasVars.hasNut())
210 Info<<
"Correcting (U,p) boundary conditions " <<
endl;
226 Info<<
"Correcting boundary conditions of turbulent fields" <<
endl;
240 solverControl_(SolverControl),
244 laminarTransportPtr_(nullptr),
245 turbulence_(nullptr),
246 RASModelVariables_(nullptr),
250 phiInitPtr_(nullptr),
254 phiMeanPtr_(nullptr),
256 correctBoundaryConditions_
258 SolverControl.solverDict().subOrEmptyDict(
"fieldReconstruction").
259 getOrDefault<bool>(
"reconstruct", false)
274 solverControl_(vs.solverControl_),
275 pPtr_(allocateRenamedField(vs.pPtr_)),
276 UPtr_(allocateRenamedField(vs.UPtr_)),
277 phiPtr_(allocateRenamedField(vs.phiPtr_)),
278 laminarTransportPtr_(nullptr),
279 turbulence_(nullptr),
280 RASModelVariables_(vs.RASModelVariables_.clone()),
282 pInitPtr_(allocateRenamedField(vs.pInitPtr_)),
283 UInitPtr_(allocateRenamedField(vs.UInitPtr_)),
284 phiInitPtr_(allocateRenamedField(vs.phiInitPtr_)),
286 pMeanPtr_(allocateRenamedField(vs.pMeanPtr_)),
287 UMeanPtr_(allocateRenamedField(UMeanPtr_)),
288 phiMeanPtr_(allocateRenamedField(vs.phiMeanPtr_)),
293 <<
"Calling incompressibleVars copy constructor" <<
endl;
300 <<
"Calling incompressibleVars::clone" <<
endl;
389 Info<<
"Restoring field values to initial ones" <<
endl;
402 Info<<
"Resetting mean fields to zero" <<
endl;
422 scalar avIter(iAverageIter);
423 scalar oneOverItP1 = 1./(avIter + 1);
424 scalar mult = avIter*oneOverItP1;
void correctBoundaryConditions()
Correct boundary field.
@ REGISTER
Request registration (bool: true).
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static autoPtr< IncompressibleTurbulenceModel > New(const volVectorField &U, const surfaceScalarField &phi, const transportModel &transportModel, const word &propertiesName=turbulenceModel::propertiesName)
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Base class for solution control classes.
const volVectorField & UInst() const
Return const reference to velocity.
solverControl & solverControl_
Reference to the solverControl of the solver allocating the fields.
bool storeInitValues() const
Return storeInitValues bool.
const volVectorField & U() const
Return const reference to velocity.
autoPtr< volVectorField > UMeanPtr_
autoPtr< volVectorField > UInitPtr_
const volScalarField & p() const
Return const reference to pressure.
autoPtr< volVectorField > UPtr_
const surfaceScalarField & phi() const
Return const reference to volume flux.
autoPtr< surfaceScalarField > phiPtr_
void restoreInitValues()
Restore field values to the initial ones.
const surfaceScalarField & phiInst() const
Return const reference to volume flux.
autoPtr< singlePhaseTransportModel > laminarTransportPtr_
autoPtr< volScalarField > pPtr_
Fields involved in the solution of the incompressible NS equations.
void correctTurbulentBoundaryConditions()
Update boundary conditions of turbulent fields.
const singlePhaseTransportModel & laminarTransport() const
Return const reference to transport model.
void setFields()
Read fields and set turbulence.
const volScalarField & pInst() const
Return const reference to pressure.
bool correctBoundaryConditions_
Update boundary conditions upon construction.
void computeMeanFields()
Compute mean fields on the fly.
void resetMeanFields()
Reset mean fields to zero.
autoPtr< surfaceScalarField > phiMeanPtr_
void renameTurbulenceFields()
Rename turbulence fields if necessary.
incompressibleVars(fvMesh &mesh, solverControl &SolverControl)
Construct from mesh.
autoPtr< incompressible::RASModelVariables > RASModelVariables_
void correctNonTurbulentBoundaryConditions()
Update boundary conditions of mean-flow.
*virtual void transfer(variablesSet &vars)
Transfer the fields of another variablesSet to this.
void correctBoundaryConditions()
correct boundaryconditions for all volFields
bool write() const
Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs.
autoPtr< surfaceScalarField > phiInitPtr_
autoPtr< incompressible::turbulenceModel > turbulence_
virtual autoPtr< variablesSet > clone() const
Clone the incompressibleVars.
const autoPtr< incompressible::RASModelVariables > & RASModelVariables() const
Return const reference to the turbulence model variables.
autoPtr< volScalarField > pMeanPtr_
Manage mean fields. Turbulent mean fields are managed in RASModelVariables.
void setInitFields()
Set initial fields if necessary.
autoPtr< volScalarField > pInitPtr_
Keep a copy of the initial field values if necessary.
void setMeanFields()
Set mean fields if necessary.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
static autoPtr< RASModelVariables > New(const fvMesh &mesh, const solverControl &SolverControl)
Return a reference to the selected turbulence model.
const volScalarField & TMVar1Inst() const
Return references to instantaneous turbulence fields.
virtual bool hasNut() const
virtual bool hasTMVar2() const
const volScalarField & nutRefInst() const
virtual bool hasTMVar1() const
Bools to identify which turbulent fields are present.
const volScalarField & TMVar2Inst() const
A simple single-phase transport model based on viscosityModel.
Base class for solver control classes.
bool doAverageIter() const
Whether or not to add fields of the current iteration to the average fields.
bool storeInitValues() const
Re-initialize.
label & averageIter()
Return average iteration index reference.
bool useAveragedFields() const
Use averaged fields? For solving the adjoint equations or computing sensitivities based on averaged f...
bool average() const
Whether averaging is enabled or not.
Base class for creating a set of variables.
void swapAndRename(autoPtr< GeometricField< Type, PatchField, GeoMesh > > &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh > > &p2)
Swap autoPtrs and rename managed fields.
bool useSolverNameForFields_
Append the solver name to the variables names?
autoPtr< GeometricField< Type, PatchField, GeoMesh > > allocateRenamedField(const autoPtr< GeometricField< Type, PatchField, GeoMesh > > &bf)
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,...
static void setField(autoPtr< GeometricField< Type, fvPatchField, volMesh > > &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Read vol fields.
word solverName_
Solver name owning the variables set.
fvMesh & mesh_
Reference to the mesh database.
static void setFluxField(autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Set flux field.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
autoPtr< GeometricField< Type, fvPatchField, volMesh > > createZeroFieldPtr(const fvMesh &mesh, const word &name, const dimensionSet dims, bool printAllocation=false)