Welcome to chemreac’s documentation!

chemreac is an open-source library for modeling chemical kinetcs in either:

  • Homogeneous bulk solution (no concentration gradients)
    • Kinetics governed by law of mass action
  • Non-homogeneous solution where concentration profile has either:
    • planar symmetry
    • cylindrical symmetry
    • spherical symmetry

For the non-homogeneous case the user may choose:

  • reflective or interpolating boundary conditions
  • number of stencil points (3, 5 or 7)
  • an arbitrarily spaced grid
  • to calculate the electric field from concentrations for advection (drift).

Interfaces are provided to Sundials (CVODE) at the C++ level and to both Sundials and SciPy at the python level.

Currently the code is written with the following assumptions:

  • isothermal conditions
  • law of mass action kinetics
  • low concentrations of charged species

The Advection/Diffusion/Reaction model

The model is formulated as the Smoluchovski equation:

\[\begin{split}\frac{\partial c_i}{\partial t} &= D_i \nabla^2c_i - \mu_i\vec{E}(\vec{c}) \cdot \nabla c_i + \sum_l r_l S_{il}\end{split}\]

where \(t\) is time, \(c_i\) is the concentration of species \(i\), \(D_i\) is the diffusion coefficient of the same species, \(\mu_i\) is the electric mobility, \(\vec{E}\) is the electric field, \(S_{il}\) is the net stoichiometric coefficient of species \(i\) in reaction \(l\) and \(r_l\) is the rate of reaction \(l\), which for a mass-action type of rate law is given by:

\[\begin{split}r_l = \begin{cases} \kappa_l\prod_k c_k^{R_{kl}} &\mbox{if } \sum_k R_{kl} > 0 \\ 0 &\mbox{otherwise} \end{cases}\end{split}\]

where \(\kappa_l\) is the rate constant, \(R_{kl}\) is the stoichiometric coefficient of species \(k\) on the reactant side.

The equation is discretized in one dimension (flat, cylindrical or spherical shells). The model is implemented in a C++ class with Python bindings for ease of access.

Contents:

Indices and tables