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:
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:
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: