Skip to content

High: [Crystallizers] Mass-fraction conversion is dead code in Batch/Semibatch crystal balances #47

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/Crystallizers.py:1515-1520 builds dliq_dt with np.append(dcomp_dt, dvol_liq) before scaling dcomp_dt for basis == mass_frac; np.append has already copied the unscaled values. The same detached-copy pattern appears at PharmaPy/Crystallizers.py:2154-2159.
fix_note: Apply the mass_frac conversion before constructing dliq_dt.

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