Maintainer triage (June 29, 2026)
- Status: Verified bug against the current
master source in this fork.
- Severity: High.
- Area labels: area:phases.
- Tackle batch: P2 - shared thermo, phase, and basis correctness.
The source review confirmed that the cited code path and failure mode are still present. The original audit details are preserved below for reproduction notes and suggested fixes.
Original audit details
Finding
SolidPhase.updatePhase(distrib=...) recomputes volume and mass from moments[3] without the solid shape factor kv, unlike the constructor.
Evidence
- Constructor:
self.vol = self.moments[3] * kv at PharmaPy/Phases.py:916-919.
- Update path:
self.vol = self.moments[3] and self.mass = self.moments[3] * self.getDensity() at PharmaPy/Phases.py:947-958.
Impact
Any distribution update for non-unit kv misstates crystal volume and mass, which propagates into slurry/cake balances and solid stream outputs.
Likely fix
Apply self.kv consistently: self.vol = self.moments[3] * self.kv and self.mass = self.vol * self.getDensity().
Maintainer triage (June 29, 2026)
mastersource in this fork.The source review confirmed that the cited code path and failure mode are still present. The original audit details are preserved below for reproduction notes and suggested fixes.
Original audit details
Finding
SolidPhase.updatePhase(distrib=...)recomputes volume and mass frommoments[3]without the solid shape factorkv, unlike the constructor.Evidence
self.vol = self.moments[3] * kvatPharmaPy/Phases.py:916-919.self.vol = self.moments[3]andself.mass = self.moments[3] * self.getDensity()atPharmaPy/Phases.py:947-958.Impact
Any distribution update for non-unit
kvmisstates crystal volume and mass, which propagates into slurry/cake balances and solid stream outputs.Likely fix
Apply
self.kvconsistently:self.vol = self.moments[3] * self.kvandself.mass = self.vol * self.getDensity().