Skip to content

Commit

Permalink
Use local limiting and nonperiodic domain in source terms elixir
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed May 15, 2024
1 parent c1af151 commit 2ddd78a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

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

0 comments on commit 2ddd78a

Please sign in to comment.