Skip to content

High: [Crystallizers] MSMPR concentration balance uses solid density in the liquid transfer term #46

Description

@bernalde

Maintainer triage (June 29, 2026)

  • Status: Verified bug against the current master source in this fork.
  • Severity: High.
  • Area labels: area:crystallizers.
  • Tackle batch: P4 - high-impact numerical/model 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

Independent Codex verification: CONFIRMED

severity_assessment: high
evidence: PharmaPy/MixedPhases.py:232-244 returns slurry densities as [liquid, solid], and PharmaPy/Crystallizers.py:548 passes that as rhos_susp. MSMPR then selects rhos[0][1] at PharmaPy/Crystallizers.py:1809 and uses it in c_tank / rho_sol at PharmaPy/Crystallizers.py:1838, while batch and semibatch use liquid density in the analogous correction.
fix_note: Use rho_liq = rhos[0][0] in the MSMPR concentration transfer correction.

Metadata

Metadata

Assignees

Labels

area:crystallizersCrystallizer models and slurry crystallization behaviorbugSomething isn't workingcorrectnessModel/numerical correctness defectrefactor:mpvOverlaps the MultiPhaseVessel refactor; revalidate after mergeseverity:highConfirmed bug with major correctness impact or broken documented workflowstatus:verifiedSource-reviewed against the current codebase

Type

No type

Projects

Status
No status

Relationships

None yet

Development

No branches or pull requests

Issue actions