36 namespace functionObjects
42 setTimeStepFaRegionsFunctionObject,
51 Foam::functionObjects::
52 setTimeStepFaRegionsFunctionObject::
53 setTimeStepFaRegionsFunctionObject
71 scalar newDeltaT = regionDeltaT();
73 static label index = -1;
82 const_cast<Time&
>(
time_).setDeltaT(newDeltaT,
false);
99 if (!time_.controlDict().lookupOrDefault<
bool>(
"adjustTimeStep",
false))
102 <<
"Need to set 'adjustTimeStep' true to allow timestep control" 114 Foam::scalar Foam::functionObjects::setTimeStepFaRegionsFunctionObject::
137 const scalar regionFaMaxCo =
138 time_.controlDict().get<scalar>(
"regionFaMaxCo");
140 const scalar maxDeltaTFact = regionFaMaxCo/(Co + SMALL);
141 const scalar deltaTFact =
142 min(
min(maxDeltaTFact, 1.0 + 0.1*maxDeltaTFact), 1.2);
144 return deltaTFact*time_.deltaTValue();
147 return time_.deltaTValue();
void size(const label n)
Older name for setAddressableSize.
defineTypeNameAndDebug(ObukhovLength, 0)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
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.
#define forAll(list, i)
Loop across all elements in list.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for 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.
virtual scalar CourantNumber() const
Courant number of the region.
label timeIndex() const noexcept
Return 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)
List< word > wordList
List of word.
#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.