53 bool satisfied(
false);
58 if (subCycledTimePtr_().index() == 1)
73 if (mesh_.time().timeIndex() == mesh_.time().startTimeIndex() + 1)
75 return nInitialIters_;
86 Time&
runTime =
const_cast<Time&
>(mesh_.time());
96 Foam::SIMPLEControlOpt::SIMPLEControlOpt
99 const word& managerType,
103 SIMPLEControl(
mesh, managerType, solver),
105 subCycledTimePtr_(nullptr),
106 deltaTSubSycle_(
Zero)
128 bool doNextIter(
true);
133 if (!subCycledTimePtr_)
136 Info<<
"Solving equations for solver " 137 << solver_.solverName() <<
"\n" <<
endl;
152 subCycledTimePtr_()++;
153 iter_ = subCycledTimePtr_().index();
156 if (criteriaSatisfied())
159 << solver_.solverName()
160 <<
" solution converged in " 161 << subCycledTimePtr_->index() <<
" iterations" <<
nl <<
endl;
163 subCycledTimePtr_->endSubCycle();
164 subCycledTimePtr_.clear();
176 else if (subCycledTimePtr_->end())
179 << solver_.solverName()
180 <<
" solution reached max. number of iterations " 181 << subCycledTimePtr_().nSubCycles() <<
nl <<
endl;
183 subCycledTimePtr_->endSubCycle();
184 subCycledTimePtr_.clear();
200 <<
"Iteration " << subCycledTimePtr_().index()
201 <<
"|" << subCycledTimePtr_().nSubCycles() <<
endl;
211 <<
"Number of iterations is non-positive (" << nIters() <<
")." 213 <<
"Skipping the solution of the equations corresponding to solver " 214 << solver_.solverName()
scalar deltaTValue() const noexcept
Return time step value.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
virtual bool read()
Read controls from optimisationDict.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual bool read()
Read controls from fvSolution dictionary.
#define DebugInfo
Report an information message using Foam::Info.
const label & nIters() const
Maximum number of solver iterations.
label nInitialIters_
Number of iterations for the first optimisation cycle.
defineTypeNameAndDebug(combustionModel, 0)
SIMPLE control class for optimisation runs. Each time is sub-cycled and corresponds to one optimisati...
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
virtual const dictionary dict() const
Return the solution dictionary.
void readModifiedObjects()
Read the objects that have been modified.
virtual void storePrevIterFields() const
Store previous iteration fields.
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool write(const bool valid=true) const
Whether to call time.write() or not.
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT()
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void resetDeltaT()
Reset deltaT in case controlDict has been re-written at run-time.
label nIters_
Number of SIMPLE iterations.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A class for managing sub-cycling times.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)