From b37f8997eaa912b3dbfab13828f8c7d7c66a264c Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Mon, 1 Jul 2024 20:06:24 -0300 Subject: [PATCH] EVOLUTION: Introduce limiter for timestep jump. To prevent solution instability caused by sudden increases in the timestep, such as when the maximum refinement level decreases, a new parameter 'dt_jump_factor' has been introduced. This parameter controls the allowable increase in the timestep. By default, 'dt_jump_factor' is set to 1.05, permitting a maximum increase of 5% from the previous timestep. Signed-off-by: Grzegorz Kowal --- sources/evolution.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/evolution.F90 b/sources/evolution.F90 index 8d32aac..4de16dd 100644 --- a/sources/evolution.F90 +++ b/sources/evolution.F90 @@ -76,6 +76,7 @@ module evolution real(kind=8) , save :: dte = 0.0d+00 real(kind=8) , save :: dtp = huge(dt) ! dt for precise snapshots real(kind=8) , save :: dtsafe = 1.0d-02 + real(kind=8) , save :: facjmp = 1.05d+00 ! the absolute and relative tolerances, limiting factors, the maximum error, ! the maximum number of passes for the adaptive step, @@ -197,6 +198,7 @@ module evolution call get_parameter("minimum_factor" , facmin) call get_parameter("maximum_factor" , facmax) call get_parameter("dt_safe_factor" , dtsafe) + call get_parameter("dt_jump_factor" , facjmp) ! select the integration method, check the correctness of the integration ! parameters and adjust the CFL coefficient if necessary @@ -1046,6 +1048,7 @@ module evolution call print_parameter(verbose, "time advance", name_int) call print_parameter(verbose, "no. of registers", registers) call print_parameter(verbose, "CFL coefficient", cfl) + call print_parameter(verbose, "timestep jump factor", facjmp) if (magnetized) then call print_parameter(verbose, "GLM alpha coefficient", glm_alpha) end if @@ -1459,7 +1462,7 @@ module evolution dth = dx_min / max(cmax & + 2.0d+00 * max(viscosity, resistivity) / dx_min, eps) - dt = cfl * dth + dt = min(facjmp * dt, cfl * dth) dt = min(dt, dtp) if (error_control) dt = min(dt, dte)