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();
78 const entry& solverPerfDictEntry = *iter;
80 const word& fieldName = solverPerfDictEntry.
keyword();
81 const label fieldi = applyToField(fieldName);
85 Pair<scalar> residuals = maxResidual(solverPerfDictEntry);
90 bool relCheck =
false;
93 (residuals.last() < residualControl_[fieldi].absTol);
97 residualControl_[fieldi].initialResidual = residuals.first();
101 const scalar iniRes =
102 (residualControl_[fieldi].initialResidual + ROOTVSMALL);
104 relative = residuals.last() / iniRes;
105 relCheck = (
relative < residualControl_[fieldi].relTol);
108 achieved = achieved && (absCheck || relCheck);
112 Info<< algorithmName_ <<
" loop:" <<
endl;
114 Info<<
" " << fieldName
115 <<
" PIMPLE iter " << corr_
117 << residualControl_[fieldi].initialResidual
118 <<
", abs tol = " << residuals.last()
119 <<
" (" << residualControl_[fieldi].absTol <<
")"
121 <<
" (" << residualControl_[fieldi].relTol <<
")"
127 return checked && achieved;
135 <<
" corrPISO:" << corrPISO_
136 <<
" corrNonOrtho:" << corrNonOrtho_
145 Foam::pimpleControl::pimpleControl
158 turbOnFinalIterOnly_(
true),
159 finalOnLastPimpleIterOnly_(
false),
167 Info<<
nl << algorithmName_;
169 if (nCorrPIMPLE_ > 1)
171 if (residualControl_.empty())
173 Info<<
": no residual control data found. "
174 <<
"Calculations will employ " << nCorrPIMPLE_
175 <<
" corrector loops" <<
nl;
179 Info<<
": max iterations = " << nCorrPIMPLE_ <<
nl;
181 for (
const fieldData& ctrl : residualControl_)
184 <<
": relTol " << ctrl.relTol
185 <<
", tolerance " << ctrl.absTol
192 Info<<
": Operating solver in PISO mode" <<
nl;
210 Info<< algorithmName_ <<
" loop: corr = " << corr_ <<
endl;
215 if (corr_ == nCorrPIMPLE_ + 1)
217 if (!residualControl_.empty() && (nCorrPIMPLE_ != 1))
219 Info<< algorithmName_ <<
": not converged within "
220 << nCorrPIMPLE_ <<
" iterations" <<
endl;
224 mesh_.data::remove(
"finalIteration");
228 bool completed =
false;
229 if (converged_ || criteriaSatisfied())
233 Info<< algorithmName_ <<
": converged in " << corr_ - 1
234 <<
" iterations" <<
endl;
236 mesh_.data::remove(
"finalIteration");
244 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
245 storePrevIterFields();
247 mesh_.data::add(
"finalIteration",
true);
255 mesh_.data::add(
"finalIteration",
true);
258 if (corr_ <= nCorrPIMPLE_)
260 Info<< algorithmName_ <<
": iteration " << corr_ <<
endl;
261 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.
const keyType & keyword() const
Return keyword.
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("blockMeshDict")
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.
const dictionary & pimpleDict
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
messageStream Info
Information stream (uses stdout - output is on the master only)
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.
forAllConstIters(mixture.phases(), phase)
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.