Skip to content

Commit

Permalink
Merge branch 'main' into update_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwinters5000 authored Jan 24, 2024
2 parents 1dbfce2 + cd51eff commit acef4a5
Showing 1 changed file with 25 additions and 76 deletions.
101 changes: 25 additions & 76 deletions src/equations/shallow_water_wet_dry_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ A smooth initial condition used for convergence tests in combination with
function Trixi.initial_condition_convergence_test(x, t,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.initial_condition_convergence_test(x, t,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -133,10 +130,7 @@ as defined in [`initial_condition_convergence_test`](@ref).
@inline function Trixi.source_terms_convergence_test(u, x, t,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.source_terms_convergence_test(u, x, t,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -148,10 +142,7 @@ Note for the shallow water equations to the total energy acts as a mathematical
function Trixi.initial_condition_weak_blast_wave(x, t,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.initial_condition_weak_blast_wave(x, t,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -176,19 +167,15 @@ For details see Section 9.2.5 of the book:
return Trixi.boundary_condition_slip_wall(u_inner, orientation_or_normal, direction,
x, t,
surface_flux_function,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Calculate 1D flux for a single point
# Note, the bottom topography has no flux
@inline function Trixi.flux(u, orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux(u, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity, equations.H0,
eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -208,10 +195,7 @@ Further details are available in the paper:#include("numerical_fluxes.jl")
orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_nonconservative_wintermeyer_etal(u_ll, u_rr, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand Down Expand Up @@ -241,10 +225,7 @@ and for curvilinear 2D case in the paper:
orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_nonconservative_fjordholm_etal(u_ll, u_rr, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -270,10 +251,7 @@ Further details on the hydrostatic reconstruction and its motivation can be foun
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_nonconservative_audusse_etal(u_ll, u_rr,
orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# TODO: This function is currently exported by Trixi.jl. Needs to be uncommented when removed from Trixi.jl
Expand Down Expand Up @@ -345,10 +323,7 @@ For further details see:
orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_nonconservative_ersing_etal(u_ll, u_rr, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -367,9 +342,7 @@ Details are available in Eq. (4.1) in the paper:
@inline function Trixi.flux_fjordholm_etal(u_ll, u_rr, orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_fjordholm_etal(u_ll, u_rr, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -389,9 +362,7 @@ Further details are available in Theorem 1 of the paper:
@inline function Trixi.flux_wintermeyer_etal(u_ll, u_rr, orientation::Integer,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.flux_wintermeyer_etal(u_ll, u_rr, orientation,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

"""
Expand All @@ -411,10 +382,7 @@ Further details on this hydrostatic reconstruction and its motivation can be fou
@inline function Trixi.hydrostatic_reconstruction_audusse_etal(u_ll, u_rr,
equations::ShallowWaterEquationsWetDry1D)
return Trixi.hydrostatic_reconstruction_audusse_etal(u_ll, u_rr,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# TODO: This function is currently exported by Trixi.jl. Needs to be uncommented when removed from Trixi.jl
Expand Down Expand Up @@ -484,19 +452,14 @@ end
equations::ShallowWaterEquationsWetDry1D)
return (dissipation::Trixi.DissipationLocalLaxFriedrichs)(u_ll, u_rr,
orientation_or_normal_direction,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0,
eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Specialized `FluxHLL` to avoid spurious dissipation in the bottom topography
@inline function (numflux::Trixi.FluxHLL)(u_ll, u_rr, orientation_or_normal_direction,
equations::ShallowWaterEquationsWetDry1D)
return (numflux::Trixi.FluxHLL)(u_ll, u_rr, orientation_or_normal_direction,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# TODO: This function is currently exported by Trixi.jl. Needs to be uncommented when removed from Trixi.jl
Expand Down Expand Up @@ -534,65 +497,54 @@ end

@inline function Trixi.max_abs_speeds(u, equations::ShallowWaterEquationsWetDry1D)
return Trixi.max_abs_speeds(u,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# # Helper function to extract the velocity vector from the conservative variables
# @inline function Trixi.velocity(u, equations::ShallowWaterEquationsWetDry1D)
# return Trixi.velocity(u,
# Trixi.ShallowWaterEquations1D(equations.gravity, equations.H0,
# eps(), eps()))
# Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
# end

# Convert conservative variables to primitive
@inline function Trixi.cons2prim(u, equations::ShallowWaterEquationsWetDry1D)
return Trixi.cons2prim(u,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Convert conservative variables to entropy
# Note, only the first two are the entropy variables, the third entry still
# just carries the bottom topography values for convenience
@inline function Trixi.cons2entropy(u, equations::ShallowWaterEquationsWetDry1D)
return Trixi.cons2entropy(u,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Convert entropy variables to conservative
@inline function Trixi.entropy2cons(w, equations::ShallowWaterEquationsWetDry1D)
return Trixi.entropy2cons(w,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Convert primitive to conservative variables
@inline function Trixi.prim2cons(prim, equations::ShallowWaterEquationsWetDry1D)
return Trixi.prim2cons(prim,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# @inline function Trixi.waterheight(u, equations::ShallowWaterEquationsWetDry1D)
# return Trixi.waterheight(u,
# Trixi.ShallowWaterEquations1D(equations.gravity,
# equations.H0, eps(), eps()))
# Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
# end

# @inline function Trixi.pressure(u, equations::ShallowWaterEquationsWetDry1D)
# return Trixi.pressure(u,
# Trixi.ShallowWaterEquations1D(equations.gravity, equations.H0,
# eps(), eps()))
# Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
# end

# @inline function Trixi.waterheight_pressure(u, equations::ShallowWaterEquationsWetDry1D)
# return Trixi.waterheight_pressure(u,
# Trixi.ShallowWaterEquations1D(equations.gravity,
# equations.H0, eps(),
# eps()))
# Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
# end

# Entropy function for the shallow water equations is the total energy
Expand All @@ -603,16 +555,13 @@ end
# Calculate total energy for a conservative state `cons`
@inline function Trixi.energy_total(cons, equations::ShallowWaterEquationsWetDry1D)
return Trixi.energy_total(cons,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(), eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Calculate kinetic energy for a conservative state `cons`
@inline function Trixi.energy_kinetic(u, equations::ShallowWaterEquationsWetDry1D)
return Trixi.energy_kinetic(u,
Trixi.ShallowWaterEquations1D(equations.gravity,
equations.H0, eps(),
eps()))
Trixi.ShallowWaterEquations1D(gravity_constant = equations.gravity))
end

# Calculate potential energy for a conservative state `cons`
Expand Down

0 comments on commit acef4a5

Please sign in to comment.