36namespace functionObjects
51Foam::functionObjects::
52setTimeStepFaRegionsFunctionObject::
53setTimeStepFaRegionsFunctionObject
71 scalar newDeltaT = regionDeltaT();
73 static label index = -1;
75 if ((time_.timeIndex() != index) && (newDeltaT < time_.deltaTValue()))
79 index = time_.timeIndex();
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"
114Foam::scalar Foam::functionObjects::setTimeStepFaRegionsFunctionObject::
123 const auto* regionFa = time_.cfindObject<
regionFaModel>(names[i]);
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();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base-class for Time/database function objects.
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.
Virtual base class for function objects with a reference to Time.
Base class for area region models.
virtual scalar CourantNumber() const
Courant number of the region.
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.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.