From 5f2a24d75a197ac827b69a22bdc48c0714520616 Mon Sep 17 00:00:00 2001 From: patrickersing Date: Fri, 11 Apr 2025 09:28:10 +0200 Subject: [PATCH] rename gravity_constant to gravity --- ...hallowwater_cubed_sphere_shell_EC_correction.jl | 2 +- ...hallowwater_cubed_sphere_shell_EC_projection.jl | 2 +- ...ir_shallowwater_cubed_sphere_shell_advection.jl | 2 +- ...xir_shallowwater_cubed_sphere_shell_standard.jl | 2 +- ...hallowwater_quad_icosahedron_shell_advection.jl | 2 +- src/equations/covariant_shallow_water.jl | 2 +- src/equations/shallow_water_3d.jl | 14 +++++++------- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/elixir_shallowwater_cubed_sphere_shell_EC_correction.jl b/examples/elixir_shallowwater_cubed_sphere_shell_EC_correction.jl index 956c7ac8..5f454d9f 100644 --- a/examples/elixir_shallowwater_cubed_sphere_shell_EC_correction.jl +++ b/examples/elixir_shallowwater_cubed_sphere_shell_EC_correction.jl @@ -6,7 +6,7 @@ using TrixiAtmo # Entropy conservation for the spherical shallow water equations in Cartesian # form obtained through an entropy correction term -equations = ShallowWaterEquations3D(gravity_constant = 9.81) +equations = ShallowWaterEquations3D(gravity = 9.81) # Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as surface flux polydeg = 3 diff --git a/examples/elixir_shallowwater_cubed_sphere_shell_EC_projection.jl b/examples/elixir_shallowwater_cubed_sphere_shell_EC_projection.jl index eace0c85..8355e1eb 100644 --- a/examples/elixir_shallowwater_cubed_sphere_shell_EC_projection.jl +++ b/examples/elixir_shallowwater_cubed_sphere_shell_EC_projection.jl @@ -8,7 +8,7 @@ using TrixiAtmo # form obtained through the projection of the momentum onto the divergence-free # tangential contravariant vectors -equations = ShallowWaterEquations3D(gravity_constant = 9.81) +equations = ShallowWaterEquations3D(gravity = 9.81) # Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as surface flux polydeg = 3 diff --git a/examples/elixir_shallowwater_cubed_sphere_shell_advection.jl b/examples/elixir_shallowwater_cubed_sphere_shell_advection.jl index 727add3a..dd8fba0a 100644 --- a/examples/elixir_shallowwater_cubed_sphere_shell_advection.jl +++ b/examples/elixir_shallowwater_cubed_sphere_shell_advection.jl @@ -21,7 +21,7 @@ cells_per_dimension = (5, 5) # We use the ShallowWaterEquations3D equations structure but modify the rhs! function to # convert it to a variable-coefficient advection equation -equations = ShallowWaterEquations3D(gravity_constant = 0.0) +equations = ShallowWaterEquations3D(gravity = 0.0) # Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs) diff --git a/examples/elixir_shallowwater_cubed_sphere_shell_standard.jl b/examples/elixir_shallowwater_cubed_sphere_shell_standard.jl index ba1c3bfa..0f769dc1 100644 --- a/examples/elixir_shallowwater_cubed_sphere_shell_standard.jl +++ b/examples/elixir_shallowwater_cubed_sphere_shell_standard.jl @@ -6,7 +6,7 @@ using TrixiAtmo # Entropy consistency test for the spherical shallow water equations in Cartesian # form using the standard DGSEM with LLF dissipation -equations = ShallowWaterEquations3D(gravity_constant = 9.81) +equations = ShallowWaterEquations3D(gravity = 9.81) # Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs as surface flux polydeg = 3 diff --git a/examples/elixir_shallowwater_quad_icosahedron_shell_advection.jl b/examples/elixir_shallowwater_quad_icosahedron_shell_advection.jl index 1820d83d..374c187d 100644 --- a/examples/elixir_shallowwater_quad_icosahedron_shell_advection.jl +++ b/examples/elixir_shallowwater_quad_icosahedron_shell_advection.jl @@ -21,7 +21,7 @@ cells_per_dimension = (2, 2) # We use the ShallowWaterEquations3D equations structure but modify the rhs! function to # convert it to a variable-coefficient advection equation -equations = ShallowWaterEquations3D(gravity_constant = 0.0) +equations = ShallowWaterEquations3D(gravity = 0.0) # Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux solver = DGSEM(polydeg = polydeg, surface_flux = flux_lax_friedrichs) diff --git a/src/equations/covariant_shallow_water.jl b/src/equations/covariant_shallow_water.jl index 89bdd323..91d98454 100644 --- a/src/equations/covariant_shallow_water.jl +++ b/src/equations/covariant_shallow_water.jl @@ -16,7 +16,7 @@ on a two-dimensional surface in three-dimensional ambient space as \end{aligned} ``` where $h$ is the fluid height, $v^a$ and $G^{ab}$ are the contravariant velocity and metric -tensor components, $g$ is the gravitational constant, $f$ is the Coriolis parameter, +tensor components, $g$ is the gravitational acceleration, $f$ is the Coriolis parameter, $J$ is the area element, and $\partial_a$ is used as a shorthand for $\partial / \partial \xi^a$. Combining the advective and pressure terms in order to define the momentum flux components diff --git a/src/equations/shallow_water_3d.jl b/src/equations/shallow_water_3d.jl index 0e9ba96d..d78b1ef5 100644 --- a/src/equations/shallow_water_3d.jl +++ b/src/equations/shallow_water_3d.jl @@ -19,7 +19,7 @@ The equations are given by \end{aligned} ``` The unknown quantities of the SWE are the water height ``h`` and the velocities ``\mathbf{v} = (v_1, v_2, v_3)^T``. -The gravitational constant is denoted by `g`. +The gravitational acceleration is denoted by `g`. The 3D Shallow Water Equations (SWE) extend the 2D SWE to model shallow water flows on 2D manifolds embedded within 3D space. To confine the flow to the 2D manifold, a source term incorporating a Lagrange multiplier is applied. @@ -48,17 +48,17 @@ References: """ struct ShallowWaterEquations3D{RealT <: Real} <: Trixi.AbstractShallowWaterEquations{3, 5} - gravity::RealT # gravitational constant + gravity::RealT # gravitational acceleration H0::RealT # constant "lake-at-rest" total water height end -# Allow for flexibility to set the gravitational constant within an elixir depending on the -# application where `gravity_constant=1.0` or `gravity_constant=9.81` are common values. +# Allow for flexibility to set the gravitational acceleration within an elixir depending on the +# application where `gravity=1.0` or `gravity=9.81` are common values. # The reference total water height H0 defaults to 0.0 but is used for the "lake-at-rest" # well-balancedness test cases. -function ShallowWaterEquations3D(; gravity_constant, H0 = zero(gravity_constant)) - T = promote_type(typeof(gravity_constant), typeof(H0)) - ShallowWaterEquations3D(gravity_constant, H0) +function ShallowWaterEquations3D(; gravity, H0 = zero(gravity)) + T = promote_type(typeof(gravity), typeof(H0)) + ShallowWaterEquations3D(gravity, H0) end Trixi.have_nonconservative_terms(::ShallowWaterEquations3D) = False() # Deactivate non-conservative terms for the moment...