Chapter12-ideal gas mixtures and humid air

Example1-pg 338

In [1]:
import math
#calculate molecular weight of air
##initialisation of variables
x= 0.78
x1= 0.21
x2= 0.008
x3= 0.002
MN2= 28.013 ##gms
MO2= 32. ##gms
MAr= 39.948 ##gms
MH2O= 18.016 ##gms
##CALCULATIONS
M= x*MN2+x1*MO2+x2*MAr+x3*MH2O
##RESULTS
print'%s %.3f %s'% ('molecular wight of air=',M,'kg/kmol')
molecular wight of air= 28.926 kg/kmol

Example2-pg341

In [2]:
import math
#calculate average value and mass
##initialisation of variables
M= 30.04 ##kg/kmol
R= 8.3143 ##J/mol K
p= 100. ##kPa
V= 0.2 ##m^3
T= 25. ##C
##CALCULATIONS
R1= R/M
m= p*V/(R1*(273.15+T))
##RESULTS
print'%s %.4f %s'% ('average value of R=',R1,'kJ/kg K')
print'%s %.3f %s'% ('mass=',m,'kg')
average value of R= 0.2768 kJ/kg K
mass= 0.242 kg

Example3-pg343

In [3]:
import math
#calculate final temperature and final pressure and change in entropy
##initialisation of variables
m1= 0.5 ##kg
cv1= 0.6496 ##kJ/kg K
T1= 80. ##C
m2= 1. ##kg
cv2= 0.6299 ##kJ/kg K
T2= 150. ##C
M= 32. ##kg
M1= 44. ##kg
V1= 0.11437 ##m^3
V2= 0.1 ##m^2
R= 8.314 ##J/mol K
##CALCULATIONS
T= (m1*cv1*(273.15+T1)+m2*cv2*(273.15+T2))/(m1*cv1+m2*cv2)
p= ((m1/M)+(m2/M1))*R*T/(V1+V2)
S= m1*(cv1*math.log(T/(273.15+T1))+(R/M)*math.log((V1+V2)/V1))+m2*(cv2*math.log(T/(273.15+T2))+(R/M1)*math.log((V1+V2)/V2))
##RESULTS
print'%s %.1f %s'% ('final temperature=',T,'kPa')
print'%s %.1f %s'% ('final pressure=',p,'kPa')
print'%s %.4f %s'% ('change in entropy=',S,'kJ/K')
final temperature= 399.3 kPa
final pressure= 594.0 kPa
change in entropy= 0.2291 kJ/K

Example4-pg354

In [4]:
import math
#calculate wet-bulb temoerature and minimum temperature and amount of water injected
##initialisation of variables
Twb= 22. ##C
Tmin= 22.3 ##C
w2= 0.0170 ##kg/kg dry air
w1= 0.0093 ##kg/kg dry air
##CALCULATIONS
m= w2-w1
##RESULTS
print'%s %.f %s'% (' wet-bulb temperature=',Twb,'C')
print'%s %.f %s'% ('minimum temperature=',Tmin,'1C')
print'%s %.4f %s'% ('amount of water injected=',m,'kg/kg dry air')
 wet-bulb temperature= 22 C
minimum temperature= 22 1C
amount of water injected= 0.0077 kg/kg dry air

Example5-pg356

In [5]:
import math
#calculate state after mixing
##initialisation of variables
w3= 0.0178 ##kg/kgair
w4= 0.0172 ##kg/kgair
##CALCULATIONS
dw= w3-w4
##RESULTS
print'%s %.4f %s'% (' state after mixing=',dw,'kg/kgair')
 state after mixing= 0.0006 kg/kgair

Example6-pg357

In [6]:
import math
#calculate air mass flow rate and amount of water to be added
##initialisation of variables
m= 20000. ##kg/h
T1= 42. ##C
T2= 22. ##C
J= 4.186 ##cal
h1= 54. ##kJ/kg
h2= 94.8 ##kJ/kg
w1= 0.0105 ##kg/h kg
w2= 0.0244 ##kg/h kg
##CALCULATIONS
ma= m*(T1-T2)*J/((h2-h1-J*T2*(w2-w1)))
mw= ma*(w2-w1)
m4= m-mw
##RESULTS
print'%s %.1f %s'%('air mass flow rate=',ma,'kg/hr')
print'%s %.f %s'%('amount of water to be added=',m4,'kg/hr')
air mass flow rate= 42368.5 kg/hr
amount of water to be added= 19411 kg/hr

Example7-pg359

In [7]:
import math
#calculate maximum useful work
##initialisation of variables
x= 0.79
P0= 101 ##kPa
P= 20 ##Mpa
V= 0.032 ##m^3
##CALCULATIONS
p= x*P0
Wrev= P*10*10*10*V*(math.log(P/(p*math.pow(10,-3)))+((p*math.pow(10,-3))/P)-1)
##RESULTS
print'%s %.1f %s'% (' maximum useful work=',Wrev,'kJ')
 maximum useful work= 2898.0 kJ