Skip to content

Commit

Permalink
update elixir and test; add topography
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickersing committed Jan 8, 2024
1 parent 9f28dd3 commit 7d03b4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
15 changes: 7 additions & 8 deletions examples/tree_2d_dgsem/elixir_shallowwater_wall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions test/test_tree_2d_shallowwater.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d03b4a

Please sign in to comment.