pyrtid.forward.models.TimeParameters#
- class pyrtid.forward.models.TimeParameters(duration: float, dt_init: float, dt_min: Optional[float] = None, dt_max: Optional[float] = None, courant_factor: float = 1.0)[source]#
Bases:
objectClass defining the time parameters used in the simulation.
It also handles the variable timestep.
- Attributes
duration (float) – Desired duration of the simulation.Duration
dt (float) – Current timestep in seconds.
dt_init (float) – Initial timestep in seconds.
dt_min (Optional[float]) – Minimum timestep in seconds.
dt_max (Optional[float]) – Maximum timestep in seconds.
courant_factor (float) – The timestep is generally limited to some maximum value by the flow and transport models, to assure numerical stability. The Courant-Friedlichs- Lewy-Factor is a relaxation parameter for the maximum timestep. Reactive systems often allow to relax the (very restrictive) maximum timestep, imposed by the transport model. For values greater than 1, the timestep re- striction will be relaxed. On the contrary, the restriction will be tightened for values inferior to 1. Reactive systems often allow to relax the maximum timestep by a factor 5, 10 or even 20. Using this option, however, may be dangerous and possibly lead to failure of the model. Always test the results obtained against a case without this parameter set. The default is 1.0.
ldt (List[float]) – List of successive timesteps (in seconds) used in the forward modelling.
nts (int) – Number of timesteps in the simulation.
nt (int) – Number of times in the simulation (nts + 1).
nfpi (int) – Number of fixed point iterations used in the last time iteration.
lnfpi – List of the number of fixed point iterations used for each time iteration. This list should have the same length as ldt.
times (NDArrayFloat) – Array of times in second from 0 to t_max.”
- __init__(duration: float, dt_init: float, dt_min: Optional[float] = None, dt_max: Optional[float] = None, courant_factor: float = 1.0) None[source]#
Initialize the instance.
Methods definition
- get_dt_max_cfl(model: ForwardModel, time_index: int) float[source]#
Get the maximum timestep to respect the CFL condition.