_Discrete_PG.dox
1/*! \page Discrete_PG Discrete Pressure Gradient Term
2
3\section section_PG Pressure Gradient Term
4
5Following \cite adcroft2008, the horizontal momentum equation in the general
6coordinate \f$r\f$ can be written as:
7\f[
8 \frac{\partial \vec{u}}{\partial t} + \nabla_r \Phi + \alpha \nabla_r p = \cal{F}
9\f]
10where the vector \f$\cal{F}\f$ represents all the forcing terms other than the pressure
11gradient. Here, \f$\vec{u}\f$ is the horizontal component of the velocity,
12\f$\Phi\f$ is the geopotential:
13\f[
14 \Phi = gz
15\f]
16\f$\alpha = 1/\rho\f$ is the specific volume and \f$p\f$ is the pressure. The
17gradient operator is a gradient along the coordinate surface \f$r\f$.
18
19MOM6 offers two options, an older one using a Montgomery potential as described in
20\cite hallberg1997 and \cite sun1999. However, it can have the instability
21described in \cite hallberg2005. The version described here is that in \cite adcroft2008
22and is the recommended option (ANALYTIC_FV_PGF = True). The paper describes the Boussinesq
23form while the code supports that and also a non-Boussinesq form.
24
25In two dimensions (\f$x\f$ and \f$p\f$), we can integrate the zonal
26component of the momentum equation above over a finite volume:
27
28\f{eqnarray}{
29 - \int dx \int dp \frac{\partial u}{\partial t} &= \int dx \int dp \left. \frac{\partial
30 \Phi}{\partial x}\right|_p \\
31 &= \int_{p_{br}}^{p_{tr}} \Phi dp + \int_{p_{tr}}^{p_{tl}} \Phi dp +
32 \int_{p_{tl}}^{p_{bl}} \Phi dp
33 &+ \int_{p_{bl}}^{p_{br}} \Phi dp \label{eq:PG_loop}
34\f}
35
36We convert to line integrals thanks to the Leibniz rule.
37See the figure for the location of the line integral ranges:
38
39\image html PG_loop.png "Schematic of the finite volume used for integrating the \f$u\f$-component of momentum. The thermodynamic variables \f$\\theta\f$ and \f$s\f$ reside on the sides of the depicted volume and are considered uniform for the vertical extent of the volume but with linear variation in the horizontal. The volume is depicted in \f$(x, p)\f$ space so \f$p\f$ is linear around the volume but \f$\\Phi\f$ can vary arbitrarily along the edges."
40\imagelatex{PG_loop.png,Schematic of the finite volume used for integrating the $u$-component of momentum. The thermodynamic variables $\theta$ and $s$ reside on the sides of the depicted volume and are considered uniform for the vertical extent of the volume but with linear variation in the horizontal. The volume is depicted in $(x\, p)$ space so $p$ is linear around the volume but $\Phi$ can vary arbitrarily along the edges.,\includegraphics[width=\textwidth\,height=\textheight/2\,keepaspectratio=true]}
41
42The only approximations made are (i) that the potential temperature \f$\theta\f$ and the
43salinity \f$s\f$ can be represented continuously in the vertical within each layer although
44discontinuities between layers are allowed and (ii) that \f$\theta\f$ and \f$s\f$ can be
45represented continuously along each layer. MOM6 has options for piecewise constant (PCM),
46piecewise linear (PLM), and piecewise parabolic (PPM) in the vertical.
47
48If we use the Wright equation of state (\cite wright1997), we can integrate the above
49integrals analytically. This equation of state can be written as:
50
51\f[
52 \alpha(s, \theta, p) = A(s, \theta) + \frac{\lambda(s, \theta)}{P(s, \theta) + p}
53\f]
54
55where \f$A, \lambda\f$ and \f$P\f$ are functions only of \f$s\f$ and \f$\theta\f$.
56The integral form of hydrostatic balance is:
57
58\f[
59 \Phi(p_t) - \Phi(p_b) = \int_{p_t}^{p_b} \alpha(s, \theta, p) dp
60\f]
61
62Assuming piecewise constant values for \f$\theta\f$ and \f$s\f$ and the above equation of
63state, we get:
64\f{eqnarray}{
65 \Phi(p_t) - \Phi(p_b) &= \int_{p_t}^{p_b} \alpha(s, \theta, p) dp \\
66 &= (p_b - p_t) A + \lambda \ln \left| \frac{P + p_b}{P + p_t} \right| \\
67 &= \Delta p \left( A + \frac{\lambda}{P + \overline{p}} \frac{1}{2 \epsilon} \ln \left|
68 \frac{1 + \epsilon}{1 - \epsilon} \right| \right) \label{eq:PG_vert}
69\f}
70which is the exact solution for the continuum only if \f$\theta\f$ and \f$s\f$ are uniform
71in the interval \f$p_t\f$ to \f$p_b\f$. Here, we have introduced the variables:
72\f[
73 \Delta p = p_b - p_t
74\f]
75\f[
76 \overline{p} = \frac{1}{2}(p_t + p_b)
77\f]
78and
79\f[
80 \epsilon = \frac{\Delta p}{2 (P + \overline{p})}
81\f]
82We will show later that \f$\epsilon \ll 1\f$. Note the series expansion:
83
84\f[
85 \frac{1}{2 \epsilon} \ln \left| \frac{1 + \epsilon}{1 - \epsilon} \right| =
86 \sum_{n=1}^\infty \frac{\epsilon^{2n-2}}{2n - 1} = 1 + \frac{\epsilon^2}{3} +
87 \frac{\epsilon^4}{5} + \cdots \forall |\epsilon | \leq 1
88\f]
89
90Typical values for the deep ocean with 100 m layer thickness are \f$6 \times 10^8\f$ Pa and
91\f$10^6\f$ Pa, respectively, yielding \f$\epsilon \sim 8 \times 10^{-4}\f$ and a
92corresponding accuracy in the geopotential height calculation of \f$\frac{\lambda
93\epsilon^3}{g} \sim 10^{-5}\f$ m. For this value of \f$\epsilon\f$, the series converges
94with just three terms. In MOM6, we use series rather than the intrinsic log function ,
95since the log is machine dependent and insufficiently accurate. In extreme circumstances,
96\f$\Delta p \sim 6 \times 10^7\f$ Pa (limited by the depth of the ocean) for which
97\f$\epsilon \sim 0.04\f$ with geopotential height errors of order 1 m. In this case, the
98series converges to machine precision with six terms.
99
100The finite volume acceleration is expression terms of four integrals around the volume,
101\f$\int \Phi dp\f$. The side integrals can be calculated by direct integration of
102\eqref{eq:PG_vert}, which gives:
103\f{eqnarray}{
104 \int_{p_t}^{p_b} \Phi dp &=
105 \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left(
106 1 - \frac{1 - \epsilon}{2 \epsilon} \ln \left| \frac{1 + \epsilon}{1 - \epsilon}
107 \right| \right) \right) \\
108 &= \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left(
109 1 - (1 - \epsilon) \left( 1 + \frac{\epsilon^2}{3} + \frac{\epsilon^4}{5} + \cdots
110 \right) \right) \right) \\
111 &= \Delta p \left( \Phi_b + \frac{1}{2} A \Delta p + \lambda \left(
112 \epsilon - (1 - \epsilon) \epsilon^2 \left( \frac{1}{3} + \frac{\epsilon^2}{5} + \cdots
113 \right) \right) \right)
114\f}
115where \f$\Phi, \Delta p, P, A\f$ and \f$\lambda\f$ are each evaluated on the left or right
116side of the volume.
117
118The top and bottom integrals in \eqref{eq:PG_loop} must allow for the effect of varying
119\f$\theta\f$ and \f$s\f$ on \f$A, \lambda\f$ and \f$P\f$. We evaluate these integrals
120numerically using sixth-order quadrature; Boole's rule requires evaluating the coefficients
121in the equation of state at five points, two of which have already been evaluated for the
122side integrals. For efficiency, we linearly interpolate the coefficients \f$A, P\f$ and
123\f$\lambda\f$ between the end points, which seems to make very little difference to the
124solution. We also verified that tenth-order quadrature makes little difference to the
125solution. The values of the top and bottom integrals are carried upward in a
126hydrostatic-like integration, obtained as follows:
127
128\f{eqnarray}{
129 \int_{p_{tl}}^{p_{tr}} \Phi_t dp &= (p_{tr} - p_{tl}) \int_0^1 \Phi_t dx \\
130 &= (p_{tr} - p_{tl}) \int_0^1 \left( \Phi_b + A(x) \Delta p(x) + \lambda (x)
131 \ln \left| \frac{1 + \epsilon (x)}{1 - \epsilon (x)} \right| \right) dx \\
132 &= (p_{tr} - p_{tl}) \int_0^1 \Phi_b dx \\
133 &+ \int_0^1 \Delta p(x) \left( A(x) + \frac{\lambda (x)}{P(x) + \overline{p} (x)}
134 \sum_{n=1}^\infty \frac{\epsilon^{2n-2}}{2n-1} \right) dx
135\f}
136
137The first integral is either known from the top integral of the layer below or the boundary
138condition at the ocean bottom. The second integral is evaluated numerically.
139
140All the above definite integrals are specific to the Wright equation of state; the use of a
141different equation of state requires analytic integration of the appropriate equations. We
142have found, however, that high-order numerical integration appears to be sufficient.
143Although the numerical implementation is more general (allowing the use of arbitrary
144equations of state), it is significantly more expensive and so we advocate the analytic
145implementation for efficiency.
146
147*/