From 131b5abd2189a2d7c4697252fab5caac3ba00935 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Mon, 12 Aug 2024 16:17:20 +0200 Subject: [PATCH] tests --- ...lixir_navierstokes_convergence_periodic_cfl.jl | 4 +++- test/test_parabolic_1d.jl | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic_cfl.jl b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic_cfl.jl index b3b15ed2ef0..d4ee18608d2 100644 --- a/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic_cfl.jl +++ b/examples/tree_1d_dgsem/elixir_navierstokes_convergence_periodic_cfl.jl @@ -122,7 +122,9 @@ analysis_callback = AnalysisCallback(semi, interval = analysis_interval) alive_callback = AliveCallback(analysis_interval = analysis_interval) -# Stepsize callback which selects the timestep to the most restrictive influence +# Stepsize callback which selects the timestep according to the most restrictive CFL condition. +# For coarser grids, linear stability is governed by the convective CFL condition, +# while for high refinements (e.g. initial_refinement_level = 8) the flow becomes diffusion-dominated. stepsize_callback = StepsizeCallbackHyperbolicParabolic(cfl_convective = 1.8, cfl_diffusive = 0.3) diff --git a/test/test_parabolic_1d.jl b/test/test_parabolic_1d.jl index 38bebdcce1d..09ce10a6d7c 100644 --- a/test/test_parabolic_1d.jl +++ b/test/test_parabolic_1d.jl @@ -84,6 +84,21 @@ end end end +@trixi_testset "TreeMesh1D: elixir_navierstokes_convergence_periodic_cfl.jl" begin + @test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem", + "elixir_navierstokes_convergence_periodic_cfl.jl"), + l2=[0.00011338560756751962, 6.240158271610694e-5, 0.0002848510206540238], + linf=[0.0006233189520368221, 0.0003592942992138859, 0.0016105764529221744]) + # Ensure that we do not have excessive memory allocations + # (e.g., from type instabilities) + let + t = sol.t[end] + u_ode = sol.u[end] + du_ode = similar(u_ode) + @test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000 + end +end + @trixi_testset "TreeMesh1D: elixir_navierstokes_convergence_periodic.jl: GradientVariablesEntropy" begin @test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem", "elixir_navierstokes_convergence_periodic.jl"),