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)
129 if (!subCycledTimePtr_)
132 Info<<
"Solving equations for solver " 133 << solver_.solverName() <<
"\n" <<
endl;
141 subCycledTimePtr_()++;
142 iter_ = subCycledTimePtr_().index();
144 bool doNextIter(
true);
146 if (criteriaSatisfied())
149 << solver_.solverName()
150 <<
" solution converged in " 151 << subCycledTimePtr_->index() <<
" iterations" <<
nl <<
endl;
153 subCycledTimePtr_->endSubCycle();
154 subCycledTimePtr_.clear();
166 else if (subCycledTimePtr_->end())
169 << solver_.solverName()
170 <<
" solution reached max. number of iterations " 171 << subCycledTimePtr_().nSubCycles() <<
nl <<
endl;
173 subCycledTimePtr_->endSubCycle();
174 subCycledTimePtr_.clear();
190 <<
"Iteration " << subCycledTimePtr_().index()
191 <<
"|" << subCycledTimePtr_().nSubCycles() <<
endl;
193 storePrevIterFields();
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.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
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.
static constexpr const zero Zero
Global zero (0)