Skip to content

Commit

Permalink
fix convergence tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickersing committed Aug 12, 2024
1 parent d975b8d commit 9973b06
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@ using TrixiShallowWater
###############################################################################
# Semidiscretization of the SWE-Exner equations with source terms for convergence testing

# Equations with MeyerPeterMueller model
equations_mpm = ShallowWaterExnerEquations1D(gravity_constant = 10.0, rho_f = 0.5,
rho_s = 1.0, porosity = 0.5,
friction = ManningFriction(n = 0.01),
sediment_model = MeyerPeterMueller(theta_c = 0.0,
d_s = 1e-3))

# Equations with Grass model
equations_grass = ShallowWaterExnerEquations1D(gravity_constant = 10.0, rho_f = 0.5,
rho_s = 1.0, porosity = 0.5,
friction = ManningFriction(n = 0.0),
sediment_model = GrassModel(A_g = 0.01))

equations = equations_grass
equations = ShallowWaterExnerEquations1D(gravity_constant = 10.0, rho_f = 0.5,
rho_s = 1.0, porosity = 0.5,
friction = ManningFriction(n = 0.0),
sediment_model = GrassModel(A_g = 0.01))

# Smooth initial condition to test convergence
@inline function Trixi.initial_condition_convergence_test(x, t,

Check warning on line 15 in examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl

View check run for this annotation

Codecov / codecov/patch

examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl#L15

Added line #L15 was not covered by tests
Expand All @@ -32,12 +23,15 @@ equations = equations_grass
return SVector(h, h * v, h_b)

Check warning on line 23 in examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl

View check run for this annotation

Codecov / codecov/patch

examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl#L23

Added line #L23 was not covered by tests
end

"""
source_terms_convergence_test(u, x, t, equations::ShallowWaterExnerEquations1D{T, S, ShieldsStressModel{T}}) where {T, S})
Source terms used for convergence tests in combination with [`Trixi.initial_condition_convergence_test`](@extref)
when using the [`MeyerPeterMueller`](@ref) model.
"""
# Source terms used for convergence tests in combination with [`Trixi.initial_condition_convergence_test`](@extref)
# when using the [`MeyerPeterMueller`](@ref) model.
# To use this source term the equations must be set to:
#
# equations = ShallowWaterExnerEquations1D(gravity_constant = 10.0, rho_f = 0.5,
# rho_s = 1.0, porosity = 0.5,
# friction = ManningFriction(n = 0.01),
# sediment_model = MeyerPeterMueller(theta_c = 0.0,
# d_s = 1e-3))
@inline function Trixi.source_terms_convergence_test(u, x, t,

Check warning on line 35 in examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl

View check run for this annotation

Codecov / codecov/patch

examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl#L35

Added line #L35 was not covered by tests
equations::ShallowWaterExnerEquations1D{T,
S,
Expand Down Expand Up @@ -70,12 +64,14 @@ when using the [`MeyerPeterMueller`](@ref) model.
return SVector(h, hv, h_b)

Check warning on line 64 in examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl

View check run for this annotation

Codecov / codecov/patch

examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl#L64

Added line #L64 was not covered by tests
end

"""
source_terms_convergence_test(u, x, t, equations::ShallowWaterExnerEquations1D{T, S, GrassModel{T}}) where {T, S})
Source terms used for convergence tests in combination with [`initial_condition_convergence_test`](@extref)
when using the the [`GrassModel`](@ref) model.
"""
# Source terms used for convergence tests in combination with [`initial_condition_convergence_test`](@extref)
# when using the the [`GrassModel`](@ref) model.
# To use this source term the equations must be set to:
#
# equations = ShallowWaterExnerEquations1D(gravity_constant = 10.0, rho_f = 0.5,
# rho_s = 1.0, porosity = 0.5,
# friction = ManningFriction(n = 0.0),
# sediment_model = GrassModel(A_g = 0.01)
@inline function Trixi.source_terms_convergence_test(u, x, t,

Check warning on line 75 in examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl

View check run for this annotation

Codecov / codecov/patch

examples/tree_1d_dgsem/elixir_shallowwater_exner_source_terms.jl#L75

Added line #L75 was not covered by tests
equations::ShallowWaterExnerEquations1D{T,
S,
Expand Down

0 comments on commit 9973b06

Please sign in to comment.