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_)),
290 correctBoundaryConditions_(vs.correctBoundaryConditions_)
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;
474 createZeroFieldPtr<scalar>
483 createZeroFieldPtr<scalar>
492 createZeroFieldPtr<scalar>
autoPtr< singlePhaseTransportModel > laminarTransportPtr_
autoPtr< volVectorField > UPtr_
const volScalarField & pInst() const
Return const reference to pressure.
*virtual void transfer(variablesSet &vars)
Transfer the fields of another variablesSet to this.
autoPtr< volScalarField > pMeanPtr_
Manage mean fields. Turbulent mean fields are managed in RASModelVariables.
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 resetMeanFields()
Reset mean fields to zero.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const surfaceScalarField & phiInst() const
Return const reference to volume flux.
void setMeanFields()
Set mean fields if necessary.
const Time & time() const
Return the top-level database.
GeometricField< vector, fvPatchField, volMesh > volVectorField
incompressibleVars(fvMesh &mesh, solverControl &SolverControl)
Construct from mesh.
void correctNonTurbulentBoundaryConditions()
Update boundary conditions of mean-flow.
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable)
void setInitFields()
Set initial fields if necessary.
static autoPtr< RASModelVariables > New(const fvMesh &mesh, const solverControl &SolverControl)
Return a reference to the selected turbulence model.
void correctTurbulentBoundaryConditions()
Update boundary conditions of turbulent fields.
autoPtr< surfaceScalarField > phiInitPtr_
GeometricField< scalar, fvPatchField, volMesh > volScalarField
autoPtr< volScalarField > pPtr_
Fields involved in the solution of the incompressible NS equations.
virtual autoPtr< variablesSet > clone() const
Clone the incompressibleVars.
const surfaceScalarField & phi() const
Return const reference to volume flux.
Base class for solution control classes.
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...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const singlePhaseTransportModel & laminarTransport() const
Return const reference to transport model.
autoPtr< surfaceScalarField > phiMeanPtr_
const volScalarField & p() const
Return const reference to pressure.
bool useSolverNameForFields_
Append the solver name to the variables names?
Base class for solver control classes.
void setFields()
Read fields and set turbulence.
Reading is optional [identical to LAZY_READ].
autoPtr< incompressible::RASModelVariables > RASModelVariables_
autoPtr< volVectorField > UMeanPtr_
solverControl & solverControl_
Reference to the solverControl of the solver allocating the fields.
#define DebugInfo
Report an information message using Foam::Info.
const volVectorField & U() const
Return const reference to velocity.
bool storeInitValues() const
Return storeInitValues bool.
void renameTurbulenceFields()
Rename turbulence fields if necessary.
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.
defineTypeNameAndDebug(combustionModel, 0)
autoPtr< surfaceScalarField > phiPtr_
bool doAverageIter() const
Whether or not to add fields of the current iteration to the average fields.
autoPtr< volVectorField > UInitPtr_
const autoPtr< incompressible::RASModelVariables > & RASModelVariables() const
Return const reference to the turbulence model variables.
void computeMeanFields()
Compute mean fields on the fly.
void restoreInitValues()
Restore field values to the initial ones.
Base class for creating a set of variables.
static void setFluxField(autoPtr< surfaceScalarField > &fieldPtr, const fvMesh &mesh, const volVectorField &velocity, const word &baseName, const word &solverName, const bool useSolverNameForFields)
Set flux field.
bool correctBoundaryConditions_
Update boundary conditions upon construction.
bool average() const
Whether averaging is enabled or not.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Automatically write from objectRegistry::writeObject()
void correctBoundaryConditions()
correct boundaryconditions for all volFields
autoPtr< volScalarField > pInitPtr_
Keep a copy of the initial field values if necessary.
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
autoPtr< incompressible::turbulenceModel > turbulence_
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
label & averageIter()
Return average iteration index reference.
bool write() const
Write dummy turbulent fields to allow for continuation in multi-point, turbulent runs.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const volVectorField & UInst() const
Return const reference to velocity.
bool useAveragedFields() const
Use averaged fields? For solving the adjoint equations or computing sensitivities based on averaged f...
A simple single-phase transport model based on viscosityModel.
bool storeInitValues() const
Re-initialize.
void swapAndRename(autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p1, autoPtr< GeometricField< Type, PatchField, GeoMesh >> &p2)
Swap autoPtrs and rename managed fields.
Request registration (bool: true)
fvMesh & mesh_
Reference to the mesh database.
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.
static constexpr const zero Zero
Global zero (0)