Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aggregation and breakage to crystallization module #241

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c4cb521
Add part II paper to citing section
jbreue16 Nov 20, 2024
1c62d6b
Change to aggregation code as starting point
jbreue16 Dec 16, 2024
be95fdc
Fix the handling of short int
jbreue16 Dec 16, 2024
dd5ed37
Add fragmentation part
jbreue16 Dec 17, 2024
08b565c
Fix code format and add CrystallizationMode flags
jbreue16 Dec 17, 2024
74d3461
Add PBM
jbreue16 Dec 17, 2024
0c8b37c
wip source out PBM kernels
jbreue16 Dec 18, 2024
84f01e9
Remove unnecessary StateParam type
jbreue16 Dec 18, 2024
ee66001
wip
jbreue16 Dec 19, 2024
4155386
wip
jbreue16 Dec 19, 2024
b88b5ee
Fix utf-8 character
jbreue16 Dec 19, 2024
d6d0f89
Change encoding to utf-8
jbreue16 Dec 19, 2024
a1995e7
Fix error checking for nBin
jbreue16 Dec 19, 2024
1d6bfd9
Move crystallization mode configuration to configureModelDiscretization
jbreue16 Dec 19, 2024
d8a0c43
Fix nBin check
jbreue16 Dec 19, 2024
fa2079a
Fix bin coords
jbreue16 Dec 23, 2024
f2e95e0
Move growth reconstruction to same Kernel
jbreue16 Dec 23, 2024
a290864
Residual: Move PBM, aggregation and fragmentation to the same loop
jbreue16 Dec 24, 2024
92bf32b
Jacobian: Move PBM, aggregation an fragmentation to same loop
jbreue16 Dec 24, 2024
42a68d7
Add `CRYSTALLIZATION_MODE` field to test data
jbreue16 Dec 25, 2024
f3eda0c
Move configuration of crys_mode to configure() function
jbreue16 Jan 21, 2025
c48d1bb
Fix name of input field `CRY_FRAGMENTATION_SELECTION_FUNCTION_ALPHA`
jbreue16 Jan 21, 2025
9de400e
Add exceptions for wrong crystallization mode
jbreue16 Jan 21, 2025
2d68ec0
wip improve modularization
jbreue16 Jan 21, 2025
3b38b52
wip
jbreue16 Jan 22, 2025
e670722
Add template to reconstruction structs
jbreue16 Jan 22, 2025
dfe87c0
Add template view for reconstruction parameter structs
jbreue16 Jan 22, 2025
7d01269
delete unnecessary type casts
jbreue16 Jan 22, 2025
dd2129d
Change crystallization mode flag enum to bitmap
jbreue16 Jan 22, 2025
60ec59c
Move reconstruction update call to PBM scope
jbreue16 Jan 22, 2025
3fdbbaa
Update documentation
jbreue16 Jan 22, 2025
3d733be
fixup!
jbreue16 Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ @article{Breuer2023

% Crystallization:

@article{Zhang2025,
title = {Solving crystallization/precipitation population balance models in CADET, Part II: Size-based Smoluchowski coagulation and fragmentation equations in batch and continuous modes},
year = {2025},
author = {Wendi Zhang and Todd Przybycien and Jan Michael Breuer and Eric {von Lieres}},
doi = {https://doi.org/10.1016/j.compchemeng.2024.108860},
journal = {Computers & Chemical Engineering},
volume = {192},
pages = {108860},
issn = {0098-1354}
}

@article{Zhang2024,
title = {Solving crystallization/precipitation population balance models in CADET, part I: Nucleation growth and growth rate dispersion in batch and continuous modes on nonuniform grids},
year = {2024},
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Therefore, we kindly ask that any publications or projects leveraging the capabi

- Breuer, J. M.; Leweke, S.; Schmölder, J.; Gassner, G.; von Lieres, E.: `Spatial discontinuous Galerkin spectral element method for a family of chromatography models in CADET <https://doi.org/10.1016/j.compchemeng.2023.108340>`_, Computers and Chemical Engineering **177** (2023), 108340.

- Zhang, W.; Przybycien T., Breuer J. M. , Leweke S. , von Lieres E.: `Solving crystallization/precipitation population balance models in CADET, part II: Size-based Smoluchowski coagulation and fragmentation equations in batch and continuous modes <https://doi.org/10.1016/j.compchemeng.2024.108860>`_, Computers and Chemical Engineering **192** (2025), 108860.

- Zhang, W.; Przybycien T., Schmölder J. , Leweke S. , von Lieres E.: `Solving crystallization/precipitation population balance models in CADET, part I: Nucleation growth and growth rate dispersion in batch and continuous modes on nonuniform grids <https://doi.org/10.1016/j.compchemeng.2024.108612>`_, Computers and Chemical Engineering **183** (2024), 108612.

- Püttmann, A.; Schnittert, S.; Naumann, U.; von Lieres, E.: `Fast and accurate parameter sensitivities for the general rate model of column liquid chromatography <http://dx.doi.org/10.1016/j.compchemeng.2013.04.021>`_, Computers and Chemical Engineering **56** (2013), 46–57.
Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Therefore, we kindly ask that any publications or projects leveraging the capabi

- Breuer, J. M.; Leweke, S.; Schmölder, J.; Gassner, G.; von Lieres, E.: `Spatial discontinuous Galerkin spectral element method for a family of chromatography models in CADET <https://doi.org/10.1016/j.compchemeng.2023.108340>`_, Computers and Chemical Engineering **177** (2023), 108340.

- Zhang, W.; Przybycien T., Breuer J. M. , Leweke S. , von Lieres E.: `Solving crystallization/precipitation population balance models in CADET, part II: Size-based Smoluchowski coagulation and fragmentation equations in batch and continuous modes <https://doi.org/10.1016/j.compchemeng.2024.108860>`_, Computers and Chemical Engineering **192** (2025), 108860.

- Zhang, W.; Przybycien T., Schmölder J. , Leweke S. , von Lieres E.: `Solving crystallization/precipitation population balance models in CADET, part I: Nucleation growth and growth rate dispersion in batch and continuous modes on nonuniform grids <https://doi.org/10.1016/j.compchemeng.2024.108612>`_, Computers and Chemical Engineering 183 (2024), 108612.

- Püttmann, A.; Schnittert, S.; Naumann, U.; von Lieres, E.: `Fast and accurate parameter sensitivities for the general rate model of column liquid chromatography <http://dx.doi.org/10.1016/j.compchemeng.2013.04.021>`_, Computers and Chemical Engineering **56** (2013), 46–57.
Expand Down
70 changes: 60 additions & 10 deletions doc/interface/population_balance_model.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
.. _pbm_config:

Population balance model
========================
Crystallization / Precipitation models
======================================

The PBM in CADET is implemented as part of the reaction module and can thus be used in any unit operation that includes reactions.
Typical applications consider crystallization in a :ref:`cstr_config` or, to model continuous processes, in a Dispersive Plug-Flow Reactor (DPFR), which is modelled by a :ref:`lumped_rate_model_without_pores_config`.
Crystallization / Precipitation in CADET is modeled by :ref:`pbm_model`, :ref:`aggregation_model`, :ref:`fragmentation_model`, as well as their combinations.
The configurations of these models have many overlaps, which is why the interface is described here in a unified manner.
For more information on the model equations, please refer to :ref:`FFCrystallization`.

The particle size domain (internal coordinate) is discretized by the FV method, giving us a finite set of particle sizes under consideration :math:`\{x_1, \dots, x_{N_x}\}`.
Every particle size considered is treated as an individual component of the unit operation and the field ``NCOMP`` of that unit operation in which the crystallization happens, must be specified accordingly as :math:`N_x + 2`.
The two additional components account for the solute :math:`c` and solubility :math:`c_\text{eq}`.
*That is, by setting the ``NCOMP`` field, you specify the number of FV cells for the internal coordinate.*
Note that any of these models can be used in any unit operation that supports reactions.

*Note that, by setting the ``NCOMP`` field, you specify the number of FV cells for the internal coordinate:*
If the PBM is considered, we have two components that account for the solute :math:`c` and solubility :math:`c_\text{eq}`.
Note that the first component must be solute :math:`c` and the last component must be the solubility :math:`c_\text{eq}`.
Additionally, we discretize the particle size domain (internal coordinate) by some customary FV methods, giving us a finite set of particle sizes under consideration :math:`\{x_1, \dots, x_{N_x}\}`.
Every particle size considered is treated as an individual component of the unit operation and the field ``NCOMP`` of that unit operation in which the crystallization happens, must be specified accordingly as :math:`N_x` or :math:`N_x + 2` if the model includes the PBM.

Example code to configure the PBM can be found in `CADET-Verification <https://github.com/cadet/CADET-Verification/blob/main/src/test_cadet_core/crystallization.py>`_ .

Example code to configure the PBM can be found in `CADET-Verification <https://github.com/cadet/CADET-Verification/>`_ .

Group /input/model/unit_XXX
---------------------------

``NCOMP``

Number of components, which is given by two plus the number discrete particle sizes, which is given by the number of FV cells discretizing the internal coordinate
Number of components, which is defined by the number of considered particle sizes (i.e. discretization with FV cells) plus, in the case that the PBM is employed, 2 (for solute and solubility).

============= ========================= =============
**Type:** int **Range:** :math:`\geq 3` **Length:** 1
Expand All @@ -38,6 +41,22 @@ Group /input/model/unit_XXX/reaction_bulk - REACTION_MODEL = CRYSTALLIZATION - U
-----------------------------------------------------------------------------------------------

*The following parameters need to be specified under Group /input/model/unit_XXX/reaction/reaction_bulk/ for CSTR units, and Group /input/model/unit_XXX/reaction/reaction/ for transport units like the LRM.*

``CRY_MODE``

Crystallization mode, which determines the exact model equation to be employed.

1. Pure PBM, as described in :ref:`pbm_model`.
2. Pure aggregation, as described in
3. Combined PBM and aggregation.
4. Pure fragmentation, as described in
5. Combined PBM and fragmentation.
6. Combined aggregation and fragmentation.
7. Combined PBM, aggregation, and fragmentation.

================ ========================= =====================================
**Type:** double **Range:** :math:`\geq 1` **Length:** :math:`\mathrm{N_x} + 1`
================ ========================= =====================================

``CRY_BINS``

Expand All @@ -47,6 +66,9 @@ Group /input/model/unit_XXX/reaction_bulk - REACTION_MODEL = CRYSTALLIZATION - U
**Type:** double **Range:** :math:`\geq 1` **Length:** :math:`\mathrm{N_x} + 1`
================ ========================= =====================================

Population Mass Balance input parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``CRY_NUCLEI_MASS_DENSITY``

Nulcei mass density
Expand Down Expand Up @@ -159,3 +181,31 @@ Group /input/model/unit_XXX/reaction_bulk - REACTION_MODEL = CRYSTALLIZATION - U
============= ================================ =============
**Type:** int **Range:** :math:`[1, \dots, 4]` **Length:** 1
============= ================================ =============

Aggregation input parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``CRY_AGGREGATION_RATE_CONSTANT``

Aggregation rate constant :math:`todo`

================ ========================= =============
**Type:** double **Range:** :math:`\geq 0` **Length:** 1
================ ========================= =============

todo: cry_aggregation_index

Fragmentation input parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``CRY_FRAGMENTATION_RATE_CONSTANT``

Fragmentation rate constant :math:`todo`

================ ========================= =============
**Type:** double **Range:** :math:`\geq 0` **Length:** 1
================ ========================= =============

todo: cry_fragmentation_kernel_gamma

todo: cry_fragmentation_selection_function_alpha
10 changes: 10 additions & 0 deletions doc/modelling/crystallization/aggregation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _aggregation_model:

Aggregation Models
~~~~~~~~~~~~~~~~~~

TODO:
^^^^^
- [ ] add equations
- [ ] combination with the PBM and fragmentation modules
- [ ] incorporation into CSTR, DPFR and, theoretically, any transport model
10 changes: 10 additions & 0 deletions doc/modelling/crystallization/fragmentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _fragmentation_model:

Fragmentation Models
~~~~~~~~~~~~~~~~~~~~

TODO:
^^^^^
- [ ] add equations
- [ ] combination with the PBM and aggregation modules
- [ ] incorporation into CSTR, DPFR and, theoretically, any transport model
14 changes: 14 additions & 0 deletions doc/modelling/crystallization/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _FFCrystallization:

Crystallization / Precipitation Models
======================================

CADET features various crystallization / precipitation mechanisms:

- :ref:`pbm_model`
- :ref:`aggregation_model`
- :ref:`fragmentation_model`

Additionally, any combination of these models is featured.
Any of these crystallization \ precipitation models can be combined with any of the transport models listed among the :ref:`unit_operation_models`.
To this end, most common use-cases consider a :ref:`cstr_model` or a dispersive plug-flow reactor (which can be modeled with the :ref:`lumped_rate_model_without_pores_model`).
2 changes: 1 addition & 1 deletion doc/modelling/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ This section gives complete information about the supported unit operations, bin
binding/index
reaction/index
networks
crystallization
crystallization/index
Loading
Loading