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 if (!pimpleControls_[i].
read())
165 if (!solidControls_[i].
read())
183 forAll(pimpleControls_, i)
185 result = result && pimpleControls_[i].hasResidualControls();
189 result = result && solidControls_[i].hasResidualControls();
200 forAll(pimpleControls_, i)
202 result = result && pimpleControls_[i].hasCorrResidualControls();
206 result = result && solidControls_[i].hasCorrResidualControls();
217 forAll(pimpleControls_, i)
219 result = pimpleControls_[i].criteriaSatisfied() && result;
223 result = solidControls_[i].criteriaSatisfied() && result;
234 forAll(pimpleControls_, i)
236 result = pimpleControls_[i].corrCriteriaSatisfied() && result;
240 result = solidControls_[i].corrCriteriaSatisfied() && result;
249 forAll(pimpleControls_, i)
251 pimpleControls_[i].resetCorrSolveIndex();
255 solidControls_[i].resetCorrSolveIndex();
262 forAll(pimpleControls_, i)
264 pimpleControls_[i].updateCorrSolveIndex();
268 solidControls_[i].updateCorrSolveIndex();
279 forAll(pimpleControls_, i)
281 pimpleControls_[i].updateFinal();
285 solidControls_[i].updateFinal();
291 forAll(pimpleControls_, i)
293 pimpleControls_[i].storePrevIterFields();
297 solidControls_[i].storePrevIterFields();
300 forAll(pimpleControls_, i)
302 pimpleControls_[i].updateFinal();
306 solidControls_[i].updateFinal();
317 if (!endIfConverged(time))
319 forAll(pimpleControls_, i)
321 pimpleControls_[i].storePrevIterFields();
325 solidControls_[i].storePrevIterFields();
337 if (!endIfConverged(time))
339 forAll(pimpleControls_, i)
341 pimpleControls_[i].storePrevIterFields();
345 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...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
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 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.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
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.