Skip to content

AtmosphereModel.pressure and AtmosphereModel.pressure_solver should probably be properties of AnelasticFormulation #245

@glwagner

Description

@glwagner

pressure :: Prs
pressure_solver :: Sol

these properties should probably be in AnelasticFormulation.

First of all, "pressure" is actually the pressure perturbation (which participates in the velocity update):

@kernel function _pressure_correct_momentum!(M, grid, Δt, αᵣ_pₙ, ρᵣ)
i, j, k = @index(Global, NTuple)
ρᶠ = ℑzᵃᵃᶠ(i, j, k, grid, ρᵣ)
ρᶜ = @inbounds ρᵣ[i, j, k]
@inbounds M.ρu[i, j, k] -= ρᶜ * Δt * ∂xᶠᶜᶜ(i, j, k, grid, αᵣ_pₙ)
@inbounds M.ρv[i, j, k] -= ρᶜ * Δt * ∂yᶜᶠᶜ(i, j, k, grid, αᵣ_pₙ)
@inbounds M.ρw[i, j, k] -= ρᶠ * Δt * ∂zᶜᶜᶠ(i, j, k, grid, αᵣ_pₙ)
end
"""
$(TYPEDSIGNATURES)
Update the predictor momentum ``(ρu, ρv, ρw)`` with the non-hydrostatic pressure via
```math
(\\rho\\boldsymbol{u})^{n+1} = (\\rho\\boldsymbol{u})^n - \\Delta t \\, \\rho_r \\boldsymbol{\\nabla} \\left( \\alpha_r p_{nh} \\right)
```
"""
function make_pressure_correction!(model::AnelasticModel, Δt)
launch!(model.architecture, model.grid, :xyz,
_pressure_correct_momentum!,
model.momentum,
model.grid,
Δt,
model.pressure,
model.formulation.reference_state.density)
return nothing
end

Also, we don't have a pressure perturbation or pressure solver for a FullyCompressibleFormulation.

Discussed with @kaiyuan-cheng

With a fully compressible formulation, we may not have pressure either --- for example we may prognose density or an Exner function, and then pressure would be computed on the fly from those variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clean up 🧹technical debt is real peopledycore 🌀It's only solving Navier-Stokes, what could possibly go wrong?semanticssimultaneously unimportant and most important

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions