Goal (scoping issue)
Extend the crystallization models with additional particulate phenomena and discretization options. This issue scopes candidate extensions and where they hook in; each accepted item becomes its own design/implementation issue.
Existing structure to build on
- Class hierarchy:
_BaseCryst (Crystallizers.py:55-1259) → BatchCryst (:1261-1679), MSMPR (:1681-2058) → SemibatchCryst (:2060-2226).
- Population-balance solvers: method of moments
method_of_moments() (:441-470) and 1-D finite-volume fvm_method() with Van Leer limiter (:472-529); RHS dispatched from unit_model() (:531).
- Kinetics:
CrystKinetics (Kinetics.py:617-978) with primary/secondary nucleation, growth, dissolution, and a custom_mechanisms dict for user-defined laws.
Currently implemented
Nucleation (primary + secondary), growth, dissolution, impurity growth-inhibition (alpha_fn), heat effects, MoM and 1-D FVM, sensitivity analysis, state events.
Candidate extensions (each → its own issue)
- Agglomeration — add a collision/aggregation kernel as a source term in the PBE RHS (
fvm_method); new kinetics parameters. (highest value / moderate effort)
- Breakage / attrition — size-dependent breakage rate + daughter distribution in the PBE RHS; relevant to fines and secondary nucleation.
- Polymorphism / multi-form — track multiple CSDs with form-specific solubility and inter-form transformation rates;
PolymorphicCrystKinetics.
- 2-D population balance — bivariate
f(L, W, t) for shape/aspect-ratio evolution; anisotropic growth; 2-D FVM.
- Additional flux limiters / higher-order schemes — Superbee, MUSCL beyond the current Van Leer.
- Generalized steady-state MSMPR solver — make
solve_steady_state robust for multi-component/numerical cases (current TODOs note limitations).
Notes / code-quality observations (track alongside #12)
_BaseCryst is large (~1200 lines); energy_balances is duplicated across the three subclasses (:1524, 1849, 2163) with magic enthalpy constants (dh_cryst = -1.46e4) that should come from the compound DB.
- Analytical Jacobian exists only for
BatchCryst (:1317-1489).
Deliverables
Depends conceptually on a working test/CI baseline (#3 theme A).
Upstream PR
Wave 4 — propose before building. Get maintainer buy-in upstream on which phenomena to prioritize before implementing; one phenomenon per PR. See #3.
Goal (scoping issue)
Extend the crystallization models with additional particulate phenomena and discretization options. This issue scopes candidate extensions and where they hook in; each accepted item becomes its own design/implementation issue.
Existing structure to build on
_BaseCryst(Crystallizers.py:55-1259) →BatchCryst(:1261-1679),MSMPR(:1681-2058) →SemibatchCryst(:2060-2226).method_of_moments()(:441-470) and 1-D finite-volumefvm_method()with Van Leer limiter (:472-529); RHS dispatched fromunit_model()(:531).CrystKinetics(Kinetics.py:617-978) with primary/secondary nucleation, growth, dissolution, and acustom_mechanismsdict for user-defined laws.Currently implemented
Nucleation (primary + secondary), growth, dissolution, impurity growth-inhibition (
alpha_fn), heat effects, MoM and 1-D FVM, sensitivity analysis, state events.Candidate extensions (each → its own issue)
fvm_method); new kinetics parameters. (highest value / moderate effort)PolymorphicCrystKinetics.f(L, W, t)for shape/aspect-ratio evolution; anisotropic growth; 2-D FVM.solve_steady_staterobust for multi-component/numerical cases (current TODOs note limitations).Notes / code-quality observations (track alongside #12)
_BaseCrystis large (~1200 lines);energy_balancesis duplicated across the three subclasses (:1524, 1849, 2163) with magic enthalpy constants (dh_cryst = -1.46e4) that should come from the compound DB.BatchCryst(:1317-1489).Deliverables
Depends conceptually on a working test/CI baseline (#3 theme A).
Upstream PR
Wave 4 — propose before building. Get maintainer buy-in upstream on which phenomena to prioritize before implementing; one phenomenon per PR. See #3.