From 7d03b4a65dfa508d5367916abd9a7497d1fa6407 Mon Sep 17 00:00:00 2001 From: patrickersing Date: Mon, 8 Jan 2024 08:52:55 +0100 Subject: [PATCH] update elixir and test; add topography --- .../tree_2d_dgsem/elixir_shallowwater_wall.jl | 15 +++++++-------- test/test_tree_2d_shallowwater.jl | 16 ++++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/tree_2d_dgsem/elixir_shallowwater_wall.jl b/examples/tree_2d_dgsem/elixir_shallowwater_wall.jl index 4f4be8083b6..b8dbad50680 100644 --- a/examples/tree_2d_dgsem/elixir_shallowwater_wall.jl +++ b/examples/tree_2d_dgsem/elixir_shallowwater_wall.jl @@ -6,24 +6,23 @@ using Trixi equations = ShallowWaterEquations2D(gravity_constant = 9.81, H0 = 3.25) -# An initial condition with a perturbation in the waterheight to test boundary_condition_slip_wall -function initial_condition_well_balancedness(x, t, equations::ShallowWaterEquations2D) +# An initial condition with a bottom topography and a perturbation in the waterheight to test +# boundary_condition_slip_wall +function initial_condition_perturbation(x, t, equations::ShallowWaterEquations2D) # Set the background values H = equations.H0 v1 = 0.0 v2 = 0.0 - x1, x2 = x - b = 0.0 - + # Bottom topography + b = 1.5 * exp(-0.5 * ((x[1])^2 + (x[2])^2)) # Waterheight perturbation - r = (x[1])^2 + (x[2])^2 - H = H + 0.5 * exp(-10 * r) + H = H + 0.5 * exp(-10.0 * ((x[1])^2 + (x[2])^2)) return prim2cons(SVector(H, v1, v2, b), equations) end -initial_condition = initial_condition_well_balancedness +initial_condition = initial_condition_perturbation boundary_condition = boundary_condition_slip_wall diff --git a/test/test_tree_2d_shallowwater.jl b/test/test_tree_2d_shallowwater.jl index 8e5bdb69334..1f3dfbf5267 100644 --- a/test/test_tree_2d_shallowwater.jl +++ b/test/test_tree_2d_shallowwater.jl @@ -331,16 +331,16 @@ end @trixi_testset "elixir_shallowwater_wall.jl" begin @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_shallowwater_wall.jl"), l2=[ - 0.10982800604156373, - 0.2696758586410491, - 0.26967585864104954, - 0.0, + 0.13517233723296504, + 0.20010876311162215, + 0.20010876311162223, + 2.719538414346464e-7, ], linf=[ - 0.4962808878041378, - 0.6577212830580099, - 0.6577212830580086, - 0.0, + 0.5303607982988336, + 0.5080989745682338, + 0.5080989745682352, + 1.1301675764130437e-6, ], tspan=(0.0, 0.25)) # Ensure that we do not have excessive memory allocations