Chemical Reactions#
Since version 4, it is possible to model chemical reactions with CADET using mass action law type reactions (see Reaction models). The mass action law states that the speed of a reaction is proportional to the product of the concentrations of their reactants.
In CADET-Process, a reaction module was implemented to facilitate the setup of these reactions.
There are two different classes: the MassActionLaw which is used for bulk phase reactions, as well as MassActionLawParticle which is specifically designed to model reactions in particle pore phase.
Forward Reactions#
As a simple example, consider the following system:
Assuming a ComponentSystem with components A and B, configure the MassActionLaw reaction model.
Show code cell content
from CADETProcess.processModel import ComponentSystem
component_system = ComponentSystem(['A', 'B'])
/home/docs/checkouts/readthedocs.org/user_builds/cadet-process/conda/v0.10.1/lib/python3.12/site-packages/PolyRound/__init__.py:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
from pkg_resources import get_distribution, DistributionNotFound
To instantiate it, pass the ComponentSystem.
Then, add the reaction using the add_reaction() method.
The following arguments are expected:
indices: The indices of the components that take part in the reaction (useful for bigger systems)
stoichiometric coefficients in the order of the indices
forward reaction rate
backward reaction rate
from CADETProcess.processModel import MassActionLaw
reaction_system = MassActionLaw(component_system)
reaction_system.add_reaction(
indices=[0,1],
coefficients=[-1, 1],
k_fwd=0.1,
k_bwd=0
)
To demonstrate this reaction, a Cstr is instantiated and the reaction is added to the tank.
Moreover, the initial conditions are set.
In principle, the Cstr supports reactions in bulk and particle pore phase.
Since the porosity is \(1\) by default, only the bulk phase is considered.
from CADETProcess.processModel import Cstr
reactor = Cstr(component_system, 'reactor')
reactor.bulk_reaction_model = reaction_system
reactor.V = 1e-6
reactor.c = [1.0, 0.0]
/home/docs/checkouts/readthedocs.org/user_builds/cadet-process/conda/v0.10.1/lib/python3.12/site-packages/CADETProcess/processModel/unitOperation.py:1188: UserWarning: The field V is only supported for backwards compatibility. Please set initial_liquid_volume and const_solid_volume
warnings.warn(
Equilibrium Reactions#
It is also possible to consider equilibrium reactions where the product can react back to the educts.
reaction_system = MassActionLaw(component_system)
reaction_system.add_reaction(
indices=[0,1],
coefficients=[-2, 1],
k_fwd=0.2,
k_bwd=0.1
)
reactor.bulk_reaction_model = reaction_system