47 if (residualControl_.empty())
55 const dictionary& solverDict = mesh_.solverPerformanceDict();
58 const word& variableName = iter().keyword();
59 const label fieldi = applyToField(variableName);
62 scalar lastResidual = 0;
63 const scalar residual =
64 maxResidual(variableName, iter().stream(), lastResidual);
68 bool absCheck = residual < residualControl_[fieldi].absTol;
69 achieved = achieved && absCheck;
73 Info<< algorithmName_ <<
" solution statistics:" <<
endl;
75 Info<<
" " << variableName <<
": tolerance = " << residual
76 <<
" (" << residualControl_[fieldi].absTol <<
")" 82 return checked && achieved;
100 <<
"Calculations will run for " 102 <<
" steps." << nl <<
endl;
virtual ~simpleControl()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
fvMesh & mesh_
Reference to the mesh database.
A list of keyword definitions, which are a keyword followed by any number of values (e...
List< fieldData > residualControl_
List of residual data per field.
Base class for solution control classes.
virtual bool loop()
Return true if run should continue and if so increment time.
virtual dimensionedScalar startTime() const
Return start time.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
virtual dimensionedScalar endTime() const
Return end time.
const Time & time() const
Return the top-level database.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool loop()
Loop loop.
A class for handling words, derived from string.
const Type & value() const
Return const reference to value.
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
virtual void read()
Read controls from fvSolution dictionary.
defineTypeNameAndDebug(combustionModel, 0)
virtual void storePrevIterFields() const
Store previous iteration fields.
void read()
Read controls from fvSolution dictionary.
const Time & time() const
Return time.
Mesh data needed to do the Finite Volume discretisation.
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
bool initialised_
Initialised flag.