Chapter 09:Properties of pure substances

Ex9.1:pg-302

In [1]:
import math
# At 1 MPa
tsat = 179.91 # Saturation temperature in degree Celsius
vf = 0.001127 # Specific volume of fluid in m**3/kg
vg = 0.19444 # Specific volume of gas in m**3/kg 
sf = 2.1387 # Specific entropy of fluid in kJ/kgK
sg = 6.5865# Specific entropy of gas in kJ/kgK
print "\n Example 9.1"
vfg = vg-vf # Change in specific volume due to evaporation
sfg = sg-sf# Change in specific entropy due to evaporation
hfg = 2015.3
print "\n At 1 MPa, \n saturation temperature is ",tsat ," degree celcius"
print "\n Changes in specific volume is ",vfg ," m**3/kg"
print "\n Change in entropy during evaporation is ",sfg ," kJ/kg K"
print "\n The latent heat of vaporization is ",hfg ," kJ/kg"
# Data is given in the table A.1(b) in Appendix in the book
 Example 9.1

 At 1 MPa, 
 saturation temperature is  179.91  degree celcius

 Changes in specific volume is  0.193313  m**3/kg

 Change in entropy during evaporation is  4.4478  kJ/kg K

 The latent heat of vaporization is  2015.3  kJ/kg

Ex9.2:pg-302

In [2]:
import math
# Given that
s = 6.76 # Entropy of saturated steam in kJ/kgK
print "\n Example 9.2"
# From the table A.1(b) given in the book at s= 6.76 kJ/kgK
p = 0.6
t=158.85
v_g=0.3156
h_g=2756.8
print "\n pressure = ",p ," Mpa\n Temperature = ",t ," degree centigrade\n Specific volume = ",v_g ," m**3/kg\n enthalpy = ",h_g ," kJ/kg"
 Example 9.2

 pressure =  0.6  Mpa
 Temperature =  158.85  degree centigrade
 Specific volume =  0.3156  m**3/kg
 enthalpy =  2756.8  kJ/kg

Ex9.3:pg-302

In [3]:
import math
v = 0.09  # Specific volume of substance at a point in m**3/kg
vf = 0.001177 # Specific volume of fluid in m**3/kg
vg = 0.09963  # Specific volume of gas in m**3/kg
hf = 908.79 # Specific enthalpy of fluid in kJ/kg
hfg = 1890.7 # Latent heat of substance in kJ/kg
sf = 2.4474 # Specific entropy of fluid in kJ/kgK
sfg = 3.8935 # Entropy change due to vaporization

print "\n Example 9.3"
x = (v-vf)/(vg-vf) # steam quality
h = hf+(x*hfg) # Specific enthalpy of substance at a point in kJ/kg
s = sf+(x*sfg) # Specific entropy of substance at a point in kJ/kgK

print "\n The enthalpy and entropy of the system are\n ",h ," kW and ",s ," kJ/kg and kJ/kg K respectively."
#The answers vary due to round off error
 Example 9.3

 The enthalpy and entropy of the system are
  2614.55463998  kW and  5.96006442363  kJ/kg and kJ/kg K respectively.

Ex9.5:pg-303

In [4]:
import math
Psat = 3.973 # Saturation pressure in MPa
vf = 0.0012512 # specific volume of fluid in m**3/kg
vg = 0.05013 # Specific volume of gas in m**3/kg
hf = 1085.36  # Specific enthalpy of fluid in kJ/kg
hfg = 1716.2 # Latent heat of vaporization in kJ/kg
sf = 2.7927 # Specific entropy of fluid in kJ/kgK
sfg = 3.2802 # Entropy change due to vaporization in kJ/kgK
mf = 9.0 # Mass of liquid in kg
V = 0.04 # Volume of vessel in m**3
# at T = 250
uf = 1080.39 #Specific internal energy in kJ/kg 
ufg = 1522.0# Change in internal energy due to vaporization in kJ/kg

print "\n Example 9.5"
Vf = mf*vf # volume of fluid
Vg = V-Vf # volume of gas
mg = Vg/vg # mass of gas
m = mf+mg # mass if mixture
x = mg/m # quality of steam
v = vf+x*(vg-vf) # specific volume of mixture
h = hf+x*hfg # enthalpy of mixture
s = sf+(x*sfg) # entropy of mixture
u = h-Psat*1e6*v*1e-03 # Internal energy of mixture
u_ = uf+x*ufg # Internal energy at 250 degree Celsius
print "\n The pressure is ",Psat ," MPa"
print "\n The total mass of mixture is ",m ," kg"
print "\n Specific volume is ",v ," m3/kg"
print "\n Enthalpy is is ",h ," kJ/kg"
print "\n The entropy is ",s ," kJ/kg K"
print "\n The internal energy is ",u ," kJ/kg"
print "\n At 250 degree Celsius, internal energy is ",u_ ,"kJ/kg" #The answer provided in the textbook is wrong

#The answers vary due to round off error
 Example 9.5

 The pressure is  3.973  MPa

 The total mass of mixture is  9.57329343706  kg

 Specific volume is  0.00417829039327  m3/kg

 Enthalpy is is  1188.13405609  kJ/kg

 The entropy is  2.9891336667  kJ/kg K

 The internal energy is  1171.53370836  kJ/kg

 At 250 degree Celsius, internal energy is  1171.53445483 kJ/kg

Ex9.7:pg-305

In [5]:
import math
# At T = 40 degree
Psat = 7.384 # Saturation pressure in kPa
sf = 0.5725 # Entropy of fluid in kJ/kgK
sfg = 7.6845 # Entropy change due to vaporization in kJ/kgK
hf = 167.57 # Enthalpy of fluid in kJ/kg
hfg = 2406.7 # Latent heat of vaporization in kJ/kg
s1 = 6.9189 # Entropy at turbine inlet in kJ/kgK
h1 = 3037.6 # Enthalpy at turbine inlet in kJ/kg
print "\n Example 9.7"
x2 = (s1-sf)/sfg # Steam quality
h2 = hf+(x2*hfg) # Enthalpy at turbine exit
W = h1-h2 # Net work done
print "\n The ideal work output of the turbine is ",W ," kJ/Kg"
#The answers vary due to round off error
 Example 9.7

 The ideal work output of the turbine is  882.40804932  kJ/Kg

Ex9.9:pg-308

In [6]:
import math
h2 = 2716.2 # Enthalpy at turbine inlet in kJ/kg
hf = 844.89 # Enthalpy of fluid in kJ/kg
hfg = 1947.3 # Latent heat of vaporization in kJ/kg
h3 = 2685.5 # Enthalpy at turbine exit in kJ/kg
print "\n Example 9.9"
x1 = (h2-hf)/hfg
x4 = (h3-hf)/hfg
print "\n The quality of steam in pipe line is ",x1  #The answers vary due to round off error
print "\n Maximum moisture content that can be determined is ",100-(x4*100) ," percent"#The answer provided in the textbook is wrong
 Example 9.9

 The quality of steam in pipe line is  0.96097673702

 Maximum moisture content that can be determined is  5.47886817645  percent

Ex9.10:pg-309

In [7]:
import math
# At 0.1Mpa, 110 degree
h2 = 2696.2 # Enthalpy at turbine inlet in kJ/kg
hf = 844.89 # Enthalpy of fluid in kJ/kg
hfg = 1947.3 # Latent heat of vaporization in kJ/kg
vf = 0.001023 # at T = 70 degree
V = 0.000150 # In m3
m2 = 3.24 # mass of condensed steam in kg

print "\n Example 9.10"
x2 = (h2-hf)/hfg # Quality of steam at turbine inlet
m1 = V/vf # mass of moisture collected in separator
x1 = (x2*m2)/(m1+m2) # quality of the steam
print "\n The quality of the steam in the pipe line is ",x1 
#The answers vary due to round off error
 Example 9.10

 The quality of the steam in the pipe line is  0.909544295341

Ex9.11:pg-310

In [8]:
import math
# P = 1MPa
vf = 0.001127 # specific volume of fluid in m**3/kg
vg = 0.1944# specific volume of gas in m**3/kg
hg = 2778.1 # specific enthalpy of gas in kJ/kg
uf = 761.68 # Specific internal energy of fluid in kJ/kg
ug = 2583.6 # Specific internal energy of gas in kJ/kg
ufg = 1822 # Change in specific internal energy due to phase change in kJ/kg 
# Initial anf final mass
Vif = 5 # Initial volume of water in m**3 
Viw = 5# Initial volume of gas in m**3 
Vff = 6  # Final volume of gas in m**3 
Vfw = 4 # Final volume of water in m**3 


print "\n Example 9.11"
ms = ((Viw/vf)+(Vif/vg)) - ((Vfw/vf)+(Vff/vg)) 
U1 =  ((Viw*uf/vf)+(Vif*ug/vg))
Uf =  ((Vfw*uf/vf)+(Vff*ug/vg))
Q = Uf-U1+(ms*hg)
print "\n The heat transfer during the process is ",Q/1e3 ," MJ"
#The answer provided in the textbook is wrong
 Example 9.11

 The heat transfer during the process is  1788.19203218  MJ

Ex9.12:pg-311

In [10]:
import math
m = 0.02 # Mass of steam in Kg
d = 280 # diameter of piston in mm
l = 305 # Stroke length in mm
P1 = 0.6 # Initial pressure in MPa
P2 = 0.12 # Final pressure in MPa
# At 0.6MPa, t = 200 degree
v1 = 0.352 # Specific volume in m**3/kg
h1 = 2850.1 # Specific enthalpy in kJ/kg
vf = 0.0010476 # specific volume of fluid in m**3/kg
vfg = 1.4271 # Specific volume change due to vaporization in m**3/kg
uf = 439.3 # specific enthalpy of fluid
ug = 2512.0 # Specific enthalpy of gas
print "\n Example 9.12"
V1 = m*v1 # total volume at point 1
Vd = (math.pi/4)*(d*1e-3)**2*l*1e-3 # displaced volume
V2 = V1+Vd  # Total volume at point 2
n = math.log(P1/P2)/math.log(V2/V1) # polytropic index
W12 = ((P1*V1)-(P2*V2))*1e6/(n-1) # work done
print "\n The value of n is ",n
print "\n The work done by the steam is ",W12/1e3 ,"kJ "
#The answers vary due to round off error
v2 = V2/m # specific volume
x2 = (v2-vf)/vfg  # Steam quality
# At 0.12MPa
u2 = uf + (x2*(ug-uf)) # Internal energy 
u1 = h1-(P1*1e6*v1*1e-03) # Internal energy
Q12 = m*(u2-u1)+ (W12/1e3) # Heat transfer
print "\n The heat transfer is ",Q12 ,"kJ "
#The answers vary due to round off error
 Example 9.12

 The value of n is  1.23844995978

 The work done by the steam is  4.72026539673 kJ 

 The heat transfer is  -1.80091923775 kJ 

Ex9.13:pg-312

In [11]:
import math
x1 = 1 # Steam quality in first vessel
x2 = 0.8 # Steam quality in second vessel
# at 0.2MPa
vg = 0.8857 # Specific volume of gas in m**3/kg
h1 =  2706.7 # Enthalpy in first vessel  in kJ/kg
v1 = vg # Specific volume of gas in first vessel in m**3/kg
hg = h1 #  Enthalpy in first vessel  1 in kJ/kg
m1 = 5  # mass in first vessel in kg
V1 = m1*v1 # Volume of first vessel in m**3
# at 0.5MPa
m2 = 10 # mass in second vessel in kg
hf = 640.23 # Enthalpy in second vessel  in kJ/kg
hfg = 2108.5 # Latent heat of vaporization in kJ/kg
vf = 0.001093 # Specific volume of fluid in second vessel in m**3/kg
vfg = 0.3749 # Change in specific volume in second vessel due to evaporation of gas in m**3/kg
v2 = vf+(x2*vfg) # Specific volume of gas in second vessel
V2 = m2*v2 # Volume of second vessel in m**3
#
Vm = V1+V2 # Total volume 
m = m1+m2 # Total mass
vm = Vm/m # net specific volume
u1 = h1 # Internal energy
h2 = hf+(x2*hfg) # Enthalpy calculation
u2 = h2 # Internal energy calculation
m3 = m # Net mass calculation
h3 = ((m1*u1)+(m2*u2))/m3 # Resultant enthalpy calculation
u3 = h3 # Resultant internal energy calculation
v3 = vm # resultant specific volume calculation
# From Mollier diagram
x3 = 0.870  # Steam quality 
p3 = 3.5 # Pressure in MPa
s3 = 6.29 # Entropy at state 3  in kJ/kgK
s1 = 7.1271 # Entropy at state 1 in kJ/kgK
sf = 1.8607  # Entropy in liquid state  in kJ/kgK
sfg = 4.9606 # Entropy change due to vaporization in kJ/kgK
s2 = sf+(x2*sfg) # Entropy calculation
E = m3*s3-((m1*s1)+(m2*s2)) # Entropy change during process

print "\n Example 9.13"
print "\n Final pressure is ",p3 ," bar"
print "\n Steam quality is ",x3 ,
print "\n Entropy change during the process is ",E ," kJ/K"
#The answers vary due to round off error
 Example 9.13

 Final pressure is  3.5  bar

 Steam quality is  0.87 
 Entropy change during the process is  0.4227  kJ/K

Ex9.14:pg-314

In [12]:
import math
# At 6 MPa, 400 degree
h1 = 3177.2 # Enthalpy in kJ/kg
s1 = 6.5408 #Entropy in kJ/kgK
# At 20 degree
h0= 83.96 # Enthalpy in kJ/kg 
s0 = 0.2966#Entropy in kJ/kgK
T0 = 20 # Surrounding temperature in degree Celsius 
f1 = (h1-h0)-(T0+273)*(s1-s0) # Availability before throttling
# By interpolation at P= 5MPa, h= 3177.2
s2 = 6.63 #Entropy in kJ/kgK
h2 = h1 # Throttling
f2 = (h2-h0)-(T0+273)*(s2-s0) # Availability after throttling
df = f1-f2 # Change in availability
x3s = (s2-1.5301)/(7.1271-1.5301) #Entropy at state 3 in kJ/kgK
h3s = 504.7+(x3s*2201.9) #Enthalpy at state 3 in kJ/kg
eis = 0.82 # isentropic efficiency
h3 = h2-eis*(h1-h3s) # Enthalpy at state 3 in kJ/kgK
x3 = (h3-504.7)/2201.7 # Steam quality at state 3
s3 = 1.5301+(x3*5.597) # Entropy at state 3
f3 = (h3-h0)-(T0+273)*(s3-s0) # Availability at state 3

print "\n Example 9.14"
print "\n The availability of the steam before the throttle valve ",f1 ," kJ/kg"
print "\n The availability of the steam after the throttle valve ",f2 ," kJ/kg"
print "\n The availability of the steam at the turbine exhaust ",f3 ," kJ/kg"
print "\n The specific work output from the turbine is ",h2-h3 ," kJ/kg"
#The answers vary due to round off error
 Example 9.14

 The availability of the steam before the throttle valve  1263.6894  kJ/kg

 The availability of the steam after the throttle valve  1237.5538  kJ/kg

 The availability of the steam at the turbine exhaust  601.851036792  kJ/kg

 The specific work output from the turbine is  546.253422512  kJ/kg

Ex9.15:pg-316

In [13]:
import math
# At 25 bar, 350 degree
h1 = 3125.87 # Enthalpy in kJ/kg
s1 = 6.8481# Entropy in kJ/kgK
# 30 degree
h0 = 125.79 # Enthalpy in kJ/kg
s0 = 0.4369# Entropy in kJ/kgK
# At 3 bar, 200 degree
h2 = 2865.5 # Enthalpy in kJ/kg
s2 = 7.3115 #Entropy in kJ/kgK
# At 0.2 bar 0.95 dry
hf = 251.4 # Enthalpy of liquid in kJ/kg
hfg = 2358.3 # Latent heat of vaporization in kJ/kg
sf = 0.8320 # Entropy of liquid in kJ/kgK
sg = 7.0765# Entropy of liquid in kJ/kgK
h3 = hf+0.92*hfg # Enthalpy at state 3 in kJ/kg
s3 = sf+(0.92*sg) # Entropy at state 3 in kJ/kgK
# Part (a)
T0 = 30 # Atmospheric temperature in degree Celsius
f1 = (h1-h0)-((T0+273)*(s1-s0)) # Availability at steam entering turbine
f2 = (h2-h0)-((T0+273)*(s2-s0)) # Availability at state 2
f3 = (h3-h0)-((T0+273)*(s3-s0))# Availability at state 3

print "\n Example 9.15"
print "\n Availability of steam entering is ",f1 ," kJ/kg"
print "\n Availability of steam leaving the turbine is ",f2 ," kJ/kg"

# Part (b)
m2m1 = 0.25  # mass ratio
m3m1 = 0.75 # mass ratio
Wrev = f1-(m2m1*f2)-(m3m1*f3) # Maximum work
print "\n Maximum work is ",Wrev ," kJ/kg"

# Part (c)
w1 = 600 # mass flow at inlet of turbine in kg/h
w2 = 150 # mass flow at state 2 in turbine in kg/h
w3 = 450# mass flow at state 2 in  turbine in kg/h
Q = -10  # Heat loss rate kJ/s
I = ((T0+273)*(w2*s2+w3*s3-w1*s1)-Q*3600)*103/600
print "\n Irreversibility is ",I/1e3 ," kJ/kg"
#The answer provided in the textbook is wrong
 Example 9.15

 Availability of steam entering is  1057.4864  kJ/kg

 Availability of steam leaving the turbine is  656.7062  kJ/kg

 Maximum work is  741.14568  kJ/kg

 Irreversibility is  21.36505104  kJ/kg

Ex9.16:pg-317

In [14]:
import math
# At dead state of 1 bar, 300K
u0 = 113.1 # Internal energy in kJ/kg
h0 = 113.2 # Enthalpy in kJ/kg
v0 = 0.001005 # Specific volume in m**3/kg
s0 = 0.395 # Entropy in kJ/kg
T0 = 300 # Atmospheric temperature in K
P0 = 1 # Atmospheric pressure in bar 
K = h0-T0*s0
# Part (a)
# At 1bar and 90 degree Celsius 
u = 376.9 # Internal energy in kJ/kg
h = 377 # Enthalpy in kJ/kg
v = 0.001035 # specific volume in m**3/kg
s = 1.193 # Entropy in kJ/kgK
m = 3 # Mass of water in kg
fi = m*(h-(T0*s)-K)  #Energy of system

print "\n Example 9.16"
print "\n Energy of system in Part (a) is ",fi ," kJ"
#The answers vary due to round off error

# Part (b)
# At P = 4 Mpa, t = 500 degree
u = 3099.8# Internal energy in kJ/kg 
h = 3446.3 # Enthalpy in kJ/kg 
v = 0.08637 # specific volume in m**3/kg 
s = 7.090 # Entropy in kJ/kgK
m = 0.2 # Mass of steam in kg 
fib = m*(u+P0*100*v-T0*s-K) # Energy of system
print "\n Energy of system in Part (b) is ",fib ," kJ"

# Part (c) # P = 0.1 bar
m = 0.4 # Mass of wet steam in kg 
x = 0.85 # Quality
u = 192+x*2245 # Internal energy 
h = 192+x*2392# Enthalpy
s = 0.649+x*7.499 # Entropy
v = 0.001010+x*14.67 # specific volume
fic = m*(u+P0*100*v-T0*s-K) # Energy of system
print "\n Energy of system in Part (c) is ",fic ," kJ"

# Part (d) 
# P = 1 Bar, t = -10 degree Celsius
m = 3 # Mass of ice in kg 
h = -354.1 # Enthalpy in kJ/kg  
s = -1.298 # at 1000kPa, -10 degree
fid = m*((h-h0)-T0*(s-s0)) # Energy of system

print "\n Energy of system in Part (d) is ",fid ," kJ" #The answer provided in the textbook is wrong
 Example 9.16

 Energy of system in Part (a) is  73.2  kJ

 Energy of system in Part (b) is  197.3474  kJ

 Energy of system in Part (c) is  498.2624  kJ

 Energy of system in Part (d) is  121.8  kJ

Ex9.17:pg-318

In [15]:
import math
# Given
th1 = 90.0 # Inlet temperature of hot water in degree Celsius
tc1 = 25.0# Inlet temperature of cold water in degree Celsius
tc2 = 50.0# Exit temperature of cold water in degree Celsius
mc = 1.0 # mass flow rate of cold water in kg/s
T0 = 300.0 # Atmospheric temperature in K
th2p = 60.0 # Temperature limit in degree Celsius for parallel flow
th2c = 35.0 # Temperature limit in degree Celsius for counter flow
mhp = (tc2-tc1)/(th1-th2p) # mass flow rate of hot water in kg/s for parallel flow
mhc = (tc2-tc1)/(th1-th2c) # mass flow rate of hot water in kg/s for counter flow
# At 300 K
h0 = 113.2 # ENthalpy in kJ/kg
s0 = 0.395 # ENtropy in kJ/kgK
T0 = 300.0 # temperature in K
# At 90 degree celsius
h1 = 376.92 # Enthalpy in kJ/kg 
s1 = 1.1925 # Entropy in kJ/kgK
af1 = mhp*((h1-h0)-T0*(s1-s0)) # Availability
# Parallel Flow
# At 60 degree
h2 = 251.13 # Enthalpy in kJ/kg 
s2 =0.8312  # Entropy in kJ/kgK
 # At 25 degree
h3 = 104.89 # Enthalpy in kJ/kg 
s3 = 0.3674 # Entropy in kJ/kgK
# At 50 degree
h4 = 209.33 # Enthalpy in kJ/kg 
s4 = 0.7038 # Entropy in kJ/kgK
REG = mc*((h4-h3)-T0*(s4-s3)) # Rate of energy gain
REL = mhp*((h1-h2)-T0*(s1-s2)) # Rate of energy loss
Ia = REL-REG # Energy destruction
n2a = REG/REL # Second law efficiency

print "\n Example 9.17"
print "\n In parallel flow"
print "\n The rate of irreversibility is ",Ia ," kW"
print "\n The Second law efficiency is ",n2a*100 ," percent"
#The answers vary due to round off error


# Counter flow
h2_ = 146.68 
sp = 0.5053 # At 35 degree
REG_b = REG # Rate of energy gain by hot water is same in both flows
REL_b = mhc*((h1-h2_)-T0*(s1-sp))
Ib = mhc*((h1-h2_)-(T0*(s1-sp))) # Energy destruction
n2b = REG_b/Ib # Second law efficiency
print "\n\n In counter flow"
print "\n The rate of irreversibility is ",Ib ," kW"
print "\n The Second law efficiency is ",n2b*100 ," percent"
#The answers vary due to round off error
 Example 9.17

 In parallel flow

 The rate of irreversibility is  10.98  kW

 The Second law efficiency is  24.275862069  percent


 In counter flow

 The rate of irreversibility is  10.9454545455  kW

 The Second law efficiency is  32.1594684385  percent

Ex9.18:pg-320

In [16]:
import math
m = 50.0# mass flow rate in kg/h
Th = 23.0 # Home temperature in degree Celsius
# State 1
T1 = 150.0 # Saturated vapor temperature in degree Celsius
h1 = 2746.4 # Saturated vapor enthalpy in kJ/kg
s1 = 6.8387 #Saturated vapor entropy in kJ/kgK
# State 2
h2 = 419.0 # Saturated liquid enthalpy in kJ/kg
s2 = 1.3071 #Saturated liquid entropy in kJ/kg 
T0 = 45.0 #  Atmospheric temperature in degree Celsius
#
b1 = h1-((T0+273)*s1) # Availability at point 1
b2 = h2-((T0+273)*s2) # Availability at point 2
Q_max = m*(b1-b2)/((T0+273)/(Th+273)-1) # maximum cooling rate

print "\n Example 9.18"
print "\n The maximum cooling rate is ",Q_max/3600 ," kW"
 Example 9.18

 The maximum cooling rate is  106.207042424  kW