53 bool satisfied(
false);
58 if (subCycledTimePtr_().index() == 1)
73 if (mesh_.time().timeIndex() == mesh_.time().startTimeIndex() + 1)
75 return nInitialIters_;
99 const word& managerType,
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();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
SIMPLE control class for optimisation runs. Each time is sub-cycled and corresponds to one optimisati...
label nInitialIters_
Number of iterations for the first optimisation cycle.
const label & nIters() const
Maximum number of solver iterations.
virtual bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
void resetDeltaT()
Reset deltaT in case controlDict has been re-written at run-time.
virtual bool read()
Read controls from optimisationDict.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
label nIters_
Number of SIMPLE iterations.
virtual const dictionary dict() const
Return the solution dictionary.
virtual bool read()
Read controls from fvSolution dictionary.
scalar deltaTValue() const noexcept
Return time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT()
void readModifiedObjects()
Read the objects that have been modified.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
virtual bool write()
Write the output fields.
Mesh data needed to do the Finite Volume discretisation.
virtual bool write(const bool valid=true) const
Write using setting from DB.
bool criteriaSatisfied()
Return true if all convergence checks are satisfied.
Base class for solution control classes.
A class for managing sub-cycling times.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define DebugInfo
Report an information message using Foam::Info.
bool read(const char *buf, int32_t &val)
Same as readInt32.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
constexpr char nl
The newline '\n' character (0x0a)