Computes a time step given such that when a source time depenedent source is added to the value, the value in question does not become negative. An example of this is adding radiation loss to the energy of a fluid. If the time step is too large the fluid energy can become negative, however a smaller time step will allow the fluid to radiate energy until radiated energy is negligible and then the time step will rise again. The positiveValue restriction as defined the following way. \(S\) is the source term, \(E\) is the energy, \(B_{v}\) is the lowest value that we would like \(E\) to be, \(\Delta t\) is the time step, \(c\) is a coefficient which is generally used to alter the sign of the source term and \(\alpha\) is a reduction factor which scales the time step. The time step is given below
The time step restriction is derived from simple considerations
Which suggests that
So if we want to make sure we do not subtract all the energy off in one time step then \(\Delta t\) would be chosen as
We introduce the factor \(\alpha\) and \(c\) to provide more flexibility in determining how the restriction should be applied and the relative sign of the source S. The restriction is then given by the following relation.
In the case where \(c\,S>0\) no restriction is applied to \(\Delta t\).
alpha
(float, required)positiveIndex
(integer, required)sourceIndex
(integer, required)basementValue
(float, required)coefficient
(float, required)numComponents
(integer, optional)The following data structures should be specified to the timeStepRestrictionUpdater (1d, 2d, 3d) that calls the positiveValue Time Step Restriction.
in
(string vector, required)1st variable
2nd variable
The following block demonstrates positiveValue used in combination with timeStepRestrictionUpdater (1d, 2d, 3d) to compute a time step that keeps the energy of the fluid (component 4 of input variable q) positive:
<Updater timeStepRestrictionEnerngy>
kind = timeStepRestrictionUpdater2d
in = [q, reactionEnergy]
timeSteps = [diffDT4]
onGrid = domain
restrictions = [positiveSource]
courantCondition = 1.0
<TimeStepRestriction positiveSource>
kind = positiveValue2d
positiveIndex = 4
sourceIndex = 0
alpha = 0.01
coefficient = 1.0
basementValue = BASEMENT_ENERGY
includeInTimeStep = false
</TimeStepRestriction>
</Updater>