76bool Foam::functionObjects::age::converged
79 const scalar initialResidual
82 if (initialResidual < tolerance_)
85 <<
" converged in " <<
nCorr <<
" correctors"
119 phiName_ =
dict.getOrDefault<
word>(
"phi",
"phi");
120 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
122 tolerance_ =
dict.getOrDefault<scalar>(
"tolerance", 1
e-5);
123 nCorr_ =
dict.getOrDefault<
int>(
"nCorr", 5);
124 diffusion_ =
dict.getOrDefault<
bool>(
"diffusion",
false);
132 divScheme_ =
word(
"div(phi," + schemesField_ +
")");
139 laplacianScheme_ =
"laplacian(muEff," + schemesField_ +
")";
143 laplacianScheme_ =
"laplacian(nuEff," + schemesField_ +
")";
153 auto* agePtr = getObjectPtr<volScalarField>(
typeName);
177 scalar relaxCoeff = 0;
178 mesh_.relaxEquation(schemesField_, relaxCoeff);
195 tmp<volScalarField> tmuEff;
206 for (
int i = 0; i <= nCorr_; ++i)
218 ageEqn.relax(relaxCoeff);
222 if (converged(i, ageEqn.solve().initialResidual()))
232 tmp<volScalarField> tnuEff;
243 for (
int i = 0; i <= nCorr_; ++i)
256 ageEqn.relax(relaxCoeff);
260 if (converged(i, ageEqn.solve().initialResidual()))
269 Info<<
"Min/max age:"
270 <<
min(
age).value() <<
' '
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
static const char *const typeName
Typename for Field.
@ NO_REGISTER
Do not request registration (bool: false).
@ 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,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Calculates and writes out the time taken for a particle to travel from an inlet to the location....
age(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
ObjectType * getObjectPtr(const word &fieldName) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
bool writeObject(const word &fieldName)
Write field if present in the (sub) objectRegistry.
const Time & time() const
Return time database.
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
Finite-volume options, which is an IOdictionary of values and a fv::optionList.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present otherwise lookup and return.
bool store()
Register object with its registry and transfer ownership to the registry.
A class for managing temporary objects.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
IncompressibleTurbulenceModel< transportModel > turbulenceModel
List< word > wordList
List of word.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool read(const char *buf, int32_t &val)
Same as readInt32.
fvMatrix< scalar > fvScalarMatrix
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
constexpr char nl
The newline '\n' character (0x0a).
wordList patchTypes(nPatches)
#define forAll(list, i)
Loop across all elements in list.