Chapter18-Non-ideal solutions

Example2-pg 507

In [3]:
import math
#what is saturation pressure
##initialisation of variables
T= 80. ##C
p= 30. ##percent
pw= 47.39 ##kPa
psat= 36 ##kPa
##RESULTS
print'%s %.1f %s'%(' Saturation pressure=',psat,'kPa')
 Saturation pressure= 36.0 kPa

Example3-pg 507

In [4]:
import math
#what is temperature of pure water and saturation pressure
##initialisation of variables
T= 120. ##C
p= 30. ##percent
T2= 80. ##C
psat= 36. ##kPa
Tw= 73. ##C
##RESULTS
print'%s %.1f %s'% ('Temperature of pure water=',Tw,'C')
print'%s %.1f %s'% ('Saturation pressure=',psat,'kPa')
Temperature of pure water= 73.0 C
Saturation pressure= 36.0 kPa

Example5-pg 511

In [6]:
import math
#calculate enthalpys at 4 point and maximum temperature and new enthalpy
##initialisation of variables
p= 10. ##bar
P= 40. ##percent
x= 0.4
H1= 16. ##kcal/kg
H2= 31. ##kcal/kg
H3= 64. ##kcal/kg
H4= 140. ##kcal/kg
T= 157. ##C
He= 580. ##kcal/kg
##RESULTS
print'%s %.f %s'% ('Enthalpy=',H1,'kcal/kg')
print'%s %.f %s'% ('Enthalpy=',H2,'kcal/kg')
print'%s %.f %s'%  ('Enthalpy=',H3,'kcal/kg')
print'%s %.f %s'% ('Enthalpy=',H4,'kcal/kg')
print'%s %.f %s'% ('Maximum temperature=',T,'C')
print'%s %.f %s'% ('Enthalpy =',He,'kcal/kg')
Enthalpy= 16 kcal/kg
Enthalpy= 31 kcal/kg
Enthalpy= 64 kcal/kg
Enthalpy= 140 kcal/kg
Maximum temperature= 157 C
Enthalpy = 580 kcal/kg

Example6-pg 517

In [7]:
import math
#what is enthalpy and circulation ratio and COP and COPcarnot
##initialisation of variables
v= 0.0011 ##m^3
P1= 1200 ##Mpa
P2= 140 ##Mpa
h5= -103 ##kJ/kg
x4= 0.860
x7= 0.253
x5= 0.337
h1= 1658.1 ##kJ/kg
h7= 343.7 ##kJ/kg
h6= -1008 ##kJ/kg
h4= 639. ##kJ/kg
h3= 40. ##kJ/kg
Tc= -10. ##C
Th= 125. ##C
Ta= 25. ##C
m1= 1. ##kg/s
m7= 6.23 ##kg/s
m6= 7.23 ##kg/s
##CALCULATIONS
h6= h5+v*(P1-P2)
cr= (x4-x7)/(x5-x7)
Qhbym= h1+(m7/m1)*h7-(m6/m1)*h6
Qcbym= h4-h3
COP= Qcbym/Qhbym
COPcarnot= ((273.15+Tc)/(273.15+Th))*((Th-Ta)/(Ta-Tc))
##RESULTS
print'%s %.1f %s'% (' Enthalpy=',h6,'kJ/kg')
print'%s %.3f %s'% (' circulation ratio=',cr,'')
print'%s %.3f %s'% (' COP=',COP,'')
print'%s %.3f %s'%  (' COP carnot=',COPcarnot,'')
 Enthalpy= -101.8 kJ/kg
 circulation ratio= 7.226 
 COP= 0.132 
 COP carnot= 1.888