45 namespace functionObjects
74 bool Foam::functionObjects::age::converged
77 const scalar initialResidual
80 if (initialResidual < tolerance_)
82 Info<<
"Field " << typeName
83 <<
" converged in " <<
nCorr <<
" correctors" 114 phiName_ =
dict.getOrDefault<
word>(
"phi",
"phi");
115 rhoName_ =
dict.getOrDefault<
word>(
"rho",
"rho");
116 schemesField_ =
dict.getOrDefault<
word>(
"schemesField", typeName);
117 tolerance_ =
dict.getOrDefault<scalar>(
"tolerance", 1
e-5);
118 nCorr_ =
dict.getOrDefault<
int>(
"nCorr", 5);
119 diffusion_ =
dict.getOrDefault<
bool>(
"diffusion",
false);
135 mesh_.time().timeName(),
147 const word divScheme(
"div(phi," + schemesField_ +
")");
150 scalar relaxCoeff = 0;
151 mesh_.relaxEquation(schemesField_, relaxCoeff);
169 word laplacianScheme;
180 "laplacian(" + tmuEff().name() +
',' + schemesField_ +
")";
183 for (
int i = 0; i <= nCorr_; ++i)
195 ageEqn.relax(relaxCoeff);
199 if (converged(i, ageEqn.solve().initialResidual()))
209 tmp<volScalarField> tnuEff;
210 word laplacianScheme;
221 "laplacian(" + tnuEff().name() +
',' + schemesField_ +
")";
224 for (
int i = 0; i <= nCorr_; ++i)
237 ageEqn.relax(relaxCoeff);
241 if (converged(i, ageEqn.solve().initialResidual()))
250 Info<<
"Min/max age:" 251 <<
min(age).value() <<
' ' 256 word fieldName = typeName;
258 return store(fieldName, tage);
264 return writeObject(typeName);
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
virtual bool execute()
Execute.
virtual bool read(const dictionary &)
Read the data.
defineTypeNameAndDebug(ObukhovLength, 0)
fvMatrix< scalar > fvScalarMatrix
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
age(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchTypes(nPatches)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the matrix for the laplacian of the field.
IncompressibleTurbulenceModel< transportModel > turbulenceModel
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
Typename for Field.
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
Reading is optional [identical to LAZY_READ].
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Calculate the matrix for the divergence of the given field and flux.
List< word > wordList
List of word.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Automatically write from objectRegistry::writeObject()
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
virtual bool read(const dictionary &dict)
Read optional controls.
virtual bool write()
Write.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to database if not present.
Defines the attributes of an object for which implicit objectRegistry management is supported...
const fvMesh & mesh_
Reference to the fvMesh.
Do not request registration (bool: false)
static constexpr const zero Zero
Global zero (0)