45 if (pimpleMeshes.
empty() && solidMeshes.
empty())
48 <<
"There needs to be at least one region" 52 if (!pimpleMeshes.
empty())
54 return pimpleMeshes[0].time();
57 return solidMeshes[0].time();
67 const word& algorithmName
71 pimpleLoop(static_cast<solutionControl&>(*
this)),
75 static_cast<solutionControl&>(*
this),
81 bool allSteady =
true, allTransient =
true;
85 pimpleControls_.append
90 allSteady = allSteady && pimpleMeshes[i].steady();
91 allTransient = allTransient && pimpleMeshes[i].transient();
101 allSteady = allSteady && solidMeshes[i].steady();
102 allTransient = allTransient && solidMeshes[i].transient();
109 Info<<
nl << algorithmName <<
": Region " << pimpleMeshes[i].name();
110 pimpleControls_[i].printResidualControls();
112 if (nCorrPimple_ > 1)
114 Info<<
nl << algorithmName <<
": Region " << pimpleMeshes[i].name();
115 pimpleControls_[i].printCorrResidualControls(nCorrPimple_);
121 Info<<
nl << algorithmName <<
": Region " << solidMeshes[i].name();
122 solidControls_[i].printResidualControls();
124 if (nCorrPimple_ > 1)
126 Info<<
nl << algorithmName <<
": Region " << solidMeshes[i].name();
127 solidControls_[i].printCorrResidualControls(nCorrPimple_);
131 Info<<
nl << algorithmName <<
": Operating solver in " 132 << (allSteady ?
"steady-state" : allTransient ?
"transient" :
133 "mixed steady-state/transient") <<
" mode with " << nCorrPimple_
134 <<
" outer corrector" << (nCorrPimple_ == 1 ?
"" :
"s") <<
nl;
136 if ((allSteady || allTransient) && nCorrPimple_ == 1)
138 Info<< algorithmName <<
": Operating solver in " 139 << (allSteady ?
"SIMPLE" :
"PISO") <<
" mode" << nl;
156 forAll(pimpleControls_, i)
158 pimpleControls_[i].read();
162 solidControls_[i].read();
178 forAll(pimpleControls_, i)
180 result = result && pimpleControls_[i].hasResidualControls();
184 result = result && solidControls_[i].hasResidualControls();
195 forAll(pimpleControls_, i)
197 result = result && pimpleControls_[i].hasCorrResidualControls();
201 result = result && solidControls_[i].hasCorrResidualControls();
212 forAll(pimpleControls_, i)
214 result = pimpleControls_[i].criteriaSatisfied() && result;
218 result = solidControls_[i].criteriaSatisfied() && result;
229 forAll(pimpleControls_, i)
231 result = pimpleControls_[i].corrCriteriaSatisfied() && result;
235 result = solidControls_[i].corrCriteriaSatisfied() && result;
244 forAll(pimpleControls_, i)
246 pimpleControls_[i].resetCorrSolveIndex();
250 solidControls_[i].resetCorrSolveIndex();
257 forAll(pimpleControls_, i)
259 pimpleControls_[i].updateCorrSolveIndex();
263 solidControls_[i].updateCorrSolveIndex();
274 forAll(pimpleControls_, i)
276 pimpleControls_[i].updateFinal();
280 solidControls_[i].updateFinal();
286 forAll(pimpleControls_, i)
288 pimpleControls_[i].storePrevIterFields();
292 solidControls_[i].storePrevIterFields();
295 forAll(pimpleControls_, i)
297 pimpleControls_[i].updateFinal();
301 solidControls_[i].updateFinal();
312 if (!endIfConverged(time))
314 forAll(pimpleControls_, i)
316 pimpleControls_[i].storePrevIterFields();
320 solidControls_[i].storePrevIterFields();
332 if (!endIfConverged(time))
334 forAll(pimpleControls_, i)
336 pimpleControls_[i].storePrevIterFields();
340 solidControls_[i].storePrevIterFields();
Multi-region-specific derivation of the solution control class.
bool loop(correctorConvergenceControl &convergence)
Pimple loop.
#define forAll(list, i)
Loop across all elements in list.
Solid no-loop control class. Implements non-orthogonal and convergence controls, but leaves loop cont...
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual ~pimpleMultiRegionControl()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void updateCorrSolveIndex()
Update the solve index in the correction residual control data.
virtual bool loop()
Return true if run should continue and if so increment time.
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
Pimple loop class. Implements the logic which controls the pimple loop generically for a given correc...
Ostream & endl(Ostream &os)
Add newline and flush stream.
Corrector convergence control class. Provides methods to check the convergence of an inner iteration ...
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 read()
Read controls.
bool read(const char *, int32_t &)
A class for handling words, derived from string.
Convergence control class. Provides methods to check the convergence of the time loop against an abso...
bool run(Time &time)
Time run loop.
virtual bool read()
Read controls.
virtual bool hasResidualControls() const
Return true if residual controls are present.
const Time & time() const
Return the time.
defineTypeNameAndDebug(combustionModel, 0)
pimpleMultiRegionControl(PtrList< fvMesh > &pimpleMeshes, PtrList< fvMesh > &solidMeshes, const word &algorithmName="PIMPLE")
Construct from meshes and the algorithm name.
virtual bool criteriaSatisfied() const
Return true if all convergence checks are satisfied.
virtual void resetCorrSolveIndex()
Reset the solve index in the correction residual control data.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Pimple no-loop control class. Implements various option flags, but leaves loop controls to the deriva...
virtual bool corrCriteriaSatisfied() const
Return true if all correction convergence checks are satisfied.
virtual bool hasCorrResidualControls() const
Return true if corrector residual controls are present.