@@ -65,7 +65,7 @@ This problem is adapted from Case 1 of the test suite described in the following
6565
6666 # Convert primitive variables from Cartesian coordinates to the chosen global
6767 # coordinate system, which depends on the equation type
68- return cartesian2global (SVector (h, vx, vy, vz, 0.0f0 ), x, equations)
68+ return cartesian2global (SVector (h, vx, vy, vz, zero (RealT) ), x, equations)
6969end
7070
7171@doc raw """
@@ -104,7 +104,8 @@ test suite described in the following paper:
104104
105105 # Convert primitive variables from spherical coordinates to the chosen global
106106 # coordinate system, which depends on the equation type
107- return spherical2global (SVector (h, vlon, vlat, zero (RealT)), x, equations)
107+ return spherical2global (SVector (h, vlon, vlat, zero (RealT), zero (RealT)), x,
108+ equations)
108109end
109110
110111@doc raw """
@@ -126,12 +127,12 @@ $g = 9.80616 \ \mathrm{m}/\mathrm{s}^2$, $\Omega = 7.292 \times 10^{-5} \ \mathr
126127and $h_0 = 8000 \ \m athrm{m}$ and defining the functions
127128```math
128129\b egin{aligned}
129- A(\t heta) &: = \f rac{\o mega}{2}(2 \O mega+\o mega) \c os^2 \t heta +
130+ A(\t heta) &= \f rac{\o mega}{2}(2 \O mega+\o mega) \c os^2 \t heta +
130131\f rac{1}{4} K^2 \c os^{2 R} \t heta\B ig((R+1) \c os^2\t heta +\l eft(2 R^2-R-2\r ight) -
131132\b ig(2 R^2 / \c os^2 \t heta\b ig) \B ig), \\
132- B(\t heta) &: = \f rac{2(\O mega+\o mega) K}{(R+1)(R+2)} \c os ^R \t heta\b ig((R^2+2 R+2) -
133+ B(\t heta) &= \f rac{2(\O mega+\o mega) K}{(R+1)(R+2)} \c os ^R \t heta\b ig((R^2+2 R+2) -
133134(R+1)^2 \c os^2 \t heta\b ig), \\
134- C(\t heta) &: = \f rac{1}{4} K^2 \c os^{2 R} \t heta\b ig((R+1) \c os^2 \t heta-(R+2)\b ig),
135+ C(\t heta) &= \f rac{1}{4} K^2 \c os^{2 R} \t heta\b ig((R+1) \c os^2 \t heta-(R+2)\b ig),
135136\e nd{aligned}
136137```
137138the initial height field is given by
@@ -147,9 +148,8 @@ This problem corresponds to Case 6 of the test suite described in the following
147148"""
148149@inline function initial_condition_rossby_haurwitz (x, t, equations)
149150 RealT = eltype (x)
150- a = sqrt (x[1 ]^ 2 + x[2 ]^ 2 + x[3 ]^ 2 )
151- lon = atan (x[2 ], x[1 ])
152- lat = asin (x[3 ] / a)
151+ a = sqrt (x[1 ]^ 2 + x[2 ]^ 2 + x[3 ]^ 2 ) # radius of the sphere
152+ lon, lat = atan (x[2 ], x[1 ]), asin (x[3 ] / a)
153153
154154 h_0 = 8.0f3
155155 omega = 7.848f-6
@@ -176,7 +176,8 @@ This problem corresponds to Case 6 of the test suite described in the following
176176
177177 # Convert primitive variables from spherical coordinates to the chosen global
178178 # coordinate system, which depends on the equation type
179- return spherical2global (SVector (h, vlon, vlat, zero (RealT)), x, equations)
179+ return spherical2global (SVector (h, vlon, vlat, zero (RealT), zero (RealT)), x,
180+ equations)
180181end
181182
182183@doc raw """
@@ -222,7 +223,8 @@ test suite described in the following paper:
222223
223224 # Convert primitive variables from spherical coordinates to the chosen global
224225 # coordinate system, which depends on the equation type
225- return spherical2global (SVector (h, vlon, vlat, zero (RealT)), x, equations)
226+ return spherical2global (SVector (h, vlon, vlat, zero (RealT), zero (RealT)), x,
227+ equations)
226228end
227229
228230# Bottom topography function to pass as auxiliary_field keyword argument in constructor for
@@ -279,12 +281,12 @@ H(\vec{x},t) =
279281\v ec{\v arphi}(\v ec{c},t) \c dot \v ec{x}/\l Vert \v ec{x} \r Vert \b ig)^2 +
280282(\v ec{\O mega} \c dot \v ec{x})^2 + 2k_1\r ight),
281283```
282- where we take $v_0 = 2\p i a / (12 \ \m athrm{days})$ and
283- $k_1 = 133681 \ \m athrm{m}^2/ \m athrm{s}^2$, and we use $\l Vert \c dot \r Vert$ to denote the
284- Euclidean norm. To use this test case with [`SplitCovariantShallowWaterEquations2D`](@ref),
285- the keyword argument `auxiliary_field = bottom_topography_unsteady_solid_body_rotation`
286- should be passed into the `SemidiscretizationHyperbolic` constructor. This analytical
287- solution was derived in the following paper:
284+ where $v_0 = 2\p i a / (12 \ \m athrm{days})$, $k_1 = 133681 \ \m athrm{m}^2/ \m athrm{s}^2$,
285+ and $\l Vert \c dot \r Vert$ denotes the Euclidean norm. To use this test case with
286+ [`SplitCovariantShallowWaterEquations2D`](@ref), the keyword argument
287+ `auxiliary_field = bottom_topography_unsteady_solid_body_rotation` should be passed into
288+ the `SemidiscretizationHyperbolic` constructor. This analytical solution was derived in the
289+ following paper:
288290- M. Läuter, D. Handorf, and K. Dethloff (2005). Unsteady analytical solutions of the
289291 spherical shallow water equations. Journal of Computational Physics 210:535–553.
290292 [DOI: 10.1016/j.jcp.2005.04.022](https://doi.org/10.1016/j.jcp.2005.04.022)
@@ -320,7 +322,7 @@ solution was derived in the following paper:
320322
321323 # Convert primitive variables from Cartesian coordinates to the chosen global
322324 # coordinate system, which depends on the equation type
323- return cartesian2global (SVector (H, v[1 ], v[2 ], v[3 ]), x, equations)
325+ return cartesian2global (SVector (H, v[1 ], v[2 ], v[3 ], zero (RealT) ), x, equations)
324326end
325327
326328# Bottom topography function to pass as auxiliary_field keyword argument in constructor for
332334@doc raw """
333335 initial_condition_barotropic_instability(x, t, equations)
334336
335- Barotrotropic instability initiated by a perturbation applied to a mid-latitude jet. A full
336- description of this case is provided in the following paper:
337+ Barotrotropic instability initiated by a perturbation applied to a mid-latitude jet. The velocity field is a purely zonal flow, given as a function of the latitude $\t heta$ as
338+ ```math
339+ v_\l ambda(\t heta) = \b egin{cases}
340+ u_0 \e xp(-4 / (\t heta_1 - \t heta_0)^{-2})\e xp((\t heta - \t heta_0)^{-1}
341+ (\t heta - \t heta_1)^{-1}), & \q uad \t heta_0 < \t heta < \t heta_1, \\
342+ 0 & \q uad \t ext{otherwise},
343+ \e nd{cases}
344+ ```
345+ where $u_0 = 80 \ \m athrm{m}/\m athrm{s}$, $\t heta_0 = \p i/7$, and
346+ $\t heta_1 = \p i/2 - \t heta_0$. The background geopotential height field is given by
347+ ```math
348+ h_0(\t heta) = 10158 \ \m athrm{m} -
349+ \f rac{a}{g} \i nt_{-\p i/2}^\t heta v_\l ambda(\t heta')\b ig(2\O mega\s in\t heta' +
350+ v_\l ambda(\t heta')\t an\t heta' / a \b ig)\, \m athrm{d}\t heta',
351+ ```
352+ where $a = 6.37122 \t imes 10^3\ \m athrm{m}$ is the Earth's radius,
353+ $g = 9.80616 \ \m athrm{m}/\m athrm{s}^2$ is the Earth's gravitational acceleration, and
354+ $\O mega = 7.292 \t imes 10^{-5}\ \m athrm{s}^{-1}$ is the Earth's rotation rate. The
355+ perturbation is then added to obtain the following geopotential height field:
356+ ```math
357+ h(\l ambda, \t heta) = \b egin{cases}
358+ h_0(\t heta) + \d elta h \c os\t heta \e xp(-(\l ambda/\a lpha)^2)
359+ \e xp(-((\t heta_2 -\t heta)/\b eta)^2), & \q uad -\p i < \l ambda < \p i,\\
360+ h_0(\t heta), & \q uad \t ext{otherwise},
361+ \e nd{cases}
362+ ```
363+ where $\l ambda$ is the longitude coordinate, and we take $\a lpha = 1/3$, $\b eta = 1/15$,
364+ and $\d elta h = 120 \ \m athrm{m}$. This problem was proposed in the following paper:
337365- J. Galewsky, R. K. Scott, and L. M. Polvani (2004). An initial-value problem for
338366 testing numerical models of the global shallow-water equations. Tellus A 56.5:429–440.
339367 [DOI: 10.3402/tellusa.v56i5.14436](https://doi.org/10.3402/tellusa.v56i5.14436)
@@ -366,7 +394,8 @@ description of this case is provided in the following paper:
366394
367395 # Convert primitive variables from spherical coordinates to the chosen global
368396 # coordinate system, which depends on the equation type
369- return spherical2global (SVector (h, vlon, vlat, zero (RealT)), x, equations)
397+ return spherical2global (SVector (h, vlon, vlat, zero (RealT), zero (RealT)), x,
398+ equations)
370399end
371400
372401@inline function galewsky_velocity (lat, u_0, lat_0, lat_1)
0 commit comments