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