Chapter 11 : Basics of Non-Ideal Flow

Example 11.1 pageno : 267

In [1]:
%matplotlib inline

from numpy import *
from matplotlib.pyplot import *
import math 

# Variables
T = array([0,5,10,15,20,25,30,35])    # time
Cpulse = array([0,3,5,5,4,2,1,0])     # tracer output concentration
dt = 5.;
sum1 = 0.;
sum2 = 0.;
Area = 0.               #Initialization

# Calculations
for i in range(8):
    sum1 = sum1+T[i]*Cpulse[i]*dt;
    sum2 = sum2+Cpulse[i]*dt;
    Area = Area+Cpulse[i]*dt;

t = sum1/sum2;
E = zeros(8)
for j in range(8):
    E[j] = Cpulse[j]/Area;

# Results
print " The mean residence time is %.f min "%(t)
plot(T,E)
plot(T,E,"go")
xlabel("t, min")
ylabel("E")
show()
Populating the interactive namespace from numpy and matplotlib
 The mean residence time is 15 min 

Example 11.2 pageno : 268

In [2]:
# Variables
M = 150.            #Molecular mass(gm)
v = 5.              #litre/sec
v = 5*60.           #litre/min
V = 860.            #litres
Cpulse = .75
# Calculations and Results
#From Material Balance
Area1 = M/v;        #gm.min/litre
A1 = 0.375;
Area2 = A1*(1+1./4+1./16+1./64+1./256+1./1024+1./4096);         #Taking Significant Areas


print " From material balance Area is %.1f gm.min/litre"%(Area1)
print " From Tracer Curve Area is %.1f gm.min/litre"%(Area2)
print " Part a"
print " As the two areas are equal,this is a properly done experiment "
#For the liquid,calculating t
sum1 = 0;
for i in range(10):
    sum1 = sum1+2*i*A1/(4**(i-1));
    t = sum1/Area1;

#liquid volume in vessel
Vl = t*v;
#Fraction of liquid
f = Vl/V;
E = Cpulse/(M/v)

print " Part b"
print " Fraction of liquid is %.f %%"%(f*100)

print " Part c"
print " The E curve is %.1f C"%E
print " Part d"
print " The vessel has  a strong recirculation of liquid,probably induced by the rising bubbles"
 From material balance Area is 0.5 gm.min/litre
 From Tracer Curve Area is 0.5 gm.min/litre
 Part a
 As the two areas are equal,this is a properly done experiment 
 Part b
 Fraction of liquid is 93 %
 Part c
 The E curve is 1.5 C
 Part d
 The vessel has  a strong recirculation of liquid,probably induced by the rising bubbles

Example 11.3 pageno : 272

In [6]:
# Variables
Cin = zeros(14)
E = zeros(14)
Cout = zeros(14)
Cin[0] = 0.
Cin[1] = 8.
Cin[2] = 4.
Cin[3] = 6
Cin[4] = 0
E[4] = 0
E[5] = 0.05
E[6] = 0.5
E[7] = 0.35
E[8] = 0.1
E[9] = 0.

# Calculations
for t in range(8,14):
    sum1 = 0;
    for p in range(5,t-1):
        if p>10 or (t-p)>5:
            h = 2;
        else:
            sum1 = sum1+Cin[t-p] * E[p];
            Cout[t] = sum1;

t = linspace(1,14,14)
Cout = transpose(Cout)

# Results
plot(t,Cout)
Out[6]:
[<matplotlib.lines.Line2D at 0x43ec990>]

Example 11.4 pageno : 275

In [5]:
import math 

# Variables
k = 0.307;            # min**-1
t = 15.;          

# Calculations and Results
fr_unconverted = math.exp(-k*t);
print " The fraction of reactant unconverted in a plug flow reactor is %.2f"%(fr_unconverted)

#For the real reactor
T = [5,10,15,20,25,30];                             #given time
E = [0.03,0.05,0.05,0.04,0.02,0.01];                #given
dt = 5;
sum1 = 0;
for i in range(6):
    sum1 = sum1+math.exp(-k*T[i])*E[i]*dt;

print " The fraction of reactant unconverted in a real reactor is %.3f"%(sum1)
 The fraction of reactant unconverted in a plug flow reactor is 0.01
 The fraction of reactant unconverted in a real reactor is 0.047

Example 11.5 pageno : 277

In [6]:
import math 
from scipy.integrate import quad 

# Variables
k = 0.5                     #litre/mol.min
CAo = 2.                    #mol/litre
to = 1.
t1 = 3.
E = 0.5

# Calculations
#Using eqn 13
def f2(t): 
	 return 1./(1+t)

XA_avg = 1-(E* quad(f2,to,t1)[0])
# Results
print " Average concentration of A remaining in the droplet is %.3f"%(XA_avg)
 Average concentration of A remaining in the droplet is 0.653
In [ ]: