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;
93 Foam::simpleControl::simpleControl
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
142 Time&
runTime =
const_cast<Time&
>(mesh_.time());
148 <<
" solution converged in " 157 storePrevIterFields();
const Type & value() const noexcept
Return const reference to value.
static bool initialised_(false)
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
fvMesh & mesh_
Reference to the mesh database.
List< fieldData > residualControl_
List of residual data per field.
constexpr char nl
The newline '\n' character (0x0a)
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.
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual dimensionedScalar endTime() const
Return end time.
const Time & time() const
Return the top-level database.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool loop()
SIMPLE loop.
void fieldData(vtk::formatter &fmt, label nFields)
Emit "FIELD FieldData <n>".
A class for handling words, derived from Foam::string.
virtual bool read()
Read controls from fvSolution dictionary.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
Mesh data needed to do the Finite Volume discretisation.
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
messageStream Info
Information stream (stdout output on master, null elsewhere)
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
bool read()
Read controls from fvSolution dictionary.