Hydrostatic balance

During the setup-phase of a run, CGCAM will compute the thermodynamic state such that the hydrostatic balance is satisfied numerically on a particular point distribution in \(z\). This point distribution corresponds to the cell center locations for a Cartesian grid type (i_grid=1), the \(z\) point distribution contained in the grid file for a terrain grid (i_grid=3), and a uniform point disribution for a general mesh (i_grid=0). With the thermodynamic value sampling points being equal to the cell centers in the Cartesian grid case, the hydrostatic balance will be satisfied at all points within the domain. For the other cases, however, interpolation errors, both when the thermodynamic variables are interpolated to the cell centers, and the errors present in interpolating the pressure to the cell faces, will upset the hydrostatic balance. While the severity of these errors are problem dependent, they will result in non-physical flows at early times during the simulation since pressure and buoyance forces are out of balance. Currently this problem can be avoided by specifying the input i_hydrostat=1, in whinc case the conservation laws are modified by anaylitically subtracting the hydrostatic force balance. While this modification is straightforward for the momentum equation is is somewhat more involved for the energy equation. For the momentum equation we simply decompose the pressure gradient and buoyancy force terms into background and fluctuating components and then subtract out the background (hydrostatic) part.

\[\begin{split}\begin{eqnarray*} \frac{\partial \rho u_i}{\partial t} & = & -\frac{\partial}{\partial x_j}\Big( u_i \; \rho u_j \Big) + \frac{\partial \sigma_{ij}}{\partial x_j} - \frac{\partial p}{\partial x_i} - \rho g\delta_{i3}\\[0.1in] & = & -\frac{\partial}{\partial x_j}\Big( u_i \; \rho u_j \Big) + \frac{\partial \sigma_{ij}}{\partial x_j} - \frac{\partial p^\prime}{\partial x_i} \;\underbrace{ - \frac{\partial \bar{p}}{\partial x_i} - \bar{\rho} g\delta_{i3}}_{=0} - \rho^\prime g\delta_{i3}\\[0.1in] & = & -\frac{\partial}{\partial x_j}\Big( u_i \; \rho u_j \Big) + \frac{\partial \sigma_{ij}}{\partial x_j} - \frac{\partial p^\prime}{\partial x_i} - \rho^\prime g\delta_{i3} \end{eqnarray*}\end{split}\]

Here \(\sigma_{ij}\) is the viscous stress as defined in section Governing Equations.

A similar development is used to remove the hydrostatic balance from the energy equation.

\[\begin{split}\begin{eqnarray*} \frac{\partial \rho E}{\partial t} & = & -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j \Big) + \frac{\partial u_i \sigma_{ij}}{\partial x_j} - \frac{\partial u_j p}{\partial x_j} - w \rho g - \frac{\partial q_j}{\partial x_j}\\[0.1in] & = & -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j \Big) + \frac{\partial u_i \sigma_{ij}}{\partial x_j} - \frac{\partial u_j p^\prime}{\partial x_j} - \frac{\partial u_j \bar{p}}{\partial x_j} - w \bar{\rho} g - w \rho^\prime g - \frac{\partial q_j}{\partial x_j}\\[0.1in] & = & -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j \Big) + \frac{\partial u_i \sigma_{ij}}{\partial x_j} - \frac{\partial u_j p^\prime}{\partial x_j} - \bar{p}\frac{\partial u_j }{\partial x_j} \;\underbrace{ - w\frac{\partial \bar{p}}{\partial z} - w \bar{\rho} g}_{=0} - w \rho^\prime g - \frac{\partial q_j}{\partial x_j}\\[0.1in] & = & -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j \Big) + \frac{\partial u_i \sigma_{ij}}{\partial x_j} - \frac{\partial u_j p^\prime}{\partial x_j} - \bar{p}\frac{\partial u_j }{\partial x_j} - w \rho^\prime g - \frac{\partial q_j}{\partial x_j}\\[0.1in] \end{eqnarray*}\end{split}\]

Note that an extra term, proportional to the velocity divergence, appears in the energy equation.

Hydrostataic balance removal in conjunction with data assimilation

The data assimilation forms are derived by subtracting the background balances from the flow equations. If the hydrostatic balance are also to be removed we can start with the results above to derive the corresponding data assimilation forms. Since the background equivalent of any prime term is null, only the advective and viscous stress terms in the momentum equation above have a background equivalent. Subtracting these, adding the measeured momentum time rate of change, and using the notation \(\sigma^\prime_{ij} = \sigma_{ij} - \bar{\sigma}_{ij}\), we get

\[ \frac{\partial \rho u_i}{\partial t} = -\frac{\partial}{\partial x_j}\Big( u_i \; \rho u_j - \bar{u}_i \; \bar{\rho}\bar{u}_j \Big) + \frac{\partial \sigma_{ij}^\prime}{\partial x_j} - \frac{\partial p^\prime}{\partial x_j} - \rho^\prime g\delta_{i3} + \left(\frac{\partial \bar{\rho} \bar{u}_i}{\partial t}\right)_D\]

A similar procedure is used to derive the data assimilation form of the energy equation

\[\begin{split}\frac{\partial \rho E}{\partial t} = -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j - \bar{E} \; \bar{\rho}\bar{u}_j \Big) + \frac{\partial}{\partial x_j}\left( u_i\sigma_{ij} - \bar{u}_i\bar{\sigma}_{ij}\right) - \\[0.1in] \frac{\partial u_j p^\prime}{\partial x_j} - \bar{p}\frac{\partial u^\prime_j }{\partial x_j} - w \rho^\prime g - \frac{\partial q^\prime_j}{\partial x_j} + \left(\frac{\partial \bar{\rho}\bar{E}}{\partial t}\right)_D\end{split}\]

Note that the viscous work term can be written as

\[u_i\sigma_{ij} - \bar{u}_i\bar{\sigma}_{ij} \; = \; u_i(\sigma^\prime_{ij} + \bar{\sigma}_{ij}) - \bar{u}_i\bar{\sigma}_{ij} \; = \; u_i\sigma^\prime_{ij} + (u_i - \bar{u}_i)\bar{\sigma}_{ij} \; = \; u_i\sigma^\prime_{ij} + u^\prime_i\bar{\sigma}_{ij}\]

This result may be used to rewrite the energy equation as

\[\frac{\partial \rho E}{\partial t} = -\frac{\partial}{\partial x_j}\Big( E \; \rho u_j - \bar{E} \; \bar{\rho}\bar{u}_j \Big) + \frac{\partial}{\partial x_j}\Big( u_i\Sigma^\prime_{ij} + u^\prime_i\bar{\sigma}_{ij} \Big) - \bar{p}\frac{\partial u^\prime_j }{\partial x_j} - w \rho^\prime g - \frac{\partial q^\prime_j}{\partial x_j} + \left(\frac{\partial \bar{\rho}\bar{E}}{\partial t}\right)_D\]

where \(\Sigma^\prime_{ij}=\sigma^\prime_{ij}-p^\prime\delta_{ij}\).