ADR 0004: State is N_k on a flattened multi-property index
- Status: Accepted (2026-11-10)
- Date: 2026-11-10
- Deciders: Vincent Mader
- Related: Dullemond notes section 1.3.1; M9
Context
The Smoluchowski equation is solved for N_k (particles per volume per bin) in both the thesis and coag_py. The p = 2 study (mass and filling factor) needs the same numerics on a 2D grid; Dullemond’s notes propose flattening (i, ε) into one index.
Decision
The solver state is a contiguous Vec<f64> of N over a ParticleGrid, which owns one Axis per property and maps between a flat index and the multi-index (row-major, mass fastest-varying is decided in M1 by benchmark). Kernels, estimators, integrators, and diagnostics only see flat indices; physics crates use multi-indices and per-property values. Moments (number, mass, second property) are computed by the grid.
Alternatives considered
- Separate code paths for 1D and 2D: duplicates numerics and makes the comparison unfair.
- State n(m) (density per unit mass): needs Δm factors everywhere; N_k is what the discrete kernel acts on.
- Mass densities ρ_k as state: natural for plots, but the kernel is bilinear in N; we scale to mass fractions only inside the integrator (ADR 0003).
Consequences
- p = 1 and p = 2 share all numerics and tests.
- Index arithmetic is centralized and tested.
- Recipes for p = 2 need a 2D Kovetz and Olund mapping (bilinear), designed in M9.