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
Several mixed-phase volume calculations use raw moments[3] as solid volume fraction/volume instead of kv * moments[3].
Evidence
Slurry.Phases moments branch uses vol_liq = self.vol * (1 - self.moments[3]) at PharmaPy/MixedPhases.py:113-120.
Cake.Phases uses self.cake_vol = self.Solid_1.moments[3] / (1 - self.porosity) at PharmaPy/MixedPhases.py:566-568.
- Other code treats solid volume as
mom_three * self.Solid_1.kv, e.g. Slurry.getFractions at PharmaPy/MixedPhases.py:268-277.
Impact
For non-unit crystal shape factors, slurry liquid volume, cake volume, cake height, deliquoring, washing, and drying geometry can be systematically wrong.
Likely fix
Use self.Solid_1.kv * moments[3] wherever moment 3 is converted to physical solid volume.
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
Several mixed-phase volume calculations use raw
moments[3]as solid volume fraction/volume instead ofkv * moments[3].Evidence
Slurry.Phasesmoments branch usesvol_liq = self.vol * (1 - self.moments[3])atPharmaPy/MixedPhases.py:113-120.Cake.Phasesusesself.cake_vol = self.Solid_1.moments[3] / (1 - self.porosity)atPharmaPy/MixedPhases.py:566-568.mom_three * self.Solid_1.kv, e.g.Slurry.getFractionsatPharmaPy/MixedPhases.py:268-277.Impact
For non-unit crystal shape factors, slurry liquid volume, cake volume, cake height, deliquoring, washing, and drying geometry can be systematically wrong.
Likely fix
Use
self.Solid_1.kv * moments[3]wherever moment 3 is converted to physical solid volume.