47 turbOnFinalIterOnly_ =
55 if ((corr_ == 1) || residualControl_.empty() || finalIter())
61 bool storeIni = this->storeInitialResiduals();
66 const dictionary& solverDict = mesh_.solverPerformanceDict();
69 const word& variableName = iter().keyword();
70 const label fieldi = applyToField(variableName);
74 const scalar firstResidual =
75 maxResidual(variableName, iter().stream(), residual);
81 residualControl_[fieldi].initialResidual = firstResidual;
84 const bool absCheck = residual < residualControl_[fieldi].absTol;
85 bool relCheck =
false;
91 residualControl_[fieldi].initialResidual
94 relative = residual/iniRes;
95 relCheck = relative < residualControl_[fieldi].relTol;
98 achieved = achieved && (absCheck || relCheck);
102 Info<< algorithmName_ <<
" loop:" <<
endl;
104 Info<<
" " << variableName
105 <<
" PIMPLE iter " << corr_
107 << residualControl_[fieldi].initialResidual
108 <<
", abs tol = " << residual
109 <<
" (" << residualControl_[fieldi].absTol <<
")" 110 <<
", rel tol = " << relative
111 <<
" (" << residualControl_[fieldi].relTol <<
")" 117 return checked && achieved;
129 turbOnFinalIterOnly_(true),
141 <<
" corrector loops" << nl <<
endl;
193 mesh_.data::remove(
"finalIteration");
197 bool completed =
false;
203 <<
" iterations" <<
endl;
205 mesh_.data::remove(
"finalIteration");
216 mesh_.data::add(
"finalIteration",
true);
224 mesh_.data::add(
"finalIteration",
true);
#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.
virtual void storePrevIterFields() const
Store previous iteration fields.
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
virtual void read()
Read controls from fvSolution dictionary.
A class for handling words, derived from string.
virtual bool loop()
PIMPLE loop.
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
virtual void read()
Read controls from fvSolution dictionary.
defineTypeNameAndDebug(combustionModel, 0)
label corr_
Current corrector loop index.
word dictName("noiseDict")
Mesh data needed to do the Finite Volume discretisation.
const dictionary & pimpleDict
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual ~pimpleControl()
Destructor.
bool converged_
Converged flag.
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given absolute flux in relative form.
bool finalIter() const
Helper function to identify final PIMPLE (outer) iteration.