Skip to content

Commit

Permalink
address comment changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickersing committed Apr 18, 2024
1 parent 0e2f101 commit 2eec19d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/equations/shallow_water_multilayer_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ end
end

Trixi.have_nonconservative_terms(::ShallowWaterMultiLayerEquations1D) = True()

function Trixi.varnames(::typeof(cons2cons),
equations::ShallowWaterMultiLayerEquations1D)
waterheight = ntuple(n -> "h" * string(n), Val(nlayers(equations)))
Expand Down
7 changes: 4 additions & 3 deletions src/equations/shallow_water_multilayer_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ end
end

Trixi.have_nonconservative_terms(::ShallowWaterMultiLayerEquations2D) = True()

function Trixi.varnames(::typeof(cons2cons),
equations::ShallowWaterMultiLayerEquations2D)
waterheight = ntuple(n -> "h" * string(n), Val(nlayers(equations)))
Expand All @@ -123,7 +124,7 @@ function Trixi.varnames(::typeof(cons2prim),
return (total_layer_height..., velocity_1..., velocity_2..., "b")
end

# # Set initial conditions at physical location `x` for time `t`
# Set initial conditions at physical location `x` for time `t`
"""
initial_condition_convergence_test(x, t, equations::ShallowWaterMultiLayerEquations2D)
Expand Down Expand Up @@ -324,7 +325,7 @@ Should be used together with [`TreeMesh`](@ref).
return flux
end

# Calculate 1D advective portion of the flux for a single point
# Calculate 2D advective portion of the flux for a single point
# Note, the bottom topography has no flux
@inline function Trixi.flux(u, orientation::Integer,
equations::ShallowWaterMultiLayerEquations2D)
Expand Down Expand Up @@ -357,7 +358,7 @@ end
return SVector(f)
end

# Calculate 1D flux for a single point in the normal direction
# Calculate 2D flux for a single point in the normal direction
# Note, this directional vector is not normalized and the bottom topography has no flux
@inline function Trixi.flux(u, normal_direction::AbstractVector,
equations::ShallowWaterMultiLayerEquations2D)
Expand Down
1 change: 1 addition & 0 deletions src/equations/shallow_water_two_layer_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function ShallowWaterTwoLayerEquations1D(; gravity_constant,
end

Trixi.have_nonconservative_terms(::ShallowWaterTwoLayerEquations1D) = True()

function Trixi.varnames(::typeof(cons2cons), ::ShallowWaterTwoLayerEquations1D)
("h_upper", "h_v_upper",
"h_lower", "h_v_lower", "b")
Expand Down
1 change: 1 addition & 0 deletions src/equations/shallow_water_two_layer_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function ShallowWaterTwoLayerEquations2D(; gravity_constant,
end

Trixi.have_nonconservative_terms(::ShallowWaterTwoLayerEquations2D) = True()

function Trixi.varnames(::typeof(cons2cons), ::ShallowWaterTwoLayerEquations2D)
("h_upper", "h_v1_upper", "h_v2_upper", "h_lower", "h_v1_lower", "h_v2_lower", "b")
end
Expand Down
1 change: 1 addition & 0 deletions src/equations/shallow_water_wet_dry_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function ShallowWaterEquationsWetDry1D(; gravity_constant, H0 = zero(gravity_con
end

Trixi.have_nonconservative_terms(::ShallowWaterEquationsWetDry1D) = True()

function Trixi.varnames(::typeof(cons2cons), ::ShallowWaterEquationsWetDry1D)
("h", "h_v", "b")
end
Expand Down
1 change: 1 addition & 0 deletions src/equations/shallow_water_wet_dry_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function ShallowWaterEquationsWetDry2D(; gravity_constant, H0 = zero(gravity_con
end

Trixi.have_nonconservative_terms(::ShallowWaterEquationsWetDry2D) = True()

Trixi.varnames(::typeof(cons2cons), ::ShallowWaterEquationsWetDry2D) = ("h", "h_v1",
"h_v2", "b")
# Note, we use the total water height, H = h + b, as the first primitive variable for easier
Expand Down

0 comments on commit 2eec19d

Please sign in to comment.