stellaGK / stella

stella is a flux tube gyrokinetic code for micro-stability and turbulence simulations of strongly magnetised plasma.
https://stellagk.github.io/stella/
Other
21 stars 10 forks source link

Cfl updates #102

Closed HanneThienpondt closed 1 year ago

HanneThienpondt commented 1 year ago

This fix closes issue #33; I've tested and confirmed (by forcing restart_time_step to .true.) that if the timestep needs be reset, the changes to g and phi are discarded and the timestep is re-done (for both flip_flop = .false. and flip_flop = .true.)

If code_dt>cfl_dt*cfl_cushion_upper or code_dt<cfl_dt*cfl_cushion_lower, set code_dt to cfl_dt*cfl_cushion_middle. If we set cfl_cushion_upper=cfl_cushion and cfl_cushion_middle=cfl_cushion_upper/delt_adjust, then the behaviour is the same as before. If cfl_cushion_lower is very low, the code_dt will never be increased. Regardless, code_dt will never increase above delt_max=code_dt_max.