51 if (residualControl_.empty())
59 const dictionary& solverDict = mesh_.solverPerformanceDict();
60 for (
const entry& solverPerfDictEntry : solverDict)
62 const word& fieldName = solverPerfDictEntry.keyword();
63 const label fieldi = applyToField(fieldName);
67 Pair<scalar> residuals = maxResidual(solverPerfDictEntry);
71 (residuals.
first() < residualControl_[fieldi].absTol);
73 achieved = achieved && absCheck;
77 Info<< algorithmName_ <<
" solution statistics:" <<
endl;
79 Info<<
" " << fieldName <<
": tolerance = "
81 <<
" (" << residualControl_[fieldi].absTol <<
")"
87 return checked && achieved;
111 const scalar duration =
115 Info<<
": no convergence criteria found. "
116 <<
"Calculations will run for " << duration <<
" steps."
121 Info<<
": convergence criteria" <<
nl;
125 <<
" tolerance " << ctrl.absTol
144 if (initialised_ && criteriaSatisfied())
148 <<
" solution converged in "
157 storePrevIterFields();
T & first() noexcept
The first element of the list, position [0].
An ordered pair of two objects of type <T> with first() and second() elements.
The TAB Method for Numerical Calculation of Spray Droplet Breakup.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
virtual dimensionedScalar startTime() const
Return start time.
static word timeName(const scalar t, const int precision=precision_)
virtual bool loop()
Return true if run should continue and if so increment time.
virtual dimensionedScalar endTime() const
Return end time.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const Type & value() const
Return const reference to value.
A keyword and a list of tokens is an 'entry'.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
virtual bool loop()
SIMPLE loop.
bool read()
Read controls from fvSolution dictionary.
Base class for solution control classes.
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
List< fieldData > residualControl_
List of residual data per field.
fvMesh & mesh_
Reference to the mesh database.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
virtual bool read()
Read controls from fvSolution dictionary.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const word dictName("faMeshDefinition")
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
Simple convenient storage of field residuals.