import math
xCO2 = 0.03 #mole fraction of CO2
xCO = 0.19 #mole fraction of CO
xH2 = 0.41 #mole fraction of H2
xCH4 = 0.25 #mole fraction of CH4
xC2H4 = 0.09 #mole fraction of C2H4
xN2 = 0.03 #mole fraction of N2
# Calculations and Results
#Part(a)
print "Parta";
M = xCO2*44 + xCO*28 + xH2*2 + xC2H4*28 +xCH4*16 + xN2*28 #kg/mol #average molar mass
yCO2 = xCO2*(44/M)
yCO = xCO*(28/M)
yH2 = xH2*(2/M)
yCH4 = xCH4*(16/M)
yC2H4 = xC2H4*(28/M)
yN2 = xN2*(28/M)
print "yCO2 = %.1f%%"%(yCO2*100)
print "yCO = %.1f%%"%(yCO*100)
print "yH2 = %.1f%%"%(yH2*100)
print "yCH4 = %.0f%%"%(yCH4*100)
print "yC2H4 = %.1f%%"%(yC2H4*100)
print "yN2 = %.1f%%"%(yN2*100)
#Part(b)
print "Partb";
nC = xCO2 + xCO + xCH4 + xC2H4*2 #number of moles of C
nH2 = xH2 + xCH4*2 + xC2H4*2 #number of moles of H2
nO2 = xCO2 + 0.5*xCO #number of moles of O2
nN2 = xN2 #number of moles of N2
mC = nC*12/M
mH2 = nH2*2/M
mO2 = nO2*32/M
mN2 = nN2*28/M
print "mC = %.1f%%"%(mC*100)
print "mH2 = %.1f%%"%(mH2*100)
print "mO2 = %.0f%%"%(mO2*100)
print "mN2 = %.1f%%"%(mN2*100)
# Variables
#Molar masses of O2,H2,N2,C and S respectively
MO2 = 32. #g/mol
MH2 = 2. #g/mol
MN2 = 28. #g/mol
MC = 12. #g/mol
MS = 32. #g/mol
#Part(a)
print "Parta"
print "Stoichiometric airCarbon) = %.2f kg/kg carbon"%((MO2 + 3.76*MN2)/MC)
#Part(b)
print "Partb"
print "Stoichiometric airHydrogen) = %.1f kg/kg hydrogen"%(0.5*(MO2 + 3.76*MN2)/MH2)
#Part(c)
print "Partc"
print "Stoichiometric airSulphur) = %.1f kg/kg sulphur"%((MO2 + 3.76*MN2)/MS)
# Variables
xC3H8 = 0.2 #mole fraction of propane
xC4H10 = 0.8 #mole fraction of bumath.tane
#Molar masses of O2,H2,N2 & C respectively
MO2 = 32. #g/mol
MH2 = 2. #g/mol
MN2 = 28. #g/mol
MC = 12. #g/mol
# Calculations and Results
#C balance
b = xC3H8*3+xC4H10*4
#H2 balance
d = xC3H8*4 + xC4H10*5
#O2 balance
a = b + d/2
#N2 balance
c = 3.76*a
Stoichiometric_air = a*(MO2 + 3.76*MN2)/(xC3H8*(MC+MO2)+xC4H10*(MC*4+MH2*5))
print "Stoichiometric air = %.2f kg/kg cooking gas"%(Stoichiometric_air)
# Variables
xC3H8 = 0.2 #mole fraction of propane
xC4H10 = 0.8 #mole fraction of bumath.tane
xO2 = 0.21 #mole fraction of O2
xN2 = 0.79 #mole fraction of N2
#Molar masses of O2,H2,N2 & C respectively
MO2 = 32. #g/mol
MH2 = 2. #g/mol
MN2 = 28. #g/mol
MC = 12. #g/mol
Stoichiometric_air = 15.42 #kg/kg
# Calculations and Results
#C balance
b = xC3H8*3+xC4H10*4
#H2 balance
e = xC3H8*4 + xC4H10*5
#O2 balance
d = 40*xO2-b -0.5*e
#N2 balance
c = 40*xN2
actual_air = 40*(xO2*MO2 + xN2*MN2)/(xC3H8*(MC*3+MH2*4)+xC4H10*(MC*4+MH2*5)) #kg/kg gas
excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100
print "Excess air = %.1f%%"%(excess_air)
theoritical_air = 100+excess_air
print "Theoritical air = %.1f%%"%(theoritical_air)
# Variables
nCO2 = 3.8 #Number of moles of CO2
nN2 = 31.6 #Number of moles of N2
nO2 = 2.2 #Number of moles of O2
# Calculations and Results
n = nCO2 + nN2 + nO2
xCO2 = nCO2/n #mole fraction of CO2
xN2 = nN2/n #mole fraction of N2
xO2 = nO2/n #mole fraction of O2
print "xCO2 = %.1f %% "%(xCO2*100)
print "xN2 = %.1f %% "%(xN2*100)
print "xO2 = %.1f %% "%(xO2*100)
# Variables
nCO2 = 3.8 #Number of moles of CO2
nN2 = 31.6 #Number of moles of N2
nO2 = 2.2 #Number of moles of O2
nH2O = 4.8 #Number of moles of H2O
# Calculations and Results
# Calculations and Results
n = nCO2 + nN2 + nO2 + nH2O
xCO2 = nCO2/n #mole fraction of CO2
xN2 = nN2/n #mole fraction of N2
xO2 = nO2/n #mole fraction of O2
xH2O = nH2O/n #mole fraction of H2O
print "Volume fraction of CO2 = %.1f%%"%(xCO2*100)
print "Volume fraction of N2 = %.1f%%"%(xN2*100)
print "Volume fraction of O2 = %.1f%%"%(xO2*100)
print "Volume fraction of H2O = %.1f%%"%(xH2O*100)
M = xCO2*44 + xN2*28 + xO2*32 + xH2O*18 #Mass of combustion product
yCO2 = xCO2*(44/M)
yH2O = xH2O*(18/M)
yN2 = xN2*(28/M)
yO2 = xO2*(32/M)
print "Mass fraction of CO2 = %.1f%%"%(yCO2*100)
print "Mass fraction of N2 = %.1f%%"%(yN2*100)
print "Mass fraction of O2 = %.1f%%"%(yO2*100)
print "Mass fraction of H2O = %.1f%%"%(yH2O*100)
#Part(a)
print "Parta"
mC = 0.65 #kg #mass of C per kg coal
mA = 0.15 #kg #mass of Ash per kg coal
CR = 0.05 #kg #mass of carbon in solid refuse per kg coal
mR = 0.2 #kg #mass of refuse per kg coal
m = mC- CR #kg #mass of carbon burnt per kg coal
#By C balance
x = (14 + 1)*(12/0.6) #kg #mass of burnt coal
#By H2 balance
b = x*(0.06/2)
#By O2 Balance
a = (14 + 0.5 + 3.5 + 4.5)-(x*0.1/32)
actual_air = a*(32+3.76*28)/x #kg/kg coal
print "Actual air = %.3f kg/kg coal"%(actual_air)
#Part(b)
print "Partb"
Stoichiometric_air = (0.6*11.45+0.06*34.3)-(0.1/0.232) #kg
excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100
print "Excess air = %.1f%%"%(excess_air)
#Part(c)
print "Partc";
print "Percentage theoritical air = %.1f%%"%(100+excess_air)
#Part(d)
print "Partd"
m = 14*44 + 1*28 +3.5*32 +81.5*28 +9*18 #kg #mass of combustion product
print "Mass fraction of CO2 = %.2f%%"%(14*44/m*100)
print "Mass fraction of CO = %.3f%%"%(1*28/m*100)
print "Mass fraction of O2 = %.2f%%"%(3.5*32/m*100)
print "Mass fraction of N2 = %.2f%%"%(81.5*28/m*100)
print "Mass fraction of H2O = %.2f%%"%(9*18/m*100)
#Part(e)
print "Parte"
xH2O = 9/(14+1+3.5+81.5+9) #molfraction of H2O
pH2O = xH2O*1e5 #Pa #partial pressure
#From steam table
tdp = 42.5 #°C
print "Dew point temperature = %.1f °C"%(tdp)
# note : part b is calculated wrong in book. so answers might be different.
# Variables
xCO2 = 9.7 #mole percent CO2
xCO = 1.1 #mole percent CO
xO2 = 4 #mole percent O2
xN2 = 85.2 #mole percent N2
# Calculations and Results
#by C balance
b = 2
#by H2 balance
d = 2
#by O2 balance
a = b+d*.5
#by N2 balance
c = 3.76*a
Stoichiometric_air = a*(32+3.76*28)/28 #kg/kg ethylene
#by C balance
x = (xCO2+xCO)/2 #kmol of ehtylene be burnt
#by H2 balance
q = 2*x
#by O2 balance
p = xCO2 + xCO/2 + xO2 + q/2
actual_air = p*(32+3.76*28)/(x*28) #kg/kg ethylene
excess_air = (actual_air - Stoichiometric_air)/Stoichiometric_air*100
print "Actual air = %.1f kg/kg ethylene "%(actual_air)
print "Excess air = %.0f%%"%(excess_air)
# variables
excess_air = 10. #%
tR = 30. #°C #temperature of reacmath.tant
tP = 120. #°C #temperature of product
delta_H = -802.3*1000 #kJ/kmol CH4
Cp_CH4 = 36. #kJ/lmolK
Cp_O2 = 29.5 #kJ/lmolK
Cp_N2 = 29.2 #kJ/lmolK
Cp_CO2 = 37. #kJ/lmolK
Cp_H2O = 33.7 #kJ/lmolK
tA = 30. #°C
tX = 25. #°C
tY = tX #°C
tB = 120. #°C
# Calculations and Results
Q_AB = (1*Cp_CO2 + 0.2*Cp_O2 + 8.272*Cp_N2 + 2*Cp_H2O)*(tB-tX)+ delta_H + (1*Cp_CH4 + 2.2*Cp_O2 +8.272*Cp_N2)*(tY-tA)
print "The heat transfer from the combustor = %.1f kJ/kg CH4 "%(Q_AB/16)
# Variables
deltaH_gasgas = -2651.4e3 #kJ/kmol bumath.tane
hfg_butane = 370 #kJ/kg #enthalpies of vaporisation of butance
hfg_water = 2442 #kJ/kg #enthalpies of vaporisation of water
M_butane = 58 #g/mol
M_water = 18 #g/mol
# Calculations and Results
deltaH_liqliq = deltaH_gasgas + M_butane*hfg_butane - 5*M_water*hfg_water
print "Enthalpy of reaction = %.1f kJ/kg"%(deltaH_liqliq/M_butane)
# Variables
#Formation Enthalpies
hf_CO2 = -393510. #kJ/kmol
hf_H2O = -285838. #kJ/kmol
hf_C3H8 = -104680. #kJ/kmol
hf_O2 = 0. #kJ/kmol
# Calculations and Results
Hp = 3*hf_CO2 + 4*hf_H2O
Hr = hf_C3H8 + 5*hf_O2
deltaH_std = Hp-Hr
print "Standard change in enthalpy for the reaction = %.0f kJ/kg"%(deltaH_std/44)
# Variables
Cp_C2H4 = 28*1.548 #kJ/lmolK
Cp_O2 = 32*0.922 #kJ/lmolK
Cp_N2 = 28*1.042 #kJ/lmolK
Cp_CO2 = 44*0.842 #kJ/lmolK
Cp_H2O = 18*1.86 #kJ/lmolK
# Calculations and Results
deltaH_BX = (2*Cp_CO2 + 2*Cp_H2O + 0.3*Cp_O2 + 12.408*Cp_N2)*(120-25)
deltaH_YA = (Cp_C2H4 + 3.3*Cp_O2 + 12.408*Cp_N2)*(25-50)
hf_CO2 = -393510. #kJ/kmol
hf_H2O = -241820. #kJ/kmol
hf_C2H4 = 52283. #kJ/kmol
deltaH_XY = 2*hf_CO2 + 2*hf_H2O - hf_C2H4 #kJ/kmol
deltaH_BA = deltaH_BX + deltaH_YA + deltaH_XY #kJ/kmol
print "The heat transferred from the combustor per kg ethylene = %.0f kJ/kg ethane"%(deltaH_BA/28)
#Part(a)
print "Parta"
#Picking up various Cp values from Table 12.1
tB = (16*50010)/(44*0.842+2*18*1.86+3*32*0.922+22.56*28*1.042)+25
print "Adiabatic combustion temperature using average Cp values)= %.1f K"%(tB+273)
#Part(b)
print "Partb"
tb1 = 1000. #K #first guess temperature
tb2 = 1200. #K second guess temperature
tb = (tb1 - tb2)/(637617-836847)*(800160-836847) + tb2
print "Adiabatic combustion temperature using ideal gas enthalpy = %.0f K"%(tb)
# Variables
delta_H_std = -45101. #kJ/kg
hfg = 2442. #kJ/kg #enthalpy of vaporisation
# Calculations and Results
LCV = -1*delta_H_std # kJ/kg hexane
print "LCV of gaseous hexane = %.1f kJ/kg hexane"%(LCV)
m = 7.*18./86 #mass of H2O per kg hexane
HCV = LCV+m*hfg #kJ/kg hexane
print "HCV of gaseous hexane = %d kJ/kg hexane"%(HCV)