50Foam::functionObjects::
51setTimeStepFaRegionsFunctionObject::
52setTimeStepFaRegionsFunctionObject
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"
113Foam::scalar Foam::functionObjects::setTimeStepFaRegionsFunctionObject::
119 for (
const regionFaModel& reg : time_.cobjects<regionFaModel>())
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();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
label timeIndex() const noexcept
Return the current time index.
scalar deltaTValue() const noexcept
Return time step value.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
This function object controls the time step for classes of the type regionFaModel....
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
virtual bool execute()
Execute does nothing.
virtual bool write()
Write does nothing.
const Time & time_
Reference to the time database.
timeFunctionObject(const timeFunctionObject &)=delete
No copy construct.
Base class for area region models.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).