Multiple Reaction in PFR
Multiple Reaction in PFR
solved with:
Problem
A new catalyst has been proposed for the synthesis of methanol from carbon monoxide and
hydrogen gas. This catalyst is reasonably active between temperatures of 330 K to about 430
K. The isothermalreactions involved in the synthesis include:
𝐶𝑂 + 2𝐻2 ⇄ 𝐶𝐻3 𝑂𝐻
𝐶𝑂 + 𝐻2 𝑂 ⇄ 𝐶𝑂2 + 𝐻2
𝐶𝐻3 𝑂𝐻 → 𝐶𝐻2 𝑂 + 𝐻2
The reactions are elementary and take place in the gas phase. The reaction is to be carried out
isothermally and as a first approximating pressure drop will be neglected. The feed consists of
7/15 hydrogen gas, 1/5 carbon monoxide, 1/5 carbon dioxide, 2/15 steam. The total molar flow
rate is 300 mol/s. The entering pressure may be varied between 1 atm and 160 atm and the
entering temperature between 300 K and 400 K.
Rate of reaction
𝐶𝐶
−𝑟1𝐴 = 𝑘1 (𝐶𝐴 𝐶𝐵2 − )
𝐾1
𝐶𝐸 𝐶𝐵
−𝑟2𝐴 = 𝑘2 (𝐶𝐴 𝐶𝐷 − )
𝐾2
−𝑟3𝐶 = 𝑘3 𝐶𝐶
2
31400 1 1 𝑑𝑚3
𝑘1 = 0.933 exp [2.5 ( ( − ))] ( ) 𝑠 −1
𝑅 330 𝑇 𝑚𝑜𝑙
2
131667 2
𝑑𝑚3
𝐾1 = (0.001987𝑇) ( )
30620 1 1 𝑚𝑜𝑙
exp [− 𝑅 (𝑇 − 298)]
18000 1 1 𝑑𝑚3
𝑘2 = 0.636 exp [ ( − )]
𝑅 300 𝑇 𝑚𝑜𝑙. 𝑠
103.943
𝐾2 =
9834 1 1
exp [− 𝑅 (𝑇 − 298)]
28956 1 1
𝑘3 = 0.244 exp [1.5 ( ( − ))] 𝑠 −1
𝑅 325 𝑇
R = 1.987 cal/mol
If the inlet temperature is 332 K and inlet pressure is 150 atm, what is the optimum volume of
plug flow reactor to maximize methanol production!
Note: Problem is addapted from Elements of Chemical Reaction Engineering 3rd edition – H. Scott Fogler with
slight changes
Solution
For simplicity,
𝑎 + 2𝑏 ⇄ 𝑐
𝑎+𝑑 ⇄𝑒+𝑏
𝑐 →𝑓+𝑏
Apply mole balances
𝑑𝐹𝑎
= 𝑟1𝐴 + 𝑟2𝐴
𝑑𝑉
𝑑𝐹𝑏
= 2𝑟1𝐴 − 𝑟2𝐴 − 𝑟3𝑐
𝑑𝑉
𝑑𝐹𝑐
= −𝑟1𝐴 + 𝑟3𝑐
𝑑𝑉
𝑑𝐹𝑑
= 𝑟2𝐴
𝑑𝑉
𝑑𝐹𝑒
= −𝑟2𝐴
𝑑𝑉
𝑑𝐹𝑓
= −𝑟3𝐶
𝑑𝑉
Initial condition
Fa0 = 60 mol/dm3
Fb0 = 140 mol/dm3
Fc0 = 0 mol/dm3
Fd0 = 40 mol/dm3
Fe0 = 60 mol/dm3
Ff0 = 0 mol/dm3
Stoichiometry
𝐹𝑖 𝑇0
𝐶𝑖 = 𝐶𝑇0 → 𝑇 = 𝑇0
𝐹𝑇 𝑇
𝐹𝑖
𝐶𝑖 = 𝐶𝑇0
𝐹𝑇
𝑃0
𝐶𝑇0 =
0.082𝑇
𝐹𝑇 = 𝐹𝑎 + 𝐹𝑏 + 𝐹𝑐 + 𝐹𝑑 + 𝐹𝑒 + 𝐹𝑓
Code solution
1. Import python extension
The first line in dfdv (-k1*(CT0 …)) stands for dFa/dV, the second line (-2*k1*(CT0 …))
stands for dFb/dV, etc.
The initial condition is given by fa_0, fb_0, etc where fa_0, fb_0 is mole of each compound
in inlet stream.
6. Solve the ODE
Method 1
Method 2
Complete code →
In [1]: import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
import pandas as pd
from scipy.integrate import odeint
from scipy.integrate import solve_ivp
Input Data
Reaction
CO = a
H2 = b
CH3OH = c
H2O = d
CO2 = e
CH2O = f
In [3]: k1=0.933*np.exp(2.5*31400/1.987*(1/330-1/initial_temp))
k2=0.636*np.exp(18000/1.987*(1/300-1/initial_temp))
k3=0.244*np.exp(1.5*28956/1.987*(1/325-1/initial_temp))
k1_reverse=131.667*(0.001987*initial_temp)**2/np.exp(-30620/1.987*(1/initial
k2_reverse=103.943/np.exp(-9843/1.987*(1/initial_temp-1/298))
k1,k2,k3,k1_reverse,k2_reverse
Out[3]: (1.9190687276748413,
11.680580752301399,
1.0075468263077965,
0.28721721442642556,
18.943706597435295)
Solution
Loading [MathJax]/extensions/Safe.js
In [5]: def dfdv(v,f):
fa,fb,fc,fd,fe,ff=f
return[-k1*(CT0*fa/(fa+fb+fc+fd+fe+ff)*(CT0*fb/(fa+fb+fc+fd+fe+ff))**2-C
2*-k1*(CT0*fa/(fa+fb+fc+fd+fe+ff)*(CT0*fb/(fa+fb+fc+fd+fe+ff))**2
k1*(CT0*fa/(fa+fb+fc+fd+fe+ff)*(CT0*fb/(fa+fb+fc+fd+fe+ff))**2-CT
-k2*(CT0*fa/(fa+fb+fc+fd+fe+ff)*CT0*fd/(fa+fb+fc+fd+fe+ff)-CT0*fe
k2*(CT0*fa/(fa+fb+fc+fd+fe+ff)*CT0*fd/(fa+fb+fc+fd+fe+ff)-CT0*fe/
k3*CT0*fc/(fa+fb+fc+fd+fe+ff)
]
fa_0=xa*feed_mol
fb_0=xb*feed_mol
fc_0=xc*feed_mol
fd_0=xd*feed_mol
fe_0=xe*feed_mol
ff_0=xf*feed_mol
f_0=(fa_0,fb_0,fc_0,fd_0,fe_0,ff_0)
In [6]: #Methode 1
#Solver = odeint
v=np.linspace(0,200,200)
sol=odeint(dfdv,y0=f_0,t=v,tfirst=True)
sol
In [7]: fa_sol=sol.T[0]
fb_sol=sol.T[1]
fc_sol=sol.T[2]
fd_sol=sol.T[3]
fe_sol=sol.T[4]
ff_sol=sol.T[5]
df=pd.DataFrame({"Volume":v,"Fa":fa_sol,"Fb":fb_sol,"Fc":fc_sol,"Fd":fd_sol,
df
Loading [MathJax]/extensions/Safe.js
Out[7]: Volume Fa Fb Fc Fd Fe Ff
In [8]: df.plot(x="Volume",y="Fc",ylabel="Concentration")
plt.title("Solver: odeint",fontweight="bold");
fc_max=round(np.max(fc_sol),3)
reactor_volume=round(df.loc[df.loc[df['Fc'].idxmax()].name][0],3)
print(f"Maximum concentration:",fc_max,"mol")
print(f"Reactor volume:",reactor_volume,"dm^3")
Loading [MathJax]/extensions/Safe.js
In [9]: #Methode 2
#Solver = solve_ivp, method=DOP853
v=np.linspace(0,200,200)
sol2=solve_ivp(dfdv,t_span=(0,200),y0=f_0,method="DOP853",t_eval=v,rtol=1e-1
sol2
Out[9]: message: The solver successfully reached the end of the integration inter
val.
success: True
status: 0
t: [ 0.000e+00 1.005e+00 ... 1.990e+02 2.000e+02]
y: [[ 6.000e+01 4.190e+01 ... 2.950e-01 2.903e-01]
[ 1.400e+02 1.252e+02 ... 1.474e+02 1.474e+02]
...
[ 6.000e+01 6.709e+01 ... 9.391e+01 9.391e+01]
[ 0.000e+00 1.163e-01 ... 2.507e+01 2.509e+01]]
sol: None
t_events: None
y_events: None
nfev: 1607
njev: 0
nlu: 0
In [10]: fa_sol2=sol2.y[0]
fb_sol2=sol2.y[1]
fc_sol2=sol2.y[2]
fd_sol2=sol2.y[3]
Loading [MathJax]/extensions/Safe.js
fe_sol2=sol2.y[4]
ff_sol2=sol2.y[5]
df2=pd.DataFrame({"Volume":v,"Fa":fa_sol2,"Fb":fb_sol2,"Fc":fc_sol2,"Fd":fd_
df2
Out[10]: Volume Fa Fb Fc Fd Fe Ff
In [11]: df2.plot(x="Volume",y="Fc",ylabel="Concentration")
plt.title("Solver: solve_ivp; method:DOP853",fontweight="bold");
fc_max=round(np.max(fc_sol),3)
reactor_volume=round(df2.loc[df.loc[df['Fc'].idxmax()].name][0],3)
print(f"Maximum concentration:",fc_max,"mol")
print(f"Reactor volume:",reactor_volume,"dm^3")
Loading [MathJax]/extensions/Safe.js
Loading [MathJax]/extensions/Safe.js