Chapter 13 - Nonreactive and reactive gaseous mixtures

Example 1 - Pg 271

In [1]:
#calculate the mass and partial volumes of  of oxygen, nitrogen
#Initialization of variables
P=70. #psia
Pt=110. #psia
V=20. #cu ft
R0=1545. #Universal gas constant
T=540. #R
M=32. #Molecular weight of Oxygen
M2=28. #Molecular weight of Nitrgoen
#calculations
N=P*V*144/(R0*T)
mo=M*N
Pn=Pt-P
N2=Pn*V*144/(R0*T)
mn=N2*M2
Vo=N*R0*T/(144*Pt)
Vn=N2*R0*T/(144*Pt)
Vn2=V-Vo
#results
print '%s %.2f %s' %("Mass of oxygen =",mo," lb")
print '%s %.2f %s' %("\n Mass of nitrogen =",mn," lb")
print '%s %.2f %s' %("\n Partial volume of oxygen =",Vo," cu ft")
print '%s %.2f %s' %("\n Partial volume of nitrogen =",Vn," cu ft")
print '%s %.2f %s' %("\n In case 2, Partial volume of nitrogen =",Vn2," cu ft")
Mass of oxygen = 7.73  lb

 Mass of nitrogen = 3.87  lb

 Partial volume of oxygen = 12.73  cu ft

 Partial volume of nitrogen = 7.27  cu ft

 In case 2, Partial volume of nitrogen = 7.27  cu ft

Example 2 - Pg 274

In [15]:
#calculate the change in entropy
#Initialization of variables
import math
P=50. #psia
V=4. #cu ft
dv=3. #cu ft
J=778.
T=560. #R
#calculation
ds= 144*P*V*math.log((V+dv)/V) /(J*T)
#results
print '%s %.3f %s' %("Change in entropy =",ds,"unit")
Change in entropy = 0.037 unit

Example 3 - Pg 275

In [3]:
#Calculate the change in entropy
#Initialization of variables
import math
p1=50. #psia
t1=100+460. #R
R1=48.3
R2=55.2
v1=4. #cu ft
p2=100. #psia
v2=3. #cu ft
t2=200.+460 #R
cv1=0.157
cv2=0.177
cpm=0.219
J=778.
#calculations
m1=144*p1*v1/(R1*t1)
m2=144*p2*v2/(R2*t2)
tf=(m1*cv1*(t1-460) + m2*cv2*(t2-460))/(m1*cv1+m2*cv2)
Po2=v1/(v1+v2) *(tf+460)/t1 *p1
ds=cpm*math.log((tf+460)/t1) - R1/J *math.log(Po2/p1)
dss=ds*m1
#results
print '%s %.4f %s' %("Change in entropy =",dss,"unit")
Change in entropy = 0.0528 unit

Example 4 - Pg 277

In [1]:
#Calculate the change in entropy
#Initialization of variables
import math
p1=30 #psia
t1=80.+460 #R
R1=48.3
R2=55.2
m1=20. #lb/min
p2=50. #psia
m2=35. #lb/min
t2=160.+460 #R
cp1=0.219
cp2=0.248
J=778
#calculations
tf=(m1*cp1*(t1-460) + m2*cp2*(t2-460))/(m1*cp1+m2*cp2)
Po2=m1/32/(m1/32+m2/28) *p1
ds=cp1*math.log((tf+460)/t1) - R1/J *math.log(Po2/p1)
dss=ds*m1
#results
print '%s %.4f %s' %("Change in entropy =",dss,"units/min")
print '%s' %("The answer is a bit different fromm textbook due to rounding off error in textbook")
Change in entropy = 1.7754 units/min
The answer is a bit different fromm textbook due to rounding off error in textbook

Example 5 - Pg 278

In [2]:
#calculate the weight per mole and also the gas constant
#Initialization of variables
import numpy
x=([0.15, 0.08, 0.77])
M=([44, 32, 28])
#calculations
b=len(x)
y=numpy.zeros(b)
yt=numpy.zeros(b)
mt=numpy.zeros(b)
per=numpy.zeros(b)
wt=numpy.zeros(b)
R=numpy.zeros(b)
for i in range (0,b):
	y[i]=x[i]/M[i]

yt=sum(y)
for i in range (0,b):
	mt[i]=y[i]/yt
	per[i]=mt[i]*100

wt=1. /yt
R=1545. /wt

#results
print '%s' %("Volumetric analysis")
print '%s' %('percent by volume')
print (per)
print '%s %.1f %s' %("Weight per mole =",wt," lb")
print '%s %.1f' %("\n Gas constant =",R)
print '%s' %("The answer is a bit different fromm textbook due to rounding off error in textbook")
Volumetric analysis
percent by volume
[ 10.20408163   7.4829932   82.31292517]
Weight per mole = 29.9  lb

 Gas constant = 51.6
The answer is a bit different fromm textbook due to rounding off error in textbook

Example 6 - Pg 283

In [3]:
#calculate the theoretical air and amount of nitrogen
#Initialization of variables
x1=0.885 #mole fraction of Ch4
x2=0.115 #mole fraction of c2h6
x3=0.4/100. #mole fraction of N2
n1=2. #Moles of Ch4
n2=3.5 #Moles of c2h6
n3=1. #moles of ch4 in case 2
n4=2. #moles of c2h6 in case 2
#calculations
y1=n1*x1
y2=n2*x2
y=y1+y2
vec2=([y1, y2])
air=y/0.21
y3=n3*x1
y4=n4*x2
yy=y3+y4
vec3=([y3 ,y4])
air2=y/0.21 *0.79
#results
print '%s %.2f %s' %("Theoretical air =",air," moles of air per mole of fuel")
print '%s' %("Oxygen analysis")
print(vec2)
print '%s %.2f %s' %("\n Amount of nitrogen =",air2," moles of nitrogen per mole of fuel")
print '%s' %("Dry analysis")
print(vec3)
print '%s %.3f %s' %("total =",yy," moles")
print '%s' %("The answer is a bit different fromm textbook due to rounding off error in textbook")
Theoretical air = 10.35  moles of air per mole of fuel
Oxygen analysis
[1.77, 0.4025]

 Amount of nitrogen = 8.17  moles of nitrogen per mole of fuel
Dry analysis
[0.885, 0.23]
total = 1.115  moles
The answer is a bit different fromm textbook due to rounding off error in textbook

Example 7 - Pg 283

In [8]:
#calculate the theoretical air fuel ratio
#Initialization of variables
import numpy
x=([0.74, 0.06, 0.01]) #mole fraction of C, H and S respectively
y=([8./3., 8, 1]) #Pounds O2 per pound substance of C,H and S respectively
oxy=0.08 #Oxygen in coal
z=0.232 #mass of coal
#calculations
b=len(x)
pou = numpy.zeros(b)
for i in range (0,b):
	pou[i]=x[i]*y[i]

tot=sum(pou)
oxy2=tot-oxy
air=oxy2/z
#results
print '%s %.2f %s' %("Theoretical air fuel ratio =",air,"lb of air per pound of coal")
Theoretical air fuel ratio = 10.27 lb of air per pound of coal

Example 8 - Pg 284

In [9]:
#calculate air fuel ratio and also molal analysis
#Initialization of variables
o2=12.5 #moles of O2
h20=9 #moles of H2O
x=0.21 #Mole fraction of Oxygen in air
M=28.97 #Molar mass of air
M2=56. #molar mass of C4H8
M1=8*12+18. #molecular mass of c8h18
#calculations
air=o2/x
pound=air*M
AR=pound/M1
y1=h20/M2 *100.
y2=o2*(79./21) /M2 *100.
#results
print '%s %.2f %s' %("Air fuel ratio =",AR,"lb of air per pound of fuel")
print '%s %.2f %s %.2f %s' %("\n Molal or volumetric analysis is",y1, "percent of CO2 and",y2, "percent N2")
Air fuel ratio = 15.13 lb of air per pound of fuel

 Molal or volumetric analysis is 16.07 percent of CO2 and 83.97 percent N2

Example 9 - Pg 285

In [10]:
#calculate the volumetric analysis and also volume of wet products
#Initialization of variables
x=18.5 #Moles of O2
c=12. #Moles of CO2
vap=13. #moles of H2O
P=15. #psia
R=1545. #Universal gas constant
#calculations
excess=x*0.5
M=12*12+2*vap
n2=(x+excess)*79/21.
nt=n2+excess+c
dry=([c, x/2, n2]) 
b= len(dry)
for i in range(0,b):
	dry[i] = dry[i] /nt *100

wet=nt+vap
fue=100./(M)
mol=wet*fue
vol=mol*R*1460./(144*P)
#results
print '%s' %("Volumetric analysis in percentage")
print ('       CO2         O2          N2')
print (dry)
print '%s %d %s' %("Volume of wet products =",vol,"cfm")
Volumetric analysis in percentage
       CO2         O2          N2
[9.55088118249005, 7.362137578169414, 83.08698123934053]
Volume of wet products = 85167 cfm

Example 10 - Pg 286

In [11]:
#calculate the volumetric analysis
#Initialization of variables
import numpy
from numpy import linalg
from numpy.linalg import inv
A=numpy.array([[1, 1], [0.5, 1]])
B=numpy.array([[1],[ 0.9]])
x=0.9
#calculations
N2=x*79./21.
C=numpy.linalg.solve(A,B)
vec= ([ C[0], C[1], N2])
su=sum(vec)
b= len(vec)
vec2=numpy.zeros(b)
for i in range (0,b):
	vec2[i]=vec[i]/su *100.;

#results
print '%s' %("Volumetric analysis")
print '%s' %('CO      CO2      N2')
print (vec2)
Volumetric analysis
CO      CO2      N2
[  4.56026059  18.24104235  77.19869707]

Example 11 - Pg 288

In [12]:
#calculate the Moles of dry products per pound of coal
#Initialization of variables
c=0.74
ref=0.02
co2=0.12
co=0.1/100.
M=12.
#calcualtions
carbon=c-ref
car2=co2+co
wt=car2*M
amount=carbon/wt
#results
print '%s %.3f %s' %("Moles of dry products per pound of coal =",amount," mole")
Moles of dry products per pound of coal = 0.496  mole

Example 12 - Pg 289

In [13]:
#calculate the Number of moles of dry products per pound of fuel
#Initialization of variables
x1=0.128
x2=0.035
x3=0.002
M=12.
N=26.
#calculations
c=x1+x3
mole=12./c
wt=M*M+N
num=mole/wt
#results
print '%s %.3f %s' %("Number of moles of dry products per pound of fuel =",num," mole")
Number of moles of dry products per pound of fuel = 0.543  mole

Example 13 - Pg 289

In [14]:
#calculate the weight of air and excess air percentage
#Initialization of variables
c=0.74
ref=0.02
co2=0.12
co=0.1/100.
o2=0.065
M=12
x=0.79
M=28.97
#calcualtions
n2=1-(co2+co+o2)
mol=n2/x
wt=mol*M
wt2=0.496
pou=wt2*wt
ta=10.27
EA=(pou-ta)/ta *100
#results
print '%s %.2f %s' %("Weight of air per pound of fuel =",pou,"lb")
print '%s %.1f %s' %("\n Excess air percentage =",EA,"percent")
Weight of air per pound of fuel = 14.81 lb

 Excess air percentage = 44.2 percent