52 pimpleDict.getOrDefault(
"turbOnFinalIterOnly",
true);
54 pimpleDict.getOrDefault(
"finalOnLastPimpleIterOnly",
false);
64 if ((corr_ == 1) || residualControl_.empty() || finalIter())
70 const bool storeIni = this->storeInitialResiduals();
75 const dictionary& solverDict = mesh_.data().solverPerformanceDict();
76 for (
const entry& solverPerfDictEntry : solverDict)
78 const word& fieldName = solverPerfDictEntry.keyword();
79 const label fieldi = applyToField(fieldName);
83 Pair<scalar> residuals = maxResidual(solverPerfDictEntry);
88 bool relCheck =
false;
91 (residuals.last() < residualControl_[fieldi].absTol);
95 residualControl_[fieldi].initialResidual = residuals.first();
100 (residualControl_[fieldi].initialResidual + ROOTVSMALL);
102 relative = residuals.last() / iniRes;
103 relCheck = (
relative < residualControl_[fieldi].relTol);
106 achieved = achieved && (absCheck || relCheck);
110 Info<< algorithmName_ <<
" loop:" <<
endl;
112 Info<<
" " << fieldName
113 <<
" PIMPLE iter " << corr_
115 << residualControl_[fieldi].initialResidual
116 <<
", abs tol = " << residuals.last()
117 <<
" (" << residualControl_[fieldi].absTol <<
")" 119 <<
" (" << residualControl_[fieldi].relTol <<
")" 125 return checked && achieved;
133 <<
" corrPISO:" << corrPISO_
134 <<
" corrNonOrtho:" << corrNonOrtho_
143 Foam::pimpleControl::pimpleControl
156 turbOnFinalIterOnly_(true),
157 finalOnLastPimpleIterOnly_(false),
171 Info<<
": no residual control data found. " 173 <<
" corrector loops" <<
nl;
182 <<
": relTol " << ctrl.relTol
183 <<
", tolerance " << ctrl.absTol
190 Info<<
": Operating solver in PISO mode" <<
nl;
208 Info<< algorithmName_ <<
" loop: corr = " << corr_ <<
endl;
213 if (corr_ == nCorrPIMPLE_ + 1)
215 if (!residualControl_.empty() && (nCorrPIMPLE_ != 1))
217 Info<< algorithmName_ <<
": not converged within " 218 << nCorrPIMPLE_ <<
" iterations" <<
endl;
222 mesh_.data().setFinalIteration(
false);
226 bool completed =
false;
227 if (converged_ || criteriaSatisfied())
231 Info<< algorithmName_ <<
": converged in " << corr_ - 1
232 <<
" iterations" <<
endl;
234 mesh_.data().setFinalIteration(
false);
242 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
243 storePrevIterFields();
245 mesh_.data().setFinalIteration(
true);
253 mesh_.data().setFinalIteration(
true);
256 if (corr_ <= nCorrPIMPLE_)
258 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
259 storePrevIterFields();
label nCorrPISO_
Maximum number of PISO correctors.
virtual bool read()
Read controls from fvSolution dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
List< fieldData > residualControl_
List of residual data per field.
constexpr char nl
The newline '\n' character (0x0a)
Base class for solution control classes.
bool solveFlow_
Flag to indicate whether to solve for the flow.
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool finalOnLastPimpleIterOnly_
Flag to indicate wheter the final solver is used only on the final pimple iter.
const dictionary & pimpleDict
bool read(const char *buf, int32_t &val)
Same as readInt32.
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.
bool SIMPLErho_
Flag to indicate whether to update density in SIMPLE rather than PISO mode.
virtual bool loop()
PIMPLE loop.
const word algorithmName_
The dictionary name, e.g. SIMPLE, PIMPLE.
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
#define DebugInfo
Report an information message using Foam::Info.
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
bool ddtCorr_
Flag to indicate that ddtCorr should be applied; default = yes.
virtual const dictionary dict() const
Return the solution dictionary.
static void check(const int retVal, const char *what)
PIMPLE control class to supply convergence information/checks for the PIMPLE loop.
Mesh data needed to do the Finite Volume discretisation.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given absolute flux in relative form.