Chapter 16:Reactive Systems

Ex16.2:pg-675

In [2]:
import math
eps_e = 0.27  # Constant
P = 1.0 # Atmospheric pressure in bar
K = (4*eps_e**2*P)/(1-eps_e**2) 
P1 = 100.0/760.0 # Pressure in Pa
eps_e_1 = math.sqrt((K/P1)/(4.0+(K/P1)))
T1 = 318.0 # Temperature in K
T2 = 298.0# Temperature in K
R = 8.3143 # Gas constant
K1 = 0.664 # dissociation constant at 318K
K2 = 0.141# dissociation constant at 298K
dH = 2.30*R*((T1*T2)/(T1-T2))*(math.log10(K1/K2))
print "\n Example 16.2\n"
print "\n K is ",K ," atm"
print "\n Epsilon is ",eps_e_1
print "\n The heat of reaction is ",dH ," kJ/kg mol"
#The answers vary due to round off error
 Example 16.2


 K is  0.314529177004  atm

 Epsilon is  0.611607081035

 The heat of reaction is  60974.6120608  kJ/kg mol

Ex16.3:pg-675

In [1]:
import math
v1 = 1.0 # Assumed
v2 = v1# Assumed 
v3 = v2 # Assumed
v4 = v2# Assumed
e = 0.56 # Degree of reaction
P = 1.0 # Dummy
T = 1200.0 # Reaction temperature in K
R = 8.3143 # Gas constant
x1 = (1-e)/2.0 # 
x2 = (1-e)/2.0
x3 = e/2.0 
x4 = e/2.0
K = (((x3**v3)*(x4**v4))/((x1**v1)*(x2**v2)))*P**(v3+v4-v1-v2) # Equilibrium constant
dG = -R*T*math.log(K) #Gibbs function change

print "\n Example 16.3\n"
print "\n Equilibrium constant is ",K
print "\n Gibbs function change is ",dG ,"J/gmol"
#The answers vary due to round off error
 Example 16.3


 Equilibrium constant is  1.61983471074

 Gibbs function change is  -4812.22485358 J/gmol

Ex16.5:pg-678

In [2]:
import math
Veo = 1.777 # Ve/Vo
e = 1.0-Veo # Degree of dissociation
P = 0.124 # in atm
K = (4*e**2*P)/(1.0-e**2)

print "\n Example 16.5\n"
print "\n The value of equillibrium constant is ",K ," atm"
 Example 16.5


 The value of equillibrium constant is  0.755668681281  atm

Ex16.6:pg-680

In [3]:
import math
v1 = 1.0 # Assumed
v2 = 0 # Assumed
v3 = 1.0 # Assumed
v4 = 1.0/2.0# Assumed
dH = 250560.0 # Enthalpy change in j/gmol
e = 3.2e-03 # Constant
R = 8.3143 # Gas constant
T = 1900.0 # Reaction temperature
Cp = ((dH**2)*(1+e/2)*e*(1+e))/(R*T**2*(v1+v2)*(v3+v4))
print "\n Example 16.6\n"
print "\n Cp is ",Cp ," J/g mol K"
#The answers vary due to round off error
 Example 16.6


 Cp is  4.48364424966  J/g mol K

Ex16.7:pg-681

In [4]:
import math
a = 21.89 # stochiometric coefficient
y = 18.5 # stochiometric coefficient
x = 8.9 # stochiometric coefficient
PC = 100*(x*12)/((x*12)+(y)) # Carbon percentage
PH = 100-PC # Hydrogen percentage
AFR = ((32*a)+(3.76*a*28))/((12*x)+y) #Air fuel ratio
EAU = (8.8*32)/((21.89*32)-(8.8*32)) # Excess air used

print "\n Example 16.7\n"
print "\n The composition of fuel is ",PH ," percent Hydrogen and ",PC ," percent Carbon"#The answer provided in the textbook is wrong
print "\n Air fuel ratio is ",AFR
print "\n Percentage of excess air used is ",EAU*100 ," percent"
#The answers vary due to round off error
 Example 16.7


 The composition of fuel is  14.7645650439  percent Hydrogen and  85.2354349561  percent Carbon

 Air fuel ratio is  23.9829146049

 Percentage of excess air used is  67.2268907563  percent

Ex16.8:pg-682

In [5]:
import math
hf_co2 = -393522.0 # Enthalpy of reaction in kJ/kg mol
hf_h20 = -285838.0# Enthalpy of reaction in kJ/kg mol
hf_ch4 = -74874.0# Enthalpy of reaction in kJ/kg mol
D = hf_co2 + (2*hf_h20) #Heat transfer 
QCV = D-hf_ch4 # Q_cv

print "\n Example 16.8\n"
print "\n Heat transfer per kg mol of fuel is ",D ," kJ"
print "\n Q_cv is ",QCV ," kJ"
#The answers vary due to round off error
 Example 16.8


 Heat transfer per kg mol of fuel is  -965198.0  kJ

 Q_cv is  -890324.0  kJ

Ex16.9:pg-683

In [6]:
import math
# Below values are taken from table
Hr = -249952+(18.7*560)+(70*540)
Hp = 8*(-393522+20288)+9*(-241827+16087)+6.25*14171+70*13491
Wcv = 150.0 # Energy out put from engine in kW
Qcv = -205.0 # Heat transfer from engine in kW
n = (Wcv-Qcv)*3600/(Hr-Hp)
print "\n Example 16.9 \n"
print "\n Fuel consumption rate is ",n*114 ," kg/h"
#The answers vary due to round off error
 Example 16.9 


 Fuel consumption rate is  38.5131749981  kg/h

Ex16.11:pg-684

In [7]:
import math
# Refer table 16.4 for values
T0 = 298.0 # Atmospheric temperature in K
Wrev = -23316-3*(-394374)-4*(-228583) # Reversible work in kJ/kg mol
Wrev_ = Wrev/44 # Reversible work in kJ/kg
Hr = -103847 # Enthalpy of reactants in kJ/kg
T = 980.0 # Through trial and error
Sr = 270.019+20*205.142+75.2*191.611 # Entropy of reactants
Sp = 3*268.194 + 4*231.849 + 15*242.855 + 75.2*227.485 # Entropy of products
IE = Sp-Sr # Increase in entropy
I = T0*3699.67/44 # Irreversibility
Si = Wrev_ - I# Availability of products of combustion 

print "\n Example 16.11 \n"
print "\n Reversible work is ",Wrev_ ," kJ/kg"
print "\n Increase in entropy during combustion is ",Sp-Sr ," kJ/kg mol K"
print "\n Irreversibility of the process ",I ," kJ/kg"
print "\n Availability of products of combustion is ",Si ," kJ/kg"
#The answers vary due to round off error
 Example 16.11 


 Reversible work is  47139  kJ/kg

 Increase in entropy during combustion is  3699.6688  kJ/kg mol K

 Irreversibility of the process  25056.8559091  kJ/kg

 Availability of products of combustion is  22082.1440909  kJ/kg

Ex16.12:pg-685

In [8]:
import math
T0 = 298.15 # Environment temperature in K
P0 = 1 # Atmospheric pressure in bar
R = 8.3143# Gas constant
xn2 = 0.7567  # mole fraction of nitrogen
xo2 = 0.2035 # mole fraction of oxygen
xh2o = 0.0312 # mole fraction of water
xco2 = 0.0003# mole fraction of carbon dioxide
# Part (a)
g_o2 = 0 # Gibbs energy of oxygen
g_c = 0 # Gibbs energy of carbon
g_co2 = -394380  # Gibbs energy of carbon dioxide
A = -g_co2 + R*T0*math.log(xo2/xco2) # Chemical energy

# Part (b)
g_h2 = 0 # Gibbs energy of hydrogen
g_h2o_g = -228590# # Gibbs energy of water
B = g_h2 + g_o2/2 - g_h2o_g + R*T0*math.log(xo2**0.5/xh2o)
# Chemical energy
# Part (c)
g_ch4 = -50790 # Gibbs energy of methane
C = g_ch4 + 2*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**2)/(xco2*xh2o))
# Chemical energy
# Part (d)
g_co = -137150# # Gibbs energy of carbon mono oxide
D =  g_co + g_o2/2 - g_co2 + R*T0*math.log((xo2**0.5)/xco2)
# Chemcal energy
# Part (e)
g_ch3oh = -166240 # Gibbs energy of methanol
E = g_ch3oh + 1.5*g_o2 - g_co2 - 2*g_h2o_g + R*T0*math.log((xo2**1.5)/(xco2*(xh2o**2)))
# Chemical energy
# Part (f)
F = R*T0*math.log(1/xn2)
# Chemical energy
# Part (g)
G = R*T0*math.log(1/xo2)
# Chemical energy
# Part (h)
H = R*T0*math.log(1/xco2)
# Chemical energy
# Part (i)
g_h2o_l = -237180 #  Gibbs energy of liquid water
I = g_h2o_l - g_h2o_g + R*T0*math.log(1/xh2o)
# Chemical energy
print "\n Example 6.12\n"
print "\n The chemical energy of carbon is  ",A ," kJ/k mol"
print "\n The chemical energy of hydrogen is  ",B ," kJ/k mol"
print "\n The chemical energy of methane is  ",C ," kJ/k mol"
print "\n The chemical energy of Carbon monoxide is  ",D ," kJ/k mol"
print "\n The chemical energy of liquid methanol is  ",E ," kJ/k mol"
print "\n The chemical energy of nitrogen is  ",F ," kJ/k mol"
print "\n The chemical energy of Oxygen is  ",G ," kJ/k mol"
print "\n The chemical energy of Carbon dioxide is  ",H ," kJ/k mol"
print "\n The chemical energy of Water is  ",I ," kJ/k mol"
#The answers vary due to round off error
 Example 6.12


 The chemical energy of carbon is   410541.588354  kJ/k mol

 The chemical energy of hydrogen is   235211.889921  kJ/k mol

 The chemical energy of methane is   821580.156423  kJ/k mol

 The chemical energy of Carbon monoxide is   275364.910207  kJ/k mol

 The chemical energy of liquid methanol is   716698.69005  kJ/k mol

 The chemical energy of nitrogen is   691.0909601  kJ/k mol

 The chemical energy of Oxygen is   3946.64370597  kJ/k mol

 The chemical energy of Carbon dioxide is   20108.2320604  kJ/k mol

 The chemical energy of Water is   5.21177422707  kJ/k mol

Ex16.13:pg-686

In [9]:
import math
# Environmet
T0 = 298.15 # Environment temperature in K
P0 = 1.0 # Atmospheric pressure in atm
R = 8.3143# Gas constant
xn2 = 0.7567  # mole fraction of nitrogen
xo2 = 0.2035 # mole fraction of oxygen
xh2o = 0.0312 # mole fraction of water
xco2 = 0.0003# mole fraction of carbon dioxide
xother = 0.0083 # Mole fraction of other gases
# Liquid octane
t1 = 25.0 # Temperature of liquid octane in degree centigrade
m = 0.57 # Mass flow rate in kg/h
T2 = 670 # Temperature of combustion product at exit in K
x1 = 0.114 # Mole fraction of CO2
x2 = .029 # Mole fraction of CO
x3 = .016 # Mole fraction of O2
x4 = .841 # Mole fraction of N2
Wcv = 1 # Power developed by the engine in kW
print "\n Example 6.13\n"
# By carbon balance 
b = 55.9 
# By hydrogen balace
c=9
# By oxygen balance
a = 12.58
Qcv = Wcv- 3845872*(.57/(3600*114.22))
E = 5407843.0 # Chemical exergy of C8H18
nII = Wcv/(E*.57/(3600*114.22))
print "\n The rate of heat transfer from the engine = ",Qcv ," kW,\n The second law of efficiency of the engine = ",nII*100 ," percent"
 Example 6.13


 The rate of heat transfer from the engine =  -4.33120060702  kW,
 The second law of efficiency of the engine =  13.3396896634  percent