You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/fluids/index.rst
+100Lines changed: 100 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -307,3 +307,103 @@ and non-penetration boundary conditions for :math:`\bm{u}`, and no-flux
307
307
for mass and energy densities. This problem can be run with::
308
308
309
309
./navierstokes -problem density_current
310
+
311
+
312
+
.. _example-petsc-shallow-water:
313
+
314
+
Shallow-water Equations mini-app
315
+
========================================
316
+
317
+
This example is located in the subdirectory :file:`examples/fluids/shallow-water`. It solves
318
+
the time-dependent shallow-water equations on a cubed-sphere. The geometry of the cubed-sphere and the relative coordinate transformations are explained in the section :ref:`example-petsc-area-sphere`. The discretization of most of the spatial differential terms needed in the shallow-water equations is already described in the section :ref:`example-petsc-bps-sphere`.
319
+
320
+
The mathematical formulation (from :cite:`taylor2010ACA`) is given in what
where quantities are expressed in spherical coordinates :math:`r^1 = \lambda` for longitude, :math:`r^2 = \theta` for latitude and :math:`r^3 = r` for the radius, with associated unit vectors :math:`\bm{ \hat \lambda}`, :math:`\bm {\hat \theta}`, and :math:`\bm{\hat k}`, respectively. We consider a unit sphere, hence, :math:`r = 1` and :math:`\partial / \partial r = 0`. In equations :math:numref:`eq-swe`, :math:`\bm u` represents velocity field with longitudinal and latitudinal components :math:`\bm u = (u_{\lambda}, u_{\theta}) \equiv (u_1, u_2)`, and :math:`h` represents the height function of the fluid thickness; moreover, :math:`\omega = \nabla \times \bm u` is the vorticity, :math:`f` the Coriolis parameter such that :math:`f = 2 \bm{\Omega} \sin(\theta)` with :math:`\bm{\Omega}` Earth's rotation, :math:`g` represents the gravitational acceleration, :math:`h_s` the bottom surface (terrain) elevation, and :math:`H_0` the constant mean depth, such that the total fluid surface height is given by :math:`h_s + H_0 + h`. On the two-dimensional Riemannian manifold describing the sphere, we can use the coordinate indices :math:`x^s = {\alpha, \beta}`, so that we can express :math:`\bm u = u^{\alpha} \bm g_{\alpha} + u^{\beta} \bm g_{\beta}`, where :math:`\bm g_{\alpha} = \partial / \partial \alpha` and :math:`\bm g_{\beta} = \partial / \partial \beta` are the natural basis vectors on the manifold :cite:`ullrich,rancic`.
332
+
333
+
We solve equations :math:numref:`eq-swe` for the state variable :math:`\bm q = (q_1, q_2, q_3) = (\bm u, h) = (u_{\lambda}, u_{\theta}, h) \equiv (u_1, u_2, h)` with a semi-implicit time integration, for which
334
+
335
+
.. math::
336
+
:label: eq-swe-semi-implicit
337
+
338
+
\bm F(t, \bm q, \bm {\dot q}) = G(t, \bm q) \, ,
339
+
340
+
where the time derivative :math:`\bm{\dot q}` is defined by
341
+
342
+
.. math::
343
+
\bm{\dot q}(\bm q) = \sigma\bm q + \bm z
344
+
345
+
in terms of :math:`\bm z` from prior state and :math:`\sigma > 0`,
346
+
both of which depend on the specific time integration scheme. We split the implicit and explicit terms as follows:
347
+
348
+
.. math::
349
+
:label: eq-swe-implicit-part
350
+
351
+
\bm F(t, \bm q, \bm {\dot q}) :=
352
+
\left\{
353
+
\begin{array}{l}
354
+
F_1 (u_{\lambda}, u_{\theta}, h) = \frac{\partial u_{\lambda}}{\partial t} + g \frac{\partial }{\partial\alpha} \left( h + h_s \right)\\
355
+
F_2 (u_{\lambda}, u_{\theta}, h) = \frac{\partial u_{\theta}}{\partial t} + g \frac{\partial }{\partial\beta} \left( h + h_s \right)\\
The differentiation of the implicit part :math:numref:`eq-swe-implicit-part` with respect to the increment :math:`\delta\bm q = (\delta\bm u, \delta h)` gives the strong form of the incremental Jacobian :math:`\partial F_i / \partial\delta q_j`, with :math:`i,j = 1,2,3`
whose integrands of the weak form are found by multiplying each entry of :math:`\partial F_i / \partial\delta q_j` by a test function :math:`\phi\in H^1(\Omega)`
397
+
and integrating by parts
398
+
399
+
.. math::
400
+
:label: eq-weak-swe-Jacobian
401
+
402
+
\left(
403
+
\begin{array}{ccc}
404
+
0 & 0 & - g \delta h \partial\phi / \partial\alpha \\
405
+
0 & 0 & - g \delta h \partial\phi / \partial\beta \\
0 commit comments