From 2ddd78aa0451a00c5929178596ebc711bd19af05 Mon Sep 17 00:00:00 2001 From: bennibolm Date: Wed, 15 May 2024 13:23:34 +0200 Subject: [PATCH] Use local limiting and nonperiodic domain in source terms elixir --- .../elixir_euler_source_terms_sc_subcell.jl | 16 +++++++++++----- test/test_structured_2d.jl | 16 ++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/examples/structured_2d_dgsem/elixir_euler_source_terms_sc_subcell.jl b/examples/structured_2d_dgsem/elixir_euler_source_terms_sc_subcell.jl index 97c541266fa..ae413828861 100644 --- a/examples/structured_2d_dgsem/elixir_euler_source_terms_sc_subcell.jl +++ b/examples/structured_2d_dgsem/elixir_euler_source_terms_sc_subcell.jl @@ -10,15 +10,20 @@ equations = CompressibleEulerEquations2D(1.4) initial_condition = initial_condition_convergence_test source_terms = source_terms_convergence_test +boundary_condition = BoundaryConditionDirichlet(initial_condition) +boundary_conditions = (x_neg = boundary_condition, + x_pos = boundary_condition, + y_neg = boundary_condition, + y_pos = boundary_condition) + # Get the DG approximation space surface_flux = flux_lax_friedrichs volume_flux = flux_ranocha polydeg = 3 basis = LobattoLegendreBasis(polydeg) limiter_idp = SubcellLimiterIDP(equations, basis; - local_twosided_variables_cons = ["rho"], - local_onesided_variables_nonlinear = [(Trixi.entropy_guermond_etal, - min)]) + positivity_variables_cons = ["rho"], + positivity_variables_nonlinear = [pressure]) volume_integral = VolumeIntegralSubcellLimiting(limiter_idp; volume_flux_dg = volume_flux, volume_flux_fv = surface_flux) @@ -32,9 +37,10 @@ f4(s) = SVector(s, 1.0 + sin(0.5 * pi * s)) mapping = Trixi.transfinite_mapping((f1, f2, f3, f4)) cells_per_dimension = (16, 16) -mesh = StructuredMesh(cells_per_dimension, mapping, periodicity = true) +mesh = StructuredMesh(cells_per_dimension, mapping, periodicity = false) semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver, + boundary_conditions = boundary_conditions, source_terms = source_terms) ############################################################################### @@ -55,7 +61,7 @@ save_solution = SaveSolutionCallback(interval = 100, save_final_solution = true, solution_variables = cons2prim) -stepsize_callback = StepsizeCallback(cfl = 0.5) +stepsize_callback = StepsizeCallback(cfl = 0.8) callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback, diff --git a/test/test_structured_2d.jl b/test/test_structured_2d.jl index 6875259e788..ff27f683a40 100644 --- a/test/test_structured_2d.jl +++ b/test/test_structured_2d.jl @@ -479,16 +479,16 @@ end @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_source_terms_sc_subcell.jl"), l2=[ - 0.00816012943805366, - 0.008658255997419217, - 0.00935190284719103, - 0.027757019482291357, + 7.939813971944535e-5, + 3.6805976512737965e-5, + 7.50142174035037e-5, + 0.0001576144969663713, ], linf=[ - 0.02722563220635177, - 0.040734034380730755, - 0.03819407626402338, - 0.08080649141597318, + 0.0007421863054295486, + 0.00037635704053817776, + 0.0007278708058917616, + 0.001550366737408826, ], tspan=(0.0, 0.5)) # Ensure that we do not have excessive memory allocations