41 namespace functionObjects
71 bool Foam::functionObjects::age::converged
74 const scalar initialResidual
77 if (initialResidual < tolerance_)
79 Info<<
"Field " << typeName
80 <<
" converged in " << nCorr <<
" correctors\n" <<
endl;
116 phiName_ =
dict.lookupOrDefault<
word>(
"phi",
"phi");
117 rhoName_ =
dict.lookupOrDefault<
word>(
"rho",
"rho");
118 nCorr_ =
dict.lookupOrDefault<
int>(
"nCorr", 5);
119 schemesField_ =
dict.lookupOrDefault<
word>(
"schemesField", typeName);
120 diffusion_ =
dict.lookupOrDefault<
Switch>(
"diffusion",
false);
121 tolerance_ =
dict.lookupOrDefault<scalar>(
"tolerance", 1
e-5);
129 return wordList{phiName_, rhoName_};
155 const word divScheme(
"div(phi," + schemesField_ +
")");
158 scalar relaxCoeff = 0.0;
159 if (mesh_.solution().relaxEquation(schemesField_))
161 relaxCoeff = mesh_.solution().equationRelaxationFactor(schemesField_);
178 const word laplacianScheme(
"laplacian(muEff," + schemesField_ +
")");
186 for (
int i=0; i<=nCorr_; i++)
198 ageEqn.
relax(relaxCoeff);
202 if (converged(i, ageEqn.
solve(schemesField_).initialResidual()))
213 word laplacianScheme;
220 "laplacian(" + tnuEff().name() +
',' + schemesField_ +
")";
223 for (
int i=0; i<=nCorr_; i++)
236 ageEqn.
relax(relaxCoeff);
240 if (converged(i, ageEqn.
solve(schemesField_).initialResidual()))
258 return writeObject(typeName);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
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 keyword definitions, which are a keyword followed by any number of values (e....
static autoPtr< dictionary > New(Istream &)
Construct top-level dictionary on freestore from Istream.
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 turbulence models (RAS, LES and laminar).
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
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(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, 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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimMass
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
wordList patchTypes(nPatches)