ClimaAtmos.jl icon indicating copy to clipboard operation
ClimaAtmos.jl copied to clipboard

Fix kinetic energy conservation with topography

Open dennisYatunin opened this issue 10 months ago • 1 comments

Purpose

This PR introduces some changes that should allow us to conserve kinetic energy in the presence of topography.

To-do

  • Add a test for exact conservation of kinetic energy in the presence of topography.
    • Update the relevant Jacobian terms for the test.

Content

  • Replace ᶠwinterp(ᶜJ, ᶜρ) in the vertical transport equation with ᶠinterp(ᶜJ * ᶜρ) / ᶠJ, since ᶠdiv internally multiplies its argument by ᶠJ.
  • Replace dot(uₕ, CTh(uₕ)) + 2 * dot(ᶜinterp(uᵥ), CT3(uₕ)) in the kinetic energy equation with dot(uₕ, CTh(uₕ) + CTh(ᶜinterp(uᵥ))) + dot(ᶜinterp(uᵥ), CT3(uₕ)), which makes it so that ∫ ᶜρₜ * ᶜK * dz = -∫ ᶜρ * ᶜKₜ * dz.
  • Update the relevant Jacobian terms.

  • [ ] I have read and checked the items on the review checklist.

dennisYatunin avatar Apr 25 '24 22:04 dennisYatunin

Thanks @dennisYatunin; I can test this against the dss update branch as well.

akshaysridhar avatar Apr 29 '24 20:04 akshaysridhar