Skip to content

Commit

Permalink
Adapt parameters in elixirs to stabilize simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Jul 9, 2024
1 parent ea2dd3a commit c1d0c5e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ basis = LobattoLegendreBasis(3)
limiter_idp = SubcellLimiterIDP(equations, basis;
local_twosided_variables_cons = ["rho"],
local_onesided_variables_nonlinear = [(Trixi.entropy_math,
max)])
max)],
max_iterations_newton = 70,
newton_tolerances = (1.0e-13, 1.0e-14))
volume_integral = VolumeIntegralSubcellLimiting(limiter_idp;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ basis = LobattoLegendreBasis(3)
limiter_idp = SubcellLimiterIDP(equations, basis;
local_twosided_variables_cons = ["rho"],
local_onesided_variables_nonlinear = [(Trixi.entropy_guermond_etal,
min)])
min)],
max_iterations_newton = 40)
volume_integral = VolumeIntegralSubcellLimiting(limiter_idp;
volume_flux_dg = volume_flux,
volume_flux_fv = surface_flux)
Expand All @@ -53,7 +54,7 @@ solver = DGSEM(basis, surface_flux, volume_integral)
coordinates_min = (-2.0, -2.0)
coordinates_max = (2.0, 2.0)
mesh = TreeMesh(coordinates_min, coordinates_max,
initial_refinement_level = 3,
initial_refinement_level = 5,
n_cells_max = 100_000)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand All @@ -76,7 +77,7 @@ save_solution = SaveSolutionCallback(interval = 1000,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.6)
stepsize_callback = StepsizeCallback(cfl = 0.5)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ save_solution = SaveSolutionCallback(interval = 600,
save_final_solution = true,
solution_variables = cons2prim)

stepsize_callback = StepsizeCallback(cfl = 0.5)
stepsize_callback = StepsizeCallback(cfl = 0.4)

callbacks = CallbackSet(summary_callback,
analysis_callback,
Expand Down
36 changes: 18 additions & 18 deletions test/test_tree_2d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,16 +349,16 @@ end
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_blast_wave_sc_subcell_nonperiodic.jl"),
l2=[
0.3221177942225801,
0.1798478357478982,
0.1798364616438908,
0.6136884131056267,
0.3221078812528291,
0.17985175694043076,
0.17983453493705628,
0.6136916718599121,
],
linf=[
1.343766644801395,
1.1749593109683463,
1.1747613085307178,
2.4216006041018785,
1.343237509126809,
1.1747101056222315,
1.174585608472406,
2.4216027326405487,
],
tspan=(0.0, 0.5),
initial_refinement_level=4,
Expand Down Expand Up @@ -404,16 +404,16 @@ end
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_euler_sedov_blast_wave_sc_subcell.jl"),
l2=[
0.41444427153173785,
0.1460669409661223,
0.14606693069201596,
0.6168046457461059,
0.4178958563460168,
0.14704017244055603,
0.14704017244056197,
0.6167420173740439,
],
linf=[
1.5720584643579567,
0.7946656826861964,
0.7946656525739751,
6.455520291414711,
1.6101346845584459,
0.8109759818235058,
0.8109759818213118,
6.451566849789292,
],
tspan=(0.0, 1.0),
initial_refinement_level=4,
Expand All @@ -428,8 +428,8 @@ end
# Run with coverage takes 6 time steps.
@test startswith(lines[end], "6")
else
# Run without coverage takes 89 time steps.
@test startswith(lines[end], "89")
# Run without coverage takes 1089 time steps.
@test startswith(lines[end], "108")
end
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand Down
20 changes: 10 additions & 10 deletions test/test_tree_2d_eulermulti.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ EXAMPLES_DIR = pkgdir(Trixi, "examples", "tree_2d_dgsem")
@test_trixi_include(joinpath(EXAMPLES_DIR,
"elixir_eulermulti_shock_bubble_shockcapturing_subcell_minmax.jl"),
l2=[
73.10860950390489,
1.4599090197303102,
57176.23978426408,
0.17812910616624406,
0.010123079422717837,
73.41054363926742,
1.5072038797716156,
57405.58964098063,
0.17877099207437225,
0.010085388785440972,
],
linf=[
214.50568817511956,
25.40392579616452,
152862.41011222568,
0.564195553101797,
0.0956331651771212,
213.59140793740318,
24.57625853486584,
152498.21319871658,
0.5911106543157919,
0.09936092838440383,
],
initial_refinement_level=3,
tspan=(0.0, 0.001))
Expand Down

0 comments on commit c1d0c5e

Please sign in to comment.