-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(0.91.0) Make hydrostatic pressure anomaly optional in `Nonhydrostati…
…cModel` (#3574) * Add kwarg for hydrostatic pressure anomaly, make nothing by default * Modify regression tests to separate hydrostatic pressure * Update docs on pressure decomposition plus nonhydrostatic model docs * Bugfix plus discontinue support for "trying" to set boundary conditions on pressure * Fix regression tests * Bump minor version * Use nonhydrostatic pressure for aux data * Add some validation of the pressure fields * Bugfix * Make sure buoyancy gets added when hydrostatic pressure is omitted * fix typos/phrasing * remove PressureField(s) * Fix AB2 test, which was wrong because update_state computes tendencies now * Relax requirement that w==0 in jld2 output writer test * Try again to get a good comparison * Dont test halo filling for hydrostatic pressure cause who cares --------- Co-authored-by: Navid C. Constantinou <[email protected]>
- Loading branch information
Showing
16 changed files
with
118 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 16 additions & 27 deletions
43
docs/src/numerical_implementation/pressure_decomposition.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,51 @@ | ||
# [Pressure decomposition](@id pressure_decomposition) | ||
|
||
In the numerical implementation of the momentum equations, the kinematic pressure ``p`` | ||
is split into "hydrostatic" and "non-hydrostatic" parts via | ||
In the numerical implementation of the momentum equations in the `NonhydrostaticModel`, the kinematic pressure ``p`` | ||
is split into "background" and "dynamic" parts via | ||
```math | ||
\begin{equation} | ||
\label{eq:pressure} | ||
p(\boldsymbol{x}, t) = p_{\text{total hydrostatic}}(\boldsymbol{x}, t) + p_{\rm{non}}(\boldsymbol{x}, t) \, . | ||
p(\boldsymbol{x}, t) = p_{\text{background}}(\boldsymbol{x}, t) + p'(\boldsymbol{x}, t) \, . | ||
\end{equation} | ||
``` | ||
|
||
The hydrostatic pressure component in \eqref{eq:pressure} is defined so that the vertical | ||
component of its gradient balances gravity: | ||
The background pressure component in \eqref{eq:pressure} is defined so that the vertical | ||
component of its gradient balances the background density field: | ||
|
||
```math | ||
\begin{align} | ||
\partial_z p_{\text{total hydrostatic}} & = - g \left ( 1 + \frac{\rho_*}{\rho_0} + \frac{\rho'}{\rho_0} \right ) \, , | ||
\partial_z p_{\text{total hydrostatic}} & = - g \left ( 1 + \frac{\rho_*}{\rho_0} \right ) \, , | ||
\end{align} | ||
``` | ||
|
||
Above, we use the notation introduced in the [Boussinesq approximation](@ref boussinesq_approximation) | ||
section. | ||
|
||
We can further split the hydrostatic pressure component into | ||
Optionally, we may further decompose the dynamic pressure perturbation ``p'`` into | ||
a "hydrostatic anomaly" and "nonhydrostatic" part: | ||
```math | ||
\begin{align} | ||
p_{\text{total hydrostatic}}(\boldsymbol{x}, t) = p_{*}(z) + p_{\rm{hyd}}(\boldsymbol{x}, t) \, , | ||
p'(\boldsymbol{x}, t) = p_{\rm{hyd}}(\boldsymbol(x), t) + p_{\rm{non}}(\boldsymbol{x}, t) \, , | ||
\end{align} | ||
``` | ||
|
||
i.e., a component that only varies in ``z`` (``p_*``) and a "hydrostatic anomaly" (``p_{\rm{hyd}}``) defined | ||
so that | ||
where | ||
|
||
```math | ||
\begin{align} | ||
\partial_z p_{*} & = - g \left ( 1 + \frac{\rho_*}{\rho_0} \right ) \, ,\\ | ||
\partial_z p_{\rm{hyd}} & = \underbrace{- g \frac{\rho'}{\rho_0}}_{= b} \, . | ||
\partial_z p_{\rm{hyd}} \equiv \underbrace{- g \frac{\rho'}{\rho_0}}_{= b} \, . | ||
\end{align} | ||
``` | ||
|
||
Doing so, the gradient of the kinematic pressure becomes: | ||
With this pressure decomposition, the kinematic pressure gradient that appears in the momentum equations | ||
(after we've employed the the [Boussinesq approximation](@ref boussinesq_approximation)) becomes | ||
|
||
```math | ||
\begin{align} | ||
\boldsymbol{\nabla} p & = \boldsymbol{\nabla} p_{\rm{non}} + \boldsymbol{\nabla}_h p_{\rm{hyd}} + ( \partial_z p_{*} + \partial_z p_{\rm{hyd}} ) \boldsymbol{\hat z}\, , | ||
\boldsymbol{\nabla} p &= - g \frac{\rho}{\rho_0} \hat {\boldsymbol{z}} + \boldsymbol{\nabla} p' | ||
&= - g \frac{\rho}{\rho_0} \hat {\boldsymbol{z}} + \boldsymbol{\nabla} p_{\rm{non}} + \boldsymbol{\nabla}_h p_{\rm{hyd}} \, . | ||
\end{align} | ||
``` | ||
|
||
where ``\boldsymbol{\nabla}_h \equiv \boldsymbol{\hat x} \partial_x + \boldsymbol{\hat y} \partial_y`` | ||
is the horizontal gradient. | ||
where ``\boldsymbol{\nabla}_h \equiv \boldsymbol{\hat x} \partial_x + \boldsymbol{\hat y} \partial_y``. | ||
|
||
Under this pressure decomposition, the kinematic pressure gradient that appears in the momentum equations | ||
(after we've employed the the [Boussinesq approximation](@ref boussinesq_approximation)) combines with | ||
the gravity force to give: | ||
|
||
```math | ||
\begin{align} | ||
\boldsymbol{\nabla} p + g \frac{\rho}{\rho_0} \hat {\boldsymbol{z}} = \boldsymbol{\nabla} p_{\rm{non}} + \boldsymbol{\nabla}_h p_{\rm{hyd}} \, . | ||
\end{align} | ||
``` | ||
|
||
Mathematically, the non-hydrostatic pressure ``p_{\rm{non}}`` enforces the incompressibility constraint. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7a4b3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
7a4b3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/106235
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
7a4b3f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh true. I was gonna bundle this with the RK3 default update, but we can bump minor version again instead