35 namespace functionObjects
41 setTimeStepFaRegionsFunctionObject,
50 Foam::functionObjects::
51 setTimeStepFaRegionsFunctionObject::
52 setTimeStepFaRegionsFunctionObject
70 scalar newDeltaT = regionDeltaT();
72 static label index = -1;
81 const_cast<Time&
>(
time_).setDeltaT(newDeltaT,
false);
98 if (!time_.controlDict().getOrDefault<
bool>(
"adjustTimeStep",
false))
101 <<
"Need to set 'adjustTimeStep' true to allow timestep control" 113 Foam::scalar Foam::functionObjects::setTimeStepFaRegionsFunctionObject::
121 const scalar regionCo = reg.CourantNumber();
131 const scalar regionFaMaxCo =
132 time_.controlDict().get<scalar>(
"regionFaMaxCo");
134 const scalar maxDeltaTFact = regionFaMaxCo/(Co + SMALL);
135 const scalar deltaTFact =
136 min(
min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
138 return deltaTFact*time_.deltaTValue();
141 return time_.deltaTValue();
defineTypeNameAndDebug(ObukhovLength, 0)
scalar deltaTValue() const noexcept
Return time step value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
virtual bool write()
Write does nothing.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
label timeIndex() const noexcept
Return the current time index.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
virtual bool execute()
Execute does nothing.
Base class for area region models.
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Virtual base class for function objects with a reference to Time.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
const Time & time_
Reference to the time database.