timestep_rkf

Module

Description

$Id$

** AUTOMATIC CPARAM.INC GENERATION ************************ CPARAM logical, parameter :: lcourant_dt = .false. ***********************************************************

Quick access

Variables:

a21, a31, a32, advance_substeps, after_substep_sum_time, b1, b2, b3, b4, beta_hat, c21, c31, c32, c41, c42, c43, calc_pencils_sub_cycle, dt_alpha_ts, dt_beta_hat, dt_decrease, dt_increase, dt_major, e1, e2, e3, e4, errcon, errdf, errmax, errmaxs, f1, farr, farraymin, gam, grow, itter, maxtry, ode, ode_timestep_first, ode_timestep_second, pde_energy_only, rk3, rkck, rkck3, rkl_coeff, safety, shrnk, split_update, stiff, substeps, swap, update_after_substep

Routines:

initialize_timestep(), time_step()

Needed modules

Variables

  • timestep/after_substep_sum_time [real,public/optional/default=0.0]
  • timestep/dt_decrease [real,private]
  • timestep/dt_increase [real,private]
  • timestep/errcon [real,private]
  • timestep/farraymin (mvar) [real,private]
  • timestep/rkck [private]
  • timestep/rkck3 [private]
  • timestep/safety [real,private/parameter/optional/default=0.95]
  • timestep/update_after_substep [private]

Subroutines and functions

subroutine  timestep/initialize_timestep()
Use :

messages (fatal_error(), warning()), general (rtoa())

Call to:

fatal_error(), warning(), pde(), impose_floors_ceilings(), update_ghosts(), advance_shear(), hydro_after_timestep(), magnetic_after_timestep(), energy_after_timestep(), special_after_timestep(), particles_special_after_dtsub()

subroutine  timestep/time_step(f, df, p)

Cash-Karp variant of Runge-Kutta-Fehlberg accurate to 5th order To use this, set itorder to 5.

22-jun-06/tony: coded 08-feb-24/fred: revisions based on high resolution simulations of SN-driven turbulence

notes: Courant time is insufficient to safeguard high Mach number turbulence with significant sources and sinks, and strong viscous stresses that are beyond the Courant analysis, hence tried RKF. Fifth order produces large time step than previous ISM methods used but the increased iterations over the pde results in longer total integration time. 3rd order has fewer overheads than default CFT method and some savings in redundant timestep calculations, providing the number of iterations of rkck can be minimised. Cash-Karp 5th order method uses dt_increase=-1/5 and dt_devrease=-1/4. dtinc and dtdec optimal around 0.5 for 3rd order scheme, but resolution sensitve, so worth testing on a new physical setup to optimise algorithm. Cash-Karp saftey=0.9 revised here to 0.95 as 0.9 overshoots, saftey<1 for dt_temp can actually reduce the timestep, so now omitted. “cons_frac_err” for relative error normalisation only method verified and sensitive to choices dt_epsi and dt_ratio. Sensitivity to eps_rkf very nonlinear and resolution dependent.

14-oct-24/fred: “rel_err” now reliable option for accuracy constraint.

“lreiterate=F”: implement solution with current dt and instead only adjust dt for the next time step. Timestep very similar and stable without reiterating.

Parameters:
  • f (,,*,*) [real,contiguous]

  • df (,,*,*) [real,contiguous]

  • p [pencil_case]

Use :

messages (warning())

Call to:

warning(), pde(), impose_floors_ceilings(), update_ghosts(), advance_shear(), hydro_after_timestep(), magnetic_after_timestep(), energy_after_timestep(), special_after_timestep(), particles_special_after_dtsub(), fatal_error()