Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/test/test_p4est_3d_mhdmultiion.jl
5582 views
1
module TestExamples3DIdealGlmMhdMultiIon
2
3
using Test
4
using Trixi
5
6
include("test_trixi.jl")
7
8
# pathof(Trixi) returns /path/to/Trixi/src/Trixi.jl, dirname gives the parent directory
9
EXAMPLES_DIR = joinpath(examples_dir(), "p4est_3d_dgsem")
10
11
@testset "MHD Multi-ion" begin
12
#! format: noindent
13
14
@trixi_testset "elixir_mhdmultiion_ec.jl" begin
15
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmultiion_ec.jl"),
16
l2=[
17
0.003734820532985263,
18
0.0038615619955546204,
19
0.003833638703487458,
20
0.0028263125135739955,
21
0.0023618139630058143,
22
0.002384129259605738,
23
0.0023828293292904833,
24
0.038089526935383124,
25
0.0038194562843790105,
26
0.003439479296467246,
27
0.003526498173885533,
28
0.0034956719160693537,
29
0.02143679204123428,
30
3.3199722425501164e-6
31
],
32
linf=[
33
0.2016143602393723,
34
0.1707562492816741,
35
0.19671841540041113,
36
0.092481456884773,
37
0.09928141143714853,
38
0.10613515319792097,
39
0.11127460598498372,
40
1.2130363801029604,
41
0.12582249707043758,
42
0.1698494562737311,
43
0.16751667624425207,
44
0.1687325700572586,
45
0.7019146966991214,
46
0.0007812116161561696
47
], tspan=(0.0, 0.05))
48
# Ensure that we do not have excessive memory allocations
49
# (e.g., from type instabilities)
50
@test_allocations(Trixi.rhs!, semi, sol, 1000)
51
end
52
53
# Up to version 0.13.0, `max_abs_speed_naive` was used as the default wave speed estimate of
54
# `const flux_lax_friedrichs = FluxLaxFriedrichs(), i.e., `FluxLaxFriedrichs(max_abs_speed = max_abs_speed_naive)`.
55
# In the `StepsizeCallback`, though, the less diffusive `max_abs_speeds` is employed which is consistent with `max_abs_speed`.
56
# Thus, we exchanged in PR#2458 the default wave speed used in the LLF flux to `max_abs_speed`.
57
# To ensure that every example still runs we specify explicitly `FluxLaxFriedrichs(max_abs_speed_naive)`.
58
# We remark, however, that the now default `max_abs_speed` is in general recommended due to compliance with the
59
# `StepsizeCallback` (CFL-Condition) and less diffusion.
60
@trixi_testset "Provably entropy-stable LLF-type fluxes for multi-ion GLM-MHD" begin
61
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_mhdmultiion_ec.jl"),
62
l2=[
63
0.0028955650582195335,
64
0.0029749524273695624,
65
0.0029533907732692344,
66
0.0024285755843305988,
67
0.0023749924019966094,
68
0.0024114801452486206,
69
0.0023991164504279404,
70
0.03150571433653016,
71
0.003874135295085382,
72
0.0032206538891184646,
73
0.0033289635387358306,
74
0.0032922608966505377,
75
0.019053919178522397,
76
1.2888164218472409e-5
77
],
78
linf=[
79
0.10031944778984792,
80
0.09835765892858706,
81
0.09915484563347321,
82
0.0643535254948433,
83
0.09957773301344566,
84
0.09607387748333969,
85
0.09698728400727108,
86
0.8341002490873852,
87
0.12157560398831846,
88
0.14778536942358805,
89
0.1464940331696904,
90
0.1449618481727096,
91
0.5487673957733081,
92
0.0014540668676888365
93
],
94
surface_flux=(FluxPlusDissipation(flux_ruedaramirez_etal,
95
DissipationLaxFriedrichsEntropyVariables(max_abs_speed_naive)),
96
flux_nonconservative_ruedaramirez_etal),
97
tspan=(0.0, 0.05))
98
# Ensure that we do not have excessive memory allocations
99
# (e.g., from type instabilities)
100
@test_allocations(Trixi.rhs!, semi, sol, 1000)
101
end
102
end
103
end # module
104
105