Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLLE CEE 2D3D NonCartesian Meshes #1692

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
487d08d
HLLE CEE 2D3D NonCartesian Meshes
DanielDoehring Oct 27, 2023
653e2cc
format
DanielDoehring Oct 27, 2023
dfc538b
Merge branch 'main' into HLLE_CEE_2D3D_NonCartesian
DanielDoehring Oct 27, 2023
fd8a922
hlle via hll
DanielDoehring Oct 30, 2023
8dbe9b3
format test
DanielDoehring Oct 30, 2023
55c4326
Merge branch 'HLLE_CEE_2D3D_NonCartesian' of github.com:DanielDoehrin…
DanielDoehring Oct 30, 2023
0f8dd92
format test
DanielDoehring Oct 30, 2023
ccf55a5
Merge branch 'main' into HLLE_CEE_2D3D_NonCartesian
DanielDoehring Oct 30, 2023
aca8cb7
format
DanielDoehring Oct 30, 2023
6e10fa5
do not export hlle
DanielDoehring Oct 30, 2023
7d089e5
Correct test vals
DanielDoehring Oct 31, 2023
c34dc6e
Merge branch 'main' into HLLE_CEE_2D3D_NonCartesian
DanielDoehring Oct 31, 2023
c60f434
test values CI
DanielDoehring Oct 31, 2023
05ddef4
Merge branch 'HLLE_CEE_2D3D_NonCartesian' of github.com:DanielDoehrin…
DanielDoehring Oct 31, 2023
c11d008
Update src/equations/compressible_euler_2d.jl
DanielDoehring Oct 31, 2023
ad17e0e
Update src/equations/compressible_euler_1d.jl
DanielDoehring Oct 31, 2023
2bb19d0
Update src/equations/compressible_euler_2d.jl
DanielDoehring Oct 31, 2023
3825ce1
Update src/equations/compressible_euler_3d.jl
DanielDoehring Oct 31, 2023
2a08efa
Update src/equations/compressible_euler_3d.jl
DanielDoehring Oct 31, 2023
a0c0221
apply suggestions
DanielDoehring Oct 31, 2023
fb3dfc9
additional sentence
DanielDoehring Oct 31, 2023
81bd303
Fix typo
DanielDoehring Oct 31, 2023
d35503f
typos
DanielDoehring Oct 31, 2023
1fc62b9
correct test vals
DanielDoehring Oct 31, 2023
dcb5185
Merge branch 'main' into HLLE_CEE_2D3D_NonCartesian
ranocha Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export LaplaceDiffusion1D, LaplaceDiffusion2D, LaplaceDiffusion3D,

export GradientVariablesPrimitive, GradientVariablesEntropy

export flux, flux_central, flux_lax_friedrichs, flux_hll, flux_hllc,
export flux, flux_central, flux_lax_friedrichs, flux_hll, flux_hllc, flux_hlle,
flux_godunov,
flux_chandrashekar, flux_ranocha, flux_derigs_etal, flux_hindenlang_gassner,
flux_nonconservative_powell, flux_nonconservative_powell_local_symmetric,
Expand Down
2 changes: 1 addition & 1 deletion src/equations/compressible_euler_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ Compactly summarized:
[Link](https://metaphor.ethz.ch/x/2019/hs/401-4671-00L/literature/mishra_hyperbolic_pdes.pdf)
"""
@inline function min_max_speed_einfeldt(u_ll, u_rr, orientation::Integer,
equations::CompressibleEulerEquations1D)
equations::CompressibleEulerEquations1D)
# Calculate primitive variables, enthalpy and speed of sound
rho_ll, v_ll, p_ll = cons2prim(u_ll, equations)
rho_rr, v_rr, p_rr = cons2prim(u_rr, equations)
Expand Down
6 changes: 3 additions & 3 deletions src/equations/compressible_euler_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1267,8 +1267,8 @@ of the numerical flux.
On Godunov-type methods near low densities.
[DOI: 10.1016/0021-9991(91)90211-3](https://doi.org/10.1016/0021-9991(91)90211-3)
"""
function min_max_speed_einfeldt(u_ll, u_rr, orientation::Integer,
equations::CompressibleEulerEquations2D)
@inline function min_max_speed_einfeldt(u_ll, u_rr, orientation::Integer,
equations::CompressibleEulerEquations2D)
# Calculate primitive variables, enthalpy and speed of sound
rho_ll, v1_ll, v2_ll, p_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr, p_rr = cons2prim(u_rr, equations)
Expand Down Expand Up @@ -1325,7 +1325,7 @@ of the numerical flux.
[DOI: 10.1016/0021-9991(91)90211-3](https://doi.org/10.1016/0021-9991(91)90211-3)
"""
@inline function min_max_speed_einfeldt(u_ll, u_rr, normal_direction::AbstractVector,
equations::CompressibleEulerEquations2D)
equations::CompressibleEulerEquations2D)
# Calculate primitive variables, enthalpy and speed of sound
rho_ll, v1_ll, v2_ll, p_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr, p_rr = cons2prim(u_rr, equations)
Expand Down
10 changes: 5 additions & 5 deletions src/equations/compressible_euler_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ function flux_hllc(u_ll, u_rr, orientation::Integer,
end

"""
min_max_speed_einfeldtmin_max_speed_einfeldt(u_ll, u_rr, orientation, equations::CompressibleEulerEquations3D)
min_max_speed_einfeldt(u_ll, u_rr, orientation, equations::CompressibleEulerEquations3D)

Computes the HLLE (Harten-Lax-van Leer-Einfeldt) flux for the compressible Euler equations.
Special estimates of the signal velocites and linearization of the Riemann problem developed
Expand All @@ -1336,8 +1336,8 @@ of the numerical flux.
On Godunov-type methods near low densities.
[DOI: 10.1016/0021-9991(91)90211-3](https://doi.org/10.1016/0021-9991(91)90211-3)
"""
function min_max_speed_einfeldt(u_ll, u_rr, orientation::Integer,
equations::CompressibleEulerEquations3D)
@inline function min_max_speed_einfeldt(u_ll, u_rr, orientation::Integer,
equations::CompressibleEulerEquations3D)
# Calculate primitive variables, enthalpy and speed of sound
rho_ll, v1_ll, v2_ll, v3_ll, p_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr, v3_rr, p_rr = cons2prim(u_rr, equations)
Expand Down Expand Up @@ -1397,8 +1397,8 @@ of the numerical flux.
On Godunov-type methods near low densities.
[DOI: 10.1016/0021-9991(91)90211-3](https://doi.org/10.1016/0021-9991(91)90211-3)
"""
function min_max_speed_einfeldt(u_ll, u_rr, normal_direction::AbstractVector,
equations::CompressibleEulerEquations3D)
@inline function min_max_speed_einfeldt(u_ll, u_rr, normal_direction::AbstractVector,
equations::CompressibleEulerEquations3D)
# Calculate primitive variables, enthalpy and speed of sound
rho_ll, v1_ll, v2_ll, v3_ll, p_ll = cons2prim(u_ll, equations)
rho_rr, v1_rr, v2_rr, v3_rr, p_rr = cons2prim(u_rr, equations)
Expand Down
8 changes: 8 additions & 0 deletions src/equations/numerical_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@ See [`FluxHLL`](@ref).
"""
const flux_hll = FluxHLL()

"""
flux_hlle
See [`min_max_speed_einfeldt`](@ref).
This is a [`FluxHLL`](@ref)-type two-wave solver with special estimates of the wave speeds.
"""
const flux_hlle = FluxHLL(min_max_speed_einfeldt)

# TODO: TrixiShallowWater: move the chen_noelle flux structure to the new package

# An empty version of the `min_max_speed_chen_noelle` function is declared here
Expand Down
2 changes: 1 addition & 1 deletion test/test_p4est_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ end
1.313896142714079,
6.293305112638921,
],
surface_flux=FluxHLL(min_max_speed_einfeldt),
surface_flux=flux_hlle,
tspan=(0.0, 0.3))
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
Expand Down
2 changes: 1 addition & 1 deletion test/test_p4est_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ end
4.730877375538398,
],
tspan=(0.0, 0.3),
surface_flux=FluxHLL(min_max_speed_einfeldt))
surface_flux=flux_hlles)
ranocha marked this conversation as resolved.
Show resolved Hide resolved
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
2 changes: 1 addition & 1 deletion test/test_tree_1d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ end
l2=[0.6442208390304879, 0.508817280068289, 0.9482809853033687],
linf=[3.007059066482486, 2.4678899558345506, 2.3952311739389787],
tspan=(0.0, 0.5),
surface_flux=FluxHLL(min_max_speed_einfeldt))
surface_flux=flux_hlle)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
2 changes: 1 addition & 1 deletion test/test_tree_2d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ end
6.24263735888126,
],
tspan=(0.0, 0.5),
surface_flux=FluxHLL(min_max_speed_einfeldt))
surface_flux=flux_hlle)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
2 changes: 1 addition & 1 deletion test/test_tree_3d_euler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ end
1.7082524045150382,
],
tspan=(0.0, 0.01),
surface_flux=FluxHLL(min_max_speed_einfeldt))
surface_flux=flux_hlle)
# Ensure that we do not have excessive memory allocations
# (e.g., from type instabilities)
let
Expand Down
37 changes: 14 additions & 23 deletions test/test_unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -892,20 +892,17 @@ end
equations = CompressibleEulerEquations1D(1.4)
u = SVector(1.1, 2.34, 5.5)

# Test HLL flux with min_max_speed_einfeldt
flux_hll = FluxHLL(min_max_speed_einfeldt)

orientations = [1]
for orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

equations = CompressibleEulerEquations2D(1.4)
u = SVector(1.1, -0.5, 2.34, 5.5)

orientations = [1, 2]
for orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

normal_directions = [SVector(1.0, 0.0),
Expand All @@ -914,7 +911,7 @@ end
SVector(-1.2, 0.3)]

for normal_direction in normal_directions
@test flux_hll(u, u, normal_direction, equations) ≈
@test flux_hlle(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end

Expand All @@ -923,7 +920,7 @@ end

orientations = [1, 2, 3]
for orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

normal_directions = [SVector(1.0, 0.0, 0.0),
Expand All @@ -933,18 +930,15 @@ end
SVector(-1.2, 0.3, 1.4)]

for normal_direction in normal_directions
@test flux_hll(u, u, normal_direction, equations) ≈
@test flux_hlle(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end
end

@timed_testset "Consistency check for HLLE flux: SWE" begin
# Test HLL flux with min_max_speed_einfeldt
flux_hll = FluxHLL(min_max_speed_einfeldt)

equations = ShallowWaterEquations1D(gravity_constant = 9.81)
u = SVector(1, 0.5, 0.0)
@test flux_hll(u, u, 1, equations) ≈ flux(u, 1, equations)
@test flux_hlle(u, u, 1, equations) ≈ flux(u, 1, equations)

equations = ShallowWaterEquations2D(gravity_constant = 9.81)
normal_directions = [SVector(1.0, 0.0),
Expand All @@ -956,25 +950,22 @@ end
u = SVector(1, 0.5, 0.5, 0.0)

for orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

for normal_direction in normal_directions
@test flux_hll(u, u, normal_direction, equations) ≈
@test flux_hlle(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end
end

@timed_testset "Consistency check for HLLE flux: MHD" begin
# Test HLL flux with min_max_speed_einfeldt
flux_hll = FluxHLL(min_max_speed_naive)

equations = IdealGlmMhdEquations1D(1.4)
u_values = [SVector(1.0, 0.4, -0.5, 0.1, 1.0, 0.1, -0.2, 0.1),
SVector(1.5, -0.2, 0.1, 0.2, 5.0, -0.1, 0.1, 0.2)]

for u in u_values
@test flux_hll(u, u, 1, equations) ≈ flux(u, 1, equations)
@test flux_hlle(u, u, 1, equations) ≈ flux(u, 1, equations)
end

equations = IdealGlmMhdEquations2D(1.4, 5.0) #= c_h =#
Expand All @@ -988,11 +979,11 @@ end
SVector(1.5, -0.2, 0.1, 0.2, 5.0, -0.1, 0.1, 0.2, 0.2)]

for u in u_values, orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

for u in u_values, normal_direction in normal_directions
@test flux_hll(u, u, normal_direction, equations) ≈
@test flux_hlle(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end

Expand All @@ -1008,11 +999,11 @@ end
SVector(1.5, -0.2, 0.1, 0.2, 5.0, -0.1, 0.1, 0.2, 0.2)]

for u in u_values, orientation in orientations
@test flux_hll(u, u, orientation, equations) ≈ flux(u, orientation, equations)
@test flux_hlle(u, u, orientation, equations) ≈ flux(u, orientation, equations)
end

for u in u_values, normal_direction in normal_directions
@test flux_hll(u, u, normal_direction, equations) ≈
@test flux_hlle(u, u, normal_direction, equations) ≈
flux(u, normal_direction, equations)
end
end
Expand Down Expand Up @@ -1245,7 +1236,7 @@ end
u = SVector(1, 0.5, 0.5, 0.0)

fluxes = [flux_central, flux_fjordholm_etal, flux_wintermeyer_etal,
flux_hll, FluxHLL(min_max_speed_davis), FluxHLL(min_max_speed_einfeldt)]
flux_hll, FluxHLL(min_max_speed_davis), flux_hlle]
end

@timed_testset "IdealGlmMhdEquations2D" begin
Expand Down
Loading