46 pimpleControls_[i].read();
61 const word& algorithmName
72 pimpleControls_(solvers.size()),
76 bool allSteady =
true, allTransient =
true;
80 pimpleControls_.set(i, &solvers[i].
pimple);
81 pimpleControls_[i].pimpleLoopPtr_ =
this;
83 allSteady = allSteady && solvers[i].mesh.schemes().steady();
84 allTransient = allTransient && solvers[i].mesh.schemes().transient();
92 pimpleControls_[i].printResidualControls();
97 pimpleControls_[i].printCorrResidualControls(
nCorr_);
102 << (allSteady ?
"steady-state" : allTransient ?
"transient" :
103 "mixed steady-state/transient") <<
" mode with " <<
nCorr_
104 <<
" outer corrector" << (
nCorr_ == 1 ?
"" :
"s") <<
nl;
106 if ((allSteady || allTransient) &&
nCorr_ == 1)
109 << (allSteady ?
"SIMPLE" :
"PISO") <<
" mode" <<
nl;
120 forAll(pimpleControls_, i)
122 pimpleControls_[i].pimpleLoopPtr_ =
nullptr;
133 forAll(pimpleControls_, i)
135 result = result || pimpleControls_[i].hasResidualControls();
146 forAll(pimpleControls_, i)
148 result = result || pimpleControls_[i].hasCorrResidualControls();
160 forAll(pimpleControls_, i)
164 cs.checked = csi.
checked || cs.checked;
167 cs.satisfied = csi.
satisfied && cs.satisfied;
179 forAll(pimpleControls_, i)
181 result = pimpleControls_[i].corrCriteriaSatisfied() && result;
190 forAll(pimpleControls_, i)
192 pimpleControls_[i].resetCorrSolveIndex();
199 forAll(pimpleControls_, i)
201 pimpleControls_[i].updateCorrSolveIndex();
210 forAll(pimpleControls_, i)
212 pimpleControls_[i].updateFinal
214 pimpleControls_[i].isFinal(finalIter())
221 forAll(pimpleControls_, i)
223 pimpleControls_[i].storePrevIterFields();
226 forAll(pimpleControls_, i)
228 pimpleControls_[i].updateFinal
230 pimpleControls_[i].isFinal(finalIter())
240 if (Ecorr_ >= nEcorr_)
254 if (!endIfConverged(time))
256 forAll(pimpleControls_, i)
258 pimpleControls_[i].storePrevIterFields();
268 if (!endIfConverged(time))
270 forAll(pimpleControls_, i)
272 pimpleControls_[i].storePrevIterFields();
#define forAll(list, i)
Loop across all elements in list.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool run() const
Return true if run should continue,.
virtual bool loop()
Return true if run should continue and if so increment time.
Convergence control class. Provides methods to check the convergence of the time loop against an abso...
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
Multi-region-specific derivation of the solution control class.
virtual const dictionary & dict() const
Return the solution dictionary.
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
bool loop(correctorConvergenceControl &convergence)
Pimple loop.
label nCorr_
Maximum number of correctors.
virtual bool read()
Read controls.
Pimple multi-region control class. As Foam::pimpleControl, but for a multi- region simulation compris...
virtual ~pimpleMultiRegionControl()
Destructor.
bool correctEnergy()
Energy corrector loop.
virtual convergenceData criteriaSatisfied() const
Return true if all convergence checks are satisfied.
pimpleMultiRegionControl(const Time &runTime, PtrList< solver > &solvers, const word &algorithmName="PIMPLE")
Construct from time and the list of solvers.
virtual bool hasResidualControls() const
Return true if residual controls are present.
virtual bool hasCorrResidualControls() const
Return true if corrector residual controls are present.
bool run(Time &time)
Time run loop.
virtual void resetCorrSolveIndex()
Reset the solve index in the correction residual control data.
virtual void updateCorrSolveIndex()
Update the solve index in the correction residual control data.
pimpleNoLoopControl & pimple(const label i)
Access the i-th pimple control.
virtual bool corrCriteriaSatisfied() const
Return true if all correction convergence checks are satisfied.
virtual bool read()
Read controls.
const word & algorithmName() const
Return the name of the algorithm.
virtual bool read()=0
Read controls.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
defineTypeNameAndDebug(combustionModel, 0)
Convergence data structure.