Go to the documentation of this file.
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::
135 if (
names.size() > 0)
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();
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
const Time & time_
Reference to the time database.
virtual bool adjustTimeStep()
Called at the end of Time::adjustDeltaT() if adjustTime is true.
Virtual base class for function objects with a reference to Time.
virtual scalar CourantNumber() const
Courant number of the region.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
scalar deltaTValue() const noexcept
Return time step value.
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Write does nothing.
label timeIndex() const noexcept
Return current time index.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
virtual bool execute()
Execute does nothing.
errorManipArg< error, int > exit(error &err, const int errNo=1)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Base class for area region models.
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)