Skip to content

Commit

Permalink
SWE: more comments and update the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilaGhaffari committed Mar 21, 2021
1 parent af734c2 commit 3c01fc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions examples/fluids/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ where the time derivative :math:`\bm{\dot q}` is defined by
\bm{\dot q}(\bm q) = \sigma \bm q + \bm z
in terms of :math:`\bm z` from prior state and :math:`\sigma > 0`,
both of which depend on the specific time integration scheme. We split the implicit and explicit terms as follows:
both of which depend on the specific time integration scheme. We split the time
integration scheme into implicit and explicit parts where the implicit terms is
given in what follows.

.. math::
:label: eq-swe-implicit-part
Expand All @@ -399,8 +401,8 @@ While for the explicit part we specify
\bm G(t, \bm q) :=
\left\{
\begin{array}{l}
G_1 (u_{\lambda}, u_{\theta}, h) = - u_{\lambda} \frac{\partial u_{\lambda}}{\partial \alpha} - u_{\theta} \frac{\partial u_{\lambda}}{\partial \beta} - f u_{\theta}\\
G_2 (u_{\lambda}, u_{\theta}, h) = - u_{\lambda} \frac{\partial u_{\theta}}{\partial \alpha} - u_{\theta} \frac{\partial u_{\theta}}{\partial \beta} + f u_{\lambda}\\
G_1 (u_{\lambda}, u_{\theta}, h) = - u_{\lambda} \frac{\partial u_{\lambda}}{\partial \alpha} - u_{\theta} \frac{\partial u_{\theta}}{\partial \alpha} + f u_{\theta}\\
G_2 (u_{\lambda}, u_{\theta}, h) = - u_{\lambda} \frac{\partial u_{\lambda}}{\partial \beta} - u_{\theta} \frac{\partial u_{\theta}}{\partial \beta} - f u_{\lambda}\\
G_3 (u_{\lambda}, u_{\theta}, h) = 0 .
\end{array}
\right.
Expand Down
14 changes: 8 additions & 6 deletions examples/fluids/shallow-water/qfunctions/geostrophic.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,21 @@ CEED_QFUNCTION(SWExplicit)(void *ctx, CeedInt Q, const CeedScalar *const *in,
// The Physics
// Explicit spatial terms of G_1(t,q):
// Explicit terms multiplying v
// - (omega + f) * khat curl u - grad(|u|^2/2) // TODO: needs fix with weak form
// -- grad(|u|^2/2) = u^T grad u
// -- khat curl u = [-u_1, u_0]
// - (omega + f) * khat curl u - grad(|u|^2/2)
// -- omega khat curl u = 0 (u_3 = 0)
// -- f khat curl u = f [-u_1, u_0]
// -- grad(|u|^2/2) = (grad u)^T u
v[0][i] = - wdetJ*(u[0]*du[0][0] + u[1]*du[1][0] - f*u[1]);
// No explicit terms multiplying dv
dv[0][0][i] = 0;
dv[1][0][i] = 0;

// Explicit spatial terms of G_2(t,q):
// Explicit terms multiplying v
// - (omega + f) * khat curl u - grad(|u|^2/2) // TODO: needs fix with weak form
// -- grad(|u|^2/2) = u^T grad u
// -- khat curl u = [-u_1, u_0]
// - (omega + f) * khat curl u - grad(|u|^2/2)
// -- omega khat curl u = 0 (u_3 = 0)
// -- f khat curl u = f [-u_1, u_0]
// -- grad(|u|^2/2) = (grad u)^T u
v[1][i] = - wdetJ*(u[0]*du[0][1] + u[1]*du[1][1] + f*u[0]);
// No explicit terms multiplying dv
dv[0][1][i] = 0;
Expand Down

0 comments on commit 3c01fc9

Please sign in to comment.