Go to the documentation of this file.
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_.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),
165 Info<<
nl << algorithmName_;
167 if (nCorrPIMPLE_ > 1)
169 if (residualControl_.empty())
171 Info<<
": no residual control data found. "
172 <<
"Calculations will employ " << nCorrPIMPLE_
173 <<
" corrector loops" <<
nl;
177 Info<<
": max iterations = " << nCorrPIMPLE_ <<
nl;
179 for (
const fieldData& ctrl : residualControl_)
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::remove(
"finalIteration");
226 bool completed =
false;
227 if (converged_ || criteriaSatisfied())
231 Info<< algorithmName_ <<
": converged in " << corr_ - 1
232 <<
" iterations" <<
endl;
234 mesh_.data::remove(
"finalIteration");
242 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
243 storePrevIterFields();
245 mesh_.data::add(
"finalIteration",
true);
253 mesh_.data::add(
"finalIteration",
true);
256 if (corr_ <= nCorrPIMPLE_)
258 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
259 storePrevIterFields();
virtual const dictionary dict() const
Return the solution dictionary.
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
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.
label nCorrPIMPLE_
Maximum number of PIMPLE correctors.
A class for handling words, derived from Foam::string.
Base class for solution control classes.
bool turbOnFinalIterOnly_
Flag to indicate whether to only solve turbulence on final iter.
bool read(const char *buf, int32_t &val)
Same as readInt32.
const word dictName("faMeshDefinition")
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool finalOnLastPimpleIterOnly_
virtual void setFirstIterFlag(const bool check=true, const bool force=false)
Set the firstIteration flag on the mesh data dictionary.
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
static void check(const int retVal, const char *what)
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool solveFlow_
Flag to indicate whether to solve for the flow.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool loop()
PIMPLE loop.
Mesh data needed to do the Finite Volume discretisation.
bool ddtCorr_
Flag to indicate that ddtCorr should be applied; default = yes.
virtual bool read()
Read controls from fvSolution dictionary.
#define DebugInfo
Report an information message using Foam::Info.
const dictionary & pimpleDict
Simple convenient storage of field residuals.
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given absolute flux in relative form.
defineTypeNameAndDebug(combustionModel, 0)
label nCorrPISO_
Maximum number of PISO correctors.