Add sedimentation latent heat tendency ρe and ρθ for 1M and 2M#591
Add sedimentation latent heat tendency ρe and ρθ for 1M and 2M#591kaiyuan-cheng wants to merge 15 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds precipitation-sedimentation latent heat flux divergence tendencies so that falling hydrometeors can modulate thermodynamic prognostics (ρe and ρθ), addressing missing sedimentation impact on liquid-ice potential temperature (issue #364).
Changes:
- Implemented a 1st-order upwind latent-heat sedimentation flux and its vertical divergence as
grid_microphysical_tendencyforVal(:ρe)andVal(:ρθ). - Applied the new tendencies to both 1M (rain; optional snow path) and 2M (cloud liquid + rain) schemes.
- Added required operator/thermodynamics imports for flux-divergence computation and Exner scaling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| ext/BreezeCloudMicrophysicsExt/two_moment_microphysics.jl | Adds sedimentation latent-heat flux divergence tendencies for 2M thermodynamics (ρe, ρθ). |
| ext/BreezeCloudMicrophysicsExt/one_moment_microphysics.jl | Adds sedimentation latent-heat flux divergence tendencies for 1M thermodynamics (ρe, ρθ). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Is this correct? shouldn't this manifest as an advection term, dz(\rho w^r \theta^li)? I don't think its correct that the latent heat appears. |
|
The latent heat term should be correct here. The term dz(\rho w^r \theta^li) would mean rain advects the whole θ_li (including the contribution from other hydrometeors). |
Yes, and this is correct right? |
|
My thought is that it would be somewhat similar to the equation for moist entropy (eq 3.5) here: https://journals.ametsoc.org/view/journals/atsc/58/15/1520-0469_2001_058_2073_adatff_2.0.co_2.xml. However I can't find a reference for what equation liquid-ice potential temperature obeys in the presence of precipitation. @kaiyuan-cheng can you indicate what principle you are using to derive the conservation equation for \theta_li? |
|
@glwagner Here is what I think. The idea is to diagnose `θˡⁱ given the change in hydrometeor. Start from the diagnostic definition of θ_li at constant T:
Differentiate it by applying the chain rule, and setting dT = 0 (assuming sedimentation moves liquid water mass without exchanging sensible heat with the air), we get
|
Do you mean In fact, this non-conservation motivates the definition of Actually Note that Tripoli and Cotton take care to mention that Still trying to understand this, but I know that in other models precipitating species may be "removed" from the working fluid. In that case provided the energetics are accurate when precipitation is formed, we don't have to worry about where the rain goes afterwards. |
By |
|
I think the rain does transport temperature? Also dT is not zero because of adiabatic pressure effects. |
Strictly speaking, yes. It does transport temperature. However, I would argue that dT is negligible, given that the hydrometeor mass fraction is small and that the effect of sensible heat is much smaller than its latent heat effect. The primary goal of this PR is to account for the impact of mass exchange on |
|
On second thought, I think we should consider adiabatic pressure effects in the sensible exchange. Let me revise the code. |
|
See equation 18 here: https://rams.atmos.colostate.edu/cotton/vita/22.pdf |
glwagner
left a comment
There was a problem hiding this comment.
I think we should consider using the specified advection scheme for sedimentation
|
Sure, for consistency, we should use the same scheme as the mass flux. I’m not sure what the cleanest implementation would be. |
I believe you need to compute the effective total velocity for each component. This is already done for Breeze.jl/src/AtmosphereModels/dynamics_kernel_functions.jl Lines 131 to 142 in dacd7e7 We may need to have the sedimentation velocity interface we explored a while ago: that PR is now stale, but I believe we can use its essential ideas. The key now is that we "only" need extra terms for the thermodynamic variable. We no longer need extra terms for total water. Note, another change we have not yet made is to prognose dry density rather than total density (to avoid the need for sedimentation terms). |
…de by local cᵖᵐΠ for ρθ Two physics/numerics fixes to the sedimentation tendency for thermodynamic variables: 1. The ρθ formulation previously put 1/(cᵖᵐ Π) inside the flux divergence (evaluated at the upwind cell). The correct form computes the enthalpy flux divergence (same as ρe) then divides by LOCAL cᵖᵐ Π. This eliminates a systematic O(Δz) bias and makes ρθ and ρe formulations physically consistent. 2. Sedimentation mass reconstruction now uses Oceananigans' configured advection scheme (_advective_tracer_flux_z) instead of manual 1st-order upwinding, matching the scheme used for mass transport of ρqʳ/ρqᶜˡ. Removes the Θˡ/Θⁱ diagnostic fields and sedimentation_theta_flux_z functions (no longer needed). Adds advection parameter to grid_microphysical_tendency interface so sedimentation fluxes can use the configured scheme. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Both one_moment and two_moment files defined sedimentation_mass_flux_z with 9 untyped arguments, causing a precompilation error. Renamed the two-moment version to two_moment_sedimentation_mass_flux_z. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Good catch! Thanks! |
|
should we tackle #458 first before merging this PR? |
|
Does it mean that this PR's code has to be refactored in the future? |
This PR addresses an issue where sedimentation was unable to modulate the liquid-ice potential temperature. We are encountering the same challenge previously discussed regarding the advection of total water and moist density: no consistent way to advect moisture-coupled thermodynamic quantities alongside falling hydrometeors.
To at least address the missing influence of sedimentation on the liquid-ice potential temperature, we implemented a 1st-order upwind scheme to compute the energy flux due to sedimentation. We recognize that this approach is not fully consistent with the mass flux.
close #364 and supersede #383