diff --git a/doc/interface/reaction/index.rst b/doc/interface/reaction/index.rst index a1b6e14a7..5bfc26c1a 100644 --- a/doc/interface/reaction/index.rst +++ b/doc/interface/reaction/index.rst @@ -3,12 +3,65 @@ Reaction models =============== +This section describes the configuration of reaction models for different phases in CADET unit operations. + +The corresponding group that contains the reaction models for each phase reads: + +- For bulk phase: ``/input/model/unit_XXX/reaction_bulk`` +- For solid phase: ``/input/model/unit_XXX/reaction_solid`` +- For particle phase: ``/input/model/unit_XXX/reaction_particle_YYY`` +- For cross phase: ``/input/model/unit_XXX/reaction_cross_phase_YYY`` + +Where ``XXX`` denotes the index of the unit operation and ``YYY`` denotes the index of the particle type. + +Configuration Steps +------------------- + +Before defining the reaction model parameters, it is necessary to specify how many reaction models are used in each phase. + +1. **Set the number of reactions**: This is done by setting ``/NREACT`` to the number of reaction models used in the phase. + + For example: + + - ``/input/model/unit_000/reaction_bulk/NREACT = 2`` indicates that 2 reaction models are used in the bulk phase + - ``/input/model/unit_000/reaction_solid/NREACT = 1`` indicates that 1 reaction model is used in the solid phase + +2. **Define reaction model parameters**: After setting ``NREACT``, the parameters for each individual reaction model are specified. + +The group that contains the parameters of each reaction model reads: +``/input/model/unit_XXX/reaction_phase/reaction_model_ZZZ``. + +Where ``XXX`` denotes the index of the unit operation, ``phase`` is either ``bulk``, ``solid``, ``particle_YYY``, +or ``cross_phase_YYY``, and ``ZZZ`` denotes the index of the reaction model (starting from ``000``). + +**Example**: If ``NREACT = 2`` for the bulk phase, then the parameters would be found in: + +- ``/input/model/unit_000/reaction_bulk/reaction_model_000`` (first reaction model) +- ``/input/model/unit_000/reaction_bulk/reaction_model_001`` (second reaction model) + +The reaction model parameters are specified in the following sections: + +**Single-Phase Reaction Models** (for bulk, solid, and particle phases): + .. toctree:: :maxdepth: 2 mass_action_law michaelis_menten_kinetics +**Cross-Phase Reaction Models** (only for cross-phase reactions): + +.. toctree:: + :maxdepth: 2 + + mass_action_law_cross_phase + +.. note:: + Cross-phase reaction models can **only** be used in the cross-phase configuration (``reaction_cross_phase_YYY``). + They cannot be used in bulk, solid, or particle phase configurations. + For reactions within a single phase, use the standard reaction models listed above. + + Externally dependent reaction models ------------------------------------ @@ -30,17 +83,3 @@ However, if only one index is passed in ``EXTFUN``, this external source is used Note that parameter sensitivities with respect to column radius, column length, particle core radius, and particle radius may be wrong when using externally dependent reaction models. This is caused by not taking into account the derivative of the external profile with respect to column position. - - -.. _multiple-particle-types_reactions: - -Multiple particle types ------------------------ - -The group that contains the parameters of a reaction model in unit operation with index ``XXX`` reads ``/input/model/unit_XXX/reaction_particle``. -This is valid for models with a single particle type. -If a model has multiple particle types, it may have a different reaction model in each type. -The parameters are then placed in the group ``/input/model/unit_XXX/reaction_particle_YYY`` instead, where ``YYY`` denotes the index of the particle type. - -Note that, in any case, ``/input/model/unit_XXX/reaction_particle_000`` contains the parameters of the first (and possibly sole) particle type. -This group also takes precedence over a possibly existing ``/input/model/unit_XXX/adsorption_particle`` group. diff --git a/doc/interface/reaction/mass_action_law.rst b/doc/interface/reaction/mass_action_law.rst index 8951a9e28..476ffd318 100644 --- a/doc/interface/reaction/mass_action_law.rst +++ b/doc/interface/reaction/mass_action_law.rst @@ -3,11 +3,11 @@ Mass Action Law ~~~~~~~~~~~~~~~ -**Group /input/model/unit_XXX/reaction - REACTION_MODEL = MASS_ACTION_LAW** +**Group /input/model/unit_XXX/reaction_phase/reaction_model_YYY - REACTION_MODEL = MASS_ACTION_LAW** For information on model equations, refer to :ref:`mass_action_law_model`. -``MAL_KFWD_BULK`` +``MAL_KFWD`` Forward rate constants for bulk volume reactions (available for external functions) @@ -15,145 +15,33 @@ For information on model equations, refer to :ref:`mass_action_law_model`. **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` ================ ========================= =================================== -``MAL_KBWD_BULK`` +``MAL_KBWD`` Backward rate constants for bulk volume reactions (available for external functions) ================ ========================= =================================== **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` ================ ========================= =================================== - -``MAL_KFWD_LIQUID`` - Forward rate constants for particle liquid phase reactions (available for external functions) - - ================ ========================= =================================== - **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` - ================ ========================= =================================== - -``MAL_KBWD_LIQUID`` - - Backward rate constants for particle liquid phase reactions (available for external functions) - - ================ ========================= =================================== - **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` - ================ ========================= =================================== - -``MAL_KFWD_SOLID`` - - Forward rate constants for particle solid phase reactions (available for external functions) - - ================ ========================= =================================== - **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` - ================ ========================= =================================== - -``MAL_KBWD_SOLID`` - - Backward rate constants for particle solid phase reactions (available for external functions) - - ================ ========================= =================================== - **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` - ================ ========================= =================================== - -``MAL_STOICHIOMETRY_BULK`` +``MAL_STOICHIOMETRY`` Stoichiometric matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage ================ ======================================================== **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` ================ ======================================================== - -``MAL_EXPONENTS_BULK_FWD`` - Forward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) - - ================ ======================================================== - **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` - ================ ======================================================== - -``MAL_EXPONENTS_BULK_BWD`` +``MAL_EXPONENTS_FWD`` - Backward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) - - ================ ======================================================== - **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` - ================ ======================================================== - -``MAL_STOICHIOMETRY_LIQUID`` - - Stoichiometric matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage - - ================ ======================================================== - **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` - ================ ======================================================== - -``MAL_EXPONENTS_LIQUID_FWD`` - - Forward exponent matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_LIQUID}` by default) - - ================ ======================================================== - **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` - ================ ======================================================== - -``MAL_EXPONENTS_LIQUID_BWD`` - - Backward exponent matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_LIQUID}` by default) + Forward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) ================ ======================================================== **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` ================ ======================================================== - -``MAL_EXPONENTS_LIQUID_FWD_MODSOLID`` - - Forward solid phase modifier exponent matrix of particle liquid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) - - ================ ============================================================ - **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` - ================ ============================================================ - -``MAL_EXPONENTS_LIQUID_BWD_MODSOLID`` - Backward solid phase modifier exponent matrix of particle liquid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) - - ================ ============================================================ - **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` - ================ ============================================================ - -``MAL_STOICHIOMETRY_SOLID`` - - Stoichiometric matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage - - ================ ============================================================ - **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` - ================ ============================================================ - -``MAL_EXPONENTS_SOLID_FWD`` - - Forward exponent matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_SOLID}` by default) - - ================ ============================================================ - **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` - ================ ============================================================ - -``MAL_EXPONENTS_SOLID_BWD`` - - Backward exponent matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_SOLID}` by default) - - ================ ============================================================ - **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` - ================ ============================================================ - -``MAL_EXPONENTS_SOLID_FWD_MODLIQUID`` +``MAL_EXPONENTS_BWD`` - Forward liquid phase modifier exponent matrix of particle solid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) - - ================ ======================================================== - **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` - ================ ======================================================== - -``MAL_EXPONENTS_SOLID_BWD_MODLIQUID`` - - Backward liquid phase modifier exponent matrix of particle solid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) + Backward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) ================ ======================================================== **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` diff --git a/doc/interface/reaction/mass_action_law_cross_phase.rst b/doc/interface/reaction/mass_action_law_cross_phase.rst new file mode 100644 index 000000000..d9d312c11 --- /dev/null +++ b/doc/interface/reaction/mass_action_law_cross_phase.rst @@ -0,0 +1,160 @@ +.. _mass_action_law_cross_phase_config: + +Mass Action Law Cross Phase +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Group /input/model/unit_XXX/reaction_phase/reaction_model_YYY - REACTION_MODEL = MASS_ACTION_LAW_CROSS_PHASE** + +For information on model equations, refer to :ref:`mass_action_law_model_cross_phase`. + +``MAL_KFWD_BULK`` + + Forward rate constants for bulk volume reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_KBWD_BULK`` + + Backward rate constants for bulk volume reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_KFWD_LIQUID`` + + Forward rate constants for particle liquid phase reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_KBWD_LIQUID`` + + Backward rate constants for particle liquid phase reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_KFWD_SOLID`` + + Forward rate constants for particle solid phase reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_KBWD_SOLID`` + + Backward rate constants for particle solid phase reactions (available for external functions) + + ================ ========================= =================================== + **Type:** double **Range:** :math:`\geq 0` **Length:** :math:`\texttt{NREACT}` + ================ ========================= =================================== + +``MAL_STOICHIOMETRY_BULK`` + + Stoichiometric matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_BULK_FWD`` + + Forward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_BULK_BWD`` + + Backward exponent matrix of bulk volume reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_BULK}` by default) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_STOICHIOMETRY_LIQUID`` + + Stoichiometric matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_LIQUID_FWD`` + + Forward exponent matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_LIQUID}` by default) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_LIQUID_BWD`` + + Backward exponent matrix of particle liquid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_LIQUID}` by default) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_LIQUID_FWD_MODSOLID`` + + Forward solid phase modifier exponent matrix of particle liquid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) + + ================ ============================================================ + **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` + ================ ============================================================ + +``MAL_EXPONENTS_LIQUID_BWD_MODSOLID`` + + Backward solid phase modifier exponent matrix of particle liquid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) + + ================ ============================================================ + **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` + ================ ============================================================ + +``MAL_STOICHIOMETRY_SOLID`` + + Stoichiometric matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage + + ================ ============================================================ + **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` + ================ ============================================================ + +``MAL_EXPONENTS_SOLID_FWD`` + + Forward exponent matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_SOLID}` by default) + + ================ ============================================================ + **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` + ================ ============================================================ + +``MAL_EXPONENTS_SOLID_BWD`` + + Backward exponent matrix of particle solid phase reactions as :math:`\texttt{NTOTALBND} \times \texttt{NREACT}` matrix in row-major storage (optional, calculated from :math:`\texttt{MAL_STOICHIOMETRY_SOLID}` by default) + + ================ ============================================================ + **Type:** double **Length:** :math:`\texttt{NTOTALBND} \cdot \texttt{NREACT}` + ================ ============================================================ + +``MAL_EXPONENTS_SOLID_FWD_MODLIQUID`` + + Forward liquid phase modifier exponent matrix of particle solid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== + +``MAL_EXPONENTS_SOLID_BWD_MODLIQUID`` + + Backward liquid phase modifier exponent matrix of particle solid phase reactions as :math:`\texttt{NCOMP} \times \texttt{NREACT}` matrix in row-major storage (optional, defaults to all 0) + + ================ ======================================================== + **Type:** double **Length:** :math:`\texttt{NCOMP} \cdot \texttt{NREACT}` + ================ ======================================================== diff --git a/doc/interface/reaction/michaelis_menten_kinetics.rst b/doc/interface/reaction/michaelis_menten_kinetics.rst index 988e65dba..19548ce33 100644 --- a/doc/interface/reaction/michaelis_menten_kinetics.rst +++ b/doc/interface/reaction/michaelis_menten_kinetics.rst @@ -3,7 +3,7 @@ Michaelis Menten kinetics ~~~~~~~~~~~~~~~~~~~~~~~~~ -**Group /input/model/unit_XXX/reaction - REACTION_MODEL = MICHAELIS_MENTEN** +**Group /input/model/unit_XXX/reaction_phase/reaction_model_YYY - REACTION_MODEL = MICHAELIS_MENTEN** For information on model equations, refer to :ref:`michaelis_menten_kinetics_model`. diff --git a/doc/modelling/reaction/index.rst b/doc/modelling/reaction/index.rst index 02330bd4a..d42c07e81 100644 --- a/doc/modelling/reaction/index.rst +++ b/doc/modelling/reaction/index.rst @@ -4,13 +4,36 @@ Reaction models =============== -Reaction models describe the (net) fluxes :math:`f_{\mathrm{react}}` of a +Reaction models describe the (net) fluxes :math:`f_{\mathrm{react}}(c)` of a reaction mechanism. -CADET features one reaction type: - - :ref:`mass_action_law_model` (most commonly used) +In this kind of mechanism, the fluxes are typically +defined as a function of the concentration of the components involved in the reaction and the reaction parameters. + +In CADET, reaction models are defined for each phase separately, i.e., for the bulk phase, particle phase and solid phase. + +CADET features the following reaction model types: + + - :ref:`mass_action_law_model` - :ref:`michaelis_menten_kinetics_model` +It is possible to combine reaction models if they are defined for the same phase. + +Cross phase reaction models +--------------------------- + +If a reaction is defined between a liquid phase (bulk or particle) and solid phases, the net fluxes of the reaction are defined +as a function of the concentrations in the respective phases and is called a cross phase reaction, i.e :math:`f_{\mathrm{react}}(c^\mathrm{b}, c^{\mathrm{\ell}})`. + +CADET features the following cross phase reaction types: + + - :ref:`mass_action_law_model_cross_phase` + +Further details on the interface specification are provided in :ref:`the corresponding section `. + +Application examples +-------------------- + Historically, a chromatography system is modeled as a reaction system without considering any transport phenomenon. We also introduce some reaction-based models that can be solved in CADET: - :ref:`thomas_model` diff --git a/doc/modelling/reaction/mass_action_law_model.rst b/doc/modelling/reaction/mass_action_law_model.rst new file mode 100644 index 000000000..27f018077 --- /dev/null +++ b/doc/modelling/reaction/mass_action_law_model.rst @@ -0,0 +1,80 @@ +.. _mass_action_law_model: + +Mass Action Law +--------------- + +The mass action law reaction model is suitable for most reactions. +Note that the concentrations are directly used for calculating the fluxes. +Hence, the model only holds for dilute solutions under the assumption of a well-stirred reaction vessel. +These assumptions can be weakened by passing to the generalized mass action law, which uses chemical activities instead of concentrations. + +The mass action law states that the speed of a reaction is proportional to the product of the concentrations of their reactants. + +The indices used in the equations have the following meaning: + +- :math:`i` is the component index, ranging from :math:`0` to :math:`N_{\mathrm{comp}}-1` +- :math:`j` is the reaction index, ranging from :math:`0` to :math:`N_{\mathrm{react}}-1` +- :math:`\ell` is the component index used in products and sums, ranging from :math:`0` to :math:`N_{\mathrm{comp}}-1` + +The net flux for component :math:`i` is given by + +.. math:: + + \begin{aligned} + f_{\mathrm{react},i}\left(c\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j} \varphi_j\left(c\right), \\ + \varphi_j(c) &= k_{\mathrm{fwd},j} \prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c_{\ell}\right)^{e_{\mathrm{fwd},\ell,j}} - k_{\mathrm{bwd},j} \prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c_{\ell}\right)^{e_{\mathrm{bwd},\ell,j}}, + \end{aligned} + +where :math:`S = (s_{i,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` is the stoichiometric matrix, :math:`\varphi_j(c)` is the net flux of reaction :math:`j`, and :math:`k_{\mathrm{fwd},j}` and :math:`k_{\mathrm{bwd},j}` are the rate constants. +The matrices :math:`E_{\mathrm{fwd}} = (e_{\mathrm{fwd},\ell,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` and :math:`E_{\mathrm{bwd}} = (e_{\mathrm{bwd},\ell,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` are usually derived by the order of the reaction, that is, + +.. math:: + :label: MRMassActionLawExpMatDefault + + \begin{aligned} + e_{\mathrm{fwd},\ell,j} &= \max(0, -s_{\ell,j}), \\ + e_{\mathrm{bwd},\ell,j} &= \max(0, s_{\ell,j}). + \end{aligned} + +However, these defaults can be changed by providing those matrices. + +This model applies to reactions occurring within a single phase (liquid, particle liquid, or solid phase) only. + +For reactions involving multiple phases, see :ref:`mass_action_law_model_cross_phase`. + + +Correlation of forward- and backward rate constants +--------------------------------------------------- + +Note that forward rate constant :math:`k_{\mathrm{fwd},i}` and backward +rate constant :math:`k_{\mathrm{bwd},i}` of reaction :math:`i` are +linearly correlated due to the form of the equilibrium constant +:math:`k_{\mathrm{eq},i}`: + +.. math:: + + \begin{aligned} + k_{\mathrm{fwd},i} = k_{\mathrm{eq},i} k_{\mathrm{bwd},i}. + \end{aligned} + +This correlation can potentially degrade performance of some optimization algorithms. +The parameters can be decoupled by reparameterization: + +.. math:: + + \begin{aligned} + r_{\mathrm{net},i} &= k_{\mathrm{fwd},i} f_{\mathrm{fwd},i} - k_{\mathrm{bwd},i} f_{\mathrm{bwd},i}\\ + &= k_{\mathrm{bwd},i} \left[ k_{\mathrm{eq},i} f_{\mathrm{fwd},i} - f_{\mathrm{bwd},i} \right] \\ + &= k_{\mathrm{fwd},i} \left[ f_{\mathrm{fwd},i} - \frac{1}{k_{\mathrm{eq},i}} f_{\mathrm{bwd},i} \right]. + \end{aligned} + +This can be achieved by a (nonlinear) parameter transform + +.. math:: + + \begin{aligned} + F\left( k_{\mathrm{eq},i}, k_{\mathrm{bwd},i} \right) &= \begin{pmatrix} k_{\mathrm{eq},i} k_{\mathrm{bwd},i} \\ k_{\mathrm{bwd},i} \end{pmatrix} \\ + \text{ with Jacobian } J_F\left( k_{\mathrm{eq},i}, k_{\mathrm{bwd},i} \right) &= \begin{pmatrix} k_{\mathrm{bwd},i} & k_{\mathrm{eq},i} \\ 0 & 1 \end{pmatrix}. + \end{aligned} + +For more information on model parameters required to define in CADET file format, see :ref:`_mass_action_law_config`. diff --git a/doc/modelling/reaction/mass_action_law.rst b/doc/modelling/reaction/mass_action_law_model_cross_phase.rst similarity index 58% rename from doc/modelling/reaction/mass_action_law.rst rename to doc/modelling/reaction/mass_action_law_model_cross_phase.rst index 5b21664bf..d4b921056 100644 --- a/doc/modelling/reaction/mass_action_law.rst +++ b/doc/modelling/reaction/mass_action_law_model_cross_phase.rst @@ -1,28 +1,38 @@ -.. _mass_action_law_model: +.. _mass_action_law_model_cross_phase: -Mass action law ---------------- +Mass Action Law Cross Phase +--------------------------- -The mass action law reaction model is suitable for most reactions. +The mass action law cross phase reaction model describes reactions that occur between different phases (liquid and solid phases). +This model extends the basic mass action law to handle interactions between phases, such as reactions between liquid phase components and bound states in the solid phase. Note that the concentrations are directly used for calculating the fluxes. Hence, the model only holds for dilute solutions under the assumption of a well-stirred reaction vessel. These assumptions can be weakened by passing to the generalized mass action law, which uses chemical activities instead of concentrations. The mass action law states that the speed of a reaction is proportional to the product of the concentrations of their reactants. -The net flux for component :math:`i` is given by +For single-phase reactions within a single phase only, see :ref:`mass_action_law_model`. -.. math:: +Cross-Phase Reactions +~~~~~~~~~~~~~~~~~~~~~ - \begin{aligned} - f_{\mathrm{react},i}^l\left(c^l\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j}^l \varphi^l_j\left(c^l\right), \\ - \varphi^l_j(c^l) &= k^l_{\mathrm{fwd},j} \prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^l_{\mathrm{fwd},\ell,j}} - k^l_{\mathrm{bwd},j} \prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^l_{\mathrm{bwd},\ell,j}}, - \end{aligned} +In situations where both liquid and solid phase are present (e.g., in a bead), reactions can occur between phases, where one phase may act as a modifier in the net flux equation of the other phase. + +In the following :math:`l` denotes the liquid phase and :math:`s` the solid phase. +Depending on the unit operation, the liquid phase can be considered as the bulk :math:`b` or particle :math:`p` phase. -where :math:`S^l = (s^l_{i,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` is the stoichiometric matrix, :math:`\varphi^l_j(c)` is the net flux of reaction :math:`j`, and :math:`k^l_{\mathrm{fwd},j}` and :math:`k^l_{\mathrm{bwd},j}` are the rate constants. -The matrices :math:`E^l_{\mathrm{fwd}} = (e^l_{\mathrm{fwd},\ell,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` and :math:`E^l_{\mathrm{bwd}} = (e^l_{\mathrm{bwd},\ell,j}) \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` are usually derived by the order of the reaction, that is, +The indices used in the equations have the following meaning: + +- :math:`j` is the reaction index, ranging from :math:`0` to :math:`N_{\mathrm{react}}-1` +- :math:`\ell` is the component index for liquid phase components, ranging from :math:`0` to :math:`N_{\mathrm{comp}}-1` +- :math:`m` is the bound state index for solid phase components, ranging from :math:`0` to :math:`\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1` + +Liquid Phase Reactions Modified by Solid Phase +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The exponent matrices are usually derived by the order of the reaction, that is, .. math:: - :label: MRMassActionLawExpMatDefault + :label: MRMassActionLawExpMatDefaultCrossPhase \begin{aligned} e^l_{\mathrm{fwd},\ell,j} &= \max(0, -s^l_{\ell,j}), \\ @@ -31,26 +41,28 @@ The matrices :math:`E^l_{\mathrm{fwd}} = (e^l_{\mathrm{fwd},\ell,j}) \in \mathbb However, these defaults can be changed by providing those matrices. -In situations where both liquid and solid phase are present (e.g., in a bead), the respective other phase may act as a modifier in the net flux equation. For example, consider reactions in the liquid phase of a particle given by .. math:: \begin{aligned} - f_{\mathrm{react},i}^p\left(c^p, c^s\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j}^p \varphi^p_j\left(c^p, c^s\right),\end{aligned} + f_{\mathrm{react},i}^l\left(c^l, c^s\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j}^l \varphi^l_j\left(c^l, c^s\right),\end{aligned} where .. math:: \begin{split} - \varphi^p_j(c^p, c^s) = k^p_{\mathrm{fwd},j} &\left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^p_{\ell}\right)^{e^p_{\mathrm{fwd},\ell,j}}\right] \left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{ps}_{\mathrm{fwd},m,j}}\right] \\ - - k^p_{\mathrm{bwd},j} &\left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^p_{\ell}\right)^{e^p_{\mathrm{bwd},\ell,j}}\right] \left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{ps}_{\mathrm{bwd},m,j}}\right]. + \varphi^l_j(c^l, c^s) = k^l_{\mathrm{fwd},j} &\left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^l_{\mathrm{fwd},\ell,j}}\right] \left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{ls}_{\mathrm{fwd},m,j}}\right] \\ + - k^l_{\mathrm{bwd},j} &\left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^l_{\mathrm{bwd},\ell,j}}\right] \left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{ls}_{\mathrm{bwd},m,j}}\right]. \end{split} The forward and backward rates of the liquid phase particle reactions can be modified by a power of every bound state in the solid phase of the particle. -The exponents of these powers are given by the matrices :math:`E^{ps}_{\mathrm{fwd}} = (e^{ps}_{\mathrm{fwd},m,j})` and :math:`E^{ps}_{\mathrm{bwd}} = (e^{ps}_{\mathrm{bwd},m,j})`, which are both of size :math:`(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}`. -Whereas the exponent matrices :math:`E^{p}_{\mathrm{fwd}}, E^{p}_{\mathrm{bwd}} \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` are initialized based on the stoichiometric matrix :math:`S^{p} \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}`, see Eq. :eq:`MRMassActionLawExpMatDefault`, the exponent matrices :math:`E^{ps}_{\mathrm{fwd}}, E^{ps}_{\mathrm{bwd}}` of the modifier terms default to :math:`0`. +The exponents of these powers are given by the matrices :math:`E^{ls}_{\mathrm{fwd}} = (e^{ls}_{\mathrm{fwd},m,j})` and :math:`E^{ls}_{\mathrm{bwd}} = (e^{ls}_{\mathrm{bwd},m,j})`, which are both of size :math:`(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}`. +Whereas the exponent matrices :math:`E^{p}_{\mathrm{fwd}}, E^{p}_{\mathrm{bwd}} \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}` are initialized based on the stoichiometric matrix :math:`S^{p} \in \mathbb{R}^{N_{\mathrm{comp}} \times N_{\mathrm{react}}}`, see Eq. :eq:`MRMassActionLawExpMatDefaultCrossPhase`, the exponent matrices :math:`E^{ls}_{\mathrm{fwd}}, E^{ls}_{\mathrm{bwd}}` of the modifier terms default to :math:`0`. + +Solid Phase Reactions Modified by Liquid Phase +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Vice versa, the rates of solid phase reactions can be modified by liquid phase concentrations. The corresponding exponent matrices :math:`E^{sp}_{\mathrm{fwd}} = (e^{sp}_{\mathrm{fwd},\ell,j})` and :math:`E^{sp}_{\mathrm{bwd}} = (e^{sp}_{\mathrm{bwd},\ell,j})` are both of size :math:`N_{\mathrm{comp}} \times N_{\mathrm{react}}`. @@ -58,7 +70,7 @@ The corresponding exponent matrices :math:`E^{sp}_{\mathrm{fwd}} = (e^{sp}_{\mat .. math:: \begin{aligned} - f_{\mathrm{react},i}^s\left(c^s, c^p\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j}^s \varphi^s_j\left(c^s, c^p\right), + f_{\mathrm{react},i}^s\left(c^s, c^l\right) &= \sum_{j=0}^{N_{\mathrm{react}}-1} s_{i,j}^s \varphi^s_j\left(c^s, c^l\right), \end{aligned} where @@ -66,11 +78,11 @@ where .. math:: \begin{split} - \varphi^s_j(c^s, c^p) = k^s_{\mathrm{fwd},j} &\left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{s}_{\mathrm{fwd},m,j}}\right] \left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^p_{\ell}\right)^{e^{sp}_{\mathrm{fwd},\ell,j}}\right] \\ - - k^p_{\mathrm{bwd},j} &\left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{s}_{\mathrm{bwd},m,j}}\right] \left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^p_{\ell}\right)^{e^{sp}_{\mathrm{bwd},\ell,j}}\right]. + \varphi^s_j(c^s, c^l) = k^s_{\mathrm{fwd},j} &\left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{s}_{\mathrm{fwd},m,j}}\right] \left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^{sp}_{\mathrm{fwd},\ell,j}}\right] \\ + - k^l_{\mathrm{bwd},j} &\left[\prod_{m=0}^{\sum_{i=0}^{N_{\mathrm{comp}}-1} N_{\mathrm{bnd},i}-1} \left(c^s_{m}\right)^{e^{s}_{\mathrm{bwd},m,j}}\right] \left[\prod_{\ell=0}^{N_{\mathrm{comp}}-1} \left(c^l_{\ell}\right)^{e^{sp}_{\mathrm{bwd},\ell,j}}\right]. \end{split} -Whereas the exponent matrices :math:`E^{s}_{\mathrm{fwd}}, E^{s}_{\mathrm{bwd}} \in \mathbb{R}^{(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}}` are initialized based on the stoichiometric matrix :math:`S^{s} \in \mathbb{R}^{(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}}`, see Eq. :eq:`MRMassActionLawExpMatDefault`, the exponent matrices :math:`E^{sp}_{\mathrm{fwd}}, E^{sp}_{\mathrm{bwd}}` of the modifier terms default to :math:`0`. +Whereas the exponent matrices :math:`E^{s}_{\mathrm{fwd}}, E^{s}_{\mathrm{bwd}} \in \mathbb{R}^{(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}}` are initialized based on the stoichiometric matrix :math:`S^{s} \in \mathbb{R}^{(\sum_i N_{\mathrm{bnd},i}) \times N_{\mathrm{react}}}`, see Eq. :eq:`MRMassActionLawExpMatDefaultCrossPhase`, the exponent matrices :math:`E^{sp}_{\mathrm{fwd}}, E^{sp}_{\mathrm{bwd}}` of the modifier terms default to :math:`0`. Correlation of forward- and backward rate constants @@ -107,4 +119,4 @@ This can be achieved by a (nonlinear) parameter transform \text{ with Jacobian } J_F\left( k_{\mathrm{eq},i}, k_{\mathrm{bwd},i} \right) &= \begin{pmatrix} k_{\mathrm{bwd},i} & k_{\mathrm{eq},i} \\ 0 & 1 \end{pmatrix}. \end{aligned} -For more information on model parameters required to define in CADET file format, see :ref:`mass_action_law_config`. +For more information on model parameters required to define in CADET file format, see :ref:`_mass_action_law_cross_phase_config`.