.. _cstr_config:

Continuous stirred tank reactor model
=====================================

Group /input/model/unit_XXX - UNIT_TYPE = CSTR
----------------------------------------------


For information on model equations, refer to :ref:`cstr_model`.

``UNIT_TYPE``

   Specifies the type of unit operation model
   
   ================  ================================  =============
   **Type:** string  **Range:** :math:`\texttt{CSTR}`  **Length:** 1
   ================  ================================  =============
   
``NCOMP``

   Number of chemical components in the chromatographic medium
   
   =============  =========================  =============
   **Type:** int  **Range:** :math:`\geq 1`  **Length:** 1
   =============  =========================  =============
   
``USE_ANALYTIC_JACOBIAN``

   Determines whether analytically computed Jacobian matrix (faster) is used (value is 1) instead of Jacobians generated by algorithmic differentiation (slower, value is 0)
   
   =============  ===========================  =============
   **Type:** int  **Range:** :math:`\{0, 1\}`  **Length:** 1
   =============  ===========================  =============
   
``ADSORPTION_MODEL``

   Specifies the type of binding model of each particle type
   
   ================  ==========================================  =====================================
   **Type:** string  **Range:** See Section :ref:`FFAdsorption`  **Length:** :math:`\texttt{NPARTYPE}`
   ================  ==========================================  =====================================
   
``NBOUND``

   Number of bound states for each component in each particle type in type-major ordering (optional, defaults to all 0)
   
   =============  =========================  ===========================================================
   **Type:** int  **Range:** :math:`\geq 0`  **Length:** :math:`\texttt{NPARTYPE} \cdot \texttt{NCOMP}`
   =============  =========================  ===========================================================
   
``REACTION_MODEL``

   Specifies the type of reaction model of the bulk volume. The model is configured in the subgroup :math:`\texttt{reaction_bulk}`.
   
   ================  ========================================  =============
   **Type:** string  **Range:** See Section :ref:`FFReaction`  **Length:** 1
   ================  ========================================  =============
   
``REACTION_MODEL_PARTICLES``

   Specifies the type of reaction model of each particle type (or of all particle types if length is 1). The model is configured in the subgroup :math:`\texttt{reaction_particle}`, or :math:`\texttt{reaction_particle_XXX}` in case of disabled multiplexing.
   
   ================  ========================================  =========================================
   **Type:** string  **Range:** See Section :ref:`FFReaction`  **Length:** :math:`1 / \texttt{NPARTYPE}`
   ================  ========================================  =========================================
   
``REACTION_MODEL_PARTICLES_MULTIPLEX``

   Multiplexing mode of :math:`\texttt{REACTION_MODEL_PARTICLES}`. If set to 0, each particle type has a different reaction model and the length of :math:`\texttt{REACTION_MODEL_PARTICLES}` is :math:`\texttt{NPARTYPE}`. If set to 1, all particle types share the same reaction model and the length of :math:`\texttt{REACTION_MODEL_PARTICLES}` is 1.  This field is optional and inferred from the length of :math:`\texttt{REACTION_MODEL_PARTICLES}` if left out.
   
   =============  ===========================  =============
   **Type:** int  **Range:** :math:`\{0, 1\}`  **Length:** 1
   =============  ===========================  =============
   
``INIT_C``

   Initial concentrations for each component in the mobile phase

   **Unit:** :math:`\mathrm{mol}\,\mathrm{m}_{\mathrm{IV}}^{-3}`
   
   ================  =========================  ==================================
   **Type:** double  **Range:** :math:`\geq 0`  **Length:** :math:`\texttt{NCOMP}`
   ================  =========================  ==================================
   
``INIT_LIQUID_VOLUME``

   Initial liquid volume

   **Unit:** :math:`\mathrm{m}^{3}`
   
   ================  =========================  =============
   **Type:** double  **Range:** :math:`\geq 0`  **Length:** 1
   ================  =========================  =============
   
``INIT_CS``

   Initial concentrations for each bound state of each component in the bead solid phase of each particle type in type-component-major ordering. This field is optional and defaults to all 0.

   **Unit:** :math:`\mathrm{mol}\,\mathrm{m}_{\mathrm{SP}}^{-3}`
   
   ================  =========================  =======================================
   **Type:** double  **Range:** :math:`\geq 0`  **Length:** :math:`\texttt{NTOTALBND}`
   ================  =========================  =======================================
   
``INIT_STATE``

   Full state vector for initialization (optional, :math:`\texttt{INIT_C}`, :math:`\texttt{INIT_CS}`, and :math:`\texttt{INIT_VOLUME}` will be ignored; if length is :math:`2\texttt{NDOF}`, then the second half is used for time derivatives).
   The ordering of the state vector is defined in :ref:`UnitOperationStateOrdering`.

   **Unit:** :math:`various`
   
   ================  =============================  ====================================================
   **Type:** double  **Range:** :math:`\mathbb{R}`  **Length:** :math:`\texttt{NDOF} / 2\texttt{NDOF}`
   ================  =============================  ====================================================
   
``CONST_SOLID_VOLUME``

   Volume of solid phase 

   **Unit:** :math:`\mathrm{m}^{3}` (defaults to 0)
   
   ================  =========================  =============
   **Type:** double  **Range:** :math:`\geq 0`  **Length:** 1
   ================  =========================  =============
   
``FLOWRATE_FILTER``

   Flow rate of pure liquid without components (optional, defaults to :math:`\mathrm{m}^{3}\,\mathrm{s}^{-1}`)

   **Unit:** :math:`\mathrm{m}^{3}\,\mathrm{s}^{-1}`
   
   ================  =========================  ======================================
   **Type:** double  **Range:** :math:`\geq 0`  **Length:** :math:`1 / \texttt{NSEC}`
   ================  =========================  ======================================
   
``PAR_TYPE_VOLFRAC``

   Volume fractions of the particle types, have to sum to 1
   
   ================  ========================  =====================================
   **Type:** double  **Range:** :math:`[0,1]`  **Length:** :math:`\texttt{NPARTYPE}`
   ================  ========================  =====================================

``NREAC_LIQUID``

   Number of reactions in the bulk volume.

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

The bulk reactions in the CSTR is defined in the following subgroup:

Group /input/model/unit_XXX/liquid_reaction_YYY

Reaction model in the bulk volume
---------------------------------
``TYPE``

   Specifies the type of reaction model

   ================  ========================================  =============
   **Type:** string  **Range:** See Section :ref:`FFReaction`  **Length:** 1
   ================  ========================================  =============

Further reaction configuration are depending on the ``TYPE``.
For information on model configuration, refer to :ref:`mass_action_law_config` or :ref:`michaelis_menten_kinetics_config`.

**NOTE:** This interface will be implemented for further unit operation in the future.
