Path: blob/main/test/test_p4est_3d_mhdmultiion.jl
2055 views
module TestExamples3DIdealGlmMhdMultiIon12using Test3using Trixi45include("test_trixi.jl")67# pathof(Trixi) returns /path/to/Trixi/src/Trixi.jl, dirname gives the parent directory8EXAMPLES_DIR = joinpath(examples_dir(), "p4est_3d_dgsem")910@testset "MHD Multi-ion" begin11#! format: noindent1213@trixi_testset "elixir_mhdmultiion_ec.jl" begin14@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmultiion_ec.jl"),15l2=[160.003734820532985263,170.0038615619955546204,180.003833638703487458,190.0028263125135739955,200.0023618139630058143,210.002384129259605738,220.0023828293292904833,230.038089526935383124,240.0038194562843790105,250.003439479296467246,260.003526498173885533,270.0034956719160693537,280.02143679204123428,293.3199722425501164e-630],31linf=[320.2016143602393723,330.1707562492816741,340.19671841540041113,350.092481456884773,360.09928141143714853,370.10613515319792097,380.11127460598498372,391.2130363801029604,400.12582249707043758,410.1698494562737311,420.16751667624425207,430.1687325700572586,440.7019146966991214,450.000781211616156169646], tspan=(0.0, 0.05))47# Ensure that we do not have excessive memory allocations48# (e.g., from type instabilities)49let50t = sol.t[end]51u_ode = sol.u[end]52du_ode = similar(u_ode)53@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 100054end55end5657# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of58# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.59# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.60# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.61# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.62# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the63# `StepsizeCallback` (CFL-Condition) and less diffusion.64@trixi_testset "Provably entropy-stable LLF-type fluxes for multi-ion GLM-MHD" begin65@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmultiion_ec.jl"),66l2=[670.0028955650582195335,680.0029749524273695624,690.0029533907732692344,700.0024285755843305988,710.0023749924019966094,720.0024114801452486206,730.0023991164504279404,740.03150571433653016,750.003874135295085382,760.0032206538891184646,770.0033289635387358306,780.0032922608966505377,790.019053919178522397,801.2888164218472409e-581],82linf=[830.10031944778984792,840.09835765892858706,850.09915484563347321,860.0643535254948433,870.09957773301344566,880.09607387748333969,890.09698728400727108,900.8341002490873852,910.12157560398831846,920.14778536942358805,930.1464940331696904,940.1449618481727096,950.5487673957733081,960.001454066867688836597],98surface_flux=(FluxPlusDissipation(flux_ruedaramirez_etal,99DissipationLaxFriedrichsEntropyVariables(max_abs_speed_naive)),100flux_nonconservative_ruedaramirez_etal),101tspan=(0.0, 0.05))102# Ensure that we do not have excessive memory allocations103# (e.g., from type instabilities)104let105t = sol.t[end]106u_ode = sol.u[end]107du_ode = similar(u_ode)108@test (@allocated Trixi.rhs!(du_ode, u_ode, semi, t)) < 1000109end110end111end112end # module113114115