41 namespace functionObjects
71 bool Foam::functionObjects::age::converged
74 const scalar initialResidual
77 if (initialResidual < tolerance_)
80 <<
" converged in " << nCorr <<
" correctors\n" <<
endl;
116 phiName_ =
dict.lookupOrDefault<
word>(
"phi",
"phi");
117 rhoName_ =
dict.lookupOrDefault<
word>(
"rho",
"rho");
118 nCorr_ =
dict.lookupOrDefaultBackwardsCompatible<
int>
120 {
"nCorrectors",
"nCorr"},
124 diffusion_ =
dict.lookupOrDefault<
Switch>(
"diffusion",
false);
125 tolerance_ =
dict.lookupOrDefault<scalar>(
"tolerance", 1
e-5);
133 return wordList{phiName_, rhoName_};
159 const word divScheme(
"div(phi," + schemesField_ +
")");
162 scalar relaxCoeff = 0.0;
163 if (mesh_.solution().relaxEquation(schemesField_))
165 relaxCoeff = mesh_.solution().equationRelaxationFactor(schemesField_);
182 const word laplacianScheme(
"laplacian(muEff," + schemesField_ +
")");
190 for (
int i=0; i<=nCorr_; i++)
202 ageEqn.
relax(relaxCoeff);
206 if (converged(i, ageEqn.
solve(schemesField_).initialResidual()))
217 word laplacianScheme;
224 "laplacian(" + tnuEff().name() +
',' + schemesField_ +
")";
227 for (
int i=0; i<=nCorr_; i++)
240 ageEqn.
relax(relaxCoeff);
244 if (converged(i, ageEqn.
solve(schemesField_).initialResidual()))
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
static fvModels & New(const word &name, const fvMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
const dimensionSet & dimensions() const
Return dimensions.
static const char *const typeName
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
label size() const
Return the number of elements in the UPtrList.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base-class for Time/database functionObjects.
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 Time and dictionary.
virtual wordList fields() const
Return the list of fields required.
virtual ~age()
Destructor.
virtual bool execute()
Execute.
virtual bool write()
Write.
virtual bool read(const dictionary &)
Read the data.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
Finite volume constraints.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void relax(const scalar alpha)
Relax matrix (for steady-state solution).
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
tmp< fvMatrix< Type > > source(const VolField< Type > &field) const
Return source for an equation.
Abstract base class for momentum transport models (RAS, LES and laminar).
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
Foam::fvConstraints & fvConstraints(Foam::fvConstraints::New(mesh))
Foam::fvModels & fvModels(Foam::fvModels::New(mesh))
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const VolField< Type > &vf, const word &name)
List< word > wordList
A List of words.
const dimensionSet & dimMass
Ostream & endl(Ostream &os)
Add newline and flush stream.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
const dimensionSet & dimTime
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
wordList patchTypes(nPatches)