Está en la página 1de 11

DEPARTMENT OF CHEMICAL SCIENCE AND ENGINEERING

SCHOOL OF ENGINEERING

KATHMANDU UNIVERSITY

MODELING & SIMULATION

IN CHEMICAL ENGINEERING

MINI PROJECT REPORT

SUBMITTED BY: SUBMITTED TO:

SACHIN BANJADE DR. KUNDAN LAL SHRESTHA

ROLL: 06
Introduction

Dehydrogenation is a chemical reaction that involves the removal of hydrogen from an organic


molecule. It is the reverse of hydrogenation. Dehydrogenation is an important reaction because it
converts alkanes, which are relatively inert and thus low-valued, to olefins (including alkenes),
which are reactive and thus more valuable. A common example of a dehydrogenation reaction is
taken, where gas phase dehydrogenation of benzene into diphenyl and further to triphenyl takes
place. The aim is to maximize the production of D and to minimize the formation of T. The
occurring reaction in the reactor is given as:

(K1)
2C6H6(B) C12H10(D) + H2(H)

(K2)
C6H6(B) C12H10(D) + C18H14(T) + H2(H)

Figure 1: Partial pressure variable for a tubular reactor

Purpose of study:

Using python programming:

1. Study the effect of varying space time on the fractional conversions X1 and X2
2. Study the value of composition over a wide range value of space time.
3. Show that the composition of Diphenyl passes through a maximum.
4. Plotting r1 and r2 vs. space time.
5. Study the effects of temperature.
Method:

The kinetic modelling of the problem is given in terms of Arrhenius relationships


And partial-pressure relationships as:

PD PH 8440 )
r1 = -k 1 (P2B- ) where, k1=1.469*107 e(
K eq1 Tr
PB P H 8440 )
r2=−k 2( ) where, k2=8.67*106 e(
K eq 2 Tr

At steady-state conditions, the mass balance design equations for the ideal tubular reactor apply.
These equations may be expressed as:
d X1
V F=−∫ =τ
r1

d X2
V F=−∫ =τ
r2

Where X1 is the fractional conversion of benzene by reaction (1), X2 is the fractional conversion
of benzene by the reaction (2) and τ is the space time.

In differential form:
d X1
=−r 1

d X2
=−r 2

Expressing PB, PH, PT, PD in terms of X1 and X2

PB= (1-X1-X2)
X
PD= 1 −X 2
2

X1
PH= + X ❑2
2

PT=X2

Ptot=PB+PD+PH+PT
Substituting into the mass balance:
X1 X1
)( )
d X1
dτ ( 2
=k 1 ( 1−X 1−X 2 ) −
2 (
−X 2

K eq1
2
+X2
)
d X2
( X
=k 1 ( 1−X 1 −X 2)( 1 − X 2)−
(X )
1
( X2) 2 + X2
)
dτ 2 K eq2

Nomenclature and symbols:

keq1, keq2 =Equilibrium constants


1
k1, k2 = Reaction rate constants ( )
at m 2 h
PB= Partial pressure of benzene (atm)
PD= Partial pressure of diphenyl (atm)
PH= Partial pressure of hydrogen (atm)
PT= Partial pressure of triphenyl (atm)
1
r1 and r2= Reaction rates ( ¿
h
Tr= Temperature (K)
X1 and X2= Fractional conversion
τ = Space time (h)

Coding:
The coding for the given problem involves the use of various libraries and function such as
numpy, scipy, pylab and etc.

#Solution of dehydrogenation of benzene in a isotherma1 tubular reactor


import numpy as np
import pylab as plt
from scipy import *
from numpy import diff
from scipy import integrate
from scipy.integrate import odeint
from scipy.misc import derivative
tr=1033
keq1=0.312
keq2=0.480
cint=0.1
tfin=1
stfin=tfin
k1=1.496e7*exp(-15200/tr)
k2=8.670e6*exp(-15200/tr)
x10=0
x20=0
nint=20
tfin=1
t=linspace(0,tfin,nint)

#for problem 1
X0=array([x10,x20])
def dX_dt(X,t=0):
return array([k1*((1-X[0]-X[1])**2-((X[0]/2-X[1])*(X[0]/2+X[1])/keq1)),
k2*((1-X[0]-X[1])*(X[0]/2-X[1])-((X[0]/2+X[1])*X[1])/keq2)])
print (dX_dt)
X,infodict=integrate.odeint(dX_dt, X0, t, full_output=True)
print(infodict['message'])
x1,x2=X.T
print(x1,x2)
plt.plot(t,x1,label="x1")
plt.plot(t,x2,label="x2")
plt.legend(loc="best")
plt.xlabel("Time")
plt.ylabel("Conversion")

#for problem 2
PB=(1-x1-x2)
PD=x1/2-x2
PH=x1/2+x2
PT=x2
Ptot=PB+PD+PH+PT
yb=PB/Ptot
yd=PD/Ptot
yh=PH/Ptot
yt=PT/Ptot
print(yb)
print(yd)
print(yt)
plt.figure()
plt.plot(t,yd,label="diphenyl")
plt.plot(t,yb,label="benzene")
plt.plot(t,yt,label="triphenyl")
plt.legend(loc="best")
plt.xlabel("Time")
plt.ylabel("Composition yb,yd,yt")
#for probelem 4
def AB(x,t=0):
A=x[0]
B=x[1]
T=1033
k1=1.496E7*exp(-15200/T)
k2=8.67E6*exp(-15200/T)
keq1=0.312
keq2=0.48
dAdt=k1*((1-A-B)**2-((A/2-B)*(A/2+B))/keq1)
dBdt=k2*((1-A-B)*(A/2-B)-(B*(A/2+B))/keq2)
return(dAdt,dBdt)
x0=[0,1]
t=np.linspace(0,1,50)
x=integrate.odeint(AB,x0,t,)
A=x[:,1]
B=x[:,0]
print(A)
plt.figure()
plt.plot(t,A,'g',label="r1")
plt.legend(loc="best")
plt.xlabel("Time")
plt.ylabel("rate")
print(B)
plt.plot(t,B,label="r2")
plt.legend(loc="best")
plt.xlabel("Time")
plt.ylabel("rate")

#for problem 5
tr=np.linspace(298,1033,20)
def dx1_dt(X):
k1=1.496e7*exp(-15200/X)
k2=8.670e6*exp(-15200/X)
return k1*((1-x1-x2)**2-((x1/2-x2)*(x1/2+x2)/keq1))
r1=-(1.496e7*exp(-15200/tr))*((1-x1-x2)**2-(((x1/2)-x2)*((x1/2)+x2)/keq1))
print(r1)
plt.figure()
plt.plot(tr,r1)
plt.xlabel("Temperature")
plt.ylabel("rate")

Discussion:

After successfully modeling the problem and coding the information in python programming,
several study were conducted regarding the effect of space time on the rate, conversion and
composition and effect of temperature on the rate of reaction. Library function used in each
section of the programming and its mechanism are discussed separately section-wise.

For problem 1:
Soon as the reaction proceeds the conversion of reactant species into corresponding product
starts. With the expense of time, more amount of reactant species is converted into the product.
At τ =0, the conversion value in both of the reaction is zero, and this value increases to a
maximum of 1. The range for space time is set using linspace(start, end, no. of interval) library
function. For space time in range 0≤ τ ≤1, following graph is obtained:

Figure 2. Effect on conversion vs. space time

dX_dt is a function which stores and prints the result as array. X [*] denotes each array for
different conversion value for two different reaction.

For problem 2:

p yi
The composition( y i= ) of species being a function of conversion varies on varying the space
p
time. The equation for partial pressure is expressed in terms of conversion. A graph by plotting
between compositions of species over a range of space time is obtained as:

Figure 3. Composition vs. time

For problem 3:

In this part, we want to see if the composition of YB passes through a maximum value. Looking
at the graph shown above in Figure 3. , we can conclude that the composition of YB passes
through a maximum value of around 0.2

For problem 4:

The rate of a reaction is given as the negative derivative of conversion for the reaction with
respect to time.

 First we declare a function AB and we put 'x' and 't' as an arguments.


 t : array: A sequence of time points for which to solve for y. The initial value point
should be the first element of this sequence.
 With 't' set initially to zero, values of A and B were put into X.
 X is an array that stores values for A and B.
 We assign the values for keq1, keq2, and t with use of linespace()
 The result is a derivative value in form of array and is returned as an array.
 x0 denotes the initial values for argument as [0,1]
 Line[:,1 ] sliced the array, taking all rows (:) but keeping the second column (1)
 Finally calling odeint function generates the solution for r 1 and r2.

Figure 4. Rate of reaction vs. time

For problem 5:

Now, we desire to see the effect of varying the temperature upon the rate of reaction. Since the
equilibrium constant for a reaction is a function of temperature. Thus, the rate of a reaction being
a function of equilibrium constant varies with varying in the temperature. The value of
temperature is taken in a range of 25-1500 using linspace() function and the rate of reaction over
this range of temperature is studied with the help of a graph. We have a relation relating the rate
of reaction with temperature.
Figure 5. rate of reaction vs. temperature

A list of common library function used in coding were:

 numpy library was imported to use array


 scipy library was imported for integration and derivative.
 Pylab was imported as p to use the graphing properties.
 Linspace defines the division of the start to end points in the specified fragments.
 For instance:
T=linspace(0, 10, 5) means the value of T is divided into 5 fragments from 1 to 10
meaning the space is of 2 points (10/5=2); T=0,2,4,6,8,10

The library pylab is used as 'plt' to plot the graph of rate or conversion of each species vs. time or
temperature.

 plt.xlabel("time") gives x axis label as temperature or space time.


 plt.ylabel("concentration") and gives y axis label as concentration
 plt.legend(loc="best")gives the legend on the best side of graph.
 p.figure() displays the figure.

También podría gustarte