Welcome to chemreac’s documentation!

chemreac is an open-source Python library for modelling 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).

Futhermore the user may choose to solve the problem for the logarithm of concentraion, time and/or space (variable transformations). The library also intends to provide first class support for photo-/radiation chemical contributions.

The numerical evaluation is performed natively (the model is implemented in C++) and the integration can be performed using Sundials (CVode) at the C++ level or 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:

\[\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}\]

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).

Contents:

Indices and tables