diff --git a/examples/structured_2d_dgsem/elixir_euler_free_stream_sc_subcell.jl b/examples/structured_2d_dgsem/elixir_euler_free_stream_sc_subcell.jl index e03db9dace1..49ddbe731a8 100644 --- a/examples/structured_2d_dgsem/elixir_euler_free_stream_sc_subcell.jl +++ b/examples/structured_2d_dgsem/elixir_euler_free_stream_sc_subcell.jl @@ -9,6 +9,12 @@ equations = CompressibleEulerEquations2D(1.4) initial_condition = initial_condition_constant +boundary_condition = BoundaryConditionDirichlet(initial_condition) +boundary_conditions = (x_neg = boundary_condition_periodic, + x_pos = boundary_condition_periodic, + y_neg = boundary_condition, + y_pos = boundary_condition) + surface_flux = flux_lax_friedrichs volume_flux = flux_ranocha polydeg = 3 @@ -45,9 +51,10 @@ function mapping(xi_, eta_) end cells_per_dimension = (16, 16) -mesh = StructuredMesh(cells_per_dimension, mapping, periodicity = true) +mesh = StructuredMesh(cells_per_dimension, mapping, periodicity = (true, false)) -semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver) +semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_conditions) ############################################################################### # ODE solvers, callbacks etc. diff --git a/src/solvers/dgsem_structured/subcell_limiters_2d.jl b/src/solvers/dgsem_structured/subcell_limiters_2d.jl index 34cfcdbaef4..909205e30af 100644 --- a/src/solvers/dgsem_structured/subcell_limiters_2d.jl +++ b/src/solvers/dgsem_structured/subcell_limiters_2d.jl @@ -9,7 +9,6 @@ function calc_bounds_twosided_interface!(var_min, var_max, variable, u, t, semi, mesh::StructuredMesh{2}) _, equations, dg, cache = mesh_equations_solver_cache(semi) (; boundary_conditions) = semi - (; contravariant_vectors) = cache.elements # Calc bounds at interfaces and periodic boundaries for element in eachelement(dg, cache) @@ -57,11 +56,9 @@ function calc_bounds_twosided_interface!(var_min, var_max, variable, u, t, semi, for cell_y in axes(mesh, 2) element = linear_indices[begin, cell_y] for j in eachnode(dg) - Ja1 = get_contravariant_vector(1, contravariant_vectors, 1, j, element) - u_inner = get_node_vars(u, equations, dg, 1, j, element) - u_outer = get_boundary_outer_state(u_inner, cache, t, - boundary_conditions[1], Ja1, 1, - equations, dg, 1, j, element) + u_outer = get_boundary_outer_state(boundary_conditions[1], + cache, t, equations, dg, + 1, j, element) var_outer = u_outer[variable] var_min[1, j, element] = min(var_min[1, j, element], var_outer) @@ -72,13 +69,9 @@ function calc_bounds_twosided_interface!(var_min, var_max, variable, u, t, semi, for cell_y in axes(mesh, 2) element = linear_indices[end, cell_y] for j in eachnode(dg) - Ja1 = get_contravariant_vector(1, contravariant_vectors, nnodes(dg), j, - element) - u_inner = get_node_vars(u, equations, dg, nnodes(dg), j, element) - u_outer = get_boundary_outer_state(u_inner, cache, t, - boundary_conditions[2], Ja1, 2, - equations, dg, nnodes(dg), j, - element) + u_outer = get_boundary_outer_state(boundary_conditions[2], + cache, t, equations, dg, + nnodes(dg), j, element) var_outer = u_outer[variable] var_min[nnodes(dg), j, element] = min(var_min[nnodes(dg), j, element], @@ -93,11 +86,9 @@ function calc_bounds_twosided_interface!(var_min, var_max, variable, u, t, semi, for cell_x in axes(mesh, 1) element = linear_indices[cell_x, begin] for i in eachnode(dg) - Ja2 = get_contravariant_vector(2, contravariant_vectors, i, 1, element) - u_inner = get_node_vars(u, equations, dg, i, 1, element) - u_outer = get_boundary_outer_state(u_inner, cache, t, - boundary_conditions[3], Ja2, 3, - equations, dg, i, 1, element) + u_outer = get_boundary_outer_state(boundary_conditions[3], + cache, t, equations, dg, + i, 1, element) var_outer = u_outer[variable] var_min[i, 1, element] = min(var_min[i, 1, element], var_outer) @@ -108,13 +99,9 @@ function calc_bounds_twosided_interface!(var_min, var_max, variable, u, t, semi, for cell_x in axes(mesh, 1) element = linear_indices[cell_x, end] for i in eachnode(dg) - Ja2 = get_contravariant_vector(2, contravariant_vectors, i, nnodes(dg), - element) - u_inner = get_node_vars(u, equations, dg, i, nnodes(dg), element) - u_outer = get_boundary_outer_state(u_inner, cache, t, - boundary_conditions[4], Ja2, 4, - equations, dg, i, nnodes(dg), - element) + u_outer = get_boundary_outer_state(boundary_conditions[4], + cache, t, equations, dg, + i, nnodes(dg), element) var_outer = u_outer[variable] var_min[i, nnodes(dg), element] = min(var_min[i, nnodes(dg), element], diff --git a/test/test_structured_2d.jl b/test/test_structured_2d.jl index 849006cfc43..340efe97c62 100644 --- a/test/test_structured_2d.jl +++ b/test/test_structured_2d.jl @@ -452,16 +452,16 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_free_stream_sc_subcell.jl"), l2=[ - 9.032004415047197e-17, - 7.468471908193906e-16, - 6.518326029493845e-16, - 1.753322836364184e-15, + 8.679465418313328e-17, + 7.45128559275597e-16, + 6.526610493700283e-16, + 1.6923968530609196e-15, ], linf=[ - 1.1102230246251565e-15, - 8.81239525796218e-15, - 1.04638520070921e-14, - 1.5987211554602254e-14, + 8.881784197001252e-16, + 9.478529072737274e-15, + 7.188694084447889e-15, + 1.4210854715202004e-14, ], atol=1.0e-13, cells_per_dimension=(8, 8))