# KineticReaction#

class qsdsan.processes.KineticReaction(rate_reactant, n, k, t, reaction, reactant=None, C0=None, components=None, **kwargs)#

A general class used to to handle reactions with common kinetics where the reaction rate is controlled by the molar concentration of a single component (i.e., the rate reactant) so the concentration can be analytically solved.

With a rate constant of k and time of t, for nth-order reaction of the rate reactant with a starting molar concentration of $$[C]_0$$, the rate law is given as

$-\frac{d[C]}{dt} = k*[C]^n$

and the integrated rate law is (n!=1)

$[C]^{1-n} = [C]_0^{1-n} - (1-n)*k*t$

when n==1, the integrated rate law is

$[C]= [C]_0*e^{-k*t}$

The linear plot that can be used to determine k is $$[C]^g$$ vs. t when n!=1 and $$ln([C])$$ vs. t when n==1.

Half-life of the component is (n!=1)

$t_{\frac{1}{2}} = \frac{[C]_0^g*(1-2^{n-1})}{(1-n)*k}$

when n==1, the half-life is

$t_{\frac{1}{2}} = \frac{ln(2)}{k}$

Note

Only single-phase reaction is supported, and it only be used to react a stream (i.e., property array cannot be used).

Parameters:
• rate_reactant (str) – ID of the rate-limiting component of the rate equation (None for 0th order), for reactions of second order and up, it only applies for the special situation where the rate is controlled by the concentration of a single component.

• n (int) – Order of the kinetic reaction, can be a non-negative integer.

• k (float) – Kinetic rate constant, unit should match the one used for C/C0 and t ($$\frac{{mol}^g}{unit\\ of\\ t}$$).

• t (float) – Time of the reaction for conversion calculation.

• reaction (dict or str) – A dictionary of stoichiometric coefficients or a stoichiometric equation written as: i1 R1 + … + in Rn -> j1 P1 + … + jm Pm

• reactant (str) – ID of reactant component, will be set to the rate_reactant if not given.

Examples

>>> import qsdsan as qs
>>> from qsdsan.processes import KineticReaction as KRxn

>>> kwargs = dict(phase='g', particle_size='Dissolved gas',
>>> SO2Cl2 = qs.Component('SO2Cl2', **kwargs)
>>> SO2 = qs.Component('SO2', **kwargs)
>>> Cl2 = qs.Component('Cl2', **kwargs)
>>> qs.set_thermo(qs.Components((SO2Cl2, SO2, Cl2)))
>>> s1 = qs.Stream('s1', SO2Cl2=100, SO2=10, Cl2=5)


Let’s look at the decomposition of sulfuryl chloride (SO2Cl2) to SO2 and Cl2, which is a first order equation at 320°C 

>>> rxn = KRxn('SO2Cl2', n=1, k=2.2e-5, t=1e5, reaction='SO2Cl2 -> SO2 +  Cl2')
>>> # The conversion is 0 at this stage (because we don't know the concentration of SO2Cl2 yet)
>>> rxn.show()
KineticReaction (by mol):
stoichiometry        reactant    X[%]
SO2Cl2 -> SO2 + Cl2  SO2Cl2      0.00
>>> # React the stream
>>> rxn(s1)
>>> s1.show()
Stream: s1
phase: 'l', T: 298.15 K, P: 101325 Pa
flow (kmol/hr): SO2Cl2  11.1
SO2     98.9
Cl2     93.9
>>> rxn.show() # now we know the conversion
KineticReaction (by mol):
stoichiometry        reactant    X[%]
SO2Cl2 -> SO2 + Cl2  SO2Cl2     88.92
>>> # You can check the rate equation, integrated rate equation, and half-life
>>> # of the component
>>> rxn.rate_equation
-2.2e-5*C(t) - Derivative(C(t), t)
>>> rxn.integrated_rate_equation.evalf(n=5) # evalf is to limit the digits
0.037578/2.7183**(2.2e-5*t)
>>> round(rxn.half_life, 2)
31506.69
>>> # You can also look at the conversion over time,
>>> # set show to "True" or use fig.show() to see the figure
>>> fig = rxn.plot_conversion_over_time(show=False)


References

property C0#

[float] Molar concentration of the rate reactant at t=0, needed for conversion calculation except for first-order reaction.

property half_life#

[float] Half-life of the rate reactant.

property integrated_rate_equation#

Integrated rate equation of the rate reactant.

property k#

[float] Kinetic rate constant, unit should match the one used for C/C0 and t ($$\frac{{mol}^g}{unit\\ of\\ t}$$).

property n#

[int] Order of the kinetic reaction, can be a non-negative integer.

plot_conversion_over_time(**kwargs)#

Plot concentrations of the reactants and products of this kinetic reaction. All keyword arguments will be passed to sympy.plot().

property rate_equation#

Differential rate equation of the rate reactant.

property rate_reactant#

[str] ID of the rate-limiting component of the rate equation (None for 0th order). When setting the

property reaction_components#

Return all chemicals involved in the reaction.

property t#

[float] Time of the reaction for conversion calculation.