Skip to content

Commit a4fd129

Browse files
Merge branch 'main' into tm/autodiff_metrics
2 parents 8121b38 + c89ab29 commit a4fd129

9 files changed

+17
-17
lines changed

.github/workflows/SpellCheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
- name: Checkout Actions Repository
1111
uses: actions/checkout@v4
1212
- name: Check spelling
13-
uses: crate-ci/typos@v1.30.0
13+
uses: crate-ci/typos@v1.31.1

examples/elixir_shallowwater_cubed_sphere_shell_EC_correction.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using TrixiAtmo
66
# Entropy conservation for the spherical shallow water equations in Cartesian
77
# form obtained through an entropy correction term
88

9-
equations = ShallowWaterEquations3D(gravity_constant = 9.81)
9+
equations = ShallowWaterEquations3D(gravity = 9.81)
1010

1111
# Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as surface flux
1212
polydeg = 3

examples/elixir_shallowwater_cubed_sphere_shell_EC_projection.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using TrixiAtmo
88
# form obtained through the projection of the momentum onto the divergence-free
99
# tangential contravariant vectors
1010

11-
equations = ShallowWaterEquations3D(gravity_constant = 9.81)
11+
equations = ShallowWaterEquations3D(gravity = 9.81)
1212

1313
# Create DG solver with polynomial degree = 3 and Wintemeyer et al.'s flux as surface flux
1414
polydeg = 3

examples/elixir_shallowwater_cubed_sphere_shell_advection.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cells_per_dimension = (5, 5)
2121

2222
# We use the ShallowWaterEquations3D equations structure but modify the rhs! function to
2323
# convert it to a variable-coefficient advection equation
24-
equations = ShallowWaterEquations3D(gravity_constant = 0.0)
24+
equations = ShallowWaterEquations3D(gravity = 0.0)
2525

2626
# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
2727
solver = DGSEM(polydeg = 3, surface_flux = flux_lax_friedrichs)

examples/elixir_shallowwater_cubed_sphere_shell_standard.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using TrixiAtmo
66
# Entropy consistency test for the spherical shallow water equations in Cartesian
77
# form using the standard DGSEM with LLF dissipation
88

9-
equations = ShallowWaterEquations3D(gravity_constant = 9.81)
9+
equations = ShallowWaterEquations3D(gravity = 9.81)
1010

1111
# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs as surface flux
1212
polydeg = 3

examples/elixir_shallowwater_quad_icosahedron_shell_advection.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cells_per_dimension = (2, 2)
2121

2222
# We use the ShallowWaterEquations3D equations structure but modify the rhs! function to
2323
# convert it to a variable-coefficient advection equation
24-
equations = ShallowWaterEquations3D(gravity_constant = 0.0)
24+
equations = ShallowWaterEquations3D(gravity = 0.0)
2525

2626
# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
2727
solver = DGSEM(polydeg = polydeg, surface_flux = flux_lax_friedrichs)

src/TrixiAtmo.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export flux_chandrashekar, FluxLMARS
4242
export flux_nonconservative_zeros, flux_nonconservative_ec,
4343
source_terms_geometric_coriolis
4444

45-
export velocity, waterheight, pressure, energy_total, energy_kinetic, energy_internal,
45+
export velocity, pressure, energy_total, energy_kinetic, energy_internal,
4646
lake_at_rest_error, source_terms_lagrange_multiplier,
4747
clean_solution_lagrange_multiplier!
4848

src/equations/covariant_shallow_water.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on a two-dimensional surface in three-dimensional ambient space as
1616
\end{aligned}
1717
```
1818
where $h$ is the fluid height, $v^a$ and $G^{ab}$ are the contravariant velocity and metric
19-
tensor components, $g$ is the gravitational constant, $f$ is the Coriolis parameter,
19+
tensor components, $g$ is the gravitational acceleration, $f$ is the Coriolis parameter,
2020
$J$ is the area element, and $\partial_a$ is used as a shorthand for
2121
$\partial / \partial \xi^a$. Combining the advective and pressure terms in order to define
2222
the momentum flux components
@@ -92,7 +92,7 @@ function Trixi.varnames(::typeof(contravariant2global),
9292
end
9393

9494
# Convenience functions to extract physical variables from state vector
95-
@inline waterheight(u, ::AbstractCovariantShallowWaterEquations2D) = u[1]
95+
@inline Trixi.waterheight(u, ::AbstractCovariantShallowWaterEquations2D) = u[1]
9696
@inline velocity_contravariant(u,
9797
::AbstractCovariantShallowWaterEquations2D) = SVector(u[2] /
9898
u[1],

src/equations/shallow_water_3d.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The equations are given by
1919
\end{aligned}
2020
```
2121
The unknown quantities of the SWE are the water height ``h`` and the velocities ``\mathbf{v} = (v_1, v_2, v_3)^T``.
22-
The gravitational constant is denoted by `g`.
22+
The gravitational acceleration is denoted by `g`.
2323
2424
The 3D Shallow Water Equations (SWE) extend the 2D SWE to model shallow water flows on 2D manifolds embedded within 3D space.
2525
To confine the flow to the 2D manifold, a source term incorporating a Lagrange multiplier is applied.
@@ -48,17 +48,17 @@ References:
4848
"""
4949
struct ShallowWaterEquations3D{RealT <: Real} <:
5050
Trixi.AbstractShallowWaterEquations{3, 5}
51-
gravity::RealT # gravitational constant
51+
gravity::RealT # gravitational acceleration
5252
H0::RealT # constant "lake-at-rest" total water height
5353
end
5454

55-
# Allow for flexibility to set the gravitational constant within an elixir depending on the
56-
# application where `gravity_constant=1.0` or `gravity_constant=9.81` are common values.
55+
# Allow for flexibility to set the gravitational acceleration within an elixir depending on the
56+
# application where `gravity=1.0` or `gravity=9.81` are common values.
5757
# The reference total water height H0 defaults to 0.0 but is used for the "lake-at-rest"
5858
# well-balancedness test cases.
59-
function ShallowWaterEquations3D(; gravity_constant, H0 = zero(gravity_constant))
60-
T = promote_type(typeof(gravity_constant), typeof(H0))
61-
ShallowWaterEquations3D(gravity_constant, H0)
59+
function ShallowWaterEquations3D(; gravity, H0 = zero(gravity))
60+
T = promote_type(typeof(gravity), typeof(H0))
61+
ShallowWaterEquations3D(gravity, H0)
6262
end
6363

6464
Trixi.have_nonconservative_terms(::ShallowWaterEquations3D) = False() # Deactivate non-conservative terms for the moment...
@@ -346,7 +346,7 @@ end
346346
return SVector(h, h_v1, h_v2, h_v3, b)
347347
end
348348

349-
@inline function waterheight(u, equations::ShallowWaterEquations3D)
349+
@inline function Trixi.waterheight(u, equations::ShallowWaterEquations3D)
350350
return u[1]
351351
end
352352

0 commit comments

Comments
 (0)