diff --git a/.travis.yml b/.travis.yml index 793cabab61..09e599437e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ env: - TRIXI_TEST=3D - TRIXI_TEST=3D_OLD - TRIXI_TEST=paper-self-gravitating-gas-dynamics + - TRIXI_TEST=paper-self-gravitating-gas-dynamics-old - TRIXI_TEST=parallel_2d - TRIXI_TEST=1D - TRIXI_TEST=misc diff --git a/examples/1d/elixir_advection_amr.jl b/examples/1d/elixir_advection_amr.jl index 5720acc0b4..cf82f36323 100644 --- a/examples/1d/elixir_advection_amr.jl +++ b/examples/1d/elixir_advection_amr.jl @@ -40,7 +40,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/1d/elixir_advection_basic.jl b/examples/1d/elixir_advection_basic.jl index a8cf2a1d5d..3451ee37c9 100644 --- a/examples/1d/elixir_advection_basic.jl +++ b/examples/1d/elixir_advection_basic.jl @@ -10,6 +10,13 @@ equations = LinearScalarAdvectionEquation1D(advectionvelocity) initial_condition = initial_condition_convergence_test +# you can either use a single function to impose the BCs weakly in all +# 1*ndims == 2 directions or you can pass a tuple containing BCs for +# each direction +# Note: "boundary_condition_periodic" indicates that it is a periodic boundary and can be omitted on +# fully periodic domains. Here, however, it is included to allow easy override during testing +boundary_conditions = boundary_condition_periodic + surface_flux = flux_lax_friedrichs solver = DGSEM(3, surface_flux) @@ -17,10 +24,12 @@ coordinates_min = (-1,) coordinates_max = ( 1,) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level=4, - n_cells_max=30_000) + n_cells_max=30_000, + periodicity=true) -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions=boundary_conditions) ############################################################################### @@ -31,7 +40,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -55,5 +66,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/1d/elixir_euler_blast_wave_shockcapturing.jl b/examples/1d/elixir_euler_blast_wave_shockcapturing.jl index 85daf873f6..a2a6b921a9 100644 --- a/examples/1d/elixir_euler_blast_wave_shockcapturing.jl +++ b/examples/1d/elixir_euler_blast_wave_shockcapturing.jl @@ -40,7 +40,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=0.8) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=0.8) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -60,5 +62,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/1d/elixir_euler_density_wave.jl b/examples/1d/elixir_euler_density_wave.jl new file mode 100644 index 0000000000..e01c8a59d5 --- /dev/null +++ b/examples/1d/elixir_euler_density_wave.jl @@ -0,0 +1,57 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations +equations = CompressibleEulerEquations1D(1.4) + +initial_condition = initial_condition_density_wave + +surface_flux = flux_central +solver = DGSEM(5, surface_flux) + +coordinates_min = -1 +coordinates_max = 1 +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=30_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 2.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.8) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 2000 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=stepsize_callback(ode), + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/1d/elixir_euler_ec.jl b/examples/1d/elixir_euler_ec.jl index 81ee1a0143..2988ed119c 100644 --- a/examples/1d/elixir_euler_ec.jl +++ b/examples/1d/elixir_euler_ec.jl @@ -30,7 +30,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -53,5 +55,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/1d/elixir_euler_nonperiodic.jl b/examples/1d/elixir_euler_nonperiodic.jl index badfd4404b..e6741d6709 100644 --- a/examples/1d/elixir_euler_nonperiodic.jl +++ b/examples/1d/elixir_euler_nonperiodic.jl @@ -42,7 +42,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/1d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl b/examples/1d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl new file mode 100644 index 0000000000..69a831fc2a --- /dev/null +++ b/examples/1d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl @@ -0,0 +1,78 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations1D(1.4) + +initial_condition = initial_condition_sedov_blast_wave + +surface_flux = flux_lax_friedrichs +volume_flux = flux_chandrashekar +basis = LobattoLegendreBasis(3) +shock_indicator_variable = density_pressure +indicator_sc = IndicatorHennemannGassner(equations, basis, + alpha_max=0.5, + alpha_min=0.001, + alpha_smooth=true, + variable=shock_indicator_variable) +volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; + volume_flux_dg=volume_flux, + volume_flux_fv=surface_flux) +solver = DGSEM(basis, surface_flux, volume_integral) + +coordinates_min = (-2,) +coordinates_max = ( 2,) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=6, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 12.5) +ode = semidiscretize(semi, tspan) + +amr_indicator = IndicatorHennemannGassner(semi, + alpha_max=0.5, + alpha_min=0.001, + alpha_smooth=true, + variable=density_pressure) +amr_controller = ControllerThreeLevel(semi, amr_indicator, + base_level=4, + max_level=6, max_threshold=0.01) +amr_callback = AMRCallback(semi, amr_controller, + interval=5, + adapt_initial_condition=true, + adapt_initial_condition_only_refine=true) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync: increase value with new timestep size calculation? +stepsize_callback = StepsizeCallback(cfl=0.3) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 1000 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=stepsize_callback(ode), + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/1d/elixir_euler_source_terms.jl b/examples/1d/elixir_euler_source_terms.jl index 4a3fc0a7d9..1bbc7af393 100644 --- a/examples/1d/elixir_euler_source_terms.jl +++ b/examples/1d/elixir_euler_source_terms.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/1d/elixir_euler_weak_blast_wave_shockcapturing.jl b/examples/1d/elixir_euler_weak_blast_wave_shockcapturing.jl new file mode 100644 index 0000000000..894963501e --- /dev/null +++ b/examples/1d/elixir_euler_weak_blast_wave_shockcapturing.jl @@ -0,0 +1,66 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations1D(1.4) + +initial_condition = initial_condition_weak_blast_wave + +surface_flux = flux_lax_friedrichs +volume_flux = flux_kennedy_gruber +basis = LobattoLegendreBasis(3) +indicator_sc = IndicatorHennemannGassner(equations, basis, + alpha_max=0.5, + alpha_min=0.001, + alpha_smooth=true, + variable=density_pressure) +volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; + volume_flux_dg=volume_flux, + volume_flux_fv=surface_flux) +solver = DGSEM(basis, surface_flux, volume_integral) + +coordinates_min = -2 +coordinates_max = 2 +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=5, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 1.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/1d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml b/examples/1d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml index 20f75d8ec4..2376108f11 100644 --- a/examples/1d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml +++ b/examples/1d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml @@ -14,9 +14,9 @@ t_end = 12.5 # Solver solver = "dg" polydeg = 3 -cfl = 0.5 +cfl = 0.3 n_steps_max = 10000 -analysis_interval = 100 +analysis_interval = 1000 volume_integral_type = "shock_capturing" shock_indicator_variable = "density_pressure" shock_alpha_min = 0.001 diff --git a/examples/2d/elixir_advection_amr.jl b/examples/2d/elixir_advection_amr.jl index e19739f22f..3eb6ed1b5c 100644 --- a/examples/2d/elixir_advection_amr.jl +++ b/examples/2d/elixir_advection_amr.jl @@ -41,7 +41,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_advection_amr_nonperiodic.jl b/examples/2d/elixir_advection_amr_nonperiodic.jl new file mode 100644 index 0000000000..50a360aff5 --- /dev/null +++ b/examples/2d/elixir_advection_amr_nonperiodic.jl @@ -0,0 +1,78 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the linear advection equation + +advectionvelocity = (1.0, 1.0) +# advectionvelocity = (0.2, -0.3) +equations = LinearScalarAdvectionEquation2D(advectionvelocity) + +initial_condition = initial_condition_gauss + +# you can either use a single function to impose the BCs weakly in all +# 2*ndims == 4 directions or you can pass a tuple containing BCs for each direction +boundary_conditions = boundary_condition_gauss + +surface_flux = flux_lax_friedrichs +solver = DGSEM(3, surface_flux) + +coordinates_min = (-5, -5) +coordinates_max = ( 5, 5) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=4, + n_cells_max=30_000, + periodicity=false) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions=boundary_conditions) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 5.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable=first), + base_level=4, + med_level=5, med_threshold=0.1, + max_level=6, max_threshold=0.6) +amr_callback = AMRCallback(semi, amr_controller, + interval=5, + adapt_initial_condition=true, + adapt_initial_condition_only_refine=true) + +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval, + extra_analysis_integrals=(entropy,)) + +# TODO: Taal decide, first AMR or save solution etc. +callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback); + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=stepsize_callback(ode), + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/2d/elixir_advection_basic.jl b/examples/2d/elixir_advection_basic.jl index 11b58988fd..e10fed5394 100644 --- a/examples/2d/elixir_advection_basic.jl +++ b/examples/2d/elixir_advection_basic.jl @@ -11,17 +11,27 @@ equations = LinearScalarAdvectionEquation2D(advectionvelocity) initial_condition = initial_condition_convergence_test +# you can either use a single function to impose the BCs weakly in all +# 1*ndims == 2 directions or you can pass a tuple containing BCs for +# each direction +# Note: "boundary_condition_periodic" indicates that it is a periodic boundary and can be omitted on +# fully periodic domains. Here, however, it is included to allow easy override during testing +boundary_conditions = boundary_condition_periodic + surface_flux = flux_lax_friedrichs -solver = DGSEM(3, surface_flux) +polydeg = 3 +solver = DGSEM(polydeg, surface_flux) coordinates_min = (-1, -1) coordinates_max = ( 1, 1) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level=4, - n_cells_max=30_000) + n_cells_max=30_000, + periodicity=true) -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions=boundary_conditions) ############################################################################### @@ -32,7 +42,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -57,5 +69,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_advection_mortar.jl b/examples/2d/elixir_advection_mortar.jl index a2fdad4b7f..4ddb935d7e 100644 --- a/examples/2d/elixir_advection_mortar.jl +++ b/examples/2d/elixir_advection_mortar.jl @@ -36,7 +36,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=2.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=2.0) +stepsize_callback = StepsizeCallback(cfl=1.0) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_advection_timeintegration.jl b/examples/2d/elixir_advection_timeintegration.jl index 41558ff5bb..cc770c4e49 100644 --- a/examples/2d/elixir_advection_timeintegration.jl +++ b/examples/2d/elixir_advection_timeintegration.jl @@ -32,7 +32,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -53,7 +55,8 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation # sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), -sol = Trixi.solve(ode, Trixi.SimpleAlgorithm2N45(), +ode_algorithm = Trixi.CarpenterKennedy2N54() +sol = Trixi.solve(ode, ode_algorithm, dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_blast_wave_shockcapturing.jl b/examples/2d/elixir_euler_blast_wave_shockcapturing.jl index f3222ef78e..8d9c449329 100644 --- a/examples/2d/elixir_euler_blast_wave_shockcapturing.jl +++ b/examples/2d/elixir_euler_blast_wave_shockcapturing.jl @@ -40,7 +40,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -60,5 +62,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_blast_wave_shockcapturing_amr.jl b/examples/2d/elixir_euler_blast_wave_shockcapturing_amr.jl index 695b581377..d04f56cf95 100644 --- a/examples/2d/elixir_euler_blast_wave_shockcapturing_amr.jl +++ b/examples/2d/elixir_euler_blast_wave_shockcapturing_amr.jl @@ -53,7 +53,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_blob_shockcapturing_amr.jl b/examples/2d/elixir_euler_blob_shockcapturing_amr.jl index 99c8114773..8fbc394de1 100644 --- a/examples/2d/elixir_euler_blob_shockcapturing_amr.jl +++ b/examples/2d/elixir_euler_blob_shockcapturing_amr.jl @@ -58,7 +58,8 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=0.3) +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_blob_shockcapturing_mortar.jl b/examples/2d/elixir_euler_blob_shockcapturing_mortar.jl index 10f61a3daa..ee71102212 100644 --- a/examples/2d/elixir_euler_blob_shockcapturing_mortar.jl +++ b/examples/2d/elixir_euler_blob_shockcapturing_mortar.jl @@ -14,7 +14,7 @@ volume_flux = flux_chandrashekar basis = LobattoLegendreBasis(3) indicator_sc = IndicatorHennemannGassner(equations, basis, - alpha_max=0.5, + alpha_max=0.05, alpha_min=0.0001, alpha_smooth=true, variable=pressure) @@ -29,6 +29,7 @@ coordinates_min = (-32, -32) coordinates_max = ( 32, 32) refinement_patches = ( (type="box", coordinates_min=(-40, -5), coordinates_max=(40, 5)), + (type="box", coordinates_min=(-40, -5), coordinates_max=(40, 5)), ) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level=4, @@ -46,7 +47,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=0.7) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=0.7) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -65,6 +68,7 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_density_wave.jl b/examples/2d/elixir_euler_density_wave.jl index 90ba5c2b47..d68cfc7604 100644 --- a/examples/2d/elixir_euler_density_wave.jl +++ b/examples/2d/elixir_euler_density_wave.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.6) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_ec.jl b/examples/2d/elixir_euler_ec.jl index fd5321d19f..2167af8cf1 100644 --- a/examples/2d/elixir_euler_ec.jl +++ b/examples/2d/elixir_euler_ec.jl @@ -30,7 +30,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_khi_shockcapturing.jl b/examples/2d/elixir_euler_khi_shockcapturing.jl index 955a816208..e58d111454 100644 --- a/examples/2d/elixir_euler_khi_shockcapturing.jl +++ b/examples/2d/elixir_euler_khi_shockcapturing.jl @@ -40,9 +40,11 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.7) -save_solution = SaveSolutionCallback(interval=100, +save_solution = SaveSolutionCallback(interval=20, save_initial_solution=true, save_final_solution=true, solution_variables=:primitive) @@ -59,6 +61,7 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_khi_shockcapturing_amr.jl b/examples/2d/elixir_euler_khi_shockcapturing_amr.jl index 2e72e64616..d837c46d12 100644 --- a/examples/2d/elixir_euler_khi_shockcapturing_amr.jl +++ b/examples/2d/elixir_euler_khi_shockcapturing_amr.jl @@ -57,7 +57,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.7) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -76,6 +78,7 @@ callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_nonperiodic.jl b/examples/2d/elixir_euler_nonperiodic.jl index a8daf77eee..fc4a185059 100644 --- a/examples/2d/elixir_euler_nonperiodic.jl +++ b/examples/2d/elixir_euler_nonperiodic.jl @@ -43,7 +43,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl b/examples/2d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl index 30106edffc..4fa873d9d4 100644 --- a/examples/2d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl +++ b/examples/2d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl @@ -53,7 +53,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.4) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -73,5 +75,5 @@ callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_source_terms.jl b/examples/2d/elixir_euler_source_terms.jl index 7ea842280f..f8bf310368 100644 --- a/examples/2d/elixir_euler_source_terms.jl +++ b/examples/2d/elixir_euler_source_terms.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_vortex.jl b/examples/2d/elixir_euler_vortex.jl index 568e14ba0b..7447f5baa2 100644 --- a/examples/2d/elixir_euler_vortex.jl +++ b/examples/2d/elixir_euler_vortex.jl @@ -29,7 +29,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -56,5 +58,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_euler_vortex_amr.jl b/examples/2d/elixir_euler_vortex_amr.jl index b079b0496a..2eb0db5362 100644 --- a/examples/2d/elixir_euler_vortex_amr.jl +++ b/examples/2d/elixir_euler_vortex_amr.jl @@ -98,7 +98,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.1) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.1) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=50, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_vortex_mortar.jl b/examples/2d/elixir_euler_vortex_mortar.jl index 735f8f1216..b222f295e2 100644 --- a/examples/2d/elixir_euler_vortex_mortar.jl +++ b/examples/2d/elixir_euler_vortex_mortar.jl @@ -32,7 +32,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_vortex_mortar_shockcapturing.jl b/examples/2d/elixir_euler_vortex_mortar_shockcapturing.jl index ac9f7369a9..3c612bf7e7 100644 --- a/examples/2d/elixir_euler_vortex_mortar_shockcapturing.jl +++ b/examples/2d/elixir_euler_vortex_mortar_shockcapturing.jl @@ -43,7 +43,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.4) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_vortex_mortar_split.jl b/examples/2d/elixir_euler_vortex_mortar_split.jl index db390a1d09..dbea35bcb7 100644 --- a/examples/2d/elixir_euler_vortex_mortar_split.jl +++ b/examples/2d/elixir_euler_vortex_mortar_split.jl @@ -33,7 +33,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_vortex_shockcapturing.jl b/examples/2d/elixir_euler_vortex_shockcapturing.jl index 75cebc8a2b..bfb9f8ba4b 100644 --- a/examples/2d/elixir_euler_vortex_shockcapturing.jl +++ b/examples/2d/elixir_euler_vortex_shockcapturing.jl @@ -39,7 +39,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.4) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_euler_weak_blast_wave_shockcapturing.jl b/examples/2d/elixir_euler_weak_blast_wave_shockcapturing.jl index 10cb883dcf..9bf8c9265e 100644 --- a/examples/2d/elixir_euler_weak_blast_wave_shockcapturing.jl +++ b/examples/2d/elixir_euler_weak_blast_wave_shockcapturing.jl @@ -40,7 +40,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_hyp_diff_harmonic_nonperiodic.jl b/examples/2d/elixir_hyp_diff_harmonic_nonperiodic.jl index 3f0ab22e3a..977691954a 100644 --- a/examples/2d/elixir_hyp_diff_harmonic_nonperiodic.jl +++ b/examples/2d/elixir_hyp_diff_harmonic_nonperiodic.jl @@ -37,7 +37,9 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_hyp_diff_llf.jl b/examples/2d/elixir_hyp_diff_llf.jl index 956f25c24e..a34a326c91 100644 --- a/examples/2d/elixir_hyp_diff_llf.jl +++ b/examples/2d/elixir_hyp_diff_llf.jl @@ -34,7 +34,7 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=2.4) +stepsize_callback = StepsizeCallback(cfl=1.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -54,6 +54,6 @@ callbacks = CallbackSet(summary_callback, steady_state_callback, stepsize_callba ############################################################################### # run the simulation -sol = Trixi.solve(ode, Trixi.HypDiffN3Erk3Sstar25(), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = Trixi.solve(ode, Trixi.HypDiffN3Erk3Sstar52(), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_hyp_diff_nonperiodic.jl b/examples/2d/elixir_hyp_diff_nonperiodic.jl index 9cbdac6405..31c61d85c3 100644 --- a/examples/2d/elixir_hyp_diff_nonperiodic.jl +++ b/examples/2d/elixir_hyp_diff_nonperiodic.jl @@ -41,7 +41,9 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_hyp_diff_upwind.jl b/examples/2d/elixir_hyp_diff_upwind.jl index 0977100c03..087220ff18 100644 --- a/examples/2d/elixir_hyp_diff_upwind.jl +++ b/examples/2d/elixir_hyp_diff_upwind.jl @@ -35,7 +35,9 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_mhd_alfven_wave.jl b/examples/2d/elixir_mhd_alfven_wave.jl index e526df3e68..2eeaa15eb1 100644 --- a/examples/2d/elixir_mhd_alfven_wave.jl +++ b/examples/2d/elixir_mhd_alfven_wave.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.2) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.2) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, @@ -55,5 +57,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/2d/elixir_mhd_alfven_wave_mortar.jl b/examples/2d/elixir_mhd_alfven_wave_mortar.jl index 875c550502..cde53b740c 100644 --- a/examples/2d/elixir_mhd_alfven_wave_mortar.jl +++ b/examples/2d/elixir_mhd_alfven_wave_mortar.jl @@ -34,7 +34,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.2) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.2) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, diff --git a/examples/2d/elixir_mhd_blast_wave_shockcapturing_amr.jl b/examples/2d/elixir_mhd_blast_wave_shockcapturing_amr.jl index 057fa0c453..71123d8101 100644 --- a/examples/2d/elixir_mhd_blast_wave_shockcapturing_amr.jl +++ b/examples/2d/elixir_mhd_blast_wave_shockcapturing_amr.jl @@ -2,11 +2,6 @@ using OrdinaryDiffEq using Trixi -## -# OBS! This crashes due to an issue with the combination of shockcapturing + non-conservative terms -# It can be run if "have_nonconservative_terms(::IdealGlmMhdEquations2D) = Val(true)" is set -# to false in the ideal_glm_mhd.jl - ############################################################################### # semidiscretization of the compressible ideal GLM-MHD equations @@ -48,17 +43,18 @@ summary_callback = SummaryCallback() amr_indicator = IndicatorHennemannGassner(semi, alpha_max=0.5, alpha_min=0.001, - alpha_smooth=true, + alpha_smooth=false, variable=density_pressure) amr_controller = ControllerThreeLevel(semi, amr_indicator, base_level=4, - max_level =7, max_threshold=0.01) + max_level =6, max_threshold=0.01) amr_callback = AMRCallback(semi, amr_controller, - interval=5, + interval=7, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_mhd_ec.jl b/examples/2d/elixir_mhd_ec.jl index 29245c014c..8f386e963d 100644 --- a/examples/2d/elixir_mhd_ec.jl +++ b/examples/2d/elixir_mhd_ec.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, diff --git a/examples/2d/elixir_mhd_orszag_tang_shockcapturing_amr.jl b/examples/2d/elixir_mhd_orszag_tang_shockcapturing_amr.jl index 9250891088..2ef9d9a146 100644 --- a/examples/2d/elixir_mhd_orszag_tang_shockcapturing_amr.jl +++ b/examples/2d/elixir_mhd_orszag_tang_shockcapturing_amr.jl @@ -2,11 +2,6 @@ using OrdinaryDiffEq using Trixi -## -# OBS! This crashes due to an issue with the combination of shockcapturing + non-conservative terms -# It can be run if "have_nonconservative_terms(::IdealGlmMhdEquations2D) = Val(true)" is set -# to false in the ideal_glm_mhd.jl - ############################################################################### # semidiscretization of the compressible ideal GLM-MHD equations gamma = 5/3 @@ -48,17 +43,18 @@ summary_callback = SummaryCallback() amr_indicator = IndicatorHennemannGassner(semi, alpha_max=0.5, alpha_min=0.001, - alpha_smooth=true, + alpha_smooth=false, variable=density_pressure) amr_controller = ControllerThreeLevel(semi, amr_indicator, base_level=4, max_level =6, max_threshold=0.01) amr_callback = AMRCallback(semi, amr_controller, - interval=5, + interval=6, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.25) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/elixir_mhd_rotor_shockcapturing_amr.jl b/examples/2d/elixir_mhd_rotor_shockcapturing_amr.jl index 18b429078f..bd2e4421f6 100644 --- a/examples/2d/elixir_mhd_rotor_shockcapturing_amr.jl +++ b/examples/2d/elixir_mhd_rotor_shockcapturing_amr.jl @@ -2,10 +2,6 @@ using OrdinaryDiffEq using Trixi -## -# OBS! This crashes due to an issue with the combination of shockcapturing + non-conservative terms -# It can be run if "have_nonconservative_terms(::IdealGlmMhdEquations2D) = Val(true)" is set -# to false in the ideal_glm_mhd.jl ############################################################################### # semidiscretization of the compressible ideal GLM-MHD equations @@ -15,7 +11,8 @@ initial_condition = initial_condition_rotor surface_flux = flux_lax_friedrichs volume_flux = flux_derigs_etal -basis = LobattoLegendreBasis(4) +polydeg = 4 +basis = LobattoLegendreBasis(polydeg) indicator_sc = IndicatorHennemannGassner(equations, basis, alpha_max=0.5, alpha_min=0.001, @@ -47,17 +44,18 @@ summary_callback = SummaryCallback() amr_indicator = IndicatorHennemannGassner(semi, alpha_max=0.5, alpha_min=0.001, - alpha_smooth=true, + alpha_smooth=false, variable=density_pressure) amr_controller = ControllerThreeLevel(semi, amr_indicator, base_level=4, max_level =6, max_threshold=0.01) amr_callback = AMRCallback(semi, amr_controller, - interval=5, + interval=6, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=0.95) +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.2) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/2d/parameters_euler_blob_shockcapturing_amr.toml b/examples/2d/parameters_euler_blob_shockcapturing_amr.toml index d2b631147f..51566d2b1b 100644 --- a/examples/2d/parameters_euler_blob_shockcapturing_amr.toml +++ b/examples/2d/parameters_euler_blob_shockcapturing_amr.toml @@ -14,7 +14,7 @@ t_end = 8.0 # Solver solver = "dg" polydeg = 4 -cfl = 0.3 +cfl = 0.2 n_steps_max = 15000 analysis_interval = 100 shock_indicator_variable = "pressure" diff --git a/examples/2d/parameters_euler_blob_shockcapturing_mortar.toml b/examples/2d/parameters_euler_blob_shockcapturing_mortar.toml index abc4d466ad..c06f02f2f7 100644 --- a/examples/2d/parameters_euler_blob_shockcapturing_mortar.toml +++ b/examples/2d/parameters_euler_blob_shockcapturing_mortar.toml @@ -2,7 +2,7 @@ # Simulation ndims = 2 equations = "CompressibleEulerEquations" -gamma = 1.66667 +gamma = 1.6666666666666667 # equations = "LinearScalarAdvectionEquation" # advectionvelocity = [1.0, 1.0] # Need only for linarscalaradvection # initial_condition = "initial_condition_convergence_test" diff --git a/examples/2d/parameters_euler_khi_shockcapturing_amr.toml b/examples/2d/parameters_euler_khi_shockcapturing_amr.toml index efde7d789f..62962775e5 100644 --- a/examples/2d/parameters_euler_khi_shockcapturing_amr.toml +++ b/examples/2d/parameters_euler_khi_shockcapturing_amr.toml @@ -45,11 +45,13 @@ amr_indicator = "khi" amr_interval = 1 amr_alpha_max = 1.0 #0.0031 amr_alpha_min = 0.0001 +adapt_initial_condition = true +adapt_initial_condition_only_refine = true #################################################################################################### # I/O # save_initial_solution = false -solution_interval = 20 +solution_interval = 100 solution_variables = "primitive" restart_interval = 1000 output_format = "hdf5" diff --git a/examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml b/examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml index 233aa1d983..b56f141528 100644 --- a/examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml +++ b/examples/2d/parameters_euler_sedov_blast_wave_shockcapturing_amr.toml @@ -14,7 +14,7 @@ t_end = 12.5 # Solver solver = "dg" polydeg = 3 -cfl = 0.5 +cfl = 0.4 n_steps_max = 10000 analysis_interval = 100 volume_integral_type = "shock_capturing" diff --git a/examples/2d/parameters_mhd_blast_wave.toml b/examples/2d/parameters_mhd_blast_wave.toml index f407214886..fcb9b543c5 100644 --- a/examples/2d/parameters_mhd_blast_wave.toml +++ b/examples/2d/parameters_mhd_blast_wave.toml @@ -21,7 +21,7 @@ t_end = 0.01 # Solver solver = "dg" polydeg = 3 -cfl = 0.5 +cfl = 0.2 n_steps_max = 10000 analysis_interval = 100 volume_integral_type = "shock_capturing" diff --git a/examples/2d/parameters_mhd_rotor.toml b/examples/2d/parameters_mhd_rotor.toml index 221666cb39..8c1f5f07d7 100644 --- a/examples/2d/parameters_mhd_rotor.toml +++ b/examples/2d/parameters_mhd_rotor.toml @@ -21,7 +21,7 @@ t_end = 0.15 # Solver solver = "dg" polydeg = 4 -cfl = 0.5 +cfl = 0.2 n_steps_max = 10000 analysis_interval = 100 volume_integral_type = "shock_capturing" diff --git a/examples/3d/elixir_advection_amr.jl b/examples/3d/elixir_advection_amr.jl index f8a7f64c65..dd2829f065 100644 --- a/examples/3d/elixir_advection_amr.jl +++ b/examples/3d/elixir_advection_amr.jl @@ -40,7 +40,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.2) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.2) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/3d/elixir_advection_basic.jl b/examples/3d/elixir_advection_basic.jl index c4477ff62b..ccd743da9c 100644 --- a/examples/3d/elixir_advection_basic.jl +++ b/examples/3d/elixir_advection_basic.jl @@ -11,6 +11,13 @@ equations = LinearScalarAdvectionEquation3D(advectionvelocity) initial_condition = initial_condition_convergence_test +# you can either use a single function to impose the BCs weakly in all +# 1*ndims == 2 directions or you can pass a tuple containing BCs for +# each direction +# Note: "boundary_condition_periodic" indicates that it is a periodic boundary and can be omitted on +# fully periodic domains. Here, however, it is included to allow easy override during testing +boundary_conditions = boundary_condition_periodic + surface_flux = flux_lax_friedrichs solver = DGSEM(3, surface_flux) @@ -18,10 +25,12 @@ coordinates_min = (-1, -1, -1) coordinates_max = ( 1, 1, 1) mesh = TreeMesh(coordinates_min, coordinates_max, initial_refinement_level=3, - n_cells_max=30_000) + n_cells_max=30_000, + periodicity=true) -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions=boundary_conditions) ############################################################################### @@ -32,7 +41,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.2) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.2) +stepsize_callback = StepsizeCallback(cfl=0.4) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -56,5 +67,5 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, # run the simulation sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback - save_everystep=false, callback=callbacks); + save_everystep=false, callback=callbacks, maxiters=1e5); summary_callback() # print the timer summary diff --git a/examples/3d/elixir_advection_mortar.jl b/examples/3d/elixir_advection_mortar.jl new file mode 100644 index 0000000000..5c5d5a06a8 --- /dev/null +++ b/examples/3d/elixir_advection_mortar.jl @@ -0,0 +1,66 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the linear advection equation + +advectionvelocity = (0.2, -0.7, 0.3) +equations = LinearScalarAdvectionEquation3D(advectionvelocity) + +initial_condition = initial_condition_convergence_test + +surface_flux = flux_lax_friedrichs +solver = DGSEM(3, surface_flux) + +coordinates_min = (-1, -1, -1) +coordinates_max = ( 1, 1, 1) +refinement_patches = ( + (type="box", coordinates_min=(0.0, -1.0, -1.0), coordinates_max=(1.0, 1.0, 1.0)), + (type="box", coordinates_min=(0.0, -0.5, -0.5), coordinates_max=(0.5, 0.5, 0.5)), +) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + refinement_patches=refinement_patches, + n_cells_max=10_000,) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 5.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=2.0) +stepsize_callback = StepsizeCallback(cfl=1.0) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval, + extra_analysis_integrals=(entropy,)) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_advection_restart.jl b/examples/3d/elixir_advection_restart.jl new file mode 100644 index 0000000000..a1948d9245 --- /dev/null +++ b/examples/3d/elixir_advection_restart.jl @@ -0,0 +1,31 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# create a restart file + +trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_basic.jl")) + + +############################################################################### +# adapt the parameters that have changed compared to "elixir_advection_basic.jl" + +# Note: If you get a restart file from somewhere else, you need to provide +# appropriate setups in the elixir loading a restart file + +restart_filename = joinpath("out", "restart_000040.h5") +mesh = load_mesh(restart_filename, n_cells_max=30_000) + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + +tspan = (load_time(restart_filename), 2.0) +ode = semidiscretize(semi, tspan, restart_filename); + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_amr.jl b/examples/3d/elixir_euler_amr.jl new file mode 100644 index 0000000000..859a7ba4ef --- /dev/null +++ b/examples/3d/elixir_euler_amr.jl @@ -0,0 +1,69 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_density_pulse + +surface_flux = flux_lax_friedrichs +solver = DGSEM(3, surface_flux) + +coordinates_min = (-5, -5, -5) +coordinates_max = ( 5, 5, 5) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=4, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 10.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable=first), + base_level=4, + med_level=5, med_threshold=1.05, + max_level=6, max_threshold=1.3) +amr_callback = AMRCallback(semi, amr_controller, + interval=5, + adapt_initial_condition=true, + adapt_initial_condition_only_refine=true) + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.4) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval, + extra_analysis_integrals=(entropy,)) + +# TODO: Taal decide, first AMR or save solution etc. +callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, + save_restart, save_solution, analysis_callback, + alive_callback); + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_blob_amr.jl b/examples/3d/elixir_euler_blob_amr.jl index f1d741277a..c08b78e889 100644 --- a/examples/3d/elixir_euler_blob_amr.jl +++ b/examples/3d/elixir_euler_blob_amr.jl @@ -49,7 +49,9 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=false, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.7) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.7) +stepsize_callback = StepsizeCallback(cfl=0.9) save_solution = SaveSolutionCallback(interval=200, save_initial_solution=true, diff --git a/examples/3d/elixir_euler_density_pulse.jl b/examples/3d/elixir_euler_density_pulse.jl new file mode 100644 index 0000000000..80b904b467 --- /dev/null +++ b/examples/3d/elixir_euler_density_pulse.jl @@ -0,0 +1,59 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_density_pulse + +surface_flux = flux_ranocha +volume_flux = flux_ranocha +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (-2, -2, -2) +coordinates_max = ( 2, 2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=100_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.4) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_ec.jl b/examples/3d/elixir_euler_ec.jl new file mode 100644 index 0000000000..4332dd9526 --- /dev/null +++ b/examples/3d/elixir_euler_ec.jl @@ -0,0 +1,59 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_weak_blast_wave + +surface_flux = flux_ranocha +volume_flux = flux_ranocha +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (-2, -2, -2) +coordinates_max = ( 2, 2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=100_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.4) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_eoc_test.jl b/examples/3d/elixir_euler_eoc_test.jl new file mode 100644 index 0000000000..b4944be2ab --- /dev/null +++ b/examples/3d/elixir_euler_eoc_test.jl @@ -0,0 +1,60 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(2.0) + +initial_condition = initial_condition_eoc_test_coupled_euler_gravity + +surface_flux = flux_hll +volume_integral = VolumeIntegralWeakForm() +solver = DGSEM(3, surface_flux, volume_integral) + +coordinates_min = (0, 0, 0) +coordinates_max = (2, 2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + source_terms=source_terms_eoc_test_euler) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 1.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_mortar.jl b/examples/3d/elixir_euler_mortar.jl index 98cfb5752f..06b19b3b82 100644 --- a/examples/3d/elixir_euler_mortar.jl +++ b/examples/3d/elixir_euler_mortar.jl @@ -35,7 +35,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=0.6) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=0.6) +stepsize_callback = StepsizeCallback(cfl=0.3) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/3d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl b/examples/3d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl new file mode 100644 index 0000000000..68944e5553 --- /dev/null +++ b/examples/3d/elixir_euler_sedov_blast_wave_shockcapturing_amr.jl @@ -0,0 +1,87 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_sedov_self_gravity +boundary_conditions = boundary_condition_sedov_self_gravity + +surface_flux = flux_hll +volume_flux = flux_ranocha +polydeg = 3 +basis = LobattoLegendreBasis(polydeg) +indicator_sc = IndicatorHennemannGassner(equations, basis, + alpha_max=0.7, + alpha_min=0.001, + alpha_smooth=true, + variable=density_pressure) +volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; + volume_flux_dg=volume_flux, + volume_flux_fv=surface_flux) +solver = DGSEM(basis, surface_flux, volume_integral) + +coordinates_min = (-4, -4, -4) +coordinates_max = ( 4, 4, 4) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=1_000_000, + periodicity=false) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions=boundary_conditions) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.4) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +amr_indicator = IndicatorHennemannGassner(semi, + alpha_max=1.0, + alpha_min=0.0, + alpha_smooth=false, + variable=density_pressure) + +amr_controller = ControllerThreeLevel(semi, amr_indicator, + base_level=2, + max_level =7, max_threshold=0.0003) + +amr_callback = AMRCallback(semi, amr_controller, + interval=1, + adapt_initial_condition=true, + adapt_initial_condition_only_refine=true) + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.35) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=10, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks, maxiters=1e5); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_shockcapturing.jl b/examples/3d/elixir_euler_shockcapturing.jl new file mode 100644 index 0000000000..864f58ec2e --- /dev/null +++ b/examples/3d/elixir_euler_shockcapturing.jl @@ -0,0 +1,70 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_weak_blast_wave + +surface_flux = flux_ranocha # OBS! Using a non-dissipative flux is only sensible to test EC, + # but not for real shock simulations +volume_flux = flux_ranocha +polydeg = 3 +basis = LobattoLegendreBasis(polydeg) +indicator_sc = IndicatorHennemannGassner(equations, basis, + alpha_max=0.5, + alpha_min=0.001, + alpha_smooth=true, + variable=density_pressure) +volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; + volume_flux_dg=volume_flux, + volume_flux_fv=surface_flux) +solver = DGSEM(basis, surface_flux, volume_integral) + +coordinates_min = (-2, -2, -2) +coordinates_max = ( 2, 2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=100_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.4) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_euler_shockcapturing_amr.jl b/examples/3d/elixir_euler_shockcapturing_amr.jl new file mode 100644 index 0000000000..b1b4a407da --- /dev/null +++ b/examples/3d/elixir_euler_shockcapturing_amr.jl @@ -0,0 +1,85 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = initial_condition_weak_blast_wave + +surface_flux = flux_ranocha # OBS! Using a non-dissipative flux is only sensible to test EC, + # but not for real shock simulations +volume_flux = flux_ranocha +polydeg = 3 +basis = LobattoLegendreBasis(polydeg) +indicator_sc = IndicatorHennemannGassner(equations, basis, + alpha_max=0.5, + alpha_min=0.001, + alpha_smooth=true, + variable=density_pressure) +volume_integral = VolumeIntegralShockCapturingHG(indicator_sc; + volume_flux_dg=volume_flux, + volume_flux_fv=surface_flux) +solver = DGSEM(basis, surface_flux, volume_integral) + +coordinates_min = (-2, -2, -2) +coordinates_max = ( 2, 2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=100_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.4) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + + +amr_indicator = IndicatorHennemannGassner(semi, + alpha_smooth=false, + variable=density_pressure) + +amr_controller = ControllerThreeLevel(semi, amr_indicator, + base_level=2, + max_level =4, max_threshold=0.0003) + +amr_callback = AMRCallback(semi, amr_controller, + interval=1, + adapt_initial_condition=true, + adapt_initial_condition_only_refine=true) + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks, maxiters=1e5); +summary_callback() # print the timer summary + diff --git a/examples/3d/elixir_euler_source_terms.jl b/examples/3d/elixir_euler_source_terms.jl index 742fb3a721..e3447639c7 100644 --- a/examples/3d/elixir_euler_source_terms.jl +++ b/examples/3d/elixir_euler_source_terms.jl @@ -10,7 +10,8 @@ equations = CompressibleEulerEquations3D(1.4) initial_condition = initial_condition_convergence_test surface_flux = flux_lax_friedrichs -solver = DGSEM(3, surface_flux) +volume_integral = VolumeIntegralWeakForm() +solver = DGSEM(3, surface_flux, volume_integral) coordinates_min = (0, 0, 0) coordinates_max = (2, 2, 2) @@ -31,7 +32,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.3) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, diff --git a/examples/3d/elixir_euler_taylor_green_vortex.jl b/examples/3d/elixir_euler_taylor_green_vortex.jl new file mode 100644 index 0000000000..8f08e9506f --- /dev/null +++ b/examples/3d/elixir_euler_taylor_green_vortex.jl @@ -0,0 +1,59 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations + +equations = CompressibleEulerEquations3D(1.4) + +initial_condition = Trixi.initial_condition_taylor_green_vortex + +surface_flux = flux_lax_friedrichs +volume_flux = flux_ranocha +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (-pi, -pi, -pi) +coordinates_max = ( pi, pi, pi) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=100_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 10.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_eulergravity_eoc_test.jl b/examples/3d/elixir_eulergravity_eoc_test.jl index 47e294bb98..cf19e679c3 100644 --- a/examples/3d/elixir_eulergravity_eoc_test.jl +++ b/examples/3d/elixir_eulergravity_eoc_test.jl @@ -37,7 +37,9 @@ semi_gravity = SemidiscretizationHyperbolic(mesh, equations_gravity, initial_con # combining both semidiscretizations for Euler + self-gravity parameters = ParametersEulerGravity(background_density=2.0, # aka rho0 gravitational_constant=1.0, # aka G - cfl=1.5, + # FIXME Taal restore after Taam sync + # cfl=1.5, + cfl=0.5, n_iterations_max=1000, timestep_gravity=timestep_gravity_erk52_3Sstar!) @@ -51,7 +53,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, diff --git a/examples/3d/elixir_hyp_diff_llf.jl b/examples/3d/elixir_hyp_diff_llf.jl index 8e531b233d..d07fa960c1 100644 --- a/examples/3d/elixir_hyp_diff_llf.jl +++ b/examples/3d/elixir_hyp_diff_llf.jl @@ -34,7 +34,7 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=1.2) +stepsize_callback = StepsizeCallback(cfl=0.8) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -54,6 +54,6 @@ callbacks = CallbackSet(summary_callback, steady_state_callback, stepsize_callba ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = Trixi.solve(ode, Trixi.HypDiffN3Erk3Sstar52(), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/3d/elixir_hyp_diff_nonperiodic.jl b/examples/3d/elixir_hyp_diff_nonperiodic.jl index 6c2f92931e..e741b733e9 100644 --- a/examples/3d/elixir_hyp_diff_nonperiodic.jl +++ b/examples/3d/elixir_hyp_diff_nonperiodic.jl @@ -42,7 +42,9 @@ summary_callback = SummaryCallback() steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) -stepsize_callback = StepsizeCallback(cfl=0.9) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=0.9) +stepsize_callback = StepsizeCallback(cfl=0.6) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -62,6 +64,6 @@ callbacks = CallbackSet(summary_callback, steady_state_callback, stepsize_callba ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = Trixi.solve(ode, Trixi.HypDiffN3Erk3Sstar52(), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary diff --git a/examples/3d/elixir_mhd_alfven_wave.jl b/examples/3d/elixir_mhd_alfven_wave.jl new file mode 100644 index 0000000000..6f233d6a82 --- /dev/null +++ b/examples/3d/elixir_mhd_alfven_wave.jl @@ -0,0 +1,56 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible ideal GLM-MHD equations + +equations = IdealGlmMhdEquations3D(5/3) + +initial_condition = initial_condition_convergence_test + +surface_flux = flux_lax_friedrichs +volume_flux = flux_derigs_etal +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (-1, -1, -1) +coordinates_max = ( 1, 1, 1) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 1.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=10, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_mhd_alfven_wave_mortar.jl b/examples/3d/elixir_mhd_alfven_wave_mortar.jl new file mode 100644 index 0000000000..b3585ce6e3 --- /dev/null +++ b/examples/3d/elixir_mhd_alfven_wave_mortar.jl @@ -0,0 +1,59 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible ideal GLM-MHD equations + +equations = IdealGlmMhdEquations3D(5/3) + +initial_condition = initial_condition_convergence_test + +surface_flux = flux_hll +volume_flux = flux_derigs_etal +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (-1, -1, -1) +coordinates_max = ( 1, 1, 1) +refinement_patches = ( + (type="box", coordinates_min=(-0.5, -0.5, -0.5), + coordinates_max=( 0.5, 0.5, 0.5)), +) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + refinement_patches=refinement_patches, + n_cells_max=10_000) + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 1.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=10, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/elixir_mhd_ec.jl b/examples/3d/elixir_mhd_ec.jl index 1ff997674f..3938e23ad1 100644 --- a/examples/3d/elixir_mhd_ec.jl +++ b/examples/3d/elixir_mhd_ec.jl @@ -31,7 +31,9 @@ ode = semidiscretize(semi, tspan) summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.4) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.4) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, diff --git a/examples/3d/elixir_mhd_orszag_tang.jl b/examples/3d/elixir_mhd_orszag_tang.jl new file mode 100644 index 0000000000..0efc9f1fda --- /dev/null +++ b/examples/3d/elixir_mhd_orszag_tang.jl @@ -0,0 +1,54 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible ideal GLM-MHD equations + +equations = IdealGlmMhdEquations3D(5/3) + +initial_condition = initial_condition_orszag_tang + +surface_flux = flux_hll +volume_flux = flux_central +solver = DGSEM(3, surface_flux, VolumeIntegralFluxDifferencing(volume_flux)) + +coordinates_min = (0, 0, 0) +coordinates_max = (1, 1, 1) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=3, + n_cells_max=10_000) + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 0.5) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync to something better +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=10, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/3d/parameters_euler_blob_amr.toml b/examples/3d/parameters_euler_blob_amr.toml index adbe27d9d8..76bc583db7 100644 --- a/examples/3d/parameters_euler_blob_amr.toml +++ b/examples/3d/parameters_euler_blob_amr.toml @@ -2,7 +2,7 @@ # Simulation ndims = 3 equations = "CompressibleEulerEquations" -gamma = 1.66667 +gamma = 1.6666666666666667 initial_condition = "initial_condition_blob" t_start = 0.0 t_end = 2.5 diff --git a/examples/paper-self-gravitating-gas-dynamics/README.md b/examples/paper-self-gravitating-gas-dynamics/README.md index 5efe2fdc53..c1cdf02a88 100644 --- a/examples/paper-self-gravitating-gas-dynamics/README.md +++ b/examples/paper-self-gravitating-gas-dynamics/README.md @@ -41,25 +41,25 @@ Trixi.convtest("examples/paper-self-gravitating-gas-dynamics/parameters_eulergra ## Sec. 4.2.1, Figures 3 + 5a, Jeans energies with Euler/CK45 and gravity/CK45 ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml") +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml") ``` ## Sec. 4.2.1, Figure 4, Jeans energies with Euler/CK45 and gravity/CK45 (update gravity once per step) ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml", update_gravity_once_per_stage=false) ``` ## Sec. 4.2.1, Figure 5b, Jeans energies with Euler/CK45 and gravity/RK3S* ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml", time_integration_scheme_gravity="timestep_gravity_erk52_3Sstar!", cfl_gravity=1.2) ``` ## Sec. 4.2.1, Creating Jeans energies figures 3 and 4 One must also shrink the analysis interval in the above command, e.g., ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml", analysis_interval=1) ``` to generate necessary data for the plots to look nice. Then run the python @@ -72,47 +72,47 @@ to generate the figure. ## Sec. 4.2.2, Figure 6, T=0.5, AMR meshes for Sedov + gravity **T = 0.0 and T = 0.5:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml", t_end=0.5) +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml", t_end=0.5) ``` **T = 1.0:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml") +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml") ``` ## Sec. 4.2.2, Figure 7a, T=0.5, Sedov + gravity with Euler/CK45 and gravity/RK3S* **AMR mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml", t_end=0.5) +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml", t_end=0.5) ``` **Uniform mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml", amr_interval=0, initial_refinement_level=8, t_end=0.5) ``` ## Sec. 4.2.2, Figure 7b, T=1.0, Sedov + gravity with Euler/CK45 and gravity/RK3S* **AMR mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml") +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml") ``` **Uniform mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml", amr_interval=0, initial_refinement_level=8) ``` ## Sec. 4.2.2, Table 6, Sedov + gravity, performance uniform vs. AMR **AMR mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml") +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml") ``` **Uniform mesh:** ```julia -Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml", +Trixi.run("examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml", amr_interval=0, initial_refinement_level=8) ``` diff --git a/examples/paper-self-gravitating-gas-dynamics/elixir_euler_eoc_test.jl b/examples/paper-self-gravitating-gas-dynamics/elixir_euler_eoc_test.jl new file mode 100644 index 0000000000..dc05d9b21b --- /dev/null +++ b/examples/paper-self-gravitating-gas-dynamics/elixir_euler_eoc_test.jl @@ -0,0 +1,61 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the compressible Euler equations +equations = CompressibleEulerEquations2D(2.0) + +initial_condition = initial_condition_eoc_test_coupled_euler_gravity + +polydeg = 3 +surface_flux = flux_hll +solver = DGSEM(polydeg, surface_flux) + +coordinates_min = (0, 0) +coordinates_max = (2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=10_000) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + source_terms=source_terms_eoc_test_euler) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 1.0) +ode = semidiscretize(semi, tspan) + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_eoc_test.jl b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_eoc_test.jl new file mode 100644 index 0000000000..9e1c370874 --- /dev/null +++ b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_eoc_test.jl @@ -0,0 +1,87 @@ + +using OrdinaryDiffEq +using Trixi + + +initial_condition = initial_condition_eoc_test_coupled_euler_gravity + + +############################################################################### +# semidiscretization of the compressible Euler equations +gamma = 2.0 +equations_euler = CompressibleEulerEquations2D(gamma) + +polydeg = 3 +solver_euler = DGSEM(polydeg, flux_hll) + +coordinates_min = (0, 0) +coordinates_max = (2, 2) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=10_000) + +semi_euler = SemidiscretizationHyperbolic(mesh, equations_euler, initial_condition, solver_euler, + source_terms=source_terms_eoc_test_coupled_euler_gravity) + + +############################################################################### +# semidiscretization of the hyperbolic diffusion equations +resid_tol = 1.0e-10 +equations_gravity = HyperbolicDiffusionEquations2D(resid_tol) + +solver_gravity = DGSEM(polydeg, flux_lax_friedrichs) + +semi_gravity = SemidiscretizationHyperbolic(mesh, equations_gravity, initial_condition, solver_gravity, + source_terms=source_terms_harmonic) + + +############################################################################### +# combining both semidiscretizations for Euler + self-gravity +parameters = ParametersEulerGravity(background_density=2.0, # aka rho0 + # rho0 is (ab)used to add a "+8π" term to the source terms + # for the manufactured solution + gravitational_constant=1.0, # aka G + # FIXME Taal restore after Taam sync + cfl=0.5, + n_iterations_max=1000, + timestep_gravity=timestep_gravity_erk52_3Sstar!) + +semi = SemidiscretizationEulerGravity(semi_euler, semi_gravity, parameters) + + +############################################################################### +# ODE solvers, callbacks etc. +tspan = (0.0, 5.0) +ode = semidiscretize(semi, tspan); + +summary_callback = SummaryCallback() + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=10, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +save_restart = SaveRestartCallback(interval=100, + save_final_restart=true) + +analysis_interval = 100 +alive_callback = AliveCallback(analysis_interval=analysis_interval) + +analysis_callback = AnalysisCallback(semi_euler, interval=analysis_interval, + save_analysis=true) + +callbacks = CallbackSet(summary_callback, stepsize_callback, + save_restart, save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary +println("Number of gravity subcycles: ", semi.gravity_counter.ncalls_since_readout) diff --git a/examples/2d/elixir_euler_gravity_jeans_instability.jl b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_jeans_instability.jl similarity index 93% rename from examples/2d/elixir_euler_gravity_jeans_instability.jl rename to examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_jeans_instability.jl index 4d43c166f9..57754373fc 100644 --- a/examples/2d/elixir_euler_gravity_jeans_instability.jl +++ b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_jeans_instability.jl @@ -94,7 +94,9 @@ semi_gravity = SemidiscretizationHyperbolic(mesh, equations_gravity, initial_con # combining both semidiscretizations for Euler + self-gravity parameters = ParametersEulerGravity(background_density=1.5e7, # aka rho0 gravitational_constant=6.674e-8, # aka G - cfl=1.6, + # FIXME Taal restore after Taam sync + # cfl=1.6, + cfl=0.8, n_iterations_max=1000, timestep_gravity=timestep_gravity_carpenter_kennedy_erk54_2N!) @@ -108,7 +110,9 @@ ode = semidiscretize(semi, tspan); summary_callback = SummaryCallback() -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +# stepsize_callback = StepsizeCallback(cfl=1.0) +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=10, save_initial_solution=true, @@ -142,7 +146,7 @@ end analysis_callback = AnalysisCallback(semi_euler, interval=analysis_interval, save_analysis=true, - extra_analysis_integrals=(entropy, energy_total, energy_kinetic, energy_internal, Val(:energy_potential))) + extra_analysis_integrals=(energy_total, energy_kinetic, energy_internal, Val(:energy_potential))) callbacks = CallbackSet(summary_callback, stepsize_callback, save_restart, save_solution, @@ -151,7 +155,8 @@ callbacks = CallbackSet(summary_callback, stepsize_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary println("Number of gravity subcycles: ", semi.gravity_counter.ncalls_since_readout) diff --git a/examples/2d/elixir_euler_gravity_sedov_blast_wave_shockcapturing_amr.jl b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_sedov_blast_wave.jl similarity index 93% rename from examples/2d/elixir_euler_gravity_sedov_blast_wave_shockcapturing_amr.jl rename to examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_sedov_blast_wave.jl index 8383528282..613d6e5192 100644 --- a/examples/2d/elixir_euler_gravity_sedov_blast_wave_shockcapturing_amr.jl +++ b/examples/paper-self-gravitating-gas-dynamics/elixir_eulergravity_sedov_blast_wave.jl @@ -53,7 +53,9 @@ semi_gravity = SemidiscretizationHyperbolic(mesh, equations_gravity, initial_con # combining both semidiscretizations for Euler + self-gravity parameters = ParametersEulerGravity(background_density=0.0, # aka rho0 gravitational_constant=6.674e-8, # aka G - cfl=2.4, + # FIXME Taal restore after Taam sync + # cfl=2.4, + cfl=1.2, n_iterations_max=100, timestep_gravity=timestep_gravity_erk52_3Sstar!) @@ -80,7 +82,8 @@ amr_callback = AMRCallback(semi, amr_controller, adapt_initial_condition=true, adapt_initial_condition_only_refine=true) -stepsize_callback = StepsizeCallback(cfl=1.0) +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.5) save_solution = SaveSolutionCallback(interval=100, save_initial_solution=true, @@ -105,7 +108,8 @@ callbacks = CallbackSet(summary_callback, amr_callback, stepsize_callback, ############################################################################### # run the simulation -sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback save_everystep=false, callback=callbacks); summary_callback() # print the timer summary println("Number of gravity subcycles: ", semi.gravity_counter.ncalls_since_readout) diff --git a/examples/paper-self-gravitating-gas-dynamics/elixir_hyp_diff_eoc_test.jl b/examples/paper-self-gravitating-gas-dynamics/elixir_hyp_diff_eoc_test.jl new file mode 100644 index 0000000000..b4d1ad269c --- /dev/null +++ b/examples/paper-self-gravitating-gas-dynamics/elixir_hyp_diff_eoc_test.jl @@ -0,0 +1,69 @@ + +using OrdinaryDiffEq +using Trixi + +############################################################################### +# semidiscretization of the hyperbolic diffusion equations + +resid_tol = 1.0e-10 # TODO: Taal, move this parameter to the callback +equations = HyperbolicDiffusionEquations2D(resid_tol) + +initial_condition = initial_condition_poisson_nonperiodic +# 1 => -x, 2 => +x, 3 => -y, 4 => +y as usual for orientations +boundary_conditions = (x_neg=boundary_condition_poisson_nonperiodic, + x_pos=boundary_condition_poisson_nonperiodic, + y_neg=boundary_condition_periodic, + y_pos=boundary_condition_periodic) + +polydeg = 3 +surface_flux = flux_lax_friedrichs +solver = DGSEM(polydeg, surface_flux) + +coordinates_min = (0, 0) +coordinates_max = (1, 1) +mesh = TreeMesh(coordinates_min, coordinates_max, + initial_refinement_level=2, + n_cells_max=30_000, + periodicity=(false, true)) + + +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + source_terms=source_terms_poisson_nonperiodic, + boundary_conditions=boundary_conditions) + + +############################################################################### +# ODE solvers, callbacks etc. + +tspan = (0.0, 5.0) +ode = semidiscretize(semi, tspan); + +summary_callback = SummaryCallback() + +steady_state_callback = SteadyStateCallback(abstol=resid_tol, reltol=0.0) + +# FIXME Taal restore after Taam sync +stepsize_callback = StepsizeCallback(cfl=0.5) + +save_solution = SaveSolutionCallback(interval=100, + save_initial_solution=true, + save_final_solution=true, + solution_variables=:primitive) + +analysis_interval = 500 +alive_callback = AliveCallback(analysis_interval=analysis_interval) +analysis_callback = AnalysisCallback(semi, interval=analysis_interval, + extra_analysis_integrals=(entropy, energy_total)) + +callbacks = CallbackSet(summary_callback, steady_state_callback, stepsize_callback, + save_solution, + analysis_callback, alive_callback) + + +############################################################################### +# run the simulation + +sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false), + dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback + save_everystep=false, callback=callbacks); +summary_callback() # print the timer summary diff --git a/examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml b/examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml similarity index 100% rename from examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_jeans_instability.toml rename to examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_jeans_instability.toml diff --git a/examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml b/examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml similarity index 100% rename from examples/paper-self-gravitating-gas-dynamics/parameters_euler_gravity_sedov_blast_wave.toml rename to examples/paper-self-gravitating-gas-dynamics/parameters_eulergravity_sedov_blast_wave.toml diff --git a/src/Trixi.jl b/src/Trixi.jl index 5f216717be..46a9be72bb 100644 --- a/src/Trixi.jl +++ b/src/Trixi.jl @@ -80,11 +80,11 @@ export flux_central, flux_lax_friedrichs, flux_hll, flux_hllc, flux_upwind, export initial_condition_constant, initial_condition_gauss, - initial_condition_density_wave, + initial_condition_density_wave, initial_condition_density_pulse, initial_condition_isentropic_vortex, initial_condition_khi, initial_condition_weak_blast_wave, initial_condition_blast_wave, - initial_condition_sedov_blast_wave, + initial_condition_sedov_blast_wave, initial_condition_medium_sedov_blast_wave, initial_condition_blob, initial_condition_orszag_tang, initial_condition_rotor @@ -97,7 +97,7 @@ export initial_condition_harmonic_nonperiodic, source_terms_harmonic, boundary_c export initial_condition_poisson_periodic, source_terms_poisson_periodic export initial_condition_poisson_nonperiodic, source_terms_poisson_nonperiodic, boundary_condition_poisson_nonperiodic export initial_condition_sedov_self_gravity, boundary_condition_sedov_self_gravity -export initial_condition_eoc_test_coupled_euler_gravity, source_terms_eoc_test_coupled_euler_gravity +export initial_condition_eoc_test_coupled_euler_gravity, source_terms_eoc_test_coupled_euler_gravity, source_terms_eoc_test_euler export TreeMesh @@ -116,7 +116,8 @@ export SemidiscretizationEulerGravity, ParametersEulerGravity, timestep_gravity_erk52_3Sstar!, timestep_gravity_carpenter_kennedy_erk54_2N! export SummaryCallback, SteadyStateCallback, AMRCallback, StepsizeCallback, - SaveRestartCallback, SaveSolutionCallback, AnalysisCallback, AliveCallback + SaveRestartCallback, SaveSolutionCallback, AnalysisCallback, AliveCallback, + TrivialCallback export load_mesh, load_time diff --git a/src/callbacks/amr.jl b/src/callbacks/amr.jl index e2d743dc1e..06917c895a 100644 --- a/src/callbacks/amr.jl +++ b/src/callbacks/amr.jl @@ -27,9 +27,9 @@ function AMRCallback(semi, controller, adaptor; throw(ArgumentError("`interval` must be a non-negative integer (provided `interval = $interval`)")) end - # AMR every `interval` time steps + # AMR every `interval` time steps, but not after the final step if interval > 0 - condition = (u, t, integrator) -> integrator.iter % interval == 0 + condition = (u, t, integrator) -> integrator.iter % interval == 0 && t < integrator.sol.prob.tspan[2] else # disable the AMR callback except possibly for initial refinement during initialization condition = (u, t, integrator) -> false end @@ -86,12 +86,13 @@ function initialize!(cb::DiscreteCallback{Condition,Affect!}, u, t, integrator) @timeit_debug timer() "initial condition AMR" if amr_callback.adapt_initial_condition # iterate until mesh does not change anymore - has_changed = true + has_changed = amr_callback(integrator, + only_refine=amr_callback.adapt_initial_condition_only_refine) while has_changed - has_changed = amr_callback(integrator, - only_refine=amr_callback.adapt_initial_condition_only_refine) compute_coefficients!(integrator.u, t, semi) u_modified!(integrator, true) + has_changed = amr_callback(integrator, + only_refine=amr_callback.adapt_initial_condition_only_refine) end end diff --git a/src/callbacks/analysis.jl b/src/callbacks/analysis.jl index 07181e793c..f8b8f96ec1 100644 --- a/src/callbacks/analysis.jl +++ b/src/callbacks/analysis.jl @@ -167,6 +167,8 @@ function (analysis_callback::AnalysisCallback)(integrator) " " * " Time/DOF/rhs!: " * @sprintf("%10.8e s", runtime_relative)) println(" sim. time: " * @sprintf("%10.8e", t)) + println(" #DOF: " * @sprintf("% 14d", ndofs(semi))) + println(" #elements: " * @sprintf("% 14d", nelements(solver, cache))) # Level information (only show for AMR) uses_amr = false @@ -190,7 +192,6 @@ function (analysis_callback::AnalysisCallback)(integrator) max_level = max(max_level, current_level) end - println(" #elements: " * @sprintf("% 14d", nelements(solver, cache))) for level = max_level:-1:min_level+1 println(" ├── level $level: " * @sprintf("% 14d", count(isequal(level), levels))) end diff --git a/src/callbacks/analysis_dg2d.jl b/src/callbacks/analysis_dg2d.jl index 4c2caed83d..f94aede03f 100644 --- a/src/callbacks/analysis_dg2d.jl +++ b/src/callbacks/analysis_dg2d.jl @@ -100,7 +100,8 @@ function analyze(::Val{:l2_divb}, du::AbstractArray{<:Any,4}, u, t, derivative_matrix[j, k] * u[7, i, k, element] ) end divb *= cache.elements.inverse_jacobian[element] - end + divb^2 + end |> sqrt end function analyze(::Val{:linf_divb}, du::AbstractArray{<:Any,4}, u, t, diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index ccb1edc47d..9bd08f6e1d 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -33,3 +33,5 @@ include("save_restart.jl") include("save_solution.jl") include("analysis.jl") include("alive.jl") + +include("trivial.jl") diff --git a/src/callbacks/stepsize_dg1d.jl b/src/callbacks/stepsize_dg1d.jl index 0dd3f58062..f97bde1d10 100644 --- a/src/callbacks/stepsize_dg1d.jl +++ b/src/callbacks/stepsize_dg1d.jl @@ -1,31 +1,37 @@ function max_dt(u::AbstractArray{<:Any,3}, t, mesh::TreeMesh{1}, constant_speed::Val{false}, equations, dg::DG, cache) - max_λ1 = max_λ2 = nextfloat(zero(t)) + # to avoid a division by zero if the speed vanishes everywhere, + # e.g. for steady-state linear advection + max_scaled_speed = nextfloat(zero(t)) for element in eachelement(dg, cache) - inv_jacobian = cache.elements.inverse_jacobian[element] + max_λ1 = zero(max_scaled_speed) for i in eachnode(dg) u_node = get_node_vars(u, equations, dg, i, element) λ1, = max_abs_speeds(u_node, equations) - max_λ1 = max(max_λ1, inv_jacobian * λ1) + max_λ1 = max(max_λ1, λ1) end + inv_jacobian = cache.elements.inverse_jacobian[element] + max_scaled_speed = max(max_scaled_speed, inv_jacobian * max_λ1) end - return 2 / (nnodes(dg) * (max_λ1)) + return 2 / (nnodes(dg) * max_scaled_speed) end function max_dt(u::AbstractArray{<:Any,3}, t, mesh::TreeMesh{1}, constant_speed::Val{true}, equations, dg::DG, cache) - max_λ1 = nextfloat(zero(t)) + # to avoid a division by zero if the speed vanishes everywhere, + # e.g. for steady-state linear advection + max_scaled_speed = nextfloat(zero(t)) for element in eachelement(dg, cache) + max_λ1, = max_abs_speeds(equations) inv_jacobian = cache.elements.inverse_jacobian[element] - λ1, = max_abs_speeds(equations) - max_λ1 = max(max_λ1, inv_jacobian * λ1) + max_scaled_speed = max(max_scaled_speed, inv_jacobian * max_λ1) end - return 2 / (nnodes(dg) * (max_λ1)) + return 2 / (nnodes(dg) * max_scaled_speed) end diff --git a/src/callbacks/stepsize_dg2d.jl b/src/callbacks/stepsize_dg2d.jl index 1edf02e651..637e595cf5 100644 --- a/src/callbacks/stepsize_dg2d.jl +++ b/src/callbacks/stepsize_dg2d.jl @@ -1,33 +1,55 @@ function max_dt(u::AbstractArray{<:Any,4}, t, mesh::TreeMesh{2}, constant_speed::Val{false}, equations, dg::DG, cache) - max_λ1 = max_λ2 = nextfloat(zero(t)) + # to avoid a division by zero if the speed vanishes everywhere, + # e.g. for steady-state linear advection + max_scaled_speed = nextfloat(zero(t)) for element in eachelement(dg, cache) - inv_jacobian = cache.elements.inverse_jacobian[element] - for j in eachnode(dg), i in eachnode(dg) - u_node = get_node_vars(u, equations, dg, i, j, element) - λ1, λ2 = max_abs_speeds(u_node, equations) - max_λ1 = max(max_λ1, inv_jacobian * λ1) - max_λ2 = max(max_λ2, inv_jacobian * λ2) + max_λ1 = max_λ2 = zero(max_scaled_speed) + # FIXME Taal restore after Taam sync: remove following if-else once c_h is updated properly: + if equations isa AbstractIdealGlmMhdEquations + equations.c_h = 0.0 + for j in nnodes(dg), i in eachnode(dg) + u_node = get_node_vars(u, equations, dg, i, j, element) + λ1, λ2 = max_abs_speeds(u_node, equations) + max_λ1 = max(max_λ1, λ1) + max_λ2 = max(max_λ2, λ2) + end + else + for j in eachnode(dg), i in eachnode(dg) + u_node = get_node_vars(u, equations, dg, i, j, element) + λ1, λ2 = max_abs_speeds(u_node, equations) + max_λ1 = max(max_λ1, λ1) + max_λ2 = max(max_λ2, λ2) + end end + # for j in eachnode(dg), i in eachnode(dg) + # u_node = get_node_vars(u, equations, dg, i, j, element) + # λ1, λ2 = max_abs_speeds(u_node, equations) + # max_λ1 = max(max_λ1, λ1) + # max_λ2 = max(max_λ2, λ2) + # end + inv_jacobian = cache.elements.inverse_jacobian[element] + max_scaled_speed = max(max_scaled_speed, inv_jacobian * (max_λ1 + max_λ2)) end - return 2 / (nnodes(dg) * (max_λ1 + max_λ2)) + return 2 / (nnodes(dg) * max_scaled_speed) end function max_dt(u::AbstractArray{<:Any,4}, t, mesh::TreeMesh{2}, constant_speed::Val{true}, equations, dg::DG, cache) - max_λ1 = max_λ2 = nextfloat(zero(t)) + # to avoid a division by zero if the speed vanishes everywhere, + # e.g. for steady-state linear advection + max_scaled_speed = nextfloat(zero(t)) for element in eachelement(dg, cache) + max_λ1, max_λ2 = max_abs_speeds(equations) inv_jacobian = cache.elements.inverse_jacobian[element] - λ1, λ2 = max_abs_speeds(equations) - max_λ1 = max(max_λ1, inv_jacobian * λ1) - max_λ2 = max(max_λ2, inv_jacobian * λ2) + max_scaled_speed = max(max_scaled_speed, inv_jacobian * (max_λ1 + max_λ2)) end - return 2 / (nnodes(dg) * (max_λ1 + max_λ2)) + return 2 / (nnodes(dg) * max_scaled_speed) end diff --git a/src/callbacks/stepsize_dg3d.jl b/src/callbacks/stepsize_dg3d.jl index bfc38cff7f..2be23ce130 100644 --- a/src/callbacks/stepsize_dg3d.jl +++ b/src/callbacks/stepsize_dg3d.jl @@ -7,6 +7,10 @@ function max_dt(u::AbstractArray{<:Any,5}, t, mesh::TreeMesh{3}, for element in eachelement(dg, cache) max_λ1 = max_λ2 = max_λ3 = zero(max_scaled_speed) + # FIXME Taal restore after Taam sync: remove following lines once c_h is updated properly: + if equations isa AbstractIdealGlmMhdEquations + equations.c_h = 0.0 + end for k in eachnode(dg), j in eachnode(dg), i in eachnode(dg) u_node = get_node_vars(u, equations, dg, i, j, k, element) λ1, λ2, λ3 = max_abs_speeds(u_node, equations) diff --git a/src/callbacks/trivial.jl b/src/callbacks/trivial.jl new file mode 100644 index 0000000000..f49a656b1a --- /dev/null +++ b/src/callbacks/trivial.jl @@ -0,0 +1,19 @@ + +""" + TrivialCallback() + +A callback that does nothing. This can be useful to disable some callbacks +easily via [`trixi_include`](@ref). +""" +function TrivialCallback() + DiscreteCallback(trivial_callback, trivial_callback, + save_positions=(false,false)) +end + +trivial_callback(u, t, integrator) = false +trivial_callback(integrator) = u_modified!(integrator, false) + + +function Base.show(io::IO, cb::DiscreteCallback{Condition,Affect!}) where {Condition, Affect!<:typeof(trivial_callback)} + print(io, "TrivialCallback()") +end diff --git a/src/equations/1d/linear_scalar_advection.jl b/src/equations/1d/linear_scalar_advection.jl index 0e4a7ddaba..6904b7b8f0 100644 --- a/src/equations/1d/linear_scalar_advection.jl +++ b/src/equations/1d/linear_scalar_advection.jl @@ -201,8 +201,8 @@ end @inline have_constant_speed(::LinearScalarAdvectionEquation1D) = Val(true) -@inline function max_abs_speeds(eq::LinearScalarAdvectionEquation1D) - return abs.(eq.advectionvelocity) +@inline function max_abs_speeds(equation::LinearScalarAdvectionEquation1D) + return abs.(equation.advectionvelocity) end diff --git a/src/equations/2d/compressible_euler.jl b/src/equations/2d/compressible_euler.jl index 8ea94092cd..217d3fd8b7 100644 --- a/src/equations/2d/compressible_euler.jl +++ b/src/equations/2d/compressible_euler.jl @@ -537,7 +537,37 @@ function initial_condition_eoc_test_coupled_euler_gravity(x, t, equations::Compr return prim2cons(SVector(rho, v1, v2, p), equations) end -# TODO: Taal, port to Taal, add docstring, and remove method with the signature below +""" + source_terms_eoc_test_coupled_euler_gravity(u, x, t, equations::CompressibleEulerEquations2D) + +Setup used for convergence tests of the Euler equations with self-gravity used in +- Michael Schlottke-Lakemper, Andrew R. Winters, Hendrik Ranocha, Gregor J. Gassner (2020) + A purely hyperbolic discontinuous Galerkin approach for self-gravitating gas dynamics + [arXiv: 2008.10593](https://arxiv.org/abs/2008.10593) +in combination with [`initial_condition_eoc_test_coupled_euler_gravity`](@ref). +""" +@inline function source_terms_eoc_test_coupled_euler_gravity(u, x, t, equations::CompressibleEulerEquations2D) + # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` + c = 2.0 + A = 0.1 + G = 1.0 # gravitational constant, must match coupling solver + C_grav = -2.0 * G / pi # 2 == 4 / ndims + + x1, x2 = x + # TODO: sincospi + si, co = sincos(pi * (x1 + x2 - t)) + rhox = A * pi * co + rho = c + A * si + + du1 = rhox + du2 = rhox + du3 = rhox + du4 = (1.0 - C_grav*rho)*rhox + + return SVector(du1, du2, du3, du4) +end + +# TODO: Taal and remove method with the signature below function source_terms_eoc_test_coupled_euler_gravity(ut, u, x, element_id, t, n_nodes, equations::CompressibleEulerEquations2D) # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` c = 2.0 @@ -561,7 +591,37 @@ function source_terms_eoc_test_coupled_euler_gravity(ut, u, x, element_id, t, n_ return nothing end -# TODO: Taal, port to Taal, add docstring, and remove method with the signature below +""" + source_terms_eoc_test_euler(u, x, t, equations::CompressibleEulerEquations2D) + +Setup used for convergence tests of the Euler equations with self-gravity used in +- Michael Schlottke-Lakemper, Andrew R. Winters, Hendrik Ranocha, Gregor J. Gassner (2020) + A purely hyperbolic discontinuous Galerkin approach for self-gravitating gas dynamics + [arXiv: 2008.10593](https://arxiv.org/abs/2008.10593) +in combination with [`initial_condition_eoc_test_coupled_euler_gravity`](@ref). +""" +@inline function source_terms_eoc_test_euler(u, x, t, equations::CompressibleEulerEquations2D) + # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` + c = 2.0 + A = 0.1 + G = 1.0 + C_grav = -2 * G / pi # 2 == 4 / ndims + + x1, x2 = x + # TODO: sincospi + si, co = sincos(pi * (x1 + x2 - t)) + rhox = A * pi * co + rho = c + A * si + + du1 = rhox + du2 = rhox * (1 - C_grav * rho) + du3 = rhox * (1 - C_grav * rho) + du4 = rhox * (1 - 3 * C_grav * rho) + + return SVector(du1, du2, du3, du4) +end + +# TODO: Taal, remove method with the signature below function source_terms_eoc_test_euler(ut, u, x, element_id, t, n_nodes, equations::CompressibleEulerEquations2D) # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` c = 2.0 @@ -989,7 +1049,9 @@ end p = (equations.gamma - 1) * (rho_e - 1/2 * rho * (v1^2 + v2^2)) c = sqrt(equations.gamma * p / rho) - return abs(v1) + c, abs(v2) + c + # FIXME Taal restore after Taam sync + # return abs(v1) + c, abs(v2) + c + return (sqrt(v1^2 + v2^2) + c), 0.0 end diff --git a/src/equations/2d/hyperbolic_diffusion.jl b/src/equations/2d/hyperbolic_diffusion.jl index 211c678fd1..0086fabf79 100644 --- a/src/equations/2d/hyperbolic_diffusion.jl +++ b/src/equations/2d/hyperbolic_diffusion.jl @@ -385,7 +385,9 @@ end @inline function max_abs_speeds(eq::HyperbolicDiffusionEquations2D) λ = sqrt(eq.nu * eq.inv_Tr) - return λ, λ + # FIXME Taal restore after Taam sync + # return λ, λ + return λ, 0.0 end diff --git a/src/equations/2d/ideal_glm_mhd.jl b/src/equations/2d/ideal_glm_mhd.jl index a6a0bf8ecd..d50ab42175 100644 --- a/src/equations/2d/ideal_glm_mhd.jl +++ b/src/equations/2d/ideal_glm_mhd.jl @@ -581,6 +581,8 @@ function calc_max_dt(u, element_id, invjacobian, cfl, equations::IdealGlmMhdEquations2D, dg) λ_max = 0.0 equations.c_h = 0.0 + # FIXME Taal restore after Taam sync + # for j in 1:nnodes(dg), i in 1:nnodes(dg) for j in nnodes(dg), i in 1:nnodes(dg) u_node = get_node_vars(u, dg, i, j, element_id) rho, rho_v1, rho_v2, rho_v3, _ = u_node @@ -610,7 +612,9 @@ end cf_max = max(cf_x_direction, cf_y_direction) equations.c_h = max(equations.c_h, cf_max) # GLM cleaning speed = c_f - return abs(v1) + cf_x_direction, abs(v2) + cf_y_direction + # FIXME Taal restore after Taam sync + # return abs(v1) + cf_x_direction, abs(v2) + cf_y_direction + return (sqrt(v1^2 + v2^2 + v3^2) + cf_max), 0.0 end diff --git a/src/equations/2d/linear_scalar_advection.jl b/src/equations/2d/linear_scalar_advection.jl index 093e3eff60..9826c4e707 100644 --- a/src/equations/2d/linear_scalar_advection.jl +++ b/src/equations/2d/linear_scalar_advection.jl @@ -261,8 +261,10 @@ end @inline have_constant_speed(::LinearScalarAdvectionEquation2D) = Val(true) -@inline function max_abs_speeds(eq::LinearScalarAdvectionEquation2D) - return abs.(eq.advectionvelocity) +@inline function max_abs_speeds(equation::LinearScalarAdvectionEquation2D) + # FIXME Taal restore after Taam sync + # return abs.(equation.advectionvelocity) + return maximum(abs.(equation.advectionvelocity)), 0.0 end diff --git a/src/equations/3d/compressible_euler.jl b/src/equations/3d/compressible_euler.jl index baf1ecaa05..871ce31c19 100644 --- a/src/equations/3d/compressible_euler.jl +++ b/src/equations/3d/compressible_euler.jl @@ -345,6 +345,42 @@ in combination with [`initial_condition_eoc_test_coupled_euler_gravity`](@ref). return SVector(du1, du2, du3, du4, du5) end +""" + source_terms_eoc_test_euler(u, x, t, equations::CompressibleEulerEquations3D) + +Setup used for convergence tests of the Euler equations with self-gravity used in +- Michael Schlottke-Lakemper, Andrew R. Winters, Hendrik Ranocha, Gregor J. Gassner (2020) + A purely hyperbolic discontinuous Galerkin approach for self-gravitating gas dynamics + [arXiv: 2008.10593](https://arxiv.org/abs/2008.10593) +in combination with [`initial_condition_eoc_test_coupled_euler_gravity`](@ref). + +!!! note + This method is to be used for testing pure Euler simulations with analytic self-gravity. + If you intend to do coupled Euler-gravity simulations, you need to use + [`source_terms_eoc_test_coupled_euler_gravity`](@ref) instead. +""" +function source_terms_eoc_test_euler(u, x, t, equations::CompressibleEulerEquations3D) + # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` + c = 2.0 + A = 0.1 + G = 1.0 + C_grav = -4 * G / (3 * pi) # "3" is the number of spatial dimensions + + x1, x2, x3 = x + # TODO: sincospi + si, co = sincos(pi * (x1 + x2 + x3 - t)) + rhox = A * pi * co + rho = c + A * si + + du1 = rhox * 2 + du2 = rhox * (2 - C_grav * rho) + du3 = rhox * (2 - C_grav * rho) + du4 = rhox * (2 - C_grav * rho) + du5 = rhox * (3 - 5 * C_grav * rho) + + return SVector(du1, du2, du3, du4, du5) +end + # TODO: Taal remove methods with the signature below function source_terms_eoc_test_coupled_euler_gravity(ut, u, x, element_id, t, n_nodes, equations::CompressibleEulerEquations3D) # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` @@ -371,7 +407,7 @@ function source_terms_eoc_test_coupled_euler_gravity(ut, u, x, element_id, t, n_ return nothing end -# TODO: Taal, port to Taal, add docstring, and remove method with the signature below +# TODO: Taal remove method with the signature below function source_terms_eoc_test_euler(ut, u, x, element_id, t, n_nodes, equations::CompressibleEulerEquations3D) # Same settings as in `initial_condition_eoc_test_coupled_euler_gravity` c = 2.0 @@ -996,7 +1032,9 @@ end p = (equations.gamma - 1) * (rho_e - 1/2 * rho * (v1^2 + v2^2 + v3^2)) c = sqrt(equations.gamma * p / rho) - return abs(v1) + c, abs(v2) + c, abs(v3) + c + # FIXME Taal restore after Taam sync + # return abs(v1) + c, abs(v2) + c, abs(v3) + c + return (sqrt(v1^2 + v2^2 + v3^2) + c), 0.0, 0.0 end diff --git a/src/equations/3d/hyperbolic_diffusion.jl b/src/equations/3d/hyperbolic_diffusion.jl index 2840f625a5..31ce17630c 100644 --- a/src/equations/3d/hyperbolic_diffusion.jl +++ b/src/equations/3d/hyperbolic_diffusion.jl @@ -367,7 +367,9 @@ end @inline function max_abs_speeds(eq::HyperbolicDiffusionEquations3D) λ = sqrt(eq.nu * eq.inv_Tr) - return λ, λ, λ + # FIXME Taal restore after Taam sync + # return λ, λ, λ + return λ, 0.0, 0.0 end diff --git a/src/equations/3d/ideal_glm_mhd.jl b/src/equations/3d/ideal_glm_mhd.jl index 6e9500ddb6..cd8c21748e 100644 --- a/src/equations/3d/ideal_glm_mhd.jl +++ b/src/equations/3d/ideal_glm_mhd.jl @@ -570,7 +570,9 @@ end cf_max = max(cf_x_direction, cf_y_direction, cf_z_direction) equations.c_h = max(equations.c_h, cf_max) # GLM cleaning speed = c_f - return abs(v1) + cf_x_direction, abs(v2) + cf_y_direction, abs(v3) + cf_z_direction + # FIXME Taal restore after Taam sync + # return abs(v1) + cf_x_direction, abs(v2) + cf_y_direction, abs(v3) + cf_z_direction + return (sqrt(v1^2 + v2^2 + v3^2) + cf_max), 0.0, 0.0 end diff --git a/src/equations/3d/linear_scalar_advection.jl b/src/equations/3d/linear_scalar_advection.jl index 84abba2b4b..792872b51d 100644 --- a/src/equations/3d/linear_scalar_advection.jl +++ b/src/equations/3d/linear_scalar_advection.jl @@ -156,8 +156,10 @@ end @inline have_constant_speed(::LinearScalarAdvectionEquation3D) = Val(true) -@inline function max_abs_speeds(eq::LinearScalarAdvectionEquation3D) - return abs.(eq.advectionvelocity) +@inline function max_abs_speeds(equation::LinearScalarAdvectionEquation3D) + # FIXME Taal restore after Taam sync + # return abs.(equation.advectionvelocity) + return maximum(abs.(equation.advectionvelocity)), 0.0, 0.0 end diff --git a/src/run.jl b/src/run.jl index ef1212975f..5bc2aa185a 100644 --- a/src/run.jl +++ b/src/run.jl @@ -298,6 +298,9 @@ function init_simulation() amr_interval = parameter("amr_interval", 0) adapt_initial_condition = parameter("adapt_initial_condition", true) adapt_initial_condition_only_refine = parameter("adapt_initial_condition_only_refine", true) + + # make sure that the random number generator is reseted and the ICs are reproducible in the julia REPL/interactive mode + seed!(0) if restart mpi_print("Loading restart file...") time, step = load_restart_file!(solver, restart_filename) @@ -613,7 +616,7 @@ function run_simulation(mesh, solver, time_parameters, time_integration_function end # Return error norms for EOC calculation - return l2_error, linf_error, varnames_cons(solver.equations) + return (; l2=l2_error, linf=linf_error, varnames=varnames_cons(solver.equations)) end diff --git a/src/run_euler_gravity.jl b/src/run_euler_gravity.jl index 206ec93d8c..bab9ab5bd6 100644 --- a/src/run_euler_gravity.jl +++ b/src/run_euler_gravity.jl @@ -356,10 +356,11 @@ function run_simulation_euler_gravity(mesh, solvers, time_parameters, time_integ # Return error norms for EOC calculation println("Number of gravity subcycles: ", globals[:gravity_subcycles]) if get_name(solver_euler.initial_condition) == "initial_condition_eoc_test_coupled_euler_gravity" - return l2_error, linf_error, vcat(varnames_cons(solver.equations), - varnames_cons(solver_gravity.equations)) + return (; l2=l2_error, linf=linf_error, + varnames=vcat(varnames_cons(solver.equations), + varnames_cons(solver_gravity.equations))) else - return l2_error, linf_error, varnames_cons(solver.equations) + return (; l2=l2_error, linf=linf_error, varnames=varnames_cons(solver.equations)) end end diff --git a/src/semidiscretization.jl b/src/semidiscretization.jl index 2326a3650a..5e5218c2f9 100644 --- a/src/semidiscretization.jl +++ b/src/semidiscretization.jl @@ -62,6 +62,8 @@ Wrap the semidiscretization `semi` as an ODE problem in the time interval `tspan that can be passed to `solve` from the [SciML ecosystem](https://diffeq.sciml.ai/latest/). """ function semidiscretize(semi::AbstractSemidiscretization, tspan) + RealT = real(semi) + tspan = (convert(RealT, first(tspan)), convert(RealT, last(tspan))) u0_ode = compute_coefficients(first(tspan), semi) return ODEProblem(rhs!, u0_ode, tspan, semi) end diff --git a/src/semidiscretization_euler_gravity.jl b/src/semidiscretization_euler_gravity.jl index 4812e97658..f0ef8f982b 100644 --- a/src/semidiscretization_euler_gravity.jl +++ b/src/semidiscretization_euler_gravity.jl @@ -131,6 +131,8 @@ end mesh_equations_solver_cache(semi.semi_euler) end +@inline Base.real(semi::SemidiscretizationEulerGravity) = real(semi.semi_euler) + # computes the coefficients of the initial condition @inline function compute_coefficients(t, semi::SemidiscretizationEulerGravity) @@ -331,22 +333,20 @@ function timestep_gravity_3Sstar!(cache, u_euler, t, dt, gravity_parameters, sem return nothing end -# This function is commented out since it's less performant than timestep_gravity_erk52_3Sstar! -# Nevertheless, we want to keep the coefficients as reference values. -# function timestep_gravity_erk51_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity) -# # New 3Sstar coefficients optimized for polynomials of degree polydeg=3 -# # and examples/parameters_hyp_diff_llf.toml -# # 5 stages, order 1 -# gamma1 = @SVector [0.0000000000000000E+00, 5.2910412316555866E-01, 2.8433964362349406E-01, -1.4467571130907027E+00, 7.5592215948661057E-02] -# gamma2 = @SVector [1.0000000000000000E+00, 2.6366970460864109E-01, 3.7423646095836322E-01, 7.8786901832431289E-01, 3.7754129043053775E-01] -# gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 8.0043329115077388E-01, 1.3550099149374278E-01] -# beta = @SVector [1.9189497208340553E-01, 5.4506406707700059E-02, 1.2103893164085415E-01, 6.8582252490550921E-01, 8.7914657211972225E-01] -# delta = @SVector [1.0000000000000000E+00, 7.8593091509463076E-01, 1.2639038717454840E-01, 1.7726945920209813E-01, 0.0000000000000000E+00] -# c = @SVector [0.0000000000000000E+00, 1.9189497208340553E-01, 1.9580448818599061E-01, 2.4241635859769023E-01, 5.0728347557552977E-01] - -# timestep_gravity_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity, -# gamma1, gamma2, gamma3, beta, delta, c) -# end +function timestep_gravity_erk51_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity) + # New 3Sstar coefficients optimized for polynomials of degree polydeg=3 + # and examples/parameters_hyp_diff_llf.toml + # 5 stages, order 1 + gamma1 = @SVector [0.0000000000000000E+00, 5.2910412316555866E-01, 2.8433964362349406E-01, -1.4467571130907027E+00, 7.5592215948661057E-02] + gamma2 = @SVector [1.0000000000000000E+00, 2.6366970460864109E-01, 3.7423646095836322E-01, 7.8786901832431289E-01, 3.7754129043053775E-01] + gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 8.0043329115077388E-01, 1.3550099149374278E-01] + beta = @SVector [1.9189497208340553E-01, 5.4506406707700059E-02, 1.2103893164085415E-01, 6.8582252490550921E-01, 8.7914657211972225E-01] + delta = @SVector [1.0000000000000000E+00, 7.8593091509463076E-01, 1.2639038717454840E-01, 1.7726945920209813E-01, 0.0000000000000000E+00] + c = @SVector [0.0000000000000000E+00, 1.9189497208340553E-01, 1.9580448818599061E-01, 2.4241635859769023E-01, 5.0728347557552977E-01] + + timestep_gravity_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity, + gamma1, gamma2, gamma3, beta, delta, c) +end function timestep_gravity_erk52_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity) # New 3Sstar coefficients optimized for polynomials of degree polydeg=3 @@ -363,22 +363,20 @@ function timestep_gravity_erk52_3Sstar!(cache, u_euler, t, dt, gravity_parameter gamma1, gamma2, gamma3, beta, delta, c) end -# This function is commented out since it's less performant than timestep_gravity_erk52_3Sstar! -# Nevertheless, we want to keep the coefficients as reference values. -# function timestep_gravity_erk53_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity) -# # New 3Sstar coefficients optimized for polynomials of degree polydeg=3 -# # and examples/parameters_hyp_diff_llf.toml -# # 5 stages, order 3 -# gamma1 = @SVector [0.0000000000000000E+00, 6.9362208054011210E-01, 9.1364483229179472E-01, 1.3129305757628569E+00, -1.4615811339132949E+00] -# gamma2 = @SVector [1.0000000000000000E+00, 1.3224582239681788E+00, 2.4213162353103135E-01, -3.8532017293685838E-01, 1.5603355704723714E+00] -# gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 3.8306787039991996E-01, -3.5683121201711010E-01] -# beta = @SVector [8.4476964977404881E-02, 3.0834660698015803E-01, 3.2131664733089232E-01, 2.8783574345390539E-01, 8.2199204703236073E-01] -# delta = @SVector [1.0000000000000000E+00, -7.6832695815481578E-01, 1.2497251501714818E-01, 1.4496404749796306E+00, 0.0000000000000000E+00] -# c = @SVector [0.0000000000000000E+00, 8.4476964977404881E-02, 2.8110631488732202E-01, 5.7093842145029405E-01, 7.2999896418559662E-01] - -# timestep_gravity_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity, -# gamma1, gamma2, gamma3, beta, delta, c) -# end +function timestep_gravity_erk53_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity) + # New 3Sstar coefficients optimized for polynomials of degree polydeg=3 + # and examples/parameters_hyp_diff_llf.toml + # 5 stages, order 3 + gamma1 = @SVector [0.0000000000000000E+00, 6.9362208054011210E-01, 9.1364483229179472E-01, 1.3129305757628569E+00, -1.4615811339132949E+00] + gamma2 = @SVector [1.0000000000000000E+00, 1.3224582239681788E+00, 2.4213162353103135E-01, -3.8532017293685838E-01, 1.5603355704723714E+00] + gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 3.8306787039991996E-01, -3.5683121201711010E-01] + beta = @SVector [8.4476964977404881E-02, 3.0834660698015803E-01, 3.2131664733089232E-01, 2.8783574345390539E-01, 8.2199204703236073E-01] + delta = @SVector [1.0000000000000000E+00, -7.6832695815481578E-01, 1.2497251501714818E-01, 1.4496404749796306E+00, 0.0000000000000000E+00] + c = @SVector [0.0000000000000000E+00, 8.4476964977404881E-02, 2.8110631488732202E-01, 5.7093842145029405E-01, 7.2999896418559662E-01] + + timestep_gravity_3Sstar!(cache, u_euler, t, dt, gravity_parameters, semi_gravity, + gamma1, gamma2, gamma3, beta, delta, c) +end # TODO: Taal decide, where should specific parts like these be? diff --git a/src/solvers/dg/1d/dg.jl b/src/solvers/dg/1d/dg.jl index 65bb383263..1106211436 100644 --- a/src/solvers/dg/1d/dg.jl +++ b/src/solvers/dg/1d/dg.jl @@ -965,8 +965,6 @@ end # Call equation-specific initial conditions functions and apply to all elements function set_initial_condition!(dg::Dg1D, time) equation = equations(dg) - # make sure that the random number generator is reseted and the ICs are reproducible in the julia REPL/interactive mode - seed!(0) for element_id in 1:dg.n_elements for i in 1:nnodes(dg) dg.elements.u[:, i, element_id] .= dg.initial_condition( diff --git a/src/solvers/dg/2d/dg.jl b/src/solvers/dg/2d/dg.jl index 8a70945524..d2ae545553 100644 --- a/src/solvers/dg/2d/dg.jl +++ b/src/solvers/dg/2d/dg.jl @@ -1357,8 +1357,6 @@ end # Call equation-specific initial conditions functions and apply to all elements function set_initial_condition!(dg::Dg2D, time) equation = equations(dg) - # make sure that the random number generator is reseted and the ICs are reproducible in the julia REPL/interactive mode - seed!(0) for element_id in 1:dg.n_elements for j in 1:nnodes(dg) for i in 1:nnodes(dg) diff --git a/src/solvers/dg/3d/dg.jl b/src/solvers/dg/3d/dg.jl index 91687fb779..5f50442355 100644 --- a/src/solvers/dg/3d/dg.jl +++ b/src/solvers/dg/3d/dg.jl @@ -1379,8 +1379,6 @@ end # Call equation-specific initial conditions functions and apply to all elements function set_initial_condition!(dg::Dg3D, time) equation = equations(dg) - # make sure that the random number generator is reseted and the ICs are reproducible in the julia REPL/interactive mode - seed!(0) for element_id in 1:dg.n_elements for k in 1:nnodes(dg), j in 1:nnodes(dg), i in 1:nnodes(dg) dg.elements.u[:, i, j, k, element_id] .= dg.initial_condition( diff --git a/src/solvers/dg/basis_lobatto_legendre.jl b/src/solvers/dg/basis_lobatto_legendre.jl index 0f698211b0..9000ad499e 100644 --- a/src/solvers/dg/basis_lobatto_legendre.jl +++ b/src/solvers/dg/basis_lobatto_legendre.jl @@ -156,7 +156,7 @@ struct LobattoLegendreAnalyzer{RealT<:Real, NNODES, Vandermonde<:AbstractMatrix{ vandermonde::Vandermonde end -function SolutionAnalyzer(basis::LobattoLegendreBasis{RealT}; analysis_polydeg=2*polydeg(basis)) where {RealT} +function SolutionAnalyzer(basis::LobattoLegendreBasis{RealT}; analysis_polydeg=2*polydeg(basis)+1) where {RealT} nnodes_ = analysis_polydeg + 1 nodes, weights = gauss_lobatto_nodes_weights(nnodes_) diff --git a/src/solvers/dg/dg_3d.jl b/src/solvers/dg/dg_3d.jl index ff3fc5865a..8bb0b0ffef 100644 --- a/src/solvers/dg/dg_3d.jl +++ b/src/solvers/dg/dg_3d.jl @@ -1004,7 +1004,7 @@ function calc_mortar_flux!(surface_flux_values::AbstractArray{<:Any,5}, for j in eachnode(dg), i in eachnode(dg), v in eachvariable(equations) fstar_lower_right[v, i, j] += noncons_diamond_lower_right[v, i, j] end - mortar_fluxes_to_elements!(surface_flux_values, dg, mortar_type, mortar, + mortar_fluxes_to_elements!(surface_flux_values, equations, mortar_l2, dg, cache, mortar, fstar_upper_left, fstar_upper_right, fstar_lower_left, fstar_lower_right, fstar_tmp1) diff --git a/src/solvers/dg/indicators_3d.jl b/src/solvers/dg/indicators_3d.jl index 919b6ce00b..60e2037bd3 100644 --- a/src/solvers/dg/indicators_3d.jl +++ b/src/solvers/dg/indicators_3d.jl @@ -106,26 +106,22 @@ function (indicator_hg::IndicatorHennemannGassner)(u::AbstractArray{<:Any,5}, # Loop over L2 mortars for mortar in eachmortar(dg, cache) # Get neighboring element ids - lower_left = dg.l2mortars.neighbor_ids[1, l2mortar_id] - lower_right = dg.l2mortars.neighbor_ids[2, l2mortar_id] - upper_left = dg.l2mortars.neighbor_ids[3, l2mortar_id] - upper_right = dg.l2mortars.neighbor_ids[4, l2mortar_id] - large = dg.l2mortars.neighbor_ids[5, l2mortar_id] + lower_left = cache.mortars.neighbor_ids[1, mortar] + lower_right = cache.mortars.neighbor_ids[2, mortar] + upper_left = cache.mortars.neighbor_ids[3, mortar] + upper_right = cache.mortars.neighbor_ids[4, mortar] + large = cache.mortars.neighbor_ids[5, mortar] # Apply smoothing - alpha[lower_left] = max(alpha_pre_smooth[lower_left], - 0.5 * alpha_pre_smooth[large], alpha[lower_left]) - alpha[lower_right] = max(alpha_pre_smooth[lower_right], - 0.5 * alpha_pre_smooth[large], alpha[lower_right]) - alpha[upper_left] = max(alpha_pre_smooth[upper_left], - 0.5 * alpha_pre_smooth[large], alpha[upper_left]) - alpha[upper_right] = max(alpha_pre_smooth[upper_right], - 0.5 * alpha_pre_smooth[large], alpha[upper_right]) - - alpha[large] = max(alpha_pre_smooth[large], 0.5 * alpha_pre_smooth[lower_left], alpha[large]) - alpha[large] = max(alpha_pre_smooth[large], 0.5 * alpha_pre_smooth[lower_right], alpha[large]) - alpha[large] = max(alpha_pre_smooth[large], 0.5 * alpha_pre_smooth[upper_left], alpha[large]) - alpha[large] = max(alpha_pre_smooth[large], 0.5 * alpha_pre_smooth[upper_right], alpha[large]) + alpha[lower_left] = max(alpha_tmp[lower_left], 0.5 * alpha_tmp[large], alpha[lower_left]) + alpha[lower_right] = max(alpha_tmp[lower_right], 0.5 * alpha_tmp[large], alpha[lower_right]) + alpha[upper_left] = max(alpha_tmp[upper_left], 0.5 * alpha_tmp[large], alpha[upper_left]) + alpha[upper_right] = max(alpha_tmp[upper_right], 0.5 * alpha_tmp[large], alpha[upper_right]) + + alpha[large] = max(alpha_tmp[large], 0.5 * alpha_tmp[lower_left], alpha[large]) + alpha[large] = max(alpha_tmp[large], 0.5 * alpha_tmp[lower_right], alpha[large]) + alpha[large] = max(alpha_tmp[large], 0.5 * alpha_tmp[upper_left], alpha[large]) + alpha[large] = max(alpha_tmp[large], 0.5 * alpha_tmp[upper_right], alpha[large]) end end diff --git a/src/timedisc/timedisc.jl b/src/timedisc/timedisc.jl index 37b7954344..99a66d3dcb 100644 --- a/src/timedisc/timedisc.jl +++ b/src/timedisc/timedisc.jl @@ -1,14 +1,24 @@ -# The following structures and methods provide a minimal implementation of -# the low-storage explicit Runge-Kutta method of -# Carpenter, Kennedy (1994) Fourth order 2N storage RK schemes, Solution 3 -# using the same interface as OrdinaryDiffEq.jl. -struct SimpleAlgorithm2N45 +# Abstract base type for time integration schemes of storage class `2N` +abstract type SimpleAlgorithm2N end + + +""" + CarpenterKennedy2N54() + +The following structures and methods provide a minimal implementation of +the low-storage explicit Runge-Kutta method of + + Carpenter, Kennedy (1994) Fourth order 2N storage RK schemes, Solution 3 + +using the same interface as OrdinaryDiffEq.jl. +""" +struct CarpenterKennedy2N54 <: SimpleAlgorithm2N a::SVector{5, Float64} b::SVector{5, Float64} c::SVector{5, Float64} - function SimpleAlgorithm2N45() + function CarpenterKennedy2N54() a = @SVector [0.0, 567301805773.0 / 1357537059087.0,2404267990393.0 / 2016746695238.0, 3550918686646.0 / 2091501179385.0, 1275806237668.0 / 842570457699.0] b = @SVector [1432997174477.0 / 9575080441755.0, 5161836677717.0 / 13612068292357.0, @@ -21,6 +31,27 @@ struct SimpleAlgorithm2N45 end end + +""" + CarpenterKennedy2N43() + +Carpenter, Kennedy (1994) Third order 2N storage RK schemes with error control +""" +struct CarpenterKennedy2N43 <: SimpleAlgorithm2N + a::SVector{4, Float64} + b::SVector{4, Float64} + c::SVector{4, Float64} + + function CarpenterKennedy2N43() + a = @SVector [0, 756391 / 934407, 36441873 / 15625000, 1953125 / 1085297] + b = @SVector [8 / 141, 6627 / 2000, 609375 / 1085297, 198961 / 526383] + c = @SVector [0, 8 / 141, 86 / 125, 1] + + new(a, b, c) + end +end + + # This struct is needed to fake https://github.com/SciML/OrdinaryDiffEq.jl/blob/0c2048a502101647ac35faabd80da8a5645beac7/src/integrators/type.jl#L1 mutable struct SimpleIntegrator2NOptions{Callback} callback::Callback # callbacks; used in Trixi @@ -55,8 +86,8 @@ mutable struct SimpleIntegrator2N{RealT<:Real, uType, Params, Sol, Alg, SimpleIn end # Fakes `solve`: https://diffeq.sciml.ai/v6.8/basics/overview/#Solving-the-Problems-1 -function solve(ode::ODEProblem, alg::SimpleAlgorithm2N45; - dt, callback=nothing, kwargs...) +function solve(ode::ODEProblem, alg::T; + dt, callback=nothing, kwargs...) where {T<:SimpleAlgorithm2N} u = copy(ode.u0) du = similar(u) u_tmp = similar(u) @@ -157,7 +188,17 @@ function Base.resize!(integrator::SimpleIntegrator2N, new_size) end -struct HypDiffN3Erk3Sstar25 +# Abstract base type for time integration schemes of storage class `3S*` +abstract type SimpleAlgorithm3Sstar end + + +""" + HypDiffN3Erk3Sstar52() + +Five stage, second-order acurate explicit Runge-Kutta scheme with stability region optimized for +the hyperbolic diffusion equation with LLF flux and polynomials of degree polydeg=3. +""" +struct HypDiffN3Erk3Sstar52 <: SimpleAlgorithm3Sstar gamma1::SVector{5, Float64} gamma2::SVector{5, Float64} gamma3::SVector{5, Float64} @@ -165,7 +206,7 @@ struct HypDiffN3Erk3Sstar25 delta::SVector{5, Float64} c::SVector{5, Float64} - function HypDiffN3Erk3Sstar25() + function HypDiffN3Erk3Sstar52() gamma1 = @SVector [0.0000000000000000E+00, 5.2656474556752575E-01, 1.0385212774098265E+00, 3.6859755007388034E-01, -6.3350615190506088E-01] gamma2 = @SVector [1.0000000000000000E+00, 4.1892580153419307E-01, -2.7595818152587825E-02, 9.1271323651988631E-02, 6.8495995159465062E-01] gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 4.1301005663300466E-01, -5.4537881202277507E-03] @@ -177,6 +218,63 @@ struct HypDiffN3Erk3Sstar25 end end + +""" + ParsaniKetchesonDeconinck3Sstar94() + +Parsani, Ketcheson, Deconinck (2013) + Optimized explicit RK schemes for the spectral difference method applied to wave propagation problems +[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899) +""" +struct ParsaniKetchesonDeconinck3Sstar94 <: SimpleAlgorithm3Sstar + gamma1::SVector{9, Float64} + gamma2::SVector{9, Float64} + gamma3::SVector{9, Float64} + beta::SVector{9, Float64} + delta::SVector{9, Float64} + c::SVector{9, Float64} + + function ParsaniKetchesonDeconinck3Sstar94() + gamma1 = @SVector [0.0000000000000000E+00, -4.6556413837561301E+00, -7.7202649689034453E-01, -4.0244202720632174E+00, -2.1296873883702272E-02, -2.4350219407769953E+00, 1.9856336960249132E-02, -2.8107894116913812E-01, 1.6894354373677900E-01] + gamma2 = @SVector [1.0000000000000000E+00, 2.4992627683300688E+00, 5.8668202764174726E-01, 1.2051419816240785E+00, 3.4747937498564541E-01, 1.3213458736302766E+00, 3.1196363453264964E-01, 4.3514189245414447E-01, 2.3596980658341213E-01] + gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00, 7.6209857891449362E-01, -1.9811817832965520E-01, -6.2289587091629484E-01, -3.7522475499063573E-01, -3.3554373281046146E-01, -4.5609629702116454E-02] + beta = @SVector [2.8363432481011769E-01, 9.7364980747486463E-01, 3.3823592364196498E-01, -3.5849518935750763E-01, -4.1139587569859462E-03, 1.4279689871485013E+00, 1.8084680519536503E-02, 1.6057708856060501E-01, 2.9522267863254809E-01] + delta = @SVector [1.0000000000000000E+00, 1.2629238731608268E+00, 7.5749675232391733E-01, 5.1635907196195419E-01, -2.7463346616574083E-02, -4.3826743572318672E-01, 1.2735870231839268E+00, -6.2947382217730230E-01, 0.0000000000000000E+00] + c = @SVector [0.0000000000000000E+00, 2.8363432481011769E-01, 5.4840742446661772E-01, 3.6872298094969475E-01, -6.8061183026103156E-01, 3.5185265855105619E-01, 1.6659419385562171E+00, 9.7152778807463247E-01, 9.0515694340066954E-01] + + new(gamma1, gamma2, gamma3, beta, delta, c) + end +end + + +""" + ParsaniKetchesonDeconinck3Sstar32() + +Parsani, Ketcheson, Deconinck (2013) + Optimized explicit RK schemes for the spectral difference method applied to wave propagation problems +[DOI: 10.1137/120885899](https://doi.org/10.1137/120885899) +""" +struct ParsaniKetchesonDeconinck3Sstar32 <: SimpleAlgorithm3Sstar + gamma1::SVector{3, Float64} + gamma2::SVector{3, Float64} + gamma3::SVector{3, Float64} + beta::SVector{3, Float64} + delta::SVector{3, Float64} + c::SVector{3, Float64} + + function ParsaniKetchesonDeconinck3Sstar32() + gamma1 = @SVector [0.0000000000000000E+00, -1.2664395576322218E-01, 1.1426980685848858E+00] + gamma2 = @SVector [1.0000000000000000E+00, 6.5427782599406470E-01, -8.2869287683723744E-02] + gamma3 = @SVector [0.0000000000000000E+00, 0.0000000000000000E+00, 0.0000000000000000E+00] + beta = @SVector [7.2366074728360086E-01, 3.4217876502651023E-01, 3.6640216242653251E-01] + delta = @SVector [1.0000000000000000E+00, 7.2196567116037724E-01, 0.0000000000000000E+00] + c = @SVector [0.0000000000000000E+00, 7.2366074728360086E-01, 5.9236433182015646E-01] + + new(gamma1, gamma2, gamma3, beta, delta, c) + end +end + + mutable struct SimpleIntegrator3SstarOptions{Callback} callback::Callback # callbacks; used in Trixi adaptive::Bool # whether the algorithm is adaptive; ignored @@ -207,8 +305,8 @@ mutable struct SimpleIntegrator3Sstar{RealT<:Real, uType, Params, Sol, Alg, Simp end # Fakes `solve`: https://diffeq.sciml.ai/v6.8/basics/overview/#Solving-the-Problems-1 -function solve(ode::ODEProblem, alg::HypDiffN3Erk3Sstar25; - dt, callback=nothing, kwargs...) +function solve(ode::ODEProblem, alg::T; + dt, callback=nothing, kwargs...) where {T<:SimpleAlgorithm3Sstar} u = copy(ode.u0) du = similar(u) u_tmp1 = similar(u) diff --git a/test/runtests.jl b/test/runtests.jl index 1289af48aa..2d78d48d82 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -38,6 +38,10 @@ const TRIXI_MPI_NPROCS = clamp(Sys.CPU_THREADS, 2, 3) include("test_paper-self-gravitating-gas-dynamics.jl") end + @time if (TRIXI_TEST == "all" && !ON_APPVEYOR) || TRIXI_TEST == "paper-self-gravitating-gas-dynamics-old" # TODO: Taal remove + include("test_paper-self-gravitating-gas-dynamics-old.jl") + end + @time if TRIXI_TEST == "all" || TRIXI_TEST == "parallel_2d" # Based on `runtests.jl` from `MPI.jl` and `PencilArrays.jl` # Precompilation disabled to prevent race conditions when loading packages diff --git a/test/test_examples_1d.jl b/test/test_examples_1d.jl index 999ca4bb81..6a9f2e4897 100644 --- a/test/test_examples_1d.jl +++ b/test/test_examples_1d.jl @@ -18,46 +18,157 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " @testset "Examples 1D" begin @testset "elixir_advection_basic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), - l2 = [6.0388296447998465e-6], - linf = [3.217887726258972e-5]) + l2 = [5.581321238071356e-6], + linf = [3.270561745361e-5]) end @testset "elixir_advection_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"), - l2 = [0.3540209654959832], - linf = [0.9999905446337742]) + l2 = [0.3540209654959832], + linf = [0.9999905446337742]) end @testset "elixir_advection_amr_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr_nonperiodic.jl"), - l2 = [4.323675034078241e-6], - linf = [3.239622040579655e-5]) + l2 = [4.317984162166343e-6], + linf = [3.239622040581043e-5]) end @testset "elixir_euler_source_terms.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), - l2 = [2.3017487546631118e-8, 1.9137514928527178e-8, 7.732828544277078e-8], - linf = [1.6282751857943367e-7, 1.426988238684146e-7, 5.298297782729833e-7]) + l2 = [2.243591980786875e-8, 1.8007794300157155e-8, 7.701353735993148e-8], + linf = [1.6169171668245497e-7, 1.4838378192827406e-7, 5.407841152660353e-7]) + end + + @testset "elixir_euler_density_wave.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_wave.jl"), + l2 = [0.0011482554828446659, 0.00011482554838682677, 5.741277410494742e-6], + linf = [0.004090978306810378, 0.0004090978313616156, 2.045489169688608e-5]) + end + + @testset "elixir_euler_density_wave.jl with initial_condition_density_pulse" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_wave.jl"), + l2 = [0.003724642049410045, 0.0037246420494099837, 0.0018623210247047657], + linf = [0.018538787219922304, 0.018538787219903874, 0.009269393609915078], + initial_condition = initial_condition_density_pulse) + end + + @testset "elixir_euler_density_wave.jl with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_wave.jl"), + l2 = [7.058654266604569e-16, 1.9703187362332313e-14, 7.286819681608443e-15], + linf = [3.774758283725532e-15, 6.733502644351574e-14, 2.4868995751603507e-14], + initial_condition = initial_condition_constant) end @testset "elixir_euler_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_nonperiodic.jl"), - l2 = [3.80950031272884e-6, 1.671745083458876e-6, 7.730956863549413e-6], - linf = [1.2966215741316844e-5, 9.2635164730126e-6, 3.090770562241829e-5]) + l2 = [3.8103398423084437e-6, 1.6765350427819571e-6, 7.733123446821975e-6], + linf = [1.2975101617795914e-5, 9.274867029507305e-6, 3.093686036947929e-5]) end @testset "elixir_euler_ec.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), - l2 = [0.1188410508446165, 0.15463666913848456, 0.4444355816866067], - linf = [0.23934128951004474, 0.27246473813214184, 0.8697154266487717]) + l2 = [0.11948926375393912, 0.15554606230413676, 0.4466895989733186], + linf = [0.2956500342985863, 0.28341906267346123, 1.0655211913235232]) + end + + @testset "elixir_euler_ec.jl with flux_shima_etal" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.06423364669980625, 0.08503530800170918, 0.2407844935006154], + linf = [0.3212150514022287, 0.3070502221852398, 1.1446658347785068], + maxiters=10, + surface_flux = flux_shima_etal, + volume_flux = flux_shima_etal) + end + + @testset "elixir_euler_ec.jl with flux_ranocha" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.06424564531300972, 0.08500942143178748, 0.2407606831620822], + linf = [0.3215742010701772, 0.30592054370082256, 1.1453122141121064], + maxiters=10, + surface_flux = flux_ranocha, + volume_flux = flux_ranocha) + end + + @testset "elixir_euler_ec.jl with flux_hll" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.0575654253650954, 0.0748264642646861, 0.21532027367350406], + linf = [0.17289848639699257, 0.22023865765090028, 0.6349097763679086], + maxiters=10, + surface_flux = flux_hll, + volume_flux = flux_hll) + end + + @testset "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), + l2 = [1.252250990134887, 0.068566581088377, 0.9448804645921002], + linf = [2.989362275712484, 0.16948139637812973, 2.665646470846281]) + end + + @testset "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl with pressure" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), + l2 = [1.297435677146544, 0.07960523576439762, 0.9453356096003658], + linf = [3.1803117766542313, 0.21385627917778924, 2.665017066963603], + shock_indicator_variable = pressure) + end + + @testset "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl with density" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), + l2 = [1.2778131494486642, 0.0709461986289949, 0.9456057083034296], + linf = [3.1163652756237115, 0.17652352860779985, 2.66646958937844], + shock_indicator_variable = density) + end + + @testset "elixir_euler_weak_blast_wave_shockcapturing.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weak_blast_wave_shockcapturing.jl"), + l2 = [0.1166063015913971, 0.15097998823740955, 0.4348178492249418], + linf = [0.1872570975062362, 0.245999816865685, 0.7037939282238272]) end @testset "elixir_euler_blast_wave_shockcapturing.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blast_wave_shockcapturing.jl"), - l2 = [0.21218593029900773, 0.2769530413665288, 0.5518482111667276], - linf = [1.505221631144809, 1.4864840122024228, 2.0501644413816162], - tspan = (0.0, 0.13)) + l2 = [0.21530530948120738, 0.2805965425286348, 0.5591770920395336], + linf = [1.508388610723991, 1.5622010377944118, 2.035149673163788], + maxiters=30) + end +end + +# Coverage test for all initial conditions +@testset "Tests for initial conditions" begin + # Linear scalar advection + @testset "elixir_advection_basic.jl with initial_condition_sin" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [9.506162481381351e-5], + linf = [0.00017492510098227054], + maxiters = 1, + initial_condition = Trixi.initial_condition_sin) + end + @testset "elixir_advection_basic.jl with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [6.120436421866528e-16], + linf = [1.3322676295501878e-15], + maxiters = 1, + initial_condition = initial_condition_constant) + end + @testset "elixir_advection_basic.jl with initial_condition_linear_x" begin + # TODO Taal: create separate `*_linear_x.jl` elixir to keep `basic` simple + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [7.602419413667044e-17], + linf = [2.220446049250313e-16], + maxiters = 1, + initial_condition = Trixi.initial_condition_linear_x, + boundary_conditions = Trixi.boundary_condition_linear_x, + periodicity=false) + end + @testset "elixir_advection_basic.jl with initial_condition_convergence_test" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [2.9989673704826656e-6], + linf = [5.841215237722963e-6], + maxiters = 1, + initial_condition = initial_condition_convergence_test, + boundary_conditions = boundary_condition_convergence_test, + periodicity=false) end end diff --git a/test/test_examples_1d_old.jl b/test/test_examples_1d_old.jl index 2820da045c..df0cb69746 100644 --- a/test/test_examples_1d_old.jl +++ b/test/test_examples_1d_old.jl @@ -14,38 +14,39 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " # Run basic tests @testset "Examples 1D" begin - @testset "parameters_advection_basic.toml" begin + @testset "taal-confirmed parameters_advection_basic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [5.581321238071356e-6], linf = [3.270561745361e-5]) end - @testset "parameters_advection_amr.toml" begin + @testset "taal-confirmed parameters_advection_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_amr.toml"), l2 = [0.3540209654959832], linf = [0.9999905446337742]) end - @testset "parameters_advection_amr_nonperiodic.toml" begin + @testset "taal-confirmed parameters_advection_amr_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_amr_nonperiodic.toml"), l2 = [4.317984162166343e-6], linf = [3.239622040581043e-5]) end - @testset "parameters_euler_nonperiodic.toml" begin + @testset "taal-confirmed parameters_euler_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_nonperiodic.toml"), l2 = [3.8103398423084437e-6, 1.6765350427819571e-6, 7.733123446821975e-6], linf = [1.2975101617795914e-5, 9.274867029507305e-6, 3.093686036947929e-5]) end - @testset "parameters_euler_blast_wave_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_blast_wave_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blast_wave_shockcapturing.toml"), l2 = [0.21530530948120738, 0.2805965425286348, 0.5591770920395336], linf = [1.508388610723991, 1.5622010377944118, 2.035149673163788], n_steps_max=30) end - @testset "parameters_euler_ec.toml" begin + @testset "taal-confirmed parameters_euler_ec.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.11948926375393912, 0.15554606230413676, 0.4466895989733186], linf = [0.2956500342985863, 0.28341906267346123, 1.0655211913235232]) end - @testset "parameters_euler_ec.toml with extra_analysis_quantities" begin + @testset "taal-confirmed parameters_euler_ec.toml with extra_analysis_quantities" begin + # TODO: Taal, remove if not required for coverage (currently not ported) test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.11948926375393912, 0.15554606230413676, 0.4466895989733186], linf = [0.2956500342985863, 0.28341906267346123, 1.0655211913235232], @@ -53,7 +54,7 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " "entropy", "energy_total", "energy_kinetic", "energy_internal", "residual"], save_analysis = true) end - @testset "parameters_euler_ec.toml with flux_shima_etal" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_shima_etal" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.06423364669980625, 0.08503530800170918, 0.2407844935006154], linf = [0.3212150514022287, 0.3070502221852398, 1.1446658347785068], @@ -61,7 +62,7 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " surface_flux = "flux_shima_etal", volume_flux = "flux_shima_etal") end - @testset "parameters_euler_ec.toml with flux_ranocha" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_ranocha" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.06424564531300972, 0.08500942143178748, 0.2407606831620822], linf = [0.3215742010701772, 0.30592054370082256, 1.1453122141121064], @@ -69,7 +70,7 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " surface_flux = "flux_ranocha", volume_flux = "flux_ranocha") end - @testset "parameters_euler_ec.toml with flux_hll" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_hll" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.0575654253650954, 0.0748264642646861, 0.21532027367350406], linf = [0.17289848639699257, 0.22023865765090028, 0.6349097763679086], @@ -77,45 +78,45 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " surface_flux = "flux_hll", volume_flux = "flux_hll") end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml" begin + @testset "taal-confirmed parameters_euler_sedov_blast_wave_shockcapturing_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), - l2 = [1.2500050612446159, 0.06878411345533555, 0.9447942342833009], - linf = [2.9791692123401017, 0.1683336841958163, 2.665578807135144]) + l2 = [1.252250990134887, 0.068566581088377, 0.9448804645921002], + linf = [2.989362275712484, 0.16948139637812973, 2.665646470846281]) end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with pressure" begin + @testset "taal-confirmed parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with pressure" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), - l2 = [1.2974912081242604, 0.07965704393481755, 0.9453618260835944], - linf = [3.1823155476320926, 0.21380426507857242, 2.6650734792251995], + l2 = [1.297435677146544, 0.07960523576439762, 0.9453356096003658], + linf = [3.1803117766542313, 0.21385627917778924, 2.665017066963603], shock_indicator_variable = "pressure") end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with density" begin + @testset "taal-confirmed parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with density" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), - l2 = [1.2797014548135697, 0.07077838776630381, 0.9457917493772532], - linf = [3.117424382044245, 0.17775688760995997, 2.666854886766347], + l2 = [1.2778131494486642, 0.0709461986289949, 0.9456057083034296], + linf = [3.1163652756237115, 0.17652352860779985, 2.66646958937844], shock_indicator_variable = "density") end - @testset "parameters_euler_weak_blast_wave_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_weak_blast_wave_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_weak_blast_wave_shockcapturing.toml"), l2 = [0.1166063015913971, 0.15097998823740955, 0.4348178492249418], linf = [0.1872570975062362, 0.245999816865685, 0.7037939282238272]) end - @testset "parameters_euler_source_terms.toml" begin + @testset "taal-confirmed parameters_euler_source_terms.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_source_terms.toml"), l2 = [2.243591980786875e-8, 1.8007794300157155e-8, 7.701353735993148e-8], linf = [1.6169171668245497e-7, 1.4838378192827406e-7, 5.407841152660353e-7]) end - @testset "parameters_euler_density_wave.toml" begin + @testset "taal-confirmed parameters_euler_density_wave.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_density_wave.toml"), l2 = [0.0011482554828446659, 0.00011482554838682677, 5.741277410494742e-6], linf = [0.004090978306810378, 0.0004090978313616156, 2.045489169688608e-5]) end - @testset "parameters_euler_density_wave.toml with initial_condition_density_pulse" begin + @testset "taal-confirmed parameters_euler_density_wave.toml with initial_condition_density_pulse" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_density_wave.toml"), l2 = [0.003724642049410045, 0.0037246420494099837, 0.0018623210247047657], linf = [0.018538787219922304, 0.018538787219903874, 0.009269393609915078], initial_condition = "initial_condition_density_pulse") end - @testset "parameters_euler_density_wave.toml with initial_condition_constant" begin + @testset "taal-confirmed parameters_euler_density_wave.toml with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_density_wave.toml"), l2 = [7.058654266604569e-16, 1.9703187362332313e-14, 7.286819681608443e-15], linf = [3.774758283725532e-15, 6.733502644351574e-14, 2.4868995751603507e-14], @@ -126,21 +127,21 @@ end # Coverage test for all initial conditions @testset "Tests for initial conditions" begin # Linear scalar advection - @testset "parameters_advection_basic.toml with initial_condition_sin" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_sin" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [9.506162481381351e-5], linf = [0.00017492510098227054], n_steps_max = 1, initial_condition = "initial_condition_sin") end - @testset "parameters_advection_basic.toml with initial_condition_constant" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [6.120436421866528e-16], linf = [1.3322676295501878e-15], n_steps_max = 1, initial_condition = "initial_condition_constant") end - @testset "parameters_advection_basic.toml with initial_condition_linear_x" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_linear_x" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [7.602419413667044e-17], linf = [2.220446049250313e-16], @@ -149,7 +150,7 @@ end boundary_conditions = "boundary_condition_linear_x", periodicity=false) end - @testset "parameters_advection_basic.toml with initial_condition_convergence_test" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_convergence_test" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [2.9989673704826656e-6], linf = [5.841215237722963e-6], diff --git a/test/test_examples_2d.jl b/test/test_examples_2d.jl index d0d0676605..edd890e6aa 100644 --- a/test/test_examples_2d.jl +++ b/test/test_examples_2d.jl @@ -22,6 +22,41 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " linf = [6.437440532547356e-5]) end + @testset "elixir_advection_basic.jl with polydeg=1" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [0.05264106093598111], + linf = [0.08754218386076518], + polydeg=1) + end + + @testset "elixir_advection_timeintegration.jl with carpenter_kennedy_erk43" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_timeintegration.jl"), + l2 = [8.908962577028364e-6], + linf = [6.969419032576418e-5], + ode_algorithm=Trixi.CarpenterKennedy2N43(), + cfl = 0.5) + end + + @testset "elixir_advection_timeintegration.jl with parsani_ketcheson_deconinck_erk94" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_timeintegration.jl"), + l2 = [7.932405161658336e-6], + linf = [6.509399993848142e-5], + ode_algorithm=Trixi.ParsaniKetchesonDeconinck3Sstar94()) + end + + @testset "elixir_advection_timeintegration.jl with parsani_ketcheson_deconinck_erk32" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_timeintegration.jl"), + l2 = [0.00440542760645958], + linf = [0.012549162970726613], + ode_algorithm=Trixi.ParsaniKetchesonDeconinck3Sstar32()) + end + + @testset "elixir_advection_timeintegration.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_timeintegration.jl"), + l2 = [9.144681765639205e-6], + linf = [6.437440532547356e-5]) + end + @testset "elixir_advection_mortar.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_mortar.jl"), l2 = [0.022356422238096973], @@ -30,8 +65,14 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " @testset "elixir_advection_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"), - l2 = [0.009801425100170215], - linf = [0.04335954152178878]) + l2 = [0.010844189678803203], + linf = [0.0491178481591637]) + end + + @testset "elixir_advection_amr_nonperiodic.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr_nonperiodic.jl"), + l2 = [0.008016815805080098], + linf = [0.04229543866599861]) end @testset "elixir_advection_restart.jl" begin @@ -40,12 +81,6 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " linf = [6.495644794757283e-5]) end - @testset "elixir_advection_timeintegration.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_timeintegration.jl"), - l2 = [9.144681778837444e-6], - linf = [6.437440532436334e-5]) - end - @testset "elixir_advection_callbacks.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_callbacks.jl")) end @@ -53,85 +88,92 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " @testset "elixir_hyp_diff_llf.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_llf.jl"), - l2 = [0.00015687751816056159, 0.001025986772217084, 0.0010259867722169909], - linf = [0.0011986956416591976, 0.006423873516411049, 0.006423873516411049]) + l2 = [0.0001568775108748819, 0.0010259867353406083, 0.0010259867353406382], + linf = [0.0011986956416590866, 0.006423873516411938, 0.006423873516411938]) end @testset "elixir_hyp_diff_harmonic_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_harmonic_nonperiodic.jl"), - l2 = [8.61813235543625e-8, 5.619399844542781e-7, 5.6193998447443e-7], - linf = [1.124861862180196e-6, 8.622436471039663e-6, 8.622436470151484e-6]) + l2 = [8.618132353932638e-8, 5.619399844708813e-7, 5.619399845476024e-7], + linf = [1.124861862326869e-6, 8.622436471483752e-6, 8.622436469707395e-6]) end @testset "elixir_hyp_diff_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_nonperiodic.jl"), - l2 = [8.523077653955306e-6, 2.8779323653065056e-5, 5.4549427691297846e-5], - linf = [5.5227409524905013e-5, 0.0001454489597927185, 0.00032396328684569653]) + l2 = [8.523077654037775e-6, 2.877932365308637e-5, 5.454942769137812e-5], + linf = [5.484978959957587e-5, 0.00014544895979200218, 0.000324491268921534]) end @testset "elixir_hyp_diff_upwind.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_upwind.jl"), - l2 = [5.868147556385677e-6, 3.805179273239753e-5, 3.805179273248075e-5], - linf = [3.7019654930525725e-5, 0.00021224229433514097, 0.00021224229433514097]) + l2 = [5.868147556488962e-6, 3.8051792732628014e-5, 3.8051792732620214e-5], + linf = [3.70196549871471e-5, 0.0002072058411455302, 0.00020720584114464202]) end @testset "elixir_euler_source_terms.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), - l2 = [8.517783186497567e-7, 1.2350199409361865e-6, 1.2350199409828616e-6, 4.277884398786315e-6], - linf = [8.357934254688004e-6, 1.0326389653148027e-5, 1.0326389654924384e-5, 4.4961900057316484e-5]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), + l2 = [8.517783186497567e-7, 1.2350199409361865e-6, 1.2350199409828616e-6, 4.277884398786315e-6], + linf = [8.357934254688004e-6, 1.0326389653148027e-5, 1.0326389654924384e-5, 4.4961900057316484e-5]) end @testset "elixir_euler_density_wave.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_wave.jl"), - l2 = [0.0010600778457965205, 0.00010600778457646603, 0.0002120155691588112, 2.6501946142012653e-5], - linf = [0.006614198043407127, 0.0006614198043931596, 0.001322839608845383, 0.00016535495117153687], - tspan = (0.0, 0.5)) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_wave.jl"), + l2 = [0.001060077845747576, 0.00010600778457107525, 0.00021201556914875742, 2.6501946139091318e-5], + linf = [0.0065356386867677085, 0.0006535638688170142, 0.0013071277374487877, 0.0001633909674296774], + tspan = (0.0, 0.5)) end @testset "elixir_euler_nonperiodic.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_nonperiodic.jl"), - l2 = [2.3652137675654753e-6, 2.1386731303685556e-6, 2.138673130413185e-6, 6.009920290578574e-6], - linf = [1.4080448659026246e-5, 1.7581818010814487e-5, 1.758181801525538e-5, 5.9568540361709665e-5]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_nonperiodic.jl"), + l2 = [2.3652137675654753e-6, 2.1386731303685556e-6, 2.138673130413185e-6, 6.009920290578574e-6], + linf = [1.4080448659026246e-5, 1.7581818010814487e-5, 1.758181801525538e-5, 5.9568540361709665e-5]) end @testset "elixir_euler_ec.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), - l2 = [0.061733846713578594, 0.05020086119442834, 0.05020836856347214, 0.2259064869636338], - linf = [0.29894122391731826, 0.30853631977725215, 0.3084722538869674, 1.0652455597305965]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.06159341742582756, 0.05012484425381723, 0.05013298724507752, 0.22537740506116724], + linf = [0.29912627861573327, 0.30886767304359375, 0.3088108573487326, 1.0657556075017878]) end @testset "elixir_euler_blast_wave_shockcapturing.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blast_wave_shockcapturing.jl"), - l2 = [0.13575932799459445, 0.11346025131402862, 0.11346028941202581, 0.33371846538168354], - linf = [1.4662633480487193, 1.3203905049492335, 1.320390504949303, 1.8131376065886553], - tspan = (0.0, 0.13)) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blast_wave_shockcapturing.jl"), + l2 = [0.13910202327088322, 0.11538722576277083, 0.1153873048510009, 0.3387876385945495], + linf = [1.454418325889352, 1.3236875559310013, 1.323687555933169, 1.8225476335086368], + maxiters=30) end @testset "elixir_euler_weak_blast_wave_shockcapturing.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weak_blast_wave_shockcapturing.jl"), - l2 = [0.053797693352771236, 0.0469609422046655, 0.04696357535470453, 0.19685219525959569], - linf = [0.18540098690235163, 0.2402949901937739, 0.23266805976720523, 0.6874635927547934]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_weak_blast_wave_shockcapturing.jl"), + l2 = [0.05365734539276933, 0.04683903386565478, 0.04684207891980008, 0.19632055541821553], + linf = [0.18542234326379825, 0.24074440953554058, 0.23261143887822433, 0.687464986948263]) end @testset "elixir_euler_blast_wave_shockcapturing_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blast_wave_shockcapturing_amr.jl"), - l2 = [0.6778339184192986, 0.28136085729167076, 0.2813607687129121, 0.7202946425475186], - linf = [2.8891939545999277, 1.8038083274644838, 1.8036523839220984, 3.0363712085327177], + l2 = [0.6776486969229696, 0.2813026529898539, 0.2813025645101231, 0.7174702524881597], + linf = [2.8939055423031546, 1.7997630098946877, 1.7997118659969253, 3.0341223482585686], tspan = (0.0, 1.0)) end @testset "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl with tend = 1.0" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), - l2 = [0.48179128651635356, 0.16552908046011455, 0.16553045844776362, 0.6182628255460497], - linf = [2.4847876521233907, 1.2814307117459813, 1.2814769220593392, 6.474196250771773], + l2 = [0.4820048896322639, 0.16556563003698888, 0.16556563003698901, 0.643610807739157], + linf = [2.485752556439829, 1.2870638985941658, 1.2870638985941667, 6.474544663221404], tspan = (0.0, 1.0)) end + @testset "elixir_euler_blob_shockcapturing_mortar.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blob_shockcapturing_mortar.jl"), + l2 = [0.22114610074017435, 0.6275613030540599, 0.24325218693791564, 2.925865235621878], + linf = [10.524011747446043, 27.512527136693347, 9.454054943042742, 97.53367336970214], + tspan = (0.0, 0.5)) + end + @testset "elixir_euler_blob_shockcapturing_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blob_shockcapturing_amr.jl"), - l2 = [0.2012143467980036, 1.1813241716700988, 0.10144725208346557, 5.230607564921326], - linf = [14.111578610092542, 71.21944410118338, 7.304666476530256, 291.9385076318331], + l2 = [0.2016728420174888, 1.1836138789789359, 0.10165086496270354, 5.237367755805095], + linf = [14.085819993255987, 71.07473800830421, 7.366144023918916, 297.24197965204814], tspan = (0.0, 0.12)) end @@ -144,8 +186,8 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " # minor versions of Julia. # See https://github.com/trixi-framework/Trixi.jl/issues/232#issuecomment-709738400 @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_khi_shockcapturing.jl"), - l2 = [0.0020460050625351277, 0.0028624298590723372, 0.001971035381754319, 0.004814883331768111], - linf = [0.02437585564403255, 0.018033033465721604, 0.00993916546672498, 0.02097263472404709], + l2 = [0.002046615463716511, 0.002862576343897973, 0.001971146183422579, 0.004817029337018751], + linf = [0.024299256322982465, 0.01620011715132652, 0.009869197749689947, 0.02060000394920891], tspan = (0.0, 0.2)) else @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_khi_shockcapturing.jl"), @@ -162,8 +204,8 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " # minor versions of Julia. # See https://github.com/trixi-framework/Trixi.jl/issues/232#issuecomment-709738400 @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_khi_shockcapturing_amr.jl"), - l2 = [0.001617236176233394, 0.0023394729603446697, 0.001296199247911843, 0.0033150160736185323], - linf = [0.019002843896656074, 0.017242107049387223, 0.008179888370650977, 0.016885672229959958], + l2 = [0.001653490458693617, 0.0023814551690212226, 0.0013742646130843919, 0.0031589243386909585], + linf = [0.022479473484114054, 0.015056172762090259, 0.0070761455651367836, 0.01461791479513419], tspan = (0.0, 0.2)) else @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_khi_shockcapturing_amr.jl"), @@ -173,122 +215,214 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " @testset "elixir_euler_vortex.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"), - l2 = [3.6342636871275523e-6, 0.0032111366825032443, 0.0032111479254594345, 0.004545714785045611], - linf = [7.903587114788113e-5, 0.030561314311228993, 0.030502600162385596, 0.042876297246817074]) + l2 = [3.6343138447409784e-6, 0.0032111379843728876, 0.0032111482778261658, 0.004545715889714643], + linf = [7.901869034399045e-5, 0.030511158864742205, 0.030451936462313256, 0.04361908901631395]) end @testset "elixir_euler_vortex_mortar.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar.jl"), - l2 = [2.120307461394424e-6, 2.7929229084570266e-5, 3.759342242369596e-5, 8.813646673773311e-5], - linf = [5.9320459189771135e-5, 0.0007491265403041236, 0.0008165690047976515, 0.0022122638048145404]) + l2 = [2.1202421511973067e-6, 2.7929028341308907e-5, 3.7593065314592924e-5, 8.813423453465327e-5], + linf = [5.93205509794581e-5, 0.0007486675478352023, 0.0008175405566226424, 0.002212267888996422]) end @testset "elixir_euler_vortex_mortar_split.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar_split.jl"), - l2 = [2.1203693476896995e-6, 2.8053512416422296e-5, 3.76179445622429e-5, 8.840787521479401e-5], - linf = [5.9005667252809424e-5, 0.0007554116730550398, 0.00081660478740464, 0.002209016304192346]) + l2 = [2.1203040671963692e-6, 2.8053312800289536e-5, 3.761758762899687e-5, 8.840565162128428e-5], + linf = [5.900575985384737e-5, 0.0007547236106317801, 0.000817616344069072, 0.0022090204216524967]) end @testset "elixir_euler_vortex_mortar_split.jl with flux_central" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar_split.jl"), - l2 = [2.120307461409829e-6, 2.7929229084583212e-5, 3.759342242369501e-5, 8.813646673812448e-5], - linf = [5.932045918888296e-5, 0.0007491265403021252, 0.0008165690047987617, 0.002212263804818093], + l2 = [2.1202421512026147e-6, 2.7929028341288412e-5, 3.759306531457842e-5, 8.813423453452753e-5], + linf = [5.932055097812583e-5, 0.0007486675478027838, 0.0008175405566221983, 0.0022122678889928693], volume_flux = flux_central) end @testset "elixir_euler_vortex_mortar_split.jl with flux_shima_etal" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar_split.jl"), - l2 = [2.120103291509122e-6, 2.805652562691104e-5, 3.759500428816484e-5, 8.841374592860891e-5], - linf = [5.934103184424e-5, 0.0007552316820342853, 0.0008152449048961508, 0.002206987374638203], + l2 = [2.1200379425410095e-6, 2.805632600815787e-5, 3.759464715100376e-5, 8.84115216688531e-5], + linf = [5.934112354222254e-5, 0.00075475390405777, 0.0008162778009123128, 0.002206991473730824], volume_flux = flux_shima_etal) end @testset "elixir_euler_vortex_mortar_split.jl with flux_ranocha" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar_split.jl"), - l2 = [2.1201032806889955e-6, 2.8056528074361895e-5, 3.759500957406334e-5, 8.841379428954133e-5], - linf = [5.934027760512439e-5, 0.0007552314317718078, 0.0008152450117491217, 0.0022069976113101575], + l2 = [2.120037931908414e-6, 2.805632845562748e-5, 3.759465243706522e-5, 8.841157002762106e-5], + linf = [5.934036929955422e-5, 0.0007547536380712039, 0.000816277844819191, 0.0022070017103743567], volume_flux = flux_ranocha) end @testset "elixir_euler_vortex_shockcapturing.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_shockcapturing.jl"), - l2 = [3.80342739421474e-6, 5.561118953968859e-5, 5.564042529709319e-5, 0.0001570628548096201], - linf = [8.491382365727329e-5, 0.0009602965158113097, 0.0009669978616948516, 0.0030750353269972663]) + l2 = [3.8034711509468997e-6, 5.561030973129845e-5, 5.563956603258559e-5, 0.00015706441614772137], + linf = [8.493408680687597e-5, 0.0009610606296146518, 0.0009684675522437791, 0.003075812221315033]) end @testset "elixir_euler_vortex_mortar_shockcapturing.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_mortar_shockcapturing.jl"), - l2 = [2.1203693476896995e-6, 2.8053512416422296e-5, 3.76179445622429e-5, 8.840787521479401e-5], - linf = [5.9005667252809424e-5, 0.0007554116730550398, 0.00081660478740464, 0.002209016304192346]) + l2 = [2.1205855860697905e-6, 2.805356649496243e-5, 3.7617723084029226e-5, 8.841527980901164e-5], + linf = [5.9005286894620035e-5, 0.0007547295163081724, 0.0008176139355887679, 0.0022089993378280326]) end @testset "elixir_euler_vortex_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex_amr.jl"), - l2 = [2.077084130934081e-6, 0.0032815991956917493, 0.0032807020145523757, 0.004646298951577697], - linf = [4.435791998502747e-5, 0.03176757178286449, 0.031797053799604846, 0.045615287239808566]) + l2 = [2.0750351586876505e-6, 0.003281637561081054, 0.0032807189382436106, 0.0046470466205649425], + linf = [4.625172721961501e-5, 0.0318570623352572, 0.031910329823320094, 0.04575283708569344]) end - @testset "elixir_mhd_alfven_wave.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"), - l2 = [0.00011134312019581907, 5.880417517656501e-6, 5.880417517683334e-6, 8.433533326833135e-6, 1.2944026635567339e-6, 1.2259080543012733e-6, 1.2259080543038862e-6, 1.8334999489680995e-6, 8.098795948637635e-7], - linf = [0.0002678907090871707, 1.6257637592484442e-5, 1.6257637592095864e-5, 2.7343412701746894e-5, 5.327954748168828e-6, 8.10079419122367e-6, 8.100794191445715e-6, 1.2083599637696674e-5, 4.179907421413125e-6]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"), + l2 = [0.00011134513490658689, 5.880188909157728e-6, 5.880188909159547e-6, 8.432880997656317e-6, 1.2942387343501909e-6, 1.2238820298971968e-6, 1.2238820298896402e-6, 1.830621754702352e-6, 8.071881352562945e-7], + linf = [0.00025632790161078667, 1.6379021163651086e-5, 1.637902116437273e-5, 2.58759953227633e-5, 5.327732286231068e-6, 8.118520269495555e-6, 8.118520269606577e-6, 1.2107354757678879e-5, 4.165806320060789e-6]) end @testset "elixir_mhd_alfven_wave_mortar.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave_mortar.jl"), - l2 = [4.6108151315202035e-6, 1.6897860606321754e-6, 1.6208236429504275e-6, 1.6994662614575904e-6, 1.486435064660995e-6, 1.3875465211720615e-6, 1.3411325436690753e-6, 1.7155153011375413e-6, 9.813872476368202e-7], - linf = [3.5225667207927636e-5, 1.5349379665866025e-5, 1.4264328575347429e-5, 1.4421439547898651e-5, 7.744170905765735e-6, 1.0187833250130396e-5, 9.861911995590056e-6, 1.6018139446766222e-5, 5.563892853177171e-6], - tspan = (0.0, 1.0)) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave_mortar.jl"), + l2 = [4.608223422391918e-6, 1.6891556053250136e-6, 1.6202140809698534e-6, 1.6994400213969954e-6, 1.4856807283318347e-6, 1.387768347373047e-6, 1.3411738859512443e-6, 1.7155298750074954e-6, 9.799762075600064e-7], + linf = [3.52219535260101e-5, 1.534468550207224e-5, 1.426263439847919e-5, 1.4421456102198249e-5, 7.743399239257265e-6, 1.019242699840106e-5, 9.862935257842764e-6, 1.6018118328936515e-5, 5.563695788849475e-6], + tspan = (0.0, 1.0)) end @testset "elixir_mhd_ec.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec.jl"), - l2 = [0.03628315925311581, 0.04301306535453907, 0.042998910996002976, 0.025746791646914315, 0.1620587870592711, 0.01745580631201365, 0.01745656644392971, 0.02688212902288343, 0.00014263322984147517], - linf = [0.23504901239438747, 0.31563591777956146, 0.3094412744514615, 0.21177505529310434, 0.9738775041875032, 0.09120517132559702, 0.0919645047337756, 0.15691668358334432, 0.0035581030835232378]) + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec.jl"), + l2 = [0.03607862694368351, 0.04281395008247395, 0.04280207686965749, 0.025746770192645763, 0.1611518499414067, 0.017455917249117023, 0.017456981264942977, 0.02688321120361229, 0.00015024027267648003], + linf = [0.23502083666166018, 0.3156846367743936, 0.31227895161037256, 0.2118146956106238, 0.9743049414302711, 0.09050624115026618, 0.09131633488909774, 0.15693063355520998, 0.0038394720095667593]) end @testset "elixir_mhd_orszag_tang_shockcapturing_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_orszag_tang_shockcapturing_amr.jl"), - l2 = [0.21894721281911703, 0.26463302881957645, 0.31507117273918805, 0.0, 0.5152448296476039, 0.23023274798808147, 0.3441658797437742, 0.0, 0.0026733194007546126], - linf = [1.2352286192592534, 0.6678377088690369, 0.8739431671403393, 0.0, 2.740788100988533, 0.6552251870441527, 0.9546253266155187, 0.0, 0.03816123862195953], + l2 = [0.21662313415818582, 0.2635698604231871, 0.31395699611730377, 0.0, 0.5122276249069517, 0.22914894367706035, 0.34302293430536107, 0.0, 0.0031837261356598232], + linf = [1.2455340346415893, 0.6656259804847943, 0.8530619473770993, 0.0, 2.762224683447692, 0.6641473992806939, 0.9631804383659317, 0.0, 0.04504842687596635], tspan = (0.0, 0.09)) end @testset "elixir_mhd_orszag_tang_shockcapturing_amr.jl with flux_hll" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_orszag_tang_shockcapturing_amr.jl"), - l2 = [0.10811766489910432, 0.20202956511451342, 0.22988158838731435, 0.0, 0.29953446216629687, 0.1570994904887061, 0.24308871328334844, 0.0, 0.011100323402918071], - linf = [0.5520018702830969, 0.5101514485370506, 0.6565173233469559, 0.0, 0.9528527119850311, 0.3990329190790233, 0.6737022346309564, 0.0, 0.18244193667531056], + l2 = [0.10797773670821377, 0.20183575429259998, 0.2297276946458608, 0.0, 0.29942847198143785, 0.1567941428185007, 0.24283635408491952, 0.0, 0.0032487131364797796], + linf = [0.5598159626426933, 0.5095082640545004, 0.655948904969917, 0.0, 0.9809725319955653, 0.39916604098537073, 0.6748429903024491, 0.0, 0.07124312329480051], tspan = (0.0, 0.06), surface_flux = flux_hll) end +end + +# Coverage test for all initial conditions +@testset "Tests for initial conditions" begin + # TODO Taal: create separate elixirs for ICs/BCs to keep `basic` simple + # Linear scalar advection + @testset "elixir_advection_basic.jl with initial_condition_sin_sin" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [0.0001424424804667062], + linf = [0.0007260692243250544], + maxiters = 1, + initial_condition = Trixi.initial_condition_sin_sin) + end + + @testset "elixir_advection_basic.jl with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [6.120436421866528e-16], + linf = [1.3322676295501878e-15], + maxiters = 1, + initial_condition = initial_condition_constant) + end + + @testset "elixir_advection_basic.jl with initial_condition_linear_x_y" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [2.559042358408011e-16], + linf = [6.8833827526759706e-15], + maxiters = 1, + initial_condition = Trixi.initial_condition_linear_x_y, + boundary_conditions = Trixi.boundary_condition_linear_x_y, + periodicity=false) + end + + @testset "elixir_advection_basic.jl with initial_condition_linear_x" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [1.5901063275642836e-16], + linf = [1.5543122344752192e-15], + maxiters = 1, + initial_condition = Trixi.initial_condition_linear_x, + boundary_conditions = Trixi.boundary_condition_linear_x, + periodicity=false) + end + + @testset "elixir_advection_basic.jl with initial_condition_linear_y" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [1.597250146891042e-16], + linf = [3.552713678800501e-15], + maxiters = 1, + initial_condition = Trixi.initial_condition_linear_y, + boundary_conditions = Trixi.boundary_condition_linear_y, + periodicity=false) + end + + # Compressible Euler + @testset "elixir_euler_vortex.jl one step with initial_condition_density_pulse" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"), + l2 = [0.003201074851451383, 0.0032010748514513724, 0.0032010748514513716, 0.0032010748514513794], + linf = [0.043716393835876444, 0.043716393835876444, 0.043716393835876, 0.04371639383587578], + maxiters = 1, + initial_condition = initial_condition_density_pulse) + end + + @testset "elixir_euler_vortex.jl one step with initial_condition_pressure_pulse" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"), + l2 = [0.00018950189533270512, 0.0020542290689775757, 0.002054229068977579, 0.01013381064979542], + linf = [0.004763284475434837, 0.028439617580275578, 0.028439617580275467, 0.13640572175447918], + maxiters = 1, + initial_condition = Trixi.initial_condition_pressure_pulse) + end + + @testset "elixir_euler_vortex.jl one step with initial_condition_density_pressure_pulse" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"), + l2 = [0.0031880440066425803, 0.0050397619349217574, 0.005039761934921767, 0.014340770024960708], + linf = [0.04279723800834989, 0.06783565847184869, 0.06783565847184914, 0.19291274039254347], + maxiters = 1, + initial_condition = Trixi.initial_condition_density_pressure_pulse) + end + + @testset "elixir_euler_vortex.jl one step with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_vortex.jl"), + l2 = [2.359732835648237e-16, 1.088770274131804e-16, 1.1814939065033234e-16, 1.980283448445849e-15], + linf = [4.440892098500626e-16, 2.914335439641036e-16, 4.718447854656915e-16, 3.552713678800501e-15], + maxiters = 1, + initial_condition = initial_condition_constant) + end + + @testset "differences-to-master elixir_euler_sedov_blast_wave_shockcapturing_amr.jl one step" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), + l2 = [0.0021037031798961936, 0.010667428589443041, 0.010667428589443027, 0.11041565217737695], + linf = [0.11754829172684966, 0.7227194329885249, 0.7227194329885249, 5.42708544137305], + maxiters=1) + end + + @testset "differences-to-master parameters_euler_sedov_blast_wave_shockcapturing_amr.toml one step with initial_condition_medium_sedov_blast_wave" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_sedov_blast_wave_shockcapturing_amr.jl"), + l2 = [0.002102553227287478, 0.01066154856802227, 0.010661548568022277, 0.11037470219676422], + linf = [0.11749257043751615, 0.7223475657303381, 0.7223475657303381, 5.425015419074852], + maxiters=1, initial_condition=initial_condition_medium_sedov_blast_wave) + end + + # GLM-MHD + @testset "elixir_mhd_alfven_wave.jl one step with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"), + l2 = [1.9377318494777845e-16, 2.0108417179968547e-16, 4.706803550379074e-16, 9.849916218369067e-17, 9.578096259273606e-15, 4.995499731290712e-16, 2.72017579525395e-16, 9.963303137205655e-17, 1.7656549191657418e-16], + linf = [4.440892098500626e-16, 7.494005416219807e-16, 1.7763568394002505e-15, 2.220446049250313e-16, 2.1316282072803006e-14, 1.3322676295501878e-15, 8.881784197001252e-16, 2.220446049250313e-16, 7.414582366945819e-16], + maxiters = 1, + initial_condition = initial_condition_constant) + end @testset "elixir_mhd_rotor_shockcapturing_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_rotor_shockcapturing_amr.jl"), - l2 = [1.2635449181120562, 1.8356372101225815, 1.7037178920138905, 0.0, 2.3126474248436755, 0.21626214510814928, 0.23683073618598693, 0.0, 0.002132844459180628], - linf = [10.353812749882609, 14.287005221052532, 15.749922601372482, 0.0, 17.089103075830185, 1.342006287193983, 1.4341241435029897, 0.0, 0.053488038358224646], + l2 = [1.2428140306560267, 1.7997194450337968, 1.6900291785233619, 0.0, 2.2634513724749357, 0.212710214030601, 0.233276208669814, 0.0, 0.0026495769095112244], + linf = [10.47092272020676, 14.061476930703114, 15.55246880748034, 0.0, 16.619962600809156, 1.3033533536346604, 1.4125607690546562, 0.0, 0.07338769474671016], tspan = (0.0, 0.05)) end @testset "elixir_mhd_blast_wave_shockcapturing_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_blast_wave_shockcapturing_amr.jl"), - l2 = [0.2101138028554417, 4.4379574949560014, 2.6239651859752238, 0.0, 359.15092246795564, 2.458555512327778, 1.4961525378625697, 0.0, 0.01346996306689436], - linf = [2.4484577379812915, 63.229017006957584, 15.321798382742966, 0.0, 2257.8231751993367, 13.692356305778407, 10.026947993726841, 0.0, 0.2839557716528234], + l2 = [0.1757875762080873, 3.8532519959458216, 2.4727214755520532, 0.0, 355.0835842161213, 2.3454068130466776, 1.3916366548136, 0.0, 0.028930416439621368], + linf = [1.5948842870594393, 44.31605592215359, 12.854945034752436, 0.0, 2207.513124699695, 12.706623740109995, 8.987432397883575, 0.0, 0.4980365769225257], tspan = (0.0, 0.003)) end - - @testset "elixir_euler_gravity_jeans_instability.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_gravity_jeans_instability.jl"), - l2 = [10733.633835505429, 13356.78041873671, 1.6035728244276416e-6, 26834.076946460955], - linf = [15194.296496834606, 18881.481413976213, 7.967111441550177e-6, 37972.997184962034], - tspan = (0.0, 0.1)) - end - - @testset "elixir_euler_gravity_sedov_blast_wave_shockcapturing_amr.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_gravity_sedov_blast_wave_shockcapturing_amr.jl"), - l2 = [0.04630745182870653, 0.06507397069667138, 0.06507397069667123, 0.48971269294890085], - linf = [2.383463161765847, 4.0791883314039605, 4.07918833140396, 16.246070713311475], - tspan = (0.0, 0.05)) - end end @@ -351,13 +485,6 @@ end @test_nowarn println(callbacks) end -# Only run extended tests if environment variable is set -if haskey(ENV, "TRIXI_TEST_EXTENDED") && lowercase(ENV["TRIXI_TEST_EXTENDED"]) in ("1", "on", "yes") - @testset "Examples (long execution time)" begin - @test_nowarn @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blob_shockcapturing_mortar.jl")) - end -end - # Clean up afterwards: delete Trixi output directory @test_nowarn rm(outdir, recursive=true) diff --git a/test/test_examples_2d_old.jl b/test/test_examples_2d_old.jl index 1aa1c4fd37..5233974dd1 100644 --- a/test/test_examples_2d_old.jl +++ b/test/test_examples_2d_old.jl @@ -14,205 +14,212 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " # Run basic tests @testset "Examples 2D" begin - @testset "parameters_advection_basic.toml" begin + @testset "taal-confirmed parameters_advection_basic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [9.144681765639205e-6], linf = [6.437440532547356e-5]) end - @testset "parameters_advection_basic.toml with polydeg=1" begin + @testset "taal-confirmed parameters_advection_basic.toml with polydeg=1" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.05264106093598111], linf = [0.08754218386076518], polydeg=1) end - @testset "parameters_advection_basic.toml with carpenter_kennedy_erk43" begin + @testset "taal-confirmed parameters_advection_basic.toml with carpenter_kennedy_erk43" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [8.908962577028364e-6], linf = [6.969419032576418e-5], time_integration_scheme = "timestep_carpenter_kennedy_erk43_2N!", cfl = 0.5) end - @testset "parameters_advection_basic.toml with parsani_ketcheson_deconinck_erk94" begin + @testset "taal-confirmed parameters_advection_basic.toml with parsani_ketcheson_deconinck_erk94" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [7.932405161658336e-6], linf = [6.509399993848142e-5], time_integration_scheme = "timestep_parsani_ketcheson_deconinck_erk94_3Sstar!") end - @testset "parameters_advection_basic.toml with parsani_ketcheson_deconinck_erk32" begin + @testset "taal-confirmed parameters_advection_basic.toml with parsani_ketcheson_deconinck_erk32" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.00440542760645958], linf = [0.012549162970726613], time_integration_scheme = "timestep_parsani_ketcheson_deconinck_erk32_3Sstar!") end - @testset "parameters_mhd_alfven_wave.toml" begin + @testset "taal-confirmed parameters_mhd_alfven_wave.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_alfven_wave.toml"), l2 = [0.00011134513490658689, 5.880188909157728e-6, 5.880188909159547e-6, 8.432880997656317e-6, 1.2942387343501909e-6, 1.2238820298971968e-6, 1.2238820298896402e-6, 1.830621754702352e-6, 8.071881352562945e-7], linf = [0.00025632790161078667, 1.6379021163651086e-5, 1.637902116437273e-5, 2.58759953227633e-5, 5.327732286231068e-6, 8.118520269495555e-6, 8.118520269606577e-6, 1.2107354757678879e-5, 4.165806320060789e-6]) end - @testset "parameters_advection_amr.toml" begin + @testset "taal-confirmed parameters_advection_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_amr.toml"), l2 = [0.010844189678803203], linf = [0.0491178481591637]) end - @testset "parameters_advection_amr_nonperiodic.toml" begin + @testset "taal-confirmed parameters_advection_amr_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_amr_nonperiodic.toml"), l2 = [0.008016815805080098], linf = [0.04229543866599861]) end - @testset "parameters_euler_vortex_amr.toml" begin + @testset "taal-confirmed parameters_euler_vortex_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_amr.toml"), l2 = [2.0750351586876505e-6, 0.003281637561081054, 0.0032807189382436106, 0.0046470466205649425], linf = [4.625172721961501e-5, 0.0318570623352572, 0.031910329823320094, 0.04575283708569344]) end - @testset "parameters_euler_blast_wave_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_blast_wave_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blast_wave_shockcapturing.toml"), l2 = [0.13910202327088322, 0.11538722576277083, 0.1153873048510009, 0.3387876385945495], linf = [1.454418325889352, 1.3236875559310013, 1.323687555933169, 1.8225476335086368], n_steps_max=30) end - @testset "parameters_euler_ec.toml" begin + @testset "taal-confirmed parameters_euler_ec.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.06159341742582756, 0.05012484425381723, 0.05013298724507752, 0.22537740506116724], linf = [0.29912627861573327, 0.30886767304359375, 0.3088108573487326, 1.0657556075017878]) end - @testset "parameters_euler_density_wave.toml" begin + @testset "taal-confirmed parameters_euler_density_wave.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_density_wave.toml"), l2 = [0.001060077845747576, 0.00010600778457107525, 0.00021201556914875742, 2.6501946139091318e-5], linf = [0.0065356386867677085, 0.0006535638688170142, 0.0013071277374487877, 0.0001633909674296774], extra_analysis_quantities=["l2_error_primitive", "linf_error_primitive"], t_end=0.5) end - @testset "parameters_mhd_ec.toml" begin + @testset "taal-confirmed parameters_mhd_ec.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_ec.toml"), l2 = [0.03607862694368351, 0.04281395008247395, 0.04280207686965749, 0.025746770192645763, 0.1611518499414067, 0.017455917249117023, 0.017456981264942977, 0.02688321120361229, 0.00015024027267648003], linf = [0.23502083666166018, 0.3156846367743936, 0.31227895161037256, 0.2118146956106238, 0.9743049414302711, 0.09050624115026618, 0.09131633488909774, 0.15693063355520998, 0.0038394720095667593]) end - @testset "parameters_hyp_diff_harmonic_nonperiodic.toml" begin + @testset "taal-confirmed parameters_hyp_diff_harmonic_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_harmonic_nonperiodic.toml"), l2 = [8.618132353932638e-8, 5.619399844708813e-7, 5.619399845476024e-7], linf = [1.124861862326869e-6, 8.622436471483752e-6, 8.622436469707395e-6]) end - @testset "parameters_hyp_diff_llf.toml" begin + @testset "taal-confirmed parameters_hyp_diff_llf.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_llf.toml"), - l2 = [0.00015687751088073104, 0.0010259867353397119, 0.0010259867353398994], - linf = [0.001198695640053704, 0.006423873515701395, 0.006423873515686296]) + l2 = [0.0001568775108748819, 0.0010259867353406083, 0.0010259867353406382], + linf = [0.0011986956416590866, 0.006423873516411938, 0.006423873516411938]) end - @testset "parameters_hyp_diff_nonperiodic.toml" begin + @testset "taal-confirmed parameters_hyp_diff_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_nonperiodic.toml"), l2 = [8.523077654037775e-6, 2.877932365308637e-5, 5.454942769137812e-5], linf = [5.484978959957587e-5, 0.00014544895979200218, 0.000324491268921534]) end - @testset "parameters_hyp_diff_upwind.toml" begin + @testset "taal-confirmed parameters_hyp_diff_upwind.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_upwind.toml"), l2 = [5.868147556488962e-6, 3.8051792732628014e-5, 3.8051792732620214e-5], linf = [3.70196549871471e-5, 0.0002072058411455302, 0.00020720584114464202]) end - @testset "parameters_advection_mortar.toml" begin + @testset "taal-confirmed parameters_advection_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_mortar.toml"), l2 = [0.022356422238096973], linf = [0.5043638249003257]) end - @testset "parameters_mhd_alfven_wave_mortar.toml" begin + @testset "taal-confirmed parameters_mhd_alfven_wave_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_alfven_wave_mortar.toml"), l2 = [4.608223422391918e-6, 1.6891556053250136e-6, 1.6202140809698534e-6, 1.6994400213969954e-6, 1.4856807283318347e-6, 1.387768347373047e-6, 1.3411738859512443e-6, 1.7155298750074954e-6, 9.799762075600064e-7], linf = [3.52219535260101e-5, 1.534468550207224e-5, 1.426263439847919e-5, 1.4421456102198249e-5, 7.743399239257265e-6, 1.019242699840106e-5, 9.862935257842764e-6, 1.6018118328936515e-5, 5.563695788849475e-6], t_end=1.0) end - @testset "parameters_euler_vortex_mortar.toml" begin + @testset "taal-confirmed parameters_euler_vortex_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar.toml"), l2 = [2.1202421511973067e-6, 2.7929028341308907e-5, 3.7593065314592924e-5, 8.813423453465327e-5], linf = [5.93205509794581e-5, 0.0007486675478352023, 0.0008175405566226424, 0.002212267888996422]) end - @testset "parameters_euler_vortex_mortar_split.toml" begin + @testset "taal-confirmed parameters_euler_vortex_mortar_split.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar_split.toml"), l2 = [2.1203040671963692e-6, 2.8053312800289536e-5, 3.761758762899687e-5, 8.840565162128428e-5], linf = [5.900575985384737e-5, 0.0007547236106317801, 0.000817616344069072, 0.0022090204216524967]) end - @testset "parameters_euler_vortex_mortar_split.toml with flux_central" begin + @testset "taal-confirmed parameters_euler_vortex_mortar_split.toml with flux_central" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar_split.toml"), l2 = [2.1202421512026147e-6, 2.7929028341288412e-5, 3.759306531457842e-5, 8.813423453452753e-5], linf = [5.932055097812583e-5, 0.0007486675478027838, 0.0008175405566221983, 0.0022122678889928693], volume_flux = "flux_central") end - @testset "parameters_euler_vortex_mortar_split.toml with flux_shima_etal" begin + @testset "taal-confirmed parameters_euler_vortex_mortar_split.toml with flux_shima_etal" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar_split.toml"), l2 = [2.1200379425410095e-6, 2.805632600815787e-5, 3.759464715100376e-5, 8.84115216688531e-5], linf = [5.934112354222254e-5, 0.00075475390405777, 0.0008162778009123128, 0.002206991473730824], volume_flux = "flux_shima_etal") end - @testset "parameters_euler_vortex_mortar_split.toml with flux_ranocha" begin + @testset "taal-confirmed parameters_euler_vortex_mortar_split.toml with flux_ranocha" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar_split.toml"), l2 = [2.120037931908414e-6, 2.805632845562748e-5, 3.759465243706522e-5, 8.841157002762106e-5], linf = [5.934036929955422e-5, 0.0007547536380712039, 0.000816277844819191, 0.0022070017103743567], volume_flux = "flux_ranocha") end - @testset "parameters_euler_vortex_mortar_split_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_vortex_mortar_split_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_mortar_split_shockcapturing.toml"), l2 = [2.1205855860697905e-6, 2.805356649496243e-5, 3.7617723084029226e-5, 8.841527980901164e-5], linf = [5.9005286894620035e-5, 0.0007547295163081724, 0.0008176139355887679, 0.0022089993378280326]) end - @testset "parameters_euler_nonperiodic.toml" begin + @testset "taal-confirmed parameters_euler_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_nonperiodic.toml"), l2 = [2.3652137675654753e-6, 2.1386731303685556e-6, 2.138673130413185e-6, 6.009920290578574e-6], linf = [1.4080448659026246e-5, 1.7581818010814487e-5, 1.758181801525538e-5, 5.9568540361709665e-5]) end - @testset "parameters_euler_source_terms.toml" begin + @testset "taal-confirmed parameters_euler_source_terms.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_source_terms.toml"), l2 = [8.517783186497567e-7, 1.2350199409361865e-6, 1.2350199409828616e-6, 4.277884398786315e-6], linf = [8.357934254688004e-6, 1.0326389653148027e-5, 1.0326389654924384e-5, 4.4961900057316484e-5]) end - @testset "parameters_euler_vortex.toml" begin + @testset "taal-confirmed parameters_euler_vortex.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex.toml"), l2 = [3.6343138447409784e-6, 0.0032111379843728876, 0.0032111482778261658, 0.004545715889714643], linf = [7.901869034399045e-5, 0.030511158864742205, 0.030451936462313256, 0.04361908901631395]) end - @testset "parameters_euler_vortex_split_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_vortex_split_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex_split_shockcapturing.toml"), l2 = [3.8034711509468997e-6, 5.561030973129845e-5, 5.563956603258559e-5, 0.00015706441614772137], linf = [8.493408680687597e-5, 0.0009610606296146518, 0.0009684675522437791, 0.003075812221315033]) end - @testset "parameters_euler_weak_blast_wave_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_weak_blast_wave_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_weak_blast_wave_shockcapturing.toml"), l2 = [0.05365734539276933, 0.04683903386565478, 0.04684207891980008, 0.19632055541821553], linf = [0.18542234326379825, 0.24074440953554058, 0.23261143887822433, 0.687464986948263]) end - @testset "parameters_euler_khi_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_khi_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_khi_shockcapturing.toml"), - l2 = [0.0020466154637164818, 0.0028625763438979495, 0.0019711461834225666, 0.004817029337018744], - linf = [0.024299256322983798, 0.016200117151326077, 0.00986919774968863, 0.020600003949211576], + l2 = [0.002046615463716511, 0.002862576343897973, 0.001971146183422579, 0.004817029337018751], + linf = [0.024299256322982465, 0.01620011715132652, 0.009869197749689947, 0.02060000394920891], t_end = 0.2) end - @testset "parameters_euler_khi_shockcapturing_amr.toml" begin + @testset "taal-confirmed parameters_euler_khi_shockcapturing_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_khi_shockcapturing_amr.toml"), - l2 = [0.0016901662212294992, 0.002288851927745578, 0.0013358949630807315, 0.0033568391465231668], - linf = [0.027437774935493042, 0.016891735404652816, 0.007312081458140164, 0.01590533115997861], + l2 = [0.001653490458693617, 0.0023814551690212226, 0.0013742646130843919, 0.0031589243386909585], + linf = [0.022479473484114054, 0.015056172762090259, 0.0070761455651367836, 0.01461791479513419], t_end = 0.2) end - @testset "parameters_euler_blob_shockcapturing_amr.toml" begin + @testset "taal-confirmed parameters_euler_blob_shockcapturing_mortar.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blob_shockcapturing_mortar.toml"), + l2 = [0.22114615931709608, 0.6275614586395163, 0.24325207085080508, 2.9258710844826785], + linf = [10.524044134146688, 27.5126438384907, 9.454012378298625, 97.53392910067888], + t_end = 0.5) + end + @testset "taal-confirmed parameters_euler_blob_shockcapturing_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blob_shockcapturing_amr.toml"), - l2 = [0.20079146298714926, 1.178526565356443, 0.1011961418887176, 5.2218453410238554], - linf = [14.056399346555613, 70.84481014603705, 7.154598484845931, 296.78986167690556], + l2 = [0.2016728420174888, 1.1836138789789359, 0.10165086496270354, 5.237367755805095], + linf = [14.085819993255987, 71.07473800830421, 7.366144023918916, 297.24197965204814], t_end = 0.12) end - @testset "parameters_mhd_orszag_tang.toml" begin + @testset "taal-confirmed parameters_mhd_orszag_tang.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_orszag_tang.toml"), l2 = [0.21662313415818582, 0.2635698604231871, 0.31395699611730377, 0.0, 0.5122276249069517, 0.22914894367706035, 0.34302293430536107, 0.0, 0.0031837261356598232], linf = [1.2455340346415893, 0.6656259804847943, 0.8530619473770993, 0.0, 2.762224683447692, 0.6641473992806939, 0.9631804383659317, 0.0, 0.04504842687596635], t_end = 0.09) end # second orszag-tang test added to exercise all components of flux_hll for GLM-MHD - @testset "parameters_mhd_orszag_tang.toml with flux_hll" begin + @testset "taal-confirmed parameters_mhd_orszag_tang.toml with flux_hll" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_orszag_tang.toml"), l2 = [0.10797773670821377, 0.20183575429259998, 0.2297276946458608, 0.0, 0.29942847198143785, 0.1567941428185007, 0.24283635408491952, 0.0, 0.0032487131364797796], linf = [0.5598159626426933, 0.5095082640545004, 0.655948904969917, 0.0, 0.9809725319955653, 0.39916604098537073, 0.6748429903024491, 0.0, 0.07124312329480051], t_end = 0.06, surface_flux = "flux_hll") end - @testset "parameters_euler_ec_mortar.toml with shock_capturing" begin + @testset "taal-confirmed parameters_euler_ec_mortar.toml with shock_capturing" begin + # TODO Taal, remove: This won't fix since we do not port the old-style EC mortars to Taal test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec_mortar.toml"), l2 = [0.04816136246215661, 0.03713041026830962, 0.03713130328181323, 0.1777051166244772], linf = [0.3118606868100966, 0.34614370128998007, 0.3460122144359348, 1.1085840270633454], volume_integral_type = "shock_capturing") end - @testset "parameters_advection_basic.toml with restart and t_end=2" begin + @testset "taal-confirmed parameters_advection_basic.toml with restart and t_end=2" begin Trixi.run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml")) test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [1.2148032444677485e-5], @@ -221,36 +228,36 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " restart = true, restart_filename = "out/restart_000040.h5") end @test_nowarn Trixi.convtest(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), 3) - @testset "parameters_euler_blast_wave_shockcapturing_amr.toml" begin + @testset "taal-confirmed parameters_euler_blast_wave_shockcapturing_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blast_wave_shockcapturing_amr.toml"), t_end=1.0, l2 = [0.6776486969229697, 0.2813026529898539, 0.28130256451012314, 0.7174702524881598], linf = [2.8939055423031532, 1.7997630098946864, 1.799711865996927, 3.034122348258568]) end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml" begin + @testset "taal-confirmed differences-to-master parameters_euler_sedov_blast_wave_shockcapturing_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), t_end=1.0, - l2 = [0.48181540798407435, 0.16553711811584917, 0.16553711811592348, 0.6436020727868234], - linf = [2.4861229629790813, 1.2873838211418498, 1.2873838211478545, 6.473895863328632]) + l2 = [0.4820048896322639, 0.16556563003698888, 0.16556563003698901, 0.643610807739157], + linf = [2.485752556439829, 1.2870638985941658, 1.2870638985941667, 6.474544663221404]) end end # Coverage test for all initial conditions @testset "Tests for initial conditions" begin # Linear scalar advection - @testset "parameters_advection_basic.toml with initial_condition_sin_sin" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_sin_sin" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.0001424424804667062], linf = [0.0007260692243250544], n_steps_max = 1, initial_condition = "initial_condition_sin_sin") end - @testset "parameters_advection_basic.toml with initial_condition_constant" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [6.120436421866528e-16], linf = [1.3322676295501878e-15], n_steps_max = 1, initial_condition = "initial_condition_constant") end - @testset "parameters_advection_basic.toml with initial_condition_linear_x_y" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_linear_x_y" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [2.559042358408011e-16], linf = [6.8833827526759706e-15], @@ -259,7 +266,7 @@ end boundary_conditions = "boundary_condition_linear_x_y", periodicity=false) end - @testset "parameters_advection_basic.toml with initial_condition_linear_x" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_linear_x" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [1.5901063275642836e-16], linf = [1.5543122344752192e-15], @@ -268,7 +275,7 @@ end boundary_conditions = "boundary_condition_linear_x", periodicity=false) end - @testset "parameters_advection_basic.toml with initial_condition_linear_y" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_linear_y" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [1.597250146891042e-16], linf = [3.552713678800501e-15], @@ -278,79 +285,70 @@ end periodicity=false) end # Compressible Euler - @testset "parameters_euler_vortex.toml one step with initial_condition_density_pulse" begin + @testset "taal-confirmed parameters_euler_vortex.toml one step with initial_condition_density_pulse" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex.toml"), l2 = [0.003201074851451383, 0.0032010748514513724, 0.0032010748514513716, 0.0032010748514513794], linf = [0.043716393835876444, 0.043716393835876444, 0.043716393835876, 0.04371639383587578], n_steps_max = 1, initial_condition = "initial_condition_density_pulse") end - @testset "parameters_euler_vortex.toml one step with initial_condition_pressure_pulse" begin + @testset "taal-confirmed parameters_euler_vortex.toml one step with initial_condition_pressure_pulse" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex.toml"), l2 = [0.00018950189533270512, 0.0020542290689775757, 0.002054229068977579, 0.01013381064979542], linf = [0.004763284475434837, 0.028439617580275578, 0.028439617580275467, 0.13640572175447918], n_steps_max = 1, initial_condition = "initial_condition_pressure_pulse") end - @testset "parameters_euler_vortex.toml one step with initial_condition_density_pressure_pulse" begin + @testset "taal-confirmed parameters_euler_vortex.toml one step with initial_condition_density_pressure_pulse" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex.toml"), l2 = [0.0031880440066425803, 0.0050397619349217574, 0.005039761934921767, 0.014340770024960708], linf = [0.04279723800834989, 0.06783565847184869, 0.06783565847184914, 0.19291274039254347], n_steps_max = 1, initial_condition = "initial_condition_density_pressure_pulse") end - @testset "parameters_euler_vortex.toml one step with initial_condition_constant" begin + @testset "taal-confirmed parameters_euler_vortex.toml one step with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_vortex.toml"), l2 = [2.359732835648237e-16, 1.088770274131804e-16, 1.1814939065033234e-16, 1.980283448445849e-15], linf = [4.440892098500626e-16, 2.914335439641036e-16, 4.718447854656915e-16, 3.552713678800501e-15], n_steps_max = 1, initial_condition = "initial_condition_constant") end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml one step" begin + @testset "taal-confirmed differences-to-master parameters_euler_sedov_blast_wave_shockcapturing_amr.toml one step" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), - l2 = [0.002911075352335366, 0.01249799423742342, 0.01249799423742343, 0.11130739933709777], - linf = [0.15341072072011042, 0.763322686048535, 0.7633226860485351, 5.184635785270958], + l2 = [0.0021037031798961936, 0.010667428589443041, 0.010667428589443027, 0.11041565217737695], + linf = [0.11754829172684966, 0.7227194329885249, 0.7227194329885249, 5.42708544137305], n_steps_max = 1) end - @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml one step with initial_condition_medium_sedov_blast_wave" begin + @testset "taal-confirmed differences-to-master parameters_euler_sedov_blast_wave_shockcapturing_amr.toml one step with initial_condition_medium_sedov_blast_wave" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), - l2 = [0.0029095199084281176, 0.012491250999308508, 0.012491250999308522, 0.11126623649275227], - linf = [0.15334906997459008, 0.7629367729245761, 0.7629367729245761, 5.18264418672338], + l2 = [0.002102553227287478, 0.01066154856802227, 0.010661548568022277, 0.11037470219676422], + linf = [0.11749257043751615, 0.7223475657303381, 0.7223475657303381, 5.425015419074852], n_steps_max = 1, initial_condition = "initial_condition_medium_sedov_blast_wave") end # GLM-MHD - @testset "parameters_mhd_alfven_wave.toml one step with initial_condition_constant" begin + @testset "taal-confirmed parameters_mhd_alfven_wave.toml one step with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_alfven_wave.toml"), l2 = [1.9377318494777845e-16, 2.0108417179968547e-16, 4.706803550379074e-16, 9.849916218369067e-17, 9.578096259273606e-15, 4.995499731290712e-16, 2.72017579525395e-16, 9.963303137205655e-17, 1.7656549191657418e-16], linf = [4.440892098500626e-16, 7.494005416219807e-16, 1.7763568394002505e-15, 2.220446049250313e-16, 2.1316282072803006e-14, 1.3322676295501878e-15, 8.881784197001252e-16, 2.220446049250313e-16, 7.414582366945819e-16], n_steps_max = 1, initial_condition = "initial_condition_constant") end - @testset "parameters_mhd_rotor.toml" begin + @testset "taal-confirmed parameters_mhd_rotor.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_rotor.toml"), - l2 = [1.251062755110083, 1.8146501210703296, 1.6947702119211985, 0.0, 2.286126233832582, 0.2142656906510094, 0.23453619782492716, 0.0, 0.003028222728287231], - linf = [10.472575582440642, 14.089807317509075, 15.561008992418031, 0.0, 16.731740428408308, 1.3219222046920664, 1.4167075971532137, 0.0, 0.08046487935486654], + l2 = [1.2428140306560267, 1.7997194450337968, 1.6900291785233619, 0.0, 2.2634513724749357, 0.212710214030601, 0.233276208669814, 0.0, 0.0026495769095112244], + linf = [10.47092272020676, 14.061476930703114, 15.55246880748034, 0.0, 16.619962600809156, 1.3033533536346604, 1.4125607690546562, 0.0, 0.07338769474671016], t_end = 0.05) end - @testset "parameters_mhd_blast_wave.toml" begin + @testset "taal-confirmed parameters_mhd_blast_wave.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_blast_wave.toml"), - l2 = [0.17537979197656783, 3.85063790427908, 2.475262063280408, 0.0, 355.77751756307794, 2.35355645151502, 1.3962841115302977, 0.0, 0.02800989397835333], - linf = [1.5861429668357858, 44.06819961699249, 12.86121814597942, 0.0, 2240.622032533027, 13.20064555739219, 8.990518759210023, 0.0, 0.5100373526240609], + l2 = [0.1757875762080873, 3.8532519959458216, 2.4727214755520532, 0.0, 355.0835842161213, 2.3454068130466776, 1.3916366548136, 0.0, 0.028930416439621368], + linf = [1.5948842870594393, 44.31605592215359, 12.854945034752436, 0.0, 2207.513124699695, 12.706623740109995, 8.987432397883575, 0.0, 0.4980365769225257], t_end = 0.003) end end - -# Only run extended tests if environment variable is set -if haskey(ENV, "TRIXI_TEST_EXTENDED") && lowercase(ENV["TRIXI_TEST_EXTENDED"]) in ("1", "on", "yes") - @testset "Examples (long execution time)" begin - @test_nowarn Trixi.run(joinpath(EXAMPLES_DIR, "parameters_euler_blob_shockcapturing_mortar.toml")) - @test_nowarn Trixi.run(joinpath(EXAMPLES_DIR, "parameters_euler_ec_mortar.toml")) - end -end - # Clean up afterwards: delete Trixi output directory @test_nowarn rm(outdir, recursive=true) diff --git a/test/test_examples_3d.jl b/test/test_examples_3d.jl index 7487e71219..0ade8e8c4e 100644 --- a/test/test_examples_3d.jl +++ b/test/test_examples_3d.jl @@ -22,59 +22,227 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " linf = [0.001503873297666436]) end + @testset "elixir_advection_restart.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_restart.jl"), + l2 = [0.00017800012466353434], + linf = [0.001452075263740804]) + end + + # TODO Taal: create separate elixirs for ICs/BCs etc. to keep `basic` simple + @testset "elixir_advection_basic.jl with initial_condition_sin" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [0.002727292086517533], + linf = [0.024833049753677727], + initial_condition=Trixi.initial_condition_sin) + end + + @testset "elixir_advection_basic.jl with initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [9.770171014620371e-16], + linf = [2.4424906541753444e-15], + initial_condition=initial_condition_constant) + end + + @testset "elixir_advection_basic.jl with initial_condition_linear_z and periodicity=false" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_basic.jl"), + l2 = [6.607840408143593e-16], + linf = [5.773159728050814e-15], + initial_condition=Trixi.initial_condition_linear_z, + boundary_conditions=Trixi.boundary_condition_linear_z, periodicity=false) + end + + @testset "elixir_euler_source_terms.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), + l2 = [0.010323099666828388, 0.00972876713766357, 0.00972876713766343, 0.009728767137663324, 0.015080409341036285], + linf = [0.034894880154510144, 0.03383545920056008, 0.033835459200560525, 0.03383545920054587, 0.06785780622711979]) + end + + @testset "elixir_euler_source_terms.jl with split_form" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), + l2 = [0.010323099666828388, 0.00972876713766357, 0.00972876713766343, 0.009728767137663324, 0.015080409341036285], + linf = [0.034894880154510144, 0.03383545920056008, 0.033835459200560525, 0.03383545920054587, 0.06785780622711979], + volume_integral=VolumeIntegralFluxDifferencing(flux_central)) + end + + @testset "elixir_euler_eoc_test.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_eoc_test.jl"), + l2 = [0.000363723832448333, 0.00039555684672049366, 0.0003955568467203738, 0.00039555684672064724, 0.0007811604790242773], + linf = [0.002400072140187337, 0.0029635489437536133, 0.0029635489437540574, 0.0029635489437565, 0.007191455734479657]) + end + + @testset "elixir_eulergravity_eoc_test.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), + l2 = [0.00042767972112699913, 0.00047204316046796835, 0.00047204316046784795, 0.0004720431604680035, 0.0010987015429634586], + linf = [0.0034966337661186397, 0.0037643976198782347, 0.003764397619878901, 0.0037643976198780127, 0.008370354378078648], + resid_tol = 1.0e-4, tspan = (0.0, 0.2)) + end + + @testset "elixir_advection_mortar.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_mortar.jl"), + l2 = [0.0018461483161353273], + linf = [0.017728496545256434]) + end + @testset "elixir_advection_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_advection_amr.jl"), - l2 = [9.773858425669403e-6], - linf = [0.0005853874124926092]) + l2 = [9.773858425669403e-6], + linf = [0.0005853874124926092]) end + @testset "elixir_euler_amr.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_amr.jl"), + l2 = [0.00382819196730758, 0.0038281919673075725, 0.0038281919673075746, 0.0038281919673075738, 0.0057422879509614905], + linf = [0.07390560349428554, 0.07390560349428577, 0.07390560349428621, 0.07390560349428643, 0.11085840524143098], + tspan=(0.0, 0.1)) + end @testset "elixir_hyp_diff_llf.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_llf.jl"), - l2 = [0.0015303316090388799, 0.011314177033289297, 0.011314177033289444, 0.011314177033289696], - linf = [0.02263459034012283, 0.10139777904690916, 0.10139777904690916, 0.10139777904690828], + l2 = [0.0015303292770225546, 0.011314166522881952, 0.011314166522881981, 0.011314166522881947], + linf = [0.022634590339093097, 0.10150613595329361, 0.10150613595329361, 0.10150613595329361], initial_refinement_level=2) end @testset "elixir_hyp_diff_nonperiodic.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_nonperiodic.jl"), - l2 = [0.00022868340901898148, 0.0007974312252173769, 0.0015035143230655171, 0.0015035143230655694], - linf = [0.0016405261410663563, 0.0029871222930526976, 0.009410031618266146, 0.009410031618266146]) + l2 = [0.00022868324220593294, 0.0007974310370259415, 0.0015035143239197598, 0.0015035143239198418], + linf = [0.0016329580288680923, 0.0029870270738030775, 0.009177053066089513, 0.009177053066084184]) end - - @testset "elixir_euler_source_terms.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms.jl"), - l2 = [0.010323099666828388, 0.00972876713766357, 0.00972876713766343, 0.009728767137663324, 0.015080409341036285], - linf = [0.034894880154510144, 0.03383545920056008, 0.033835459200560525, 0.03383545920054587, 0.06785780622711979]) + @testset "elixir_hyp_diff_llf.jl with initial_refinement_level=2, surface_flux=flux_upwind)" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_llf.jl"), + l2 = [0.0015377708559180534, 0.011376842329542572, 0.011376842329542624, 0.0113768423295426], + linf = [0.02271542063004106, 0.10191067906109286, 0.10191067906109552, 0.10191067906109286], + initial_refinement_level=2, surface_flux=flux_upwind) end @testset "elixir_euler_mortar.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_mortar.jl"), - l2 = [0.0019011097544691046, 0.0018289464161846331, 0.0018289464161847266, 0.0018289464161847851, 0.0033547668596639966], - linf = [0.011918626829790169, 0.011808582902362641, 0.01180858290237552, 0.011808582902357312, 0.024648094686513744]) + l2 = [0.0019011097431965655, 0.0018289464087588392, 0.0018289464087585998, 0.0018289464087588862, 0.003354766311541738], + linf = [0.011918594206950184, 0.011808582644224241, 0.011808582644249999, 0.011808582644239785, 0.02464803617735356]) + end + + + @testset "elixir_euler_taylor_green_vortex.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_taylor_green_vortex.jl"), + l2 = [0.0003494971047256544, 0.03133386380969968, 0.031333863809699644, 0.04378595081016185, 0.015796569210801217], + linf = [0.0013934701399120897, 0.07284947983025436, 0.07284947983025408, 0.12803234075782724, 0.07624639122292365], + tspan = (0.0, 0.5)) + end + + @testset "elixir_euler_shockcapturing.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing.jl"), + l2 = [0.025558219399128387, 0.01612806446620796, 0.016128064466207948, 0.016120400619198158, 0.09208276987000782], + linf = [0.3950327737713353, 0.26324766244272796, 0.2632476624427279, 0.2634129727753079, 1.371321006006725]) + end + + @testset "elixir_euler_shockcapturing.jl with initial_condition_sedov_blast_wave" begin + # OBS! This setup does not run longer but crashes (also the parameters do not make sense) -> only for testing the IC! + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing.jl"), + l2 = [0.03627060784392582, 0.05178777376859809, 0.05178777376859804, 0.05178777376859802, 0.23043996953698023], + linf = [0.9307998233177583, 1.4326649193439467, 1.4326649193439467, 1.4326649193439467, 12.80585041235138], + initial_condition=initial_condition_sedov_blast_wave, cfl=0.25, alpha_max=1.0, tspan=(0.0, 0.1)) + end + + @testset "elixir_euler_shockcapturing.jl with initial_condition_sedov_self_gravity" begin + # OBS! This setup does not run longer but crashes (also the parameters do not make sense) -> only for testing the IC! + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing.jl"), + l2 = [0.04846527000320781, 0.051787773760055514, 0.051787773760055486, 0.05178777376005548, 0.23043996953467236], + linf = [0.9307979866990295, 1.4326649193456429, 1.4326649193456429, 1.4326649193456429, 12.805850412386896], + initial_condition=initial_condition_sedov_self_gravity, cfl=0.25, alpha_max=1.0, tspan=(0.0, 0.1)) + end + + @testset "elixir_euler_shockcapturing_amr.jl" begin + # OBS! This setup does not make much practical sense. It is only added to exercise the + # `sedov_self_gravity` AMR indicator, which in its original configuration is too expensive for + # CI testing + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_shockcapturing_amr.jl"), + l2 = [0.022890627324485553, 0.013353127563710173, 0.013353127563710156, 0.013352146925243637, 0.08348119429398775], + linf = [0.3769085161148348, 0.380358363190641, 0.3803583631906434, 0.380366775575835, 1.3162027903728162], + maxiters=10) + end + + @testset "elixir_euler_density_pulse.jl with source_terms_harmonic" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_density_pulse.jl"), + l2 = [0.05719652660597408, 0.0571965266059741, 0.05719652660597407, 0.05719652660597409, 0.08579478990896279], + linf = [0.27375961853433606, 0.27375961853433517, 0.27375961853433384, 0.2737596185343343, 0.4106394278015033], + source_terms=Trixi.source_terms_harmonic) + end + + @testset "elixir_euler_ec.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.025101741317688664, 0.01655620530022176, 0.016556205300221737, 0.016549388264402515, 0.09075092792976944], + linf = [0.43498932208478724, 0.2821813924028202, 0.28218139240282025, 0.2838043627560838, 1.5002293438086647]) + end + + @testset "elixir_euler_ec.jl with initial_condition=initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [5.717218008425079e-16, 6.088971423170968e-16, 6.23130776282275e-16, 7.29884557381127e-16, 5.167198077601542e-15], + linf = [3.885780586188048e-15, 4.454769886308441e-15, 3.219646771412954e-15, 4.884981308350689e-15, 4.440892098500626e-14], + initial_condition=initial_condition_constant) + end + + @testset "elixir_euler_ec.jl with flux_chandrashekar" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.025105743648126774, 0.016571417754430256, 0.01657141775443023, 0.016565202090289916, 0.09077232065771225], + linf = [0.4349225166034201, 0.27945714200874, 0.2794571420087401, 0.28021366413271664, 1.5240679700745954], + surface_flux=flux_chandrashekar, volume_flux=flux_chandrashekar) + end + + @testset "elixir_euler_ec.jl with flux_kennedy_gruber" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.025120431810845507, 0.016599310737401483, 0.01659931073740148, 0.016592567464138185, 0.090856457771812], + linf = [0.43120500632996794, 0.28419288751363336, 0.2841928875136334, 0.28583515705222146, 1.515485025725378], + surface_flux=flux_kennedy_gruber, volume_flux=flux_kennedy_gruber) + end + + @testset "elixir_euler_ec.jl with flux_shima_etal" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_ec.jl"), + l2 = [0.025099944530993942, 0.016561611274319134, 0.016561611274319127, 0.01655478190136039, 0.09076538812894279], + linf = [0.43472962954165273, 0.2824065323711477, 0.2824065323711474, 0.28409419760015847, 1.4995295774522692], + surface_flux=flux_shima_etal, volume_flux=flux_shima_etal) end @testset "elixir_euler_blob_amr.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_blob_amr.jl"), - l2 = [0.04867856452253151, 0.2640486962336911, 0.0354927658652858, 0.03549276586528571, 1.0777274757408568], - linf = [9.558543313792217, 49.4518309553356, 10.319859082570309, 10.319859082570487, 195.1066220797401], + l2 = [0.04641288111176061, 0.25587674204071276, 0.03358077695134774, 0.033580776951347646, 1.0552376897521447], + linf = [9.773023537783775, 48.58018285242446, 9.56936427666669, 9.56936427666669, 170.97251488955624], tspan = (0.0, 0.2)) end - @testset "elixir_mhd_ec.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec.jl"), - l2 = [0.017285648572570363, 0.01777055834391421, 0.01777055834391415, 0.017772303802227787, 0.07402246754850351, 0.010363311581708652, 0.010363311581708655, 0.010365244788128367, 0.00020795117986261875], - linf = [0.26483877701302616, 0.3347840483592971, 0.3347840483592973, 0.3698107272043008, 1.2339463134928033, 0.09858876654056647, 0.09858876654056714, 0.10426402075606456, 0.008001763586594345]) + l2 = [0.01921453037426997, 0.01924853398980921, 0.01924853398980923, 0.019247118340533328, 0.08310482412935676, 0.010362656540935251, 0.010362656540935237, 0.010364587080559528, 0.00020760700572485828], + linf = [0.2645851360519166, 0.33611482816103344, 0.33611482816103466, 0.36952265576762666, 1.230825809630423, 0.09818527443798974, 0.09818527443798908, 0.10507242371450054, 0.008456471524217968]) end + @testset "elixir_mhd_ec.jl with initial_condition=initial_condition_constant" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_ec.jl"), + l2 = [4.850506049646793e-16, 2.4804155700127237e-15, 3.579471462379534e-15, 2.7395862184339726e-15, 2.4916602560342516e-14, 1.669368799061149e-15, 1.4052897861706032e-15, 1.0685989093080367e-15, 1.1611070325375158e-15], + linf = [3.552713678800501e-15, 1.4710455076283324e-14, 2.3814283878209608e-14, 2.6423307986078726e-14, 1.6342482922482304e-13, 1.1546319456101628e-14, 1.0880185641326534e-14, 1.4099832412739488e-14, 1.1483287543575534e-14], + atol = 1000*eps(), + initial_condition=initial_condition_constant) + end - @testset "elixir_eulergravity_eoc_test.jl" begin - @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), - l2 = [0.00042767201750631214, 0.0004720121013484361, 0.00047201210134851195, 0.00047201210134847107, 0.0010986046486879376], - linf = [0.003497353351708421, 0.0037653614087260756, 0.003765361408728074, 0.0037653614087242993, 0.008372792646797134], - resid_tol = 1.0e-4, tspan = (0.0, 0.2)) + @testset "elixir_mhd_alfven_wave.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave.jl"), + l2 = [0.0038729054515012624, 0.00903693761037057, 0.0041729297273898815, 0.01160504558506348, 0.006241548790045999, 0.009227641613254402, 0.0034580608435846143, 0.011684993365513006, 0.0022068452165023645], + linf = [0.012628629484152443, 0.03265276295369954, 0.012907838374176334, 0.044746702024108326, 0.02796611265824822, 0.03453054781110626, 0.010261557301859958, 0.044762592434299864, 0.010012319622784436]) + end + + @testset "elixir_mhd_alfven_wave_mortar.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_alfven_wave_mortar.jl"), + l2 = [0.0021484102061835623, 0.006826504155492453, 0.0030653111370061784, 0.008735898256361025, 0.0051601878379492335, 0.007157480202233399, 0.0028291977973972948, 0.008815052614117018, 0.0022321821323698257], + linf = [0.012956870409227328, 0.05529249146399706, 0.020854504834048836, 0.05898012498637771, 0.03162799656904003, 0.05512773554440975, 0.017941374395225362, 0.060061114374191496, 0.013036070296136178], + tspan = (0.0, 0.25)) + end + + # 3D Orszag-Tang included to exercise all terms in the HLL flux + @testset "elixir_mhd_orszag_tang.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhd_orszag_tang.jl"), + l2 = [0.0043911605751115424, 0.04144735653371165, 0.04150129965650717, 0.04150353600000829, 0.036931197750736805, 0.021125598820694595, 0.032956068087418154, 0.03296235602392588, 6.318083915607208e-6], + linf = [0.01789383976134809, 0.08496187610572214, 0.08909116075943745, 0.08505952838326755, 0.10443373959204932, 0.05387852204182135, 0.08812990990777562, 0.07804874749131957, 8.138512446081734e-5], + tspan = (0.0, 0.06)) end end diff --git a/test/test_examples_3d_old.jl b/test/test_examples_3d_old.jl index 80bed14280..cad79b5d44 100644 --- a/test/test_examples_3d_old.jl +++ b/test/test_examples_3d_old.jl @@ -14,148 +14,148 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " # Run basic tests @testset "Examples 3D" begin - @testset "parameters_advection_basic.toml" begin + @testset "taal-confirmed parameters_advection_basic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.00015975754755823664], linf = [0.001503873297666436]) end - @testset "parameters_advection_basic.toml with restart and t_end=2" begin + @testset "taal-confirmed parameters_advection_basic.toml with restart and t_end=2" begin Trixi.run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml")) test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.00017800012466353434], linf = [0.001452075263740804], t_end = 2, restart = true, restart_filename = "out/restart_000040.h5") end - @testset "parameters_advection_basic.toml with initial_condition_sin" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_sin" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [0.002727292086517533], linf = [0.024833049753677727], initial_condition=Trixi.initial_condition_sin) end - @testset "parameters_advection_basic.toml with initial_condition_constant" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [9.770171014620371e-16], linf = [2.4424906541753444e-15], - initial_condition=Trixi.initial_condition_constant) + initial_condition=initial_condition_constant) end - @testset "parameters_advection_basic.toml with initial_condition_linear_z and periodicity=false" begin + @testset "taal-confirmed parameters_advection_basic.toml with initial_condition_linear_z and periodicity=false" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_basic.toml"), l2 = [6.607840408143593e-16], linf = [5.773159728050814e-15], initial_condition=Trixi.initial_condition_linear_z, boundary_conditions=Trixi.boundary_condition_linear_z, periodicity=false) end - @testset "parameters_euler_source_terms.toml" begin + @testset "taal-confirmed parameters_euler_source_terms.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_source_terms.toml"), l2 = [0.010323099666828388, 0.00972876713766357, 0.00972876713766343, 0.009728767137663324, 0.015080409341036285], linf = [0.034894880154510144, 0.03383545920056008, 0.033835459200560525, 0.03383545920054587, 0.06785780622711979]) end - @testset "parameters_euler_source_terms.toml with split_form" begin + @testset "taal-confirmed parameters_euler_source_terms.toml with split_form" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_source_terms.toml"), l2 = [0.010323099666828388, 0.00972876713766357, 0.00972876713766343, 0.009728767137663324, 0.015080409341036285], linf = [0.034894880154510144, 0.03383545920056008, 0.033835459200560525, 0.03383545920054587, 0.06785780622711979], volume_integral_type = "split_form") end - @testset "parameters_euler_eoc_test.toml" begin + @testset "taal-confirmed parameters_euler_eoc_test.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_eoc_test.toml"), l2 = [0.000363723832448333, 0.00039555684672049366, 0.0003955568467203738, 0.00039555684672064724, 0.0007811604790242773], linf = [0.002400072140187337, 0.0029635489437536133, 0.0029635489437540574, 0.0029635489437565, 0.007191455734479657]) end - @testset "parameters_eulergravity_eoc_test.toml with resid_tol = 1.0e-4, t_end = 0.2" begin + @testset "taal-confirmed parameters_eulergravity_eoc_test.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), l2 = [0.00042767972112699913, 0.00047204316046796835, 0.00047204316046784795, 0.0004720431604680035, 0.0010987015429634586, 0.00012296598036447797, 0.0005745341792812197, 0.0005745341792812442, 0.0005745341792812238], linf = [0.0034966337661186397, 0.0037643976198782347, 0.003764397619878901, 0.0037643976198780127, 0.008370354378078648, 0.0010129211321238465, 0.0024406779290754455, 0.002440677929075438, 0.0024406779290755756], resid_tol = 1.0e-4, t_end = 0.2) end - @testset "parameters_advection_mortar.toml" begin + @testset "taal-confirmed parameters_advection_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_mortar.toml"), l2 = [0.0018461483161353273], linf = [0.017728496545256434]) end - @testset "parameters_euler_mortar.toml" begin + @testset "taal-confirmed parameters_euler_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_mortar.toml"), l2 = [0.0019011097431965655, 0.0018289464087588392, 0.0018289464087585998, 0.0018289464087588862, 0.003354766311541738], linf = [0.011918594206950184, 0.011808582644224241, 0.011808582644249999, 0.011808582644239785, 0.02464803617735356]) end - @testset "parameters_advection_amr.toml" begin + @testset "taal-confirmed parameters_advection_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_advection_amr.toml"), l2 = [9.773858425669403e-6], linf = [0.0005853874124926092]) end - @testset "parameters_euler_amr.toml" begin + @testset "taal-confirmed parameters_euler_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_amr.toml"), l2 = [0.00382819196730758, 0.0038281919673075725, 0.0038281919673075746, 0.0038281919673075738, 0.0057422879509614905], linf = [0.07390560349428554, 0.07390560349428577, 0.07390560349428621, 0.07390560349428643, 0.11085840524143098], t_end=0.1) end - @testset "parameters_euler_blob_amr.toml" begin + @testset "taal-confirmed parameters_euler_blob_amr.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_blob_amr.toml"), l2 = [0.04641288111176061, 0.25587674204071276, 0.03358077695134774, 0.033580776951347646, 1.0552376897521447], linf = [9.773023537783775, 48.58018285242446, 9.56936427666669, 9.56936427666669, 170.97251488955624], t_end=0.2) end - @testset "parameters_euler_ec.toml" begin + @testset "taal-confirmed parameters_euler_ec.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.025101741317688664, 0.01655620530022176, 0.016556205300221737, 0.016549388264402515, 0.09075092792976944], linf = [0.43498932208478724, 0.2821813924028202, 0.28218139240282025, 0.2838043627560838, 1.5002293438086647]) end - @testset "parameters_euler_ec.toml with initial_condition=Trixi.initial_condition_constant" begin + @testset "taal-confirmed parameters_euler_ec.toml with initial_condition=initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [5.717218008425079e-16, 6.088971423170968e-16, 6.23130776282275e-16, 7.29884557381127e-16, 5.167198077601542e-15], linf = [3.885780586188048e-15, 4.454769886308441e-15, 3.219646771412954e-15, 4.884981308350689e-15, 4.440892098500626e-14], - initial_condition=Trixi.initial_condition_constant) + initial_condition=initial_condition_constant) end - @testset "parameters_euler_ec.toml with flux_chandrashekar" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_chandrashekar" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.025105743648126774, 0.016571417754430256, 0.01657141775443023, 0.016565202090289916, 0.09077232065771225], linf = [0.4349225166034201, 0.27945714200874, 0.2794571420087401, 0.28021366413271664, 1.5240679700745954], surface_flux=flux_chandrashekar, volume_flux=flux_chandrashekar) end - @testset "parameters_euler_ec.toml with flux_kennedry_gruber" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_kennedy_gruber" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.025120431810845507, 0.016599310737401483, 0.01659931073740148, 0.016592567464138185, 0.090856457771812], linf = [0.43120500632996794, 0.28419288751363336, 0.2841928875136334, 0.28583515705222146, 1.515485025725378], surface_flux=flux_kennedy_gruber, volume_flux=flux_kennedy_gruber) end - @testset "parameters_euler_ec.toml with flux_shima_etal" begin + @testset "taal-confirmed parameters_euler_ec.toml with flux_shima_etal" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_ec.toml"), l2 = [0.025099944530993942, 0.016561611274319134, 0.016561611274319127, 0.01655478190136039, 0.09076538812894279], linf = [0.43472962954165273, 0.2824065323711477, 0.2824065323711474, 0.28409419760015847, 1.4995295774522692], surface_flux=flux_shima_etal, volume_flux=flux_shima_etal) end - @testset "parameters_euler_density_pulse.toml with source_terms_harmonic" begin + @testset "taal-confirmed parameters_euler_density_pulse.toml with source_terms_harmonic" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_density_pulse.toml"), l2 = [0.05719652660597408, 0.0571965266059741, 0.05719652660597407, 0.05719652660597409, 0.08579478990896279], linf = [0.27375961853433606, 0.27375961853433517, 0.27375961853433384, 0.2737596185343343, 0.4106394278015033], source_terms=Trixi.source_terms_harmonic, extra_analysis_quantities=["l2_error_primitive", "linf_error_primitive"]) end - @testset "parameters_euler_taylor_green_vortex.toml" begin + @testset "taal-confirmed parameters_euler_taylor_green_vortex.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_taylor_green_vortex.toml"), l2 = [0.0003494971047256544, 0.03133386380969968, 0.031333863809699644, 0.04378595081016185, 0.015796569210801217], linf = [0.0013934701399120897, 0.07284947983025436, 0.07284947983025408, 0.12803234075782724, 0.07624639122292365], t_end = 0.5) end - @testset "parameters_euler_shockcapturing.toml" begin + @testset "taal-confirmed parameters_euler_shockcapturing.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_shockcapturing.toml"), l2 = [0.025558219399128387, 0.01612806446620796, 0.016128064466207948, 0.016120400619198158, 0.09208276987000782], linf = [0.3950327737713353, 0.26324766244272796, 0.2632476624427279, 0.2634129727753079, 1.371321006006725]) end - @testset "parameters_euler_shockcapturing.toml with initial_condition_sedov_blast_wave" begin + @testset "taal-confirmed parameters_euler_shockcapturing.toml with initial_condition_sedov_blast_wave" begin # OBS! This setup does not run longer but crashes (also the parameters do not make sense) -> only for testing the IC! test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_shockcapturing.toml"), l2 = [0.03627060784392582, 0.05178777376859809, 0.05178777376859804, 0.05178777376859802, 0.23043996953698023], linf = [0.9307998233177583, 1.4326649193439467, 1.4326649193439467, 1.4326649193439467, 12.80585041235138], - initial_condition=Trixi.initial_condition_sedov_blast_wave, cfl=0.25, shock_alpha_max=1.0, t_end=0.1) + initial_condition=initial_condition_sedov_blast_wave, cfl=0.25, shock_alpha_max=1.0, t_end=0.1) end - @testset "parameters_euler_shockcapturing.toml with initial_condition_sedov_self_gravity" begin + @testset "taal-confirmed parameters_euler_shockcapturing.toml with initial_condition_sedov_self_gravity" begin # OBS! This setup does not run longer but crashes (also the parameters do not make sense) -> only for testing the IC! test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_shockcapturing.toml"), l2 = [0.04846527000320781, 0.051787773760055514, 0.051787773760055486, 0.05178777376005548, 0.23043996953467236], linf = [0.9307979866990295, 1.4326649193456429, 1.4326649193456429, 1.4326649193456429, 12.805850412386896], - initial_condition=Trixi.initial_condition_sedov_self_gravity, cfl=0.25, shock_alpha_max=1.0, t_end=0.1) + initial_condition=initial_condition_sedov_self_gravity, cfl=0.25, shock_alpha_max=1.0, t_end=0.1) end - @testset "parameters_euler_shockcapturing.toml with amr_indicator=`sedov_self_gravity`" begin + @testset "taal-confirmed parameters_euler_shockcapturing.toml with amr_indicator=`sedov_self_gravity`" begin # OBS! This setup does not make much practical sense. It is only added to exercise the # `sedov_self_gravity` AMR indicator, which in its original configuration is too expensive for # CI testing @@ -164,54 +164,55 @@ const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", " linf = [0.3769085161148348, 0.380358363190641, 0.3803583631906434, 0.380366775575835, 1.3162027903728162], n_steps_max=10, amr_interval=1, amr_indicator="sedov_self_gravity", max_refinement_level=4) end - @testset "parameters_hyp_diff_llf.toml with initial_refinement_level=2" begin + @testset "taal-confirmed parameters_hyp_diff_llf.toml with initial_refinement_level=2" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_llf.toml"), l2 = [0.0015303292770225546, 0.011314166522881952, 0.011314166522881981, 0.011314166522881947], linf = [0.022634590339093097, 0.10150613595329361, 0.10150613595329361, 0.10150613595329361], initial_refinement_level=2) end - @testset "parameters_hyp_diff_llf.toml with initial_refinement_level=2, surface_flux=Trixi.flux_upwind)" begin + @testset "taal-confirmed parameters_hyp_diff_llf.toml with initial_refinement_level=2, surface_flux=flux_upwind)" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_llf.toml"), l2 = [0.0015377708559180534, 0.011376842329542572, 0.011376842329542624, 0.0113768423295426], linf = [0.02271542063004106, 0.10191067906109286, 0.10191067906109552, 0.10191067906109286], - initial_refinement_level=2, surface_flux=Trixi.flux_upwind) + initial_refinement_level=2, surface_flux=flux_upwind) end - @testset "parameters_hyp_diff_nonperiodic.toml" begin + @testset "taal-confirmed parameters_hyp_diff_nonperiodic.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_nonperiodic.toml"), l2 = [0.00022868324220593294, 0.0007974310370259415, 0.0015035143239197598, 0.0015035143239198418], linf = [0.0016329580288680923, 0.0029870270738030775, 0.009177053066089513, 0.009177053066084184]) end - @testset "parameters_mhd_ec.toml" begin + @testset "taal-confirmed parameters_mhd_ec.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_ec.toml"), l2 = [0.01921453037426997, 0.01924853398980921, 0.01924853398980923, 0.019247118340533328, 0.08310482412935676, 0.010362656540935251, 0.010362656540935237, 0.010364587080559528, 0.00020760700572485828], linf = [0.2645851360519166, 0.33611482816103344, 0.33611482816103466, 0.36952265576762666, 1.230825809630423, 0.09818527443798974, 0.09818527443798908, 0.10507242371450054, 0.008456471524217968]) end - @testset "parameters_mhd_ec.toml with initial_condition=Trixi.initial_condition_constant" begin + @testset "taal-confirmed parameters_mhd_ec.toml with initial_condition=initial_condition_constant" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_ec.toml"), l2 = [4.850506049646793e-16, 2.4804155700127237e-15, 3.579471462379534e-15, 2.7395862184339726e-15, 2.4916602560342516e-14, 1.669368799061149e-15, 1.4052897861706032e-15, 1.0685989093080367e-15, 1.1611070325375158e-15], linf = [3.552713678800501e-15, 1.4710455076283324e-14, 2.3814283878209608e-14, 2.6423307986078726e-14, 1.6342482922482304e-13, 1.1546319456101628e-14, 1.0880185641326534e-14, 1.4099832412739488e-14, 1.1483287543575534e-14], atol = 1000*eps(), - initial_condition=Trixi.initial_condition_constant) + initial_condition=initial_condition_constant) end - @testset "parameters_mhd_alfven_wave.toml" begin + @testset "taal-confirmed parameters_mhd_alfven_wave.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_alfven_wave.toml"), l2 = [0.0038729054515012624, 0.00903693761037057, 0.0041729297273898815, 0.01160504558506348, 0.006241548790045999, 0.009227641613254402, 0.0034580608435846143, 0.011684993365513006, 0.0022068452165023645], linf = [0.012628629484152443, 0.03265276295369954, 0.012907838374176334, 0.044746702024108326, 0.02796611265824822, 0.03453054781110626, 0.010261557301859958, 0.044762592434299864, 0.010012319622784436]) end - @testset "parameters_mhd_alfven_wave_mortar.toml" begin + @testset "taal-confirmed parameters_mhd_alfven_wave_mortar.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_alfven_wave_mortar.toml"), l2 = [0.0021484102061835623, 0.006826504155492453, 0.0030653111370061784, 0.008735898256361025, 0.0051601878379492335, 0.007157480202233399, 0.0028291977973972948, 0.008815052614117018, 0.0022321821323698257], linf = [0.012956870409227328, 0.05529249146399706, 0.020854504834048836, 0.05898012498637771, 0.03162799656904003, 0.05512773554440975, 0.017941374395225362, 0.060061114374191496, 0.013036070296136178], t_end = 0.25) end # 3D Orszag-Tang included to exercise all terms in the HLL flux - @testset "parameters_mhd_orszag_tang.toml" begin + @testset "taal-confirmed parameters_mhd_orszag_tang.toml" begin test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_mhd_orszag_tang.toml"), l2 = [0.0043911605751115424, 0.04144735653371165, 0.04150129965650717, 0.04150353600000829, 0.036931197750736805, 0.021125598820694595, 0.032956068087418154, 0.03296235602392588, 6.318083915607208e-6], linf = [0.01789383976134809, 0.08496187610572214, 0.08909116075943745, 0.08505952838326755, 0.10443373959204932, 0.05387852204182135, 0.08812990990777562, 0.07804874749131957, 8.138512446081734e-5], t_end = 0.06) - end # too expensive for CI - # @testset "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with n_steps_max = 2" begin + end + # too expensive for CI + # @testset "taal-confirmed parameters_euler_sedov_blast_wave_shockcapturing_amr.toml with n_steps_max = 2" begin # test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_sedov_blast_wave_shockcapturing_amr.toml"), # l2 = [0.00015213881280510253, 0.001481110249423103, 0.0014811102494231387, 0.001481110249423187, 0.002940437008367858], # linf = [0.03254534843490764, 0.38932044051654113, 0.38932044051654097, 0.38932044051654097, 1.050399588579145], diff --git a/test/test_paper-self-gravitating-gas-dynamics-old.jl b/test/test_paper-self-gravitating-gas-dynamics-old.jl new file mode 100644 index 0000000000..37288755db --- /dev/null +++ b/test/test_paper-self-gravitating-gas-dynamics-old.jl @@ -0,0 +1,118 @@ +module TestPaperSelfgravitatingGasDynamics + +using Test +using Trixi + +include("test_trixi.jl") + +# Start with a clean environment: remove Trixi output directory if it exists +outdir = "out" +isdir(outdir) && rm(outdir, recursive=true) + +# pathof(Trixi) returns /path/to/Trixi/src/Trixi.jl, dirname gives the parent directory +const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "paper-self-gravitating-gas-dynamics") + +# Numerical examples from the Euler-gravity paper +@testset "paper-self-gravitating-gas-dynamics" begin + @testset "taal-confirmed parameters_euler_eoc_test.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_eoc_test.toml"), + l2 = [0.00017409779099463607, 0.0003369287450282371, 0.00033692874502819616, 0.0006099035183426747], + linf = [0.0010793454782482836, 0.0018836374478419238, 0.0018836374478410356, 0.003971446179607874]) + end + + @testset "taal-confirmed parameters_euler_eoc_test.toml with polydeg=4" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_eoc_test.toml"), + l2 = [1.7187032983384504e-5, 2.6780178144541376e-5, 2.678017814469407e-5, 4.952410417693103e-5], + linf = [0.00015018092862240096, 0.00016548331714294484, 0.00016548331714405506, 0.00043726245511699346], + polydeg=4) + end + + @testset "taal-confirmedparameters_hyp_diff_eoc_test.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_eoc_test.toml"), + l2 = [0.00315402168051244, 0.012394424055283394, 0.021859728673870843], + linf = [0.017332075119072865, 0.07843510773347322, 0.11325788389718668]) + end + + @testset "taal-confirmed parameters_hyp_diff_eoc_test.toml with polydeg=4" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_eoc_test.toml"), + l2 = [0.00025112830138292663, 0.0008808243851096586, 0.0016313343234903468], + linf = [0.001719090967553516, 0.0031291844657076145, 0.00994609342322228], + polydeg=4) + end + + @testset "taal-confirmed parameters_eulergravity_eoc_test.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), + l2 = [0.0002487158370511598, 0.0003370291440916084, 0.00033702914409161063, 0.0007231934514459757, 0.00013852406160669235, 0.0007541252869723029, 0.0007541252869723299], + linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383, 0.0009549587622960237, 0.0030981236291827237, 0.003098123629182964], + t_end=0.1) + end + + @testset "taal-confirmed parameters_eulergravity_eoc_test.toml with polydeg=4" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), + l2 = [1.9536732064098693e-5, 2.756381055173374e-5, 2.7563810551703437e-5, 5.688705902953846e-5, 1.0684325470325204e-5, 5.829033623593028e-5, 5.829033623591347e-5], + linf = [0.00012335977351507488, 0.00020086338378089152, 0.00020086338378044744, 0.0004962132679873221, 8.5358666522109e-5, 0.0002927883863423353, 0.00029278838634330673], + t_end=0.1, polydeg=4) + end + + @testset "taal-check-wontfix parameters_eulergravity_eoc_test.toml with update_gravity_once_per_stage=false" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), + l2 = [0.00039754984075255105, 0.0011317710289437735, 0.00113177102894379, 0.002302567979915388, 0.0002449228820755184, 0.0009838245219995854, 0.0009838245219995676], + linf = [0.0013753628419428399, 0.0031706120730756737, 0.0031706120730756737, 0.0069469754604232214, 0.0008251489152860739, 0.0030597255494218545, 0.0030597255494215977], + t_end=0.1, update_gravity_once_per_stage=false) + end + + @testset "taal-confirmed parameters_eulergravity_eoc_test.toml with 1st order RK3S*" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), + l2 = [0.00024871583705119436, 0.0003370291440915927, 0.0003370291440916112, 0.0007231934514459859, 0.00013852406160669225, 0.0007541252869723031, 0.0007541252869723208], + linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383, 0.0009549587622960237, 0.0030981236291827237, 0.003098123629182964], + t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk51_3Sstar!") + end + + @testset "taal-confirmed parameters_eulergravity_eoc_test.toml with 3rd order RK3S*" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), + l2 = [0.000248715837047647, 0.0003370291440257414, 0.00033702914402587556, 0.0007231934513057375, 0.0001385240616293125, 0.0007541252869544295, 0.0007541252869544261], + linf = [0.00158117312532835, 0.0020493897540796446, 0.0020493897540800887, 0.0047937212650124295, 0.000954958762033685, 0.0030981236303003834, 0.003098123630300921], + t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk53_3Sstar!") + end + + @testset "taal-confirmed parameters_eulergravity_jeans_instability.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_jeans_instability.toml"), + l2 = [10734.053145404043, 13357.12732236844, 1.7837692768650575e-6, 26835.12522125218], + linf = [15194.889944849536, 18881.971585248222, 8.201044698652684e-6, 37974.48081559688], + t_end=0.1) + end + + @testset "taal-check-wontfix parameters_eulergravity_jeans_instability.toml with update_gravity_once_per_stage=false" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_jeans_instability.toml"), + l2 = [10723.612236928993, 13336.218272054195, 1.9668755665996365e-6, 26809.0229428131], + linf = [15180.113783512264, 18852.413655795124, 8.569420630932309e-6, 37937.54015120864], + t_end=0.1, update_gravity_once_per_stage=false) + end + + @testset "taal-confirmed parameters_eulergravity_jeans_instability.toml with RK3S*" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_jeans_instability.toml"), + l2 = [10734.45053135681, 13358.158052105966, 2.77477865977926e-6, 26836.118686572947], + linf = [15195.451977761462, 18883.428246416606, 1.2227873818940334e-5, 37975.88590713963], + t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk52_3Sstar!", + cfl_gravity=1.2) + end + + @testset "taal-confirmed parameters_eulergravity_sedov_blast_wave.toml" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_sedov_blast_wave.toml"), + l2 = [0.04630745182870653, 0.06507397069667135, 0.06507397069667123, 0.4897126929489009], + linf = [2.3861430058270825, 4.083635578775232, 4.083635578775231, 16.246070713311482], + t_end=0.05) + end + + @testset "taal-confirmed parameters_eulergravity_sedov_blast_wave.toml with amr_interval=0 and ref-level=8" begin + test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_sedov_blast_wave.toml"), + l2 = [0.002892212158623831, 0.013724796675028317, 0.013724796675028307, 0.05822941648860658], + linf = [0.26747911779347944, 1.3858220186530343, 1.3858220186530334, 4.071204772447612], + t_end=0.005, amr_interval=0, initial_refinement_level=8) + end +end + +# Clean up afterwards: delete Trixi output directory +@test_nowarn rm(outdir, recursive=true) + +end #module diff --git a/test/test_paper-self-gravitating-gas-dynamics.jl b/test/test_paper-self-gravitating-gas-dynamics.jl index 6cf03a8c5e..e0b14b1d18 100644 --- a/test/test_paper-self-gravitating-gas-dynamics.jl +++ b/test/test_paper-self-gravitating-gas-dynamics.jl @@ -12,107 +12,106 @@ isdir(outdir) && rm(outdir, recursive=true) # pathof(Trixi) returns /path/to/Trixi/src/Trixi.jl, dirname gives the parent directory const EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "paper-self-gravitating-gas-dynamics") -# Numerical examples from the Euler-gravity paper +@testset "2D" begin + +# Run basic tests @testset "paper-self-gravitating-gas-dynamics" begin - @testset "parameters_euler_eoc_test.toml" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_eoc_test.toml"), - l2 = [0.00017409779099463607, 0.0003369287450282371, 0.00033692874502819616, 0.0006099035183426747], - linf = [0.0010793454782482836, 0.0018836374478419238, 0.0018836374478410356, 0.003971446179607874]) + @testset "elixir_euler_eoc_test.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_eoc_test.jl"), + l2 = [0.00017409779099463607, 0.0003369287450282371, 0.00033692874502819616, 0.0006099035183426747], + linf = [0.0010793454782482836, 0.0018836374478419238, 0.0018836374478410356, 0.003971446179607874]) end - @testset "parameters_euler_eoc_test.toml with polydeg=4" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_eoc_test.toml"), - l2 = [1.7187032983384504e-5, 2.6780178144541376e-5, 2.678017814469407e-5, 4.952410417693103e-5], - linf = [0.00015018092862240096, 0.00016548331714294484, 0.00016548331714405506, 0.00043726245511699346], - polydeg=4) + @testset "elixir_euler_eoc_test.jl with polydeg=4" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_eoc_test.jl"), + l2 = [1.7187032983384504e-5, 2.6780178144541376e-5, 2.678017814469407e-5, 4.952410417693103e-5], + linf = [0.00015018092862240096, 0.00016548331714294484, 0.00016548331714405506, 0.00043726245511699346], + polydeg = 4) end - @testset "parameters_hyp_diff_eoc_test.toml" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_eoc_test.toml"), - l2 = [0.00315402168051244, 0.012394424055283394, 0.021859728673870843], - linf = [0.017332075119072865, 0.07843510773347322, 0.11325788389718668]) - end - @testset "parameters_hyp_diff_eoc_test.toml with polydeg=4" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_hyp_diff_eoc_test.toml"), - l2 = [0.00025112830138292663, 0.0008808243851096586, 0.0016313343234903468], - linf = [0.001719090967553516, 0.0031291844657076145, 0.00994609342322228], - polydeg=4) + @testset "elixir_hyp_diff_eoc_test.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_eoc_test.jl"), + l2 = [0.00315402168051244, 0.012394424055283394, 0.021859728673870843], + linf = [0.017332075119072865, 0.07843510773347322, 0.11325788389718668]) end - @testset "parameters_eulergravity_eoc_test.toml" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), - l2 = [0.0002487158370511598, 0.0003370291440916084, 0.00033702914409161063, 0.0007231934514459757, 0.00013852406160669235, 0.0007541252869723029, 0.0007541252869723299], - linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383, 0.0009549587622960237, 0.0030981236291827237, 0.003098123629182964], - t_end=0.1) + @testset "elixir_hyp_diff_eoc_test.jl with polydeg=4" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_hyp_diff_eoc_test.jl"), + l2 = [0.00025112830138292663, 0.0008808243851096586, 0.0016313343234903468], + linf = [0.001719090967553516, 0.0031291844657076145, 0.00994609342322228], + polydeg = 4) end - @testset "parameters_eulergravity_eoc_test.toml with polydeg=4" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), - l2 = [1.9536732064098693e-5, 2.756381055173374e-5, 2.7563810551703437e-5, 5.688705902953846e-5, 1.0684325470325204e-5, 5.829033623593028e-5, 5.829033623591347e-5], - linf = [0.00012335977351507488, 0.00020086338378089152, 0.00020086338378044744, 0.0004962132679873221, 8.5358666522109e-5, 0.0002927883863423353, 0.00029278838634330673], - t_end=0.1, polydeg=4) - end - @testset "parameters_eulergravity_eoc_test.toml with update_gravity_once_per_stage=false" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), - l2 = [0.00039754984075255105, 0.0011317710289437735, 0.00113177102894379, 0.002302567979915388, 0.0002449228820755184, 0.0009838245219995854, 0.0009838245219995676], - linf = [0.0013753628419428399, 0.0031706120730756737, 0.0031706120730756737, 0.0069469754604232214, 0.0008251489152860739, 0.0030597255494218545, 0.0030597255494215977], - t_end=0.1, update_gravity_once_per_stage=false) + @testset "elixir_eulergravity_eoc_test.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), + l2 = [0.0002487158370511598, 0.0003370291440916084, 0.00033702914409161063, 0.0007231934514459757], + linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383], + tspan = (0.0, 0.1)) end - @testset "parameters_eulergravity_eoc_test.toml with 1st order RK3S*" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), - l2 = [0.00024871583705119436, 0.0003370291440915927, 0.0003370291440916112, 0.0007231934514459859, 0.00013852406160669225, 0.0007541252869723031, 0.0007541252869723208], - linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383, 0.0009549587622960237, 0.0030981236291827237, 0.003098123629182964], - t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk51_3Sstar!") + @testset "elixir_eulergravity_eoc_test.jl with polydeg=4" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), + l2 = [1.9536732064098693e-5, 2.756381055173374e-5, 2.7563810551703437e-5, 5.688705902953846e-5], + linf = [0.00012335977351507488, 0.00020086338378089152, 0.00020086338378044744, 0.0004962132679873221], + tspan = (0.0, 0.1), polydeg = 4) end - @testset "parameters_eulergravity_eoc_test.toml with 3rd order RK3S*" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_eulergravity_eoc_test.toml"), - l2 = [0.000248715837047647, 0.0003370291440257414, 0.00033702914402587556, 0.0007231934513057375, 0.0001385240616293125, 0.0007541252869544295, 0.0007541252869544261], - linf = [0.00158117312532835, 0.0020493897540796446, 0.0020493897540800887, 0.0047937212650124295, 0.000954958762033685, 0.0030981236303003834, 0.003098123630300921], - t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk53_3Sstar!") + @testset "elixir_eulergravity_eoc_test.jl with 1st order RK3S*" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), + l2 = [0.00024871583705119436, 0.0003370291440915927, 0.0003370291440916112, 0.0007231934514459859], + linf = [0.001581173125044355, 0.002049389755695241, 0.0020493897556961294, 0.004793721268126383], + tspan = (0.0, 0.1), timestep_gravity=Trixi.timestep_gravity_erk51_3Sstar!) end - @testset "parameters_euler_gravity_jeans_instability.toml" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_gravity_jeans_instability.toml"), - l2 = [10734.053145404043, 13357.12732236844, 1.7837692768650575e-6, 26835.12522125218], - linf = [15194.889944849536, 18881.971585248222, 8.201044698652684e-6, 37974.48081559688], - t_end=0.1) + @testset "elixir_eulergravity_eoc_test.jl with 3rd order RK3S*" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_eoc_test.jl"), + l2 = [0.000248715837047647, 0.0003370291440257414, 0.00033702914402587556, 0.0007231934513057375], + linf = [0.00158117312532835, 0.0020493897540796446, 0.0020493897540800887, 0.0047937212650124295], + tspan = (0.0, 0.1), timestep_gravity=Trixi.timestep_gravity_erk53_3Sstar!) end - @testset "parameters_euler_gravity_jeans_instability.toml with update_gravity_once_per_stage=false" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_gravity_jeans_instability.toml"), - l2 = [10723.612236928993, 13336.218272054195, 1.9668755665996365e-6, 26809.0229428131], - linf = [15180.113783512264, 18852.413655795124, 8.569420630932309e-6, 37937.54015120864], - t_end=0.1, update_gravity_once_per_stage=false) + + @testset "elixir_eulergravity_jeans_instability.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_jeans_instability.jl"), + l2 = [10733.634574440104, 13356.777246273672, 1.9930894028451876e-6, 26834.07879379781], + linf = [15194.297536645085, 18881.47693900588, 8.325325156694497e-6, 37972.99978450313], + tspan = (0.0, 0.1)) end - @testset "parameters_euler_gravity_jeans_instability.toml with RK3S*" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_gravity_jeans_instability.toml"), - l2 = [10734.45053135681, 13358.158052105966, 2.77477865977926e-6, 26836.118686572947], - linf = [15195.451977761462, 18883.428246416606, 1.2227873818940334e-5, 37975.88590713963], - t_end=0.1, time_integration_scheme_gravity="timestep_gravity_erk52_3Sstar!", - cfl_gravity=1.2) + @testset "elixir_eulergravity_jeans_instability.jl with RK3S*" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_jeans_instability.jl"), + l2 = [10734.59878993429, 13358.214052395579, 2.7246732181080924e-6, 26836.489332980615], + linf = [15195.661845114082, 18883.507539561684, 1.1096401891274226e-5, 37976.4105797708], + tspan = (0.0, 0.1), + parameters=ParametersEulerGravity(background_density=1.5e7, + gravitational_constant=6.674e-8, + # FIXME Taal restore after Taam sync + cfl=1.2, + n_iterations_max=1000, + timestep_gravity=timestep_gravity_erk52_3Sstar!)) end - @testset "parameters_euler_gravity_sedov_blast_wave.toml" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_gravity_sedov_blast_wave.toml"), - l2 = [0.04630745182870653, 0.06507397069667138, 0.06507397069667123, 0.48971269294890085], - linf = [2.3861430058270847, 4.083635578775231, 4.083635578775232, 16.246070713311475], - t_end=0.05) + + @testset "elixir_eulergravity_sedov_blast_wave.jl" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_sedov_blast_wave.jl"), + l2 = [0.04630745182888786, 0.06507397069616608, 0.0650739706961657, 0.48971269294846076], + linf = [2.386143005917894, 4.083635578827995, 4.0836355788279946, 16.24607071330087], + tspan = (0.0, 0.05)) end - @testset "parameters_euler_gravity_sedov_blast_wave.toml with amr_interval=0 and ref-level=8" begin - test_trixi_run(joinpath(EXAMPLES_DIR, "parameters_euler_gravity_sedov_blast_wave.toml"), - l2 = [0.0028922121586238323, 0.013724796675028317, 0.013724796675028307, 0.05822941648860658], - linf = [0.26747911779347966, 1.385822018653034, 1.385822018653034, 4.071204772447614], - t_end=0.005, amr_interval=0, initial_refinement_level=8) + @testset "elixir_eulergravity_sedov_blast_wave.jl with amr_interval=0 and ref-level=8" begin + @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_eulergravity_sedov_blast_wave.jl"), + l2 = [0.0028922121586240916, 0.013724796675028319, 0.013724796675028305, 0.05822941648860658], + linf = [0.26747911779347966, 1.3858220186530341, 1.3858220186530337, 4.0712047724476115], + tspan = (0.0, 0.005), initial_refinement_level=8, amr_callback=TrivialCallback()) end end # Clean up afterwards: delete Trixi output directory @test_nowarn rm(outdir, recursive=true) +end # 2D + end #module