Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions examples/elixir_euler_energy_baroclinic_instability.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# An idealized baroclinic instability test case
# For optimal results consider increasing the resolution to 16x16x8 trees per cube face, i.e.,
# set `trees_per_cube_face = (16, 8)` below.
#
#
# This elixir takes about 8 hours, using 16 threads of an AMD Ryzen 7 7800X3D.
#
# References:
Expand Down Expand Up @@ -205,7 +205,7 @@ boundary_conditions = Dict(:inside => boundary_condition_slip_wall,

polydeg = 5
surface_flux = (FluxLMARS(340), flux_zero)
volume_flux = (flux_ranocha, flux_nonconservative_waruzewski_etal)
volume_flux = (flux_ranocha, flux_nonconservative_waruszewski_etal)

solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
Expand Down
6 changes: 3 additions & 3 deletions examples/elixir_euler_energy_inertia_gravity_waves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using Trixi, TrixiAtmo

Test cases for linearized analytical solution by
- Baldauf, Michael and Brdar, Slavko (2013)
An analytic solution for linear gravity waves in a channel as a test
An analytic solution for linear gravity waves in a channel as a test
for numerical models using the non-hydrostatic, compressible {E}uler equations
[DOI: 10.1002/qj.2105] (https://doi.org/10.1002/qj.2105)
"""
Expand Down Expand Up @@ -62,12 +62,12 @@ equations = CompressibleEulerEnergyEquationsWithGravity2D(c_p = 1004,
c_v = 717,
gravity = 9.81)

# We have an isothermal background state with T0 = 250 K.
# We have an isothermal background state with T0 = 250 K.
# The reference speed of sound can be computed as:
# cs = sqrt(gamma * R * T0)
cs = sqrt(equations.gamma * equations.R * 250)
surface_flux = (FluxLMARS(cs), flux_zero)
volume_flux = (flux_ranocha, flux_nonconservative_waruzewski_etal)
volume_flux = (flux_ranocha, flux_nonconservative_waruszewski_etal)
polydeg = 3
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Trixi, TrixiAtmo

Test cases for linearized analytical solution by
- Baldauf, Michael and Brdar, Slavko (2013)
An analytic solution for linear gravity waves in a channel as a test
An analytic solution for linear gravity waves in a channel as a test
for numerical models using the non-hydrostatic, compressible {E}uler equations
[DOI: 10.1002/qj.2105] (https://doi.org/10.1002/qj.2105)
"""
Expand Down Expand Up @@ -40,12 +40,12 @@ equations = CompressibleEulerPotentialTemperatureEquationsWithGravity2D(c_p = 10
c_v = 717,
gravity = 9.81)

# We have an isothermal background state with T0 = 250 K.
# We have an isothermal background state with T0 = 250 K.
# The reference speed of sound can be computed as:
# cs = sqrt(gamma * R * T0)
cs = sqrt(equations.gamma * equations.R * 250)
surface_flux = (FluxLMARS(cs), flux_zero)
volume_flux = (flux_tec, flux_nonconservative_waruzewski_etal)
volume_flux = (flux_tec, flux_nonconservative_waruszewski_etal)
polydeg = 3
solver = DGSEM(polydeg = polydeg, surface_flux = surface_flux,
volume_integral = VolumeIntegralFluxDifferencing(volume_flux))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ boundary_conditions = Dict(:x_neg => boundary,
:y_neg => boundary_condition_slip_wall,
:y_pos => boundary)

# We have an isothermal background state with T0 = 250 K.
# We have an isothermal background state with T0 = 250 K.
# The reference speed of sound can be computed as:
# cs = sqrt(gamma * R * T0)
cs = sqrt(equations.gamma * equations.R * linear_hydrostatic_setup.T_0)
polydeg = 3
basis = LobattoLegendreBasis(polydeg)

surface_flux = (FluxLMARS(cs), flux_zero)
volume_flux = (flux_tec, flux_nonconservative_waruzewski_etal)
volume_flux = (flux_tec, flux_nonconservative_waruszewski_etal)
volume_integral = VolumeIntegralFluxDifferencing(volume_flux)

solver = DGSEM(basis, surface_flux, volume_integral)
Expand Down
2 changes: 1 addition & 1 deletion src/TrixiAtmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export flux_nonconservative_zeros, flux_nonconservative_ec,
source_terms_coriolis, source_terms_coriolis_lagrange_multiplier,
flux_tec, flux_etec, flux_nonconservative_souza_etal,
flux_nonconservative_artiano_etal,
flux_nonconservative_waruzewski_etal, flux_zero
flux_nonconservative_waruszewski_etal, flux_zero

export source_terms_lagrange_multiplier, clean_solution_lagrange_multiplier!

Expand Down
22 changes: 11 additions & 11 deletions src/equations/compressible_euler_energy_with_gravity_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct CompressibleEulerEnergyEquationsWithGravity2D{RealT <: Real} <:
c_v::RealT # specific heat at constant volume in J/(kg K)
g::RealT # gravitational acceleration in m/s²
R::RealT # gas constant in J/(kg K)
gamma::RealT # ratio of specific heats
gamma::RealT # ratio of specific heats
inv_gamma_minus_one::RealT # = inv(gamma - 1); can be used to write slow divisions as fast multiplications
function CompressibleEulerEnergyEquationsWithGravity2D(; c_p, c_v,
gravity)
Expand Down Expand Up @@ -166,26 +166,26 @@ end
end

"""
flux_nonconservative_waruzewski_etal(u_ll, u_rr, normal_direction::AbstractVector, equations::CompressibleEulerEnergyEquationsWithGravity2D)
flux_nonconservative_waruszewski_etal(u_ll, u_rr, normal_direction::AbstractVector, equations::CompressibleEulerEnergyEquationsWithGravity2D)

Well-balanced gravity term for an isothermal background state
for the [`CompressibleEulerEnergyEquationsWithGravity2D`](@ref)
developed by

- Maciej Waruszewski and Jeremy E. Kozdon and Lucas C. Wilcox and Thomas H. Gibson and Francis X. Giraldo (2022)
Entropy stable discontinuous {G}alerkin methods for balance laws
Entropy stable discontinuous {G}alerkin methods for balance laws
in non-conservative form: Applications to the {E}uler equations with gravity
[DOI: 10.1016/j.jcp.2022.111507](https://doi.org/10.1016/j.jcp.2022.111507)

The well-balancedness on curvilinear coordinates was proven by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
@inline function flux_nonconservative_waruzewski_etal(u_ll, u_rr,
normal_direction::AbstractVector,
equations::CompressibleEulerEnergyEquationsWithGravity2D)
@inline function flux_nonconservative_waruszewski_etal(u_ll, u_rr,
normal_direction::AbstractVector,
equations::CompressibleEulerEnergyEquationsWithGravity2D)
rho_ll, rho_v1_ll, rho_v2_ll, _, phi_ll = u_ll
rho_rr, rho_v1_rr, rho_v2_rr, _, phi_rr = u_rr
v1_ll = rho_v1_ll / rho_ll
Expand All @@ -212,7 +212,7 @@ for the [`CompressibleEulerEnergyEquationsWithGravity2D`](@ref)
developed by

- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand Down Expand Up @@ -240,12 +240,12 @@ end
"""
flux_nonconservative_souza_etal(u_ll, u_rr, normal_direction::AbstractVector, equations::CompressibleEulerEnergyEquationsWithGravity2D)

Kinetic and potential energy preserving (KPEP) gravity term
Kinetic and potential energy preserving (KPEP) gravity term
for the [`CompressibleEulerEnergyEquationsWithGravity2D`](@ref)
developed by

- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
an Idealized Fully Compressible Nonhydrostatic Dry Atmosphere
[DOI: 10.1029/2022MS003527] (https://doi.org/10.1029/2022MS003527)
"""
Expand Down
20 changes: 10 additions & 10 deletions src/equations/compressible_euler_energy_with_gravity_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct CompressibleEulerEnergyEquationsWithGravity3D{RealT <: Real} <:
c_v::RealT # specific heat at constant volume in J/(kg K)
g::RealT # gravitational acceleration in m/s²
R::RealT # gas constant in J/(kg K)
gamma::RealT # ratio of specific heats
gamma::RealT # ratio of specific heats
inv_gamma_minus_one::RealT # = inv(gamma - 1); can be used to write slow divisions as fast multiplications
function CompressibleEulerEnergyEquationsWithGravity3D(; c_p, c_v,
gravity)
Expand Down Expand Up @@ -116,25 +116,25 @@ end
end

"""
flux_nonconservative_waruzewski_etal(u_ll, u_rr,
flux_nonconservative_waruszewski_etal(u_ll, u_rr,
normal_direction::AbstractVector,
equations::CompressibleEulerEulerEquationsWithGravity3D)

Well-balanced gravity term for isothermal background state
- Maciej Waruszewski and Jeremy E. Kozdon and Lucas C. Wilcox and Thomas H. Gibson and Francis X. Giraldo (2022),
Entropy stable discontinuous {G}alerkin methods for balance laws
Entropy stable discontinuous {G}alerkin methods for balance laws
in non-conservative form: Applications to the {E}uler equations with gravity
[DOI: 10.1016/j.jcp.2022.111507](https://doi.org/10.1016/j.jcp.2022.111507)

The well balanced on curvilinear coordinates was proven by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
@inline function flux_nonconservative_waruzewski_etal(u_ll, u_rr,
normal_direction::AbstractVector,
equations::CompressibleEulerEnergyEquationsWithGravity3D)
@inline function flux_nonconservative_waruszewski_etal(u_ll, u_rr,
normal_direction::AbstractVector,
equations::CompressibleEulerEnergyEquationsWithGravity3D)
rho_ll, rho_v1_ll, rho_v2_ll, rho_v3_ll, _, phi_ll = u_ll
rho_rr, rho_v1_rr, rho_v2_rr, rho_v3_rr, _, phi_rr = u_rr
v1_ll = rho_v1_ll
Expand Down Expand Up @@ -165,7 +165,7 @@ end

Well-balanced gravity term for constant potential temperature background state by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand Down Expand Up @@ -198,8 +198,8 @@ end
"""
flux_nonconservative_souza_etal(u_ll, u_rr, normal_direction::AbstractVector, equations::CompressibleEulerEnergyEquationsWithGravity3D)

- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
an Idealized Fully Compressible Nonhydrostatic Dry Atmosphere
[DOI: 10.1029/2022MS003527] (https://doi.org/10.1029/2022MS003527)
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct CompressibleEulerPotentialTemperatureEquationsWithGravity1D{RealT <: Real
c_v::RealT # specific heat at constant volume in J/(kg K)
g::RealT # gravitational acceleration in m/s²
R::RealT # gas constant in J/(kg K)
gamma::RealT # ratio of specific heats
gamma::RealT # ratio of specific heats
inv_gamma_minus_one::RealT # = inv(gamma - 1); can be used to write slow divisions as fast multiplications
K::RealT # = p_0 * (R / p_0)^gamma; scaling factor between pressure and weighted potential temperature
stolarsky_factor::RealT # = (gamma - 1) / gamma; used in the stolarsky mean
Expand Down Expand Up @@ -75,23 +75,23 @@ end
end

"""
flux_nonconservative_waruzewski_etal(u_ll, u_rr, orientation::Integer, equations::CompressibleEulerPotentialTemperatureEquationsWithGravity1D)
flux_nonconservative_waruszewski_etal(u_ll, u_rr, orientation::Integer, equations::CompressibleEulerPotentialTemperatureEquationsWithGravity1D)

Well-balanced gravity term for isothermal background state
- Maciej Waruszewski and Jeremy E. Kozdon and Lucas C. Wilcox and Thomas H. Gibson and Francis X. Giraldo (2022),
Entropy stable discontinuous {G}alerkin methods for balance laws
Entropy stable discontinuous {G}alerkin methods for balance laws
in non-conservative form: Applications to the {E}uler equations with gravity
[DOI: 10.1016/j.jcp.2022.111507](https://doi.org/10.1016/j.jcp.2022.111507)

The well balanced on curvilinear coordinates was proven by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
@inline function flux_nonconservative_waruzewski_etal(u_ll, u_rr,
orientation::Integer,
equations::CompressibleEulerPotentialTemperatureEquationsWithGravity1D)
@inline function flux_nonconservative_waruszewski_etal(u_ll, u_rr,
orientation::Integer,
equations::CompressibleEulerPotentialTemperatureEquationsWithGravity1D)
rho_ll, _, _, phi_ll = u_ll
rho_rr, _, _, phi_rr = u_rr
rho_avg = ln_mean(rho_ll, rho_rr)
Expand All @@ -107,7 +107,7 @@ end

Well-balanced gravity term for constant potential temperature background state by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand All @@ -127,8 +127,8 @@ end
"""
flux_nonconservative_souza_etal(u_ll, u_rr, orientation::Integer, equations::CompressibleEulerPotentialTemperatureEquationsWithGravity1D)

- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
- Souza et al.
The Flux-Differencing Discontinuous {G}alerkin Method Applied to
an Idealized Fully Compressible Nonhydrostatic Dry Atmosphere
[DOI: 10.1029/2022MS003527] (https://doi.org/10.1029/2022MS003527)
"""
Expand Down Expand Up @@ -172,7 +172,7 @@ end

Total energy conservative two-point flux by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand Down Expand Up @@ -202,7 +202,7 @@ end

Entropy conservative two-point flux by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand Down Expand Up @@ -231,7 +231,7 @@ end

Entropy and total energy conservative two-point flux by
- Marco Artiano, Oswald Knoth, Peter Spichtinger, Hendrik Ranocha (2025)
Structure-Preserving High-Order Methods for the Compressible Euler Equations
Structure-Preserving High-Order Methods for the Compressible Euler Equations
in Potential Temperature Formulation for Atmospheric Flows
(https://arxiv.org/abs/2509.10311)
"""
Expand Down
Loading
Loading