# initialization of variables
AFactual=20 # air fuel ratio actual
# The energy balance is done from equation
# C4H10 + 6.5(O2+3.76N2)-----> 4CO2 + 5H2O + 24.44N2
P=100 # atmospheic preesure in kPa
mair=6.5*(1+3.76)*29 # mass of air
mfuel=1*58 # mass of fuel
AFth=mair/mfuel # theoritical air-fuel ratio
Pexcessair=(AFactual-AFth)*100/AFth
print "The % excess air is",round(Pexcessair,2),"% \n"
# NOW THE REACTION IS
# C4H10+ (1+%excessair/100)*6.5*(O2+3.76N2) -----> 4CO2 + 5H2O + 1.903O2 + 31.6N2
PCO2=4/42.5*100 # VOLUME % OF CO2
print "The volume % of CO2 is",round(PCO2,2),"% \n"
# NOW WE FIND DEW POINT
Nv=5 # moles of water
N=42.5 # moles of air
Pv=P*(Nv/N) # partial pressure of vapour
Tdp=49# dew point temperature in degree celsius from table C.2
print "The Dew point temperature is",round(Tdp,2),"degree celsius"
# initialization of variables
Pair=0.9 # 90% air is used for combustion
# THE REACTION IS
# C4H10 + 0.9*6.5*(O2+3.76N2)----> aCO2 + 5H20 + bCO
# a and b are calculated by atomic balance
a=2.7
b=1.3
PCO=b*100/31 # volume % of CO
print "The volume % of CO is",round(PCO,2),"% \n"
mair=6.5*Pair*4.76*29 # mass of air in kg
mfuel=1*58 # mass of fuel butane in kg
AF=mair/mfuel # air-fuel ratio
print "The air to fuel ratio is",round(AF,2),"kg air/ kg fuel "
# THE SOLUTION IS CORRECT BUT THERE ARE SOME PRINTING MISTAKES IN TEXTBOOK
# initialization of variables
# THE REACTION IS
# aC4H10 + b(O2+3.76N2)----> CO2 + 1CO + 3.5H20 + 84.6N2 + cH2O
# a, b and c are calculated by atomic balance
# on balancing the equations we get a=3 b=22.5 c=15
# Now equation becomes
#C4H10 + 7.5(O2+3.76N2)----> 3.67CO2 + 0.33CO + 1.17H20 + 28.17N2 + 5H2O
#MOLES OF AIR in this equation is 7.5 moles
mairactual=7.5 # in moles
#MOLES OF AIR in standard equation of Ex.9 is 6.5
mairtheoritical=6.5
Ptheoriticalair=100*(mairactual/mairtheoritical)
print "The % theoritical air is",round(Ptheoriticalair,1),"% "
# initialization of variables
# The reaction equation is
#CaHb + c(O2+3.76N2)---> 10.4CO2 + 1.2CO + 2.8O2 + 85.6N2 + dH2O
# using atomic balancing the equations become
# C11.6H37.9 + 21.08(O2+3.76N2)---> 11.6CO2 + 18.95H2O + 79.26N2
Ptheoriticalair=22.8*100/21.08 # theoritical air
excessair=Ptheoriticalair-100
print"The excess air is",round(excessair),"%"
# initialization of variables
# The reaction equation is
#C3H8 + 5(O2+3.76N2)---> 3CO2 + 18.8N2 + 4H2O
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
hfCO2=-393520 # enthalpy associated with CO2
hfH2O=-285830 # enthalpy associated with H2O(l)
hfC3H8=-103850# ehthalpy associated with C3H8
# by first law Q= Hproducts - Hreactants
Qg=3*(hfCO2)+4*(hfH2O)-(hfC3H8) # enthalpy of combustion for gaseous propane
print " The enthalpy of combustion for gaseous propane is",round(Qg),"kJ\n"
hv=15060 # enthalpy of vaporization for propane
Ql=3*(hfCO2)+4*(hfH2O)-(hfC3H8-hv) # enthalpy of combustion for liquid propane
print " The enthalpy of combustion for liquid propane is",round(Ql),"kJ\n"
#The answers are slightly different in textbook as they have approximated the result while in Python results are precise
# initialization of variables
# The reaction equation is
#C3H8 + 5(O2+3.76N2)---> 3CO2 + 18.8N2 + 4H2O
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
hfCO2=-393520 # enthalpy of formation associated with CO2
hbarCO2=22280 #enthalpy associated with CO2 at 600K from table E.4
hdotbarCO2=9364#enthalpy associated with CO2 at 298K from table E.4
hfH2O=-241820 # enthalpy of formation associated with gaseous H2O
hbarH2O=20402 #enthalpy associated with H20 at 600K from table E.6
hdotbarH2O=9904#enthalpy associated with H20 at 298K from table E.6
hfC3H8=-103850# ehthalpy of formation associated with C3H8
hbarN2=17563 #enthalpy associated with N2 at 600K from table E.2
hdotbarN2=8669#enthalpy associated with N2 at 298K from table E.2
# by first law Q= Hproducts - Hreactants
Qg=3*(hfCO2+hbarCO2-hdotbarCO2)+4*(hfH2O+hbarH2O-hdotbarH2O)+18.8*(hbarN2-hdotbarN2)-(hfC3H8) # enthalpy of combustion
print"The heat transfer required is",round(Qg),"kJ\n"
#The answer is WRONG textbook as they have made an error in calculating Qg
import math
# initialization of variables
# The reaction equation is
#C8H18 + 12.5(O2+3.76N2)---> 8CO2 + 47N2 + 9H2O
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
hfCO2=-393520 # enthalpy of formation associated with CO2
hbarCO2=42769 #enthalpy associated with CO2 at 1000K from table E.4
hdotbarCO2=9364#enthalpy associated with CO2 at 298K from table E.4
hfH2O=-241820 # enthalpy of formation associated with gaseous H2O
hbarH2O=35882 #enthalpy associated with H20 at 1000K from table E.6
hdotbarH2O=9904#enthalpy associated with H20 at 298K from table E.6
hfC3H8=-103850# ehthalpy of formation associated with C3H8
hbarN2p=(30784+29476)/2 #enthalpy associated with N2 at 1000K from table E.2 by averaging enthalpy at 1020K and 980K for product
hbarN2r=17563 #enthalpy associated with N2 at 600K from table E.2 for reactant
hdotbarN2=8669#enthalpy associated with N2 at 298K from table E.2
hfC8H18=-249910 # enthalpy of formation associated with octane taken from internet as not provided in textbook
hbarO2=17929 # enthalpy associated with O2 at 600K table E.3
hdotbarO2=8682#enthalpy associated with O2 at 298K table E.3
# using first law and including kinetic energy change
# 0=Hp-Hr+Mp*(V^2)/2
Hp=8*(hfCO2+hbarCO2-hdotbarCO2)+9*(hfH2O+hbarH2O-hdotbarH2O)+47*(hbarN2p-hdotbarN2)
# enthalpy of products
Hr=(hfC8H18)+12.5*(hbarO2-hdotbarO2)+47*(hbarN2r-hdotbarN2)
# enthalpy of reactants
Mp=8*44+9*18+47*28 #(mass of products by multiplying molecular mass to number of moles)
V=math.sqrt(2*1000*(Hr-Hp)/Mp)# exit velocity using energy balance
print "The exit velocity is",round(V),"m/s"
#The answers are slightly different in textbook as they have approximated the values while in Python results are precise
# initialization of variables
# The reaction equation with theoritical air is
# C8H18 + 12.5(O2+3.76N2)---> 8CO2 + 47N2 + 9H2O
# for 400% theoritical air reaction is
# C8H18 + 50(O2+3.76N2)---> 8CO2 + 188N2 + 9H2O + 37.5O2
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
hfCO2=-393520 # enthalpy of formation associated with CO2
hbarCO2=42769 #enthalpy associated with CO2 at 1000K from table E.4
hdotbarCO2=9364#enthalpy associated with CO2 at 298K from table E.4
hfH2O=-241820 # enthalpy of formation associated with gaseous H2O
hbarH2O=35882 #enthalpy associated with H20 at 1000K from table E.6
hdotbarH2O=9904#enthalpy associated with H20 at 298K from table E.6
hbarN2p=(30784+29476)/2 #enthalpy associated with N2 at 1000K from table E.2 by averaging enthalpy at 1020K and 980K
hdotbarN2=8669#enthalpy associated with N2 at 298K from table E.2
hfC8H18=-249910 # enthalpy associated with octane taken from internet as not provided in textbook
hbarO2=31389 # enthalpy associated with O2 at 1000K table E.3
hdotbarO2=8682#enthalpy associated with O2 at 298K table E.3
Hp=8*(hfCO2+hbarCO2-hdotbarCO2)+9*(hfH2O+hbarH2O-hdotbarH2O)+37.5*(hbarO2-hdotbarO2)+188*(hbarN2p-hdotbarN2)# enthalpy of products
Hr=(hfC8H18)
# enthalpy of reactants
Q=Hp-Hr # using first law2
print " The heat transfer is",round(Q),"kJ"
#The answers are slightly different in textbook as they have approximated the values while in Python results are precise
# initialization of variables
# The reaction equation is
#C3H8 + 5O2---> 8CO2 + 4H2O
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
hfCO2=-393520 # enthalpy associated with CO2
hfH2O=-241820 # enthalpy associated with gaseous H2O
hfC3H8=103850# enthalpy of formation associated with C3H8
hfgC3H8=15060# enthalpy of vapourization associated with C3H8
T=20+273 # temperature in kelvin
Rbar=8.314 # universal gas constant
Nr=6 # number of moles of reactants
Np=7 # number of moles of products
Hp=3*(hfCO2)+4*(hfH2O) # enthalpy of products
Hr=hfC3H8+hfgC3H8 # enthalpy of reactants
Q=(Hp-Hr-(Nr-Np)*Rbar*T)*10**(-3) # heat transfer from first law
print " The heat transfer is",round(Q),"MJ"
#The answers are slightly different in textbook as they have approximated the values while in Python results are precise
# initialization of variables
# The reaction equation for theoritical air is
#C3H8 + 5(O2 + 3.76N2) ---> 3CO2 + 4H2O + 18.8N2
# for 250% theoritical air reaction becomes
#C3H8 + 12.5(O2 + 3.76N2) ---> 3CO2 + 4H2O + 47N2 + 7.5O2
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
Np=47+7.5+4+3 # number of moles of product
hfCO2=-393520 # enthalpy of formation associated with CO2
hbarCO2=(62963+65271)/2 #enthalpy associated with CO2 at 1380 K from table E.4
hbarCO2dash=(58381+60666)/2 #enthalpy associated with CO2 at 1300 K by average from table E.4
hdotbarCO2=9364#enthalpy associated with CO2 at 298K from table E.4
hfC3H8=-103850# ehthalpy of formation associated with C3H8
hfH2O=-241820 # enthalpy of formation associated with gaseous H2O
hbarH2O=(51521+53351)/2 #enthalpy associated with H20 at 1380 K by taking average from table E.6
hbarH2Odash=48807 #enthalpy associated with H20 at 1300 K from table E.6
hdotbarH2O=9904#enthalpy associated with H20 at 298K from table E.6
hbarN2=42920 #enthalpy associated with N2 at 1380K from table E.2 by interpolating enthalpy between 1020K and 980K
hbarN2dash=40170 #enthalpy associated with N2 at 1300 K from table E.2
hdotbarN2=8669#enthalpy associated with N2 at 298K from table E.2
hfO2=(44198+45648)/2 # enthalpy associated with O2 at 1380 Kby taking average from table E.3
hfO2dash=48807 # enthalpy associated with O2 at 1380 Kby taking average from table E.3
hdotbarO2=8682#enthalpy associated with O2 at 298K table E.3
# for adiabatic flame temperature first assume products composed only of nitrogen and Q=0 as adiabatic
hp=(hfC3H8-3*(hfCO2)-4*(hfH2O))/Np +hdotbarN2
# using hp we assume temp=1380 K
# then energy for 1380 k is
H1=3*(hfCO2+hbarCO2-hdotbarCO2)+4*(hfH2O+hbarH2O-hdotbarH2O)+7.5*(hfO2-hdotbarO2)+47*(hbarN2-hdotbarN2) # energy assuming temperature to be 1380 K
#this is very large
# now at 1300 K adiabatic temperature
H2=3*(hfCO2+hbarCO2dash-hdotbarCO2)+4*(hfH2O+hbarH2Odash-hdotbarH2O)+7.5*(hfO2dash-hdotbarO2)+47*(hbarN2dash-hdotbarN2) # energy assuming temperature to be 1300 K
# now interpolation between these two temperatures
Tp=1300-((hp+H2)/(H1-H2))*(1380-1300) # adiabatic temperature by interpolation
print "The adiabatic flame temperature is",round(Tp),"K"
#The answers is different in textbook as they have printed the value of hfCO2 with positive sign while calculating H2
# initialization of variables
# The reaction equation for theoritical air is
#C3H8 + 5(O2 + 3.76N2) ---> 3CO2 + 4H2O + 18.8N2
# All the enthalpy of formation values are taken from Table B.5 with units in kJ/mol
Np=18.8+4+3 # number of moles of product
hfCO2=-393520 # enthalpy associated with CO2
hbarCO2=137400 #enthalpy associated with CO2 at 2600 K from table E.4 by interpolation
hbarCO2dash=125152 #enthalpy associated with CO2 at 2400 K from table E.4
hdotbarCO2=9364#enthalpy associated with CO2 at 298K from table E.4
hfC3H8=-103850# ehthalpy associated with C3H8
hfH2O=-241820 # enthalpy associated with gaseous H2O
hbarH2O=114273 #enthalpy associated with H20 at 2600 K from table E.6
hbarH2Odash=103508 #enthalpy associated with H20 at 2400 K from table E.6
hdotbarH2O=9904#enthalpy associated with H20 at 298K from table E.6
hbarN2=86600 #enthalpy associated with N2 at 2600 K from table E.2 by interpolation
hbarN2dash=79320 #enthalpy associated with N2 at 2400 K from table E.2
hdotbarN2=8669#enthalpy associated with N2 at 298K from table E.2
# for adiabatic flame temperature first assume products composed only of nitrogen and Q=0 as adiabatic
hp=(hfC3H8-3*(hfCO2)-4*(hfH2O))/Np +hdotbarN2
# using hp we assume temp=2600 K
# then energy for 2600 k is
H1=3*(hfCO2+hbarCO2-hdotbarCO2)+4*(hfH2O+hbarH2O-hdotbarH2O)+18.8*(hbarN2-hdotbarN2) # energy assuming temperature to be 2600 K
# now at 2400 K adiabatic temperature
H2=3*(hfCO2+hbarCO2dash-hdotbarCO2)+4*(hfH2O+hbarH2Odash-hdotbarH2O)+18.8*(hbarN2dash-hdotbarN2) # energy assuming temperature to be 2400 K
# now interpolation between these two temperatures
Tp=2400-((hp+H2)/(H1-H2))*(2600-2400) # adiabatic temperature by interpolation
print "The adiabatic flame temperature is",round(Tp),"K"
#The answers are slightly different in textbook as they have approximated the values while in Python results are precise