Time integration methods
Trixi.jl is compatible with the SciML ecosystem for ordinary differential equations. In particular, explicit Runge-Kutta methods from OrdinaryDiffEq.jl are tested extensively. Interesting classes of time integration schemes are
Some common options for solve
from OrdinaryDiffEq.jl are the following. Further documentation can be found in the SciML docs.
- If you use a fixed time step method like
CarpenterKennedy2N54
, you need to pass a time step asdt=...
. If you use aStepsizeCallback
, the value passed asdt=...
is irrelevant since it will be overwritten by theStepsizeCallback
. If you want to use an adaptive time step method such asSSPRK43
orRDPK3SpFSAL49
and still want to use CFL-based step size control via theStepsizeCallback
, you need to pass the keyword argumentadaptive=false
tosolve
. - You should usually set
save_everystep=false
. Otherwise, OrdinaryDiffEq.jl will (try to) save the numerical solution after every time step in RAM (until you run out of memory or start to swap). - You can set the maximal number of time steps via
maxiters=...
. - SSP methods and many low-storage methods from OrdinaryDiffEq.jl support
stage_limiter!
s andstep_limiter!
s, e.g.,PositivityPreservingLimiterZhangShu
from Trixi.jl. - If you start Julia with multiple threads and want to use them also in the time integration method from OrdinaryDiffEq.jl, you need to pass the keyword argument
thread=OrdinaryDiffEq.True()
to the algorithm, e.g.,RDPK3SpFSAL49(thread=OrdinaryDiffEq.True())
orCarpenterKennedy2N54(thread=OrdinaryDiffEq.True(), williamson_condition=false)
. For more information on using thread-based parallelism in Trixi.jl, please refer to Shared-memory parallelization with threads. - If you use error-based step size control (see also the section on error-based adaptive step sizes together with MPI, you need to pass
internalnorm=ode_norm
and you should passunstable_check=ode_unstable_check
to OrdinaryDiffEq'ssolve
, which are both included inode_default_options
.
If you use explicit Runge-Kutta methods from OrdinaryDiffEq.jl, the total number of rhs!
calls can be (slightly) bigger than the number of steps times the number of stages, e.g. to allow for interpolation (dense output), root-finding for continuous callbacks, and error-based time step control. In general, you often should not need to worry about this if you use Trixi.jl.