Skip to content

Commit e72c6dd

Browse files
Swith to fixed timestep (#2621)
1 parent 7891e28 commit e72c6dd

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

examples/dgmulti_1d/elixir_euler_shu_osher_gauss_shock_capturing.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ analysis_callback = AnalysisCallback(semi, interval = 100, uEltype = real(dg))
8484
save_solution = SaveSolutionCallback(interval = 100,
8585
solution_variables = cons2prim)
8686

87-
# handles the re-calculation of the maximum Δt after each time step
88-
stepsize_callback = StepsizeCallback(cfl = 0.13)
89-
9087
# collect all callbacks such that they can be passed to the ODE solver
91-
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution,
92-
stepsize_callback)
88+
callbacks = CallbackSet(summary_callback, analysis_callback, save_solution)
9389

9490
# ###############################################################################
9591
# # run the simulation
9692

93+
# We use a fixed time step here, as the wave speed estimate
94+
# (which aims to bound the largest eigenvalues from above)
95+
# in the stepsize callback produced sometimes unphysical values
9796
sol = solve(ode, SSPRK43(), adaptive = false;
98-
dt = 1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
97+
dt = 2e-3,
9998
callback = callbacks, ode_default_options()...)

test/test_dgmulti_1d.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,8 @@ end
5757
@trixi_testset "elixir_euler_shu_osher_gauss_shock_capturing.jl " begin
5858
@test_trixi_include(joinpath(EXAMPLES_DIR,
5959
"elixir_euler_shu_osher_gauss_shock_capturing.jl"),
60-
l2=[
61-
1.696712726264938,
62-
6.018435800027037,
63-
21.774221602026298
64-
],
65-
linf=[
66-
3.2229930998898952,
67-
10.702431261492814,
68-
38.37420027341893
69-
])
60+
l2=[1.6967163299095107, 6.018450129099115, 21.774272062049693],
61+
linf=[3.2229821729393437, 10.702811890261692, 38.37413018581744])
7062
# Ensure that we do not have excessive memory allocations
7163
# (e.g., from type instabilities)
7264
@test_allocations(Trixi.rhs!, semi, sol, 1000)

0 commit comments

Comments
 (0)