Skip to content

Commit

Permalink
Change CSTR model for variable porosity
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreue16 committed Aug 14, 2024
1 parent fd5ddac commit 2b470fb
Show file tree
Hide file tree
Showing 15 changed files with 416 additions and 423 deletions.
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pip install -r requirements.txt
```

Then, in the `doc` folder run:
Then, in the `doc` folder, run:

`sphinx-build -b html . build`

Expand Down
14 changes: 8 additions & 6 deletions doc/interface/unit_operations/cstr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For information on model equations, refer to :ref:`cstr_model`.

``INIT_VOLUME``

Initial tank volume
Initial liquid volume

**Unit:** :math:`\mathrm{m}^{3}`

Expand Down Expand Up @@ -113,13 +113,15 @@ For information on model equations, refer to :ref:`cstr_model`.
**Type:** double **Range:** :math:`\mathbb{R}` **Length:** :math:`\texttt{NDOF} / 2\texttt{NDOF}`
================ ============================= ====================================================

``POROSITY``
``CONST_SOLID_VOLUME``

Porosity :math:`\varepsilon` (defaults to 1)
Volume of solid phase

**Unit:** :math:`\mathrm{m}^{3}` (defaults to 0)

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

``FLOWRATE_FILTER``

Expand Down
18 changes: 18 additions & 0 deletions doc/modelling/equations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. File for the substitution for the declaration in the equations of unit operations.
.. -----------------------------------------------------------components ------------------------------------------------------------------------------------------------------------
.. |component_li| replace:: :math:`c^\ell_i` concentration of component :math:`i` in the liquid phase.
.. |component_sij| replace:: :math:`c^s_{j,i,m_{j,i}}` concentration of component :math:`i` in the solid phase of particle type :math:`j` and particle type :math:`m_{j,i}`.

.. ----------------------------------------------------------- flow ------------------------------------------------------------------------------------------------------------
.. |flow_in_out| replace:: :math:`F_{\text{in}}` and :math:`F_{\text{out}}` flow rates of liquid into and out of the tank.

.. ----------------------------------------------------------- reaction ------------------------------------------------------------------------------------------------------------
.. |reaction| replace:: :math:`f_{\text{react},i}^l\left( c^\ell \right)` and :math:`f_{\text{react},j,i}^s\left( c^\ell, c_j^s \right)` reaction rates of component :math:`i` in the liquid and solid phase.
.. |reaction_ads| replace:: :math:`f_{\text{ads},j}\left( c^\ell, c^s_j\right)` adsorption rate of component :math:`i` in the solid phase of particle type :math:`j` .
.. -----------------------------------------------------------volume_fac ------------------------------------------------------------------------------------------------------------
.. |volume_fac_pat| replace:: :math:`d_j` volume fraction of the different solid volume in the tank.

.. -----------------------------------------------------------volume ------------------------------------------------------------------------------------------------------------
.. |volume_liquid| replace:: :math:`V^{\ell}` liquid volume in the tank.
.. |volume_solid| replace:: :math:`V^{s}` solid volume in the tank.
32 changes: 22 additions & 10 deletions doc/modelling/unit_operations/cstr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,49 @@
Continuous stirred tank reactor model (CSTR)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../equations.rst

The continuous stirred tank reactor model is a basic building block in unit operation networks and often used to model holdup volume.
When combined with a binding model, it can be used to model batch uptake experiments.

Assuming that the fluid inside the tank is well-mixed and that the volume can vary, the governing equations are given by
Assuming that the fluid inside the tank is well-mixed and that the liquid volume :math:`V^{\ell}` can vary, the governing equations are given by

.. math::
\begin{aligned}
\frac{\mathrm{d}}{\mathrm{d}t} \left(\left[ c^\ell_i + \frac{1-\varepsilon}{\varepsilon} \sum_j d_j \sum_{m_{j,i}} c^s_{j,i,m_{j,i}} \right] V\right) &= F_{\text{in}} c^\ell_{\text{in},i} - F_{\text{out}} c^\ell_i + V f_{\text{react},i}^l\left( c^\ell \right) \\
&+ V \frac{1-\varepsilon}{\varepsilon}\sum_j d_j f_{\text{react},j,i}^s\left( c^\ell, c_j^s \right),
\frac{\mathrm{d}}{\mathrm{d}t} (V^{\ell} c^\ell_i) + V^{s} \sum_j d_j \sum_{m_{j,i}}^{N_{\text{bnd},j,i}} \frac{\mathrm{d}}{\mathrm{d}t} (c^s_{j,i,m_{j,i}}) &= F_{\text{in}} c^\ell_{\text{in},i} - F_{\text{out}} c^\ell_i + V^{\ell} f_{\text{react},i}^l\left( c^\ell \right) \\
&+V^{s}\sum_j d_j f_{\text{react},j,i}^s\left( c^\ell, c_j^s \right)
\end{aligned}
where:

- |component_li|
- |component_sij|
- |volume_liquid|
- |volume_solid|
- |flow_in_out|
- |reaction|
- |volume_fac_pat|

which balances the mass, the binding equation
Depending on whether quasi-stationary or dynamic binding is used the binding behavior of :math:`c_i^{\ell}` and :math:`c^s_j` is described by

.. math::
\begin{aligned}
\text{quasi-stationary: }& & 0 &= f_{\text{ads},j}\left( c^\ell, c^s_j\right), \\
\text{dynamic: }& & \frac{\partial c^s_j}{\partial t} &= f_{\text{ads},j}\left( c^\ell, c^s_j\right) + f_{\text{react},j}^s\left( c^\ell, c_j^s \right),
\text{quasi-stationary: }& & 0 &= f_{\text{ads},j}\left( c_i^\ell, c^s_j\right), \\
\text{dynamic: }& & \frac{\partial c^s_j}{\partial t} &= f_{\text{ads},j}\left( c_i^\ell, c^s_j\right) + f_{\text{react},j}^s\left( c_i^\ell, c_j^s \right),
\end{aligned}
depending on whether quasi-stationary or dynamic binding is used, and the evolution of volume
where :math:`f_{\text{ads},j}` is the adsorption rate in the solid phase of particle type :math:`j`.

The evolution of volume of the liquid volume

.. math::
\begin{aligned}
\frac{\mathrm{d}V}{\mathrm{d}t} &= F_{\text{in}} - F_{\text{out}} - F_{\text{filter}}.
\frac{\mathrm{d}V^{\ell}}{\mathrm{d}t}= F_{\text{in}} - F_{\text{out}} - F_{\text{filter}}.
\end{aligned}
The porosity :math:`\varepsilon` denotes the ratio of liquid phase volume to total tank volume.
Thus, setting :math:`\varepsilon = 1`, removing all bound states by setting :math:`N_{\text{bnd},j,i} = 0` for all components :math:`i` and particle types :math:`j`, and applying no binding model results in a simple tank.
Removing all bound states by setting :math:`N_{\text{bnd},j,i} = 0` for all components :math:`i` and particle types :math:`j`, and applying no binding model results in a simple tank.
The additional parameter :math:`F_{\text{filter}}`, which denotes the flow rate of pure liquid (without any components) out of the tank, can be used to model a filtering unit.

Note that it is the user’s duty to make sure that the volume of the CSTR does not fall below 0. If it does, the simulation may fail to run or may produce unreasonable (e.g., unphysical) results.
Expand Down
Loading

0 comments on commit 2b470fb

Please sign in to comment.