Skip to content

fix(P3): use per-regime material density in the ice aspect-ratio closure#740

Closed
haakon-e wants to merge 1 commit into
he/rosenbrock-modesfrom
he/p3-aspect-ratio-fix
Closed

fix(P3): use per-regime material density in the ice aspect-ratio closure#740
haakon-e wants to merge 1 commit into
he/rosenbrock-modesfrom
he/p3-aspect-ratio-fix

Conversation

@haakon-e

@haakon-e haakon-e commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

The oblate aspect ratio ϕ = c/a = 3√π·m/(4·ρ·A^{3/2}) was evaluated with the size-dependent effective density ρ = m/V_sphere(D) instead of the particle's material density. With the effective density the particle mass cancels, ϕ comes out prolate (>1) for every nonspherical size, and the min(1, ϕ) clamp then pinned ϕ ≡ 1 everywhere — disabling the cbrt(ϕ) aspect-ratio fall-speed correction entirely. Use the per-regime material density and drop the clamp.

What changed (src/P3_particle_properties.jl, docs, tests)

  • New ϕ_material_density(state, D): returns ρ_i in the small-spherical, dense-nonspherical, and partially-rimed regimes, and ρ_g in the graupel regime (D_gr ≤ D < D_cr).
  • ϕᵢ now divides by ϕ_material_density(state, D) and no longer clamps; the docstring keeps the one-line formula and links to the docs.
  • ice_density docstring: removed the stale "Needed for aspect ratio calculation, so we assume zero liquid fraction" clause (ϕᵢ no longer calls it).

Mechanism / why

ϕ = 3√π·m/(4·ρ·A^{3/2}) compares the particle's mass-to-area shape factor against the density of the solid material it is made of. Substituting the effective density m/V_sphere(D) replaces ρ with a quantity that itself carries the mass, cancelling m and collapsing the closure to a near-constant ≈ 1; the min(1, ⋅) clamp then masked the residual >1 excursions, so ϕ ≡ 1 and cbrt(ϕ) ≡ 1. Within each P3 mass regime the material density is constant, so ϕ tracks m/A^{3/2}: spherical in the spherical regimes (ϕ = 1), oblate (ϕ < 1) in the dense-nonspherical regime.

Residual ϕ > 1 band just above D_th (why no clamp)

ϕ slightly exceeds 1 (peak ≈ 1.2) in a narrow band immediately above D_th. The projected area is discontinuous at D_th (it drops from the spherical law (π/4)D² to the nonspherical law γ·D^σ, ≈ 0.88× smaller) while the mass stays continuous, so m/A^{3/2} is inflated just past the threshold. cbrt(ϕ) stays finite and bounded there (cbrt(1.2) ≈ 1.06), so a clamp is unnecessary and would re-introduce the ϕ ≡ 1 pathology in that band. Reconciling the mass and area laws at D_th (so the area is continuous too) is a separate P3 area power-law item, deliberately left as a follow-on.

Validation

  • Effect: large unrimed ice fall speeds drop by up to ~4× — the intended oblate correction. Mass-weighted velocities drop most (mass weighting emphasises the large nonspherical sizes where ϕ is smallest).

Caveats / follow-on

  • The residual ϕ > 1 band above D_th remains (follow-on: reconcile the area law).

@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 2e70e53 to b6ab68d Compare June 23, 2026 00:32
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 69f01fa to abdbd39 Compare June 23, 2026 00:32
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from b6ab68d to 4f2ec41 Compare June 23, 2026 21:32
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from abdbd39 to 7f9b793 Compare June 23, 2026 21:32
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 4f2ec41 to c84af4b Compare June 23, 2026 22:26
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 7f9b793 to 3aa2995 Compare June 23, 2026 22:26
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from c84af4b to 6003aae Compare June 24, 2026 21:56
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 3aa2995 to 22a3865 Compare June 24, 2026 21:56
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.27%. Comparing base (090fd49) to head (c8b0dba).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           he/rosenbrock-modes     #740      +/-   ##
=======================================================
+ Coverage                93.21%   93.27%   +0.05%     
=======================================================
  Files                       57       57              
  Lines                     3185     3197      +12     
=======================================================
+ Hits                      2969     2982      +13     
+ Misses                     216      215       -1     
Components Coverage Δ
src 94.00% <100.00%> (+0.05%) ⬆️
ext 69.47% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 6003aae to 4604d1d Compare June 25, 2026 18:01
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 22a3865 to f42aeb2 Compare June 25, 2026 18:01
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 4604d1d to 19fdeab Compare June 26, 2026 00:38
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from f42aeb2 to b4b9090 Compare June 26, 2026 00:38
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 19fdeab to 40ca910 Compare June 26, 2026 01:22
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from b4b9090 to aeb57d4 Compare June 26, 2026 01:22
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 40ca910 to b2dbb8c Compare June 26, 2026 01:31
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from aeb57d4 to 93c9f4a Compare June 26, 2026 01:31
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from b2dbb8c to 98ea608 Compare July 1, 2026 05:34
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 93c9f4a to 22beeec Compare July 1, 2026 05:35
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 98ea608 to 3a09afe Compare July 1, 2026 05:46
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 22beeec to bd052f1 Compare July 1, 2026 05:46
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 3a09afe to 33b6a35 Compare July 1, 2026 06:24
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from bd052f1 to 0f061bb Compare July 1, 2026 06:24
The oblate aspect ratio ϕ = c/a = 3√π·m/(4·ρ·A^{3/2}) was evaluated with the
size-dependent effective density ρ = m/V_sphere(D) instead of the particle's
material density. The mass then cancels, ϕ becomes prolate (>1) for every
nonspherical size, and the min(1,ϕ) clamp pinned ϕ≡1 everywhere — disabling the
cbrt(ϕ) aspect-ratio fall-speed correction.

Use the per-regime material density: ρ_i in the small-spherical, dense-
nonspherical and partially-rimed regimes, ρ_g in the graupel regime (where the
spherical mass law makes m/V_sphere ≡ ρ_g, so ϕ=1 is recovered). The min(1,ϕ)
clamp is removed; cbrt(ϕ) is finite without it. A residual ϕ>1 band (peak ≈ 1.2,
~97–120 µm) remains from the projected-area discontinuity at D_th — documented as
a follow-on.

Effect: large unrimed ice fall speeds drop by up to ~4×, the intended oblate
correction. Tests asserting ϕ≈1 at nonspherical D (which codified the bug) and
the velocity reference snapshots are updated to the corrected per-regime values;
a residual-band assertion pins 1 < ϕ(D_th·1.001) < 1.3.

The spheroid derivation, the material-density distinction, and the residual-band
explanation are moved to the P3 documentation (Mathematical Formulation); the
docstrings keep the one-line formula and a link. The order-50 quadrature sweep
stays within the existing 5e-3 tolerance (max rel ≈ 2.6e-3), so that tolerance
is unchanged.
@haakon-e
haakon-e force-pushed the he/rosenbrock-modes branch from 33b6a35 to 090fd49 Compare July 1, 2026 15:01
@haakon-e
haakon-e force-pushed the he/p3-aspect-ratio-fix branch from 0f061bb to c8b0dba Compare July 1, 2026 15:01
@haakon-e

haakon-e commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Folded into #741

@haakon-e haakon-e closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant