Skip to content

sedimentation_speed interface + effective sedimentation for total water#458

Closed
glwagner wants to merge 4 commits into
mainfrom
fall-speed-interface
Closed

sedimentation_speed interface + effective sedimentation for total water#458
glwagner wants to merge 4 commits into
mainfrom
fall-speed-interface

Conversation

@glwagner
Copy link
Copy Markdown
Member

@glwagner glwagner commented Feb 7, 2026

This PR implements a "sedimentation interface" for microphysics schemes to specify the sedimentation speed of hydrometeors. The intent is to produce a system that automatically computes the effective sedimentation speed of aggregate quantities: total liquid fraction $q^l$, total ice fraction $q^i$ (both diagnostic quantities, possibly not stored), and finally total water fraction $q^t$ (which is required to consistently advect total moisture density as well as density).

glwagner and others added 2 commits February 6, 2026 22:16
Rename the primary microphysics sedimentation interface for clarity:
- `fall_speed` → `sedimentation_speed` (per-tracer positive magnitude)
- `model.fall_velocities` → `model.bulk_sedimentation_velocities` (precomputed aggregates)
- Related helpers renamed consistently throughout

Update developer documentation with comprehensive sedimentation speed
section covering notation, interface tables, math, and concrete examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@giordano giordano added the breaking change 💔 Concerning a change which breaks the API label Feb 8, 2026
glwagner and others added 2 commits February 8, 2026 13:10
…ion_velocity

Build aggregate (speed_field, humidity_field) pairs generically from
sedimentation_speed + prognostic_field_names, filtering to mass tracers
(names starting with :ρq). This eliminates a per-scheme interface function
that duplicated information already available from sedimentation_speed.

Also rename _sedimentation_velocity → get_sedimentation_velocity since the
_ prefix is reserved for @kernel functions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@giordano
Copy link
Copy Markdown
Member

giordano commented Feb 8, 2026

Docs build fails: https://github.com/NumericalEarth/Breeze.jl/actions/runs/21804612301/job/62905752336?pr=458#step:7:39

ERROR: LoadError: LoadError: DomainError with -14.409214019974407:
Exponentiation yielding a complex result requires a complex argument.
Replace x^y with (x+0im)^y, Complex(x)^y, or similar.
in expression starting at /__w/Breeze.jl/Breeze.jl/docs/src/literated/cloudy_thermal_bubble.md:34

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2026

@glwagner
Copy link
Copy Markdown
Member Author

glwagner commented Feb 9, 2026

looking into it

@glwagner
Copy link
Copy Markdown
Member Author

glwagner commented Feb 9, 2026

Still digesting this, but here is a summary of one reason for the instability:

Root cause: The fall-speed-interface branch introduced a bulk sedimentation velocity for ρqᵗ (total water), computed as wᵗ = -Σ(wᵢ qᵢ)/qᵗ. This is physically correct (derived by summing individual species equations), but numerically unstable because WENO reconstruction of ρ wᵗ qᵗ produces a different discrete flux than WENO reconstruction of ρ wᵢ qᵢ for the individual species. This discrete inconsistency causes qᵗ < qʳ over time, leading to negative vapor, negative temperature, and the DomainError in saturation_vapor_pressure.

In other words. In order to consistently include this advection term in multiple equations, it has to be computed in exactly the same way. We can't use WENO to compute the moisture density flux and rain flux separately, because the advection fluxes are numerically different.

This is serious difficulty in prognosing total water. I'd like to think about it a bit more. cc @kaiyuan-cheng

This difficulty also must be addressed if we wanted to include the hydrometeor fluxes in the density equation, or the energy equation (when using static or total energy).

@glwagner
Copy link
Copy Markdown
Member Author

superceded by #614

@glwagner glwagner closed this Apr 10, 2026
@glwagner glwagner deleted the fall-speed-interface branch April 10, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change 💔 Concerning a change which breaks the API DO NOT MERGE ⚠️ DON'T EVEN THINK ABOUT IT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants