123 Info<<
"Allocating Mean Primal Fields" <<
endl;
189 if (rasVars.hasTMVar1())
193 if (rasVars.hasTMVar2())
197 if (rasVars.hasNut())
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_
255 SolverControl.solverDict().subOrEmptyDict(
"fieldReconstruction").
256 getOrDefault<bool>(
"reconstruct", false)
271 solverControl_(vs.solverControl_),
272 pPtr_(allocateRenamedField(vs.pPtr_)),
273 UPtr_(allocateRenamedField(vs.UPtr_)),
274 phiPtr_(allocateRenamedField(vs.phiPtr_)),
275 laminarTransportPtr_(nullptr),
276 turbulence_(nullptr),
277 RASModelVariables_(vs.RASModelVariables_.clone()),
279 pInitPtr_(allocateRenamedField(vs.pInitPtr_)),
280 UInitPtr_(allocateRenamedField(vs.UInitPtr_)),
281 phiInitPtr_(allocateRenamedField(vs.phiInitPtr_)),
283 pMeanPtr_(allocateRenamedField(vs.pMeanPtr_)),
284 UMeanPtr_(allocateRenamedField(UMeanPtr_)),
285 phiMeanPtr_(allocateRenamedField(vs.phiMeanPtr_)),
287 correctBoundaryConditions_(vs.correctBoundaryConditions_)
290 <<
"Calling incompressibleVars copy constructor" <<
endl;
297 <<
"Calling incompressibleVars::clone" <<
endl;
386 Info<<
"Restoring field values to initial ones" <<
endl;
399 Info<<
"Resetting mean fields to zero" <<
endl;
419 scalar avIter(iAverageIter);
420 scalar oneOverItP1 = 1./(avIter + 1);
421 scalar mult = avIter*oneOverItP1;
471 createZeroFieldPtr<scalar>
480 createZeroFieldPtr<scalar>
489 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
Get flux-required for given name, or default.
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 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 time name of given scalar time 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.
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)