From dbddf8586bec800e2d40906a586870cb5417f942 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Mon, 19 Jun 2023 09:17:01 -0500 Subject: [PATCH] fix CNS convergence elixir and add to tests --- .../elixir_navierstokes_convergence.jl | 20 +++++-------------- test/test_parabolic_2d.jl | 8 ++++++++ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl index 1375f387cc1..8111df8251a 100644 --- a/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl +++ b/examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl @@ -18,17 +18,11 @@ solver = DGSEM(polydeg=3, surface_flux=flux_lax_friedrichs, coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y)) coordinates_max = ( 1.0, 1.0) # maximum coordinates (max(x), max(y)) -# Create a uniformly refined mesh with periodic boundaries -mesh = TreeMesh(coordinates_min, coordinates_max, - initial_refinement_level=4, - periodicity=(true, true), - n_cells_max=30_000) # set maximum capacity of tree data structure - trees_per_dimension = (4, 4) mesh = P4estMesh(trees_per_dimension, polydeg=3, initial_refinement_level=2, coordinates_min=coordinates_min, coordinates_max=coordinates_max, - periodicity=true) + periodicity=(true, false)) # Note: the initial condition cannot be specialized to `CompressibleNavierStokesDiffusion2D` # since it is called by both the parabolic solver (which passes in `CompressibleNavierStokesDiffusion2D`) @@ -181,16 +175,12 @@ heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0) boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom, heat_bc_top_bottom) # define inviscid boundary conditions -boundary_conditions = (; x_neg = boundary_condition_periodic, - x_pos = boundary_condition_periodic, - y_neg = boundary_condition_slip_wall, - y_pos = boundary_condition_slip_wall) +boundary_conditions = Dict(:y_neg => boundary_condition_slip_wall, + :y_pos => boundary_condition_slip_wall) # define viscous boundary conditions -boundary_conditions_parabolic = (; x_neg = boundary_condition_periodic, - x_pos = boundary_condition_periodic, - y_neg = boundary_condition_top_bottom, - y_pos = boundary_condition_top_bottom) +boundary_conditions_parabolic = Dict(:y_neg => boundary_condition_top_bottom, + :y_pos => boundary_condition_top_bottom) semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic), initial_condition, solver; boundary_conditions=(boundary_conditions, boundary_conditions_parabolic), diff --git a/test/test_parabolic_2d.jl b/test/test_parabolic_2d.jl index 8ab7bc7556b..6d953f8372f 100644 --- a/test/test_parabolic_2d.jl +++ b/test/test_parabolic_2d.jl @@ -216,6 +216,14 @@ isdir(outdir) && rm(outdir, recursive=true) ) end + @trixi_testset "P4estMesh2D: elixir_navierstokes_convergence.jl" begin + @test_trixi_include(joinpath(examples_dir(), "p4est_2d_dgsem", "elixir_navierstokes_convergence.jl"), + initial_refinement_level = 2, tspan=(0.0, 0.5), + l2 = [4.2852610204634015e-6, 2.0679143814141558e-5, 1.4336134288439704e-5, 7.800744943199459e-6], + linf = [3.570853695711307e-5, 0.00034481633921521794, 8.593188464759635e-5, 0.00010656913331352769] + ) + end + @trixi_testset "P4estMesh2D: elixir_navierstokes_lid_driven_cavity.jl" begin @test_trixi_include(joinpath(examples_dir(), "p4est_2d_dgsem", "elixir_navierstokes_lid_driven_cavity.jl"), initial_refinement_level = 2, tspan=(0.0, 0.5),