Chapter 11:THERMODYNAMIC PROPERTY RELATIONS

Example 11.1, Page No:510

In [1]:
import math
from __future__ import division

#Variable declaration
p1=150; p2=200; p3=250; p4=300; p5=350; p6=400; p7=450; p8=500; p9=550; p10=600; p11=650; p12=700;
p13=750; p14=800; p15=850; p16=900; # Pressures of merect's  boiler experiment in kPa
t1=111.4; t2=120.2; t3=127.4; t4=133.6; t5=138.9; t6=143.6; t7=147.9; t8=151.9;  t9=155.5; t10=158.9; t11=162;
t12=165; t13=167.8; t14=170.4; t15=173; t16=175.4; # Temperatures of merect's boiler experiment in degree celcius
n=16;# Total number of readings taken  

#Calculation for constants
# Values of constant A & B
s_y= math.log10 (p1*p2*p3*p4*p5*p6*p7*p8*p9*p10*p11*p12*p13*p14*p15*p16);
s_x=1/(t1+273)+1/(t2+273)+1/(t3+273)+1/(t4+273)+1/(t5+273)+1/(t6+273)+1/(t7+273)+1/(t8+273)+1/(t9+273)+1/(t10+273)+1/(t11+273)+1/(t12+273)+1/(t13+273)+1/(t14+273)+1/(t15+273)+1/(t16+273);
s_xy=((math.log10 (p1))*1/(t1+273))+ ((math.log10 (p2))*1/(t2+273))+ ((math.log10 (p3))*1/(t3+273))+ ((math.log10 (p4))*1/(t4+273))+ ((math.log10 (p5))*1/(t5+273))+ ((math.log10 (p6))*1/(t6+273))+ ((math.log10 (p7))*1/(t7+273))+ ((math.log10 (p8))*1/(t8+273))+ ((math.log10 (p9))*1/(t9+273))+ ((math.log10 (p10))*1/(t10+273))+ ((math.log10 (p11))*1/(t11+273)) + ((math.log10 (p12))*1/(t12+273)) + ((math.log10 (p13))*1/(t13+273)) + ((math.log10 (p14))*1/(t14+273)) + ((math.log10 (p15))*1/(t15+273)) + ((math.log10 (p16))*1/(t16+273));
s_x2=(1/(273+t1))**2+(1/(273+t2))**2+(1/(273+t3))**2+(1/(273+t4))**2+(1/(273+t5))**2+(1/(273+t6))**2+(1/(273+t7))**2+(1/(273+t8))**2+(1/(273+t9))**2+(1/(273+t10))**2+(1/(273+t11))**2+(1/(273+t12))**2+(1/(273+t13))**2+(1/(273+t14))**2+(1/(273+t15))**2+(1/(273+t16))**2;
B= ((n*s_xy)-(s_x*s_y))/((n*s_x2)-((s_x)**2)); # Constant B
A=((s_y)-(B*s_x))/n; # Constant A

#Result for constants
print "Values of constant A & B"
print "A =",round(A,5)
print "B =",round(B,1),"   (roundoff error)"

#Calculation for latent heat of vapourization
# The latent heat of vapourization
T=150; # The latent heat of vapourization at this temperature in degree celcius
d_T=20; d_p=258.7; # Temperature and pressure difference
vg=0.3928; vf=0.0011; # specific volume in m^3/kg
hfg=(T+273)*(vg-vf)*d_p/d_T; # Clapeyron equztion

#Result for latent heat of vapourization
print "The latent heat of vapourization at 150 oC =",round(hfg,2),"kJ/kg"
Values of constant A & B
A = 7.62068
B = -2091.6    (roundoff error)
The latent heat of vapourization at 150 oC = 2143.19 kJ/kg

Example 11.3, Page No:517

In [2]:
import math

#Variable declaration
p5=6000; # Pressure of superheated steam in kPa
T5=723.15; # Temperature of superheated steam in kelvin
p1=0.6113; # Pressure at reference state in kPa
T1=273.16; # Temperature at reference state in kelvin
hfg1=2501.3; # Latent heat of vapourization of water at reference state in kJ/kg
R_1=8.3143; # Universal gas constant of air in kJ/kmol K
# The critical state properties of water
pc=2.09; # pressure in MPa
Tc=647.3; # Temperature in kelvin
h1=0; # Reference state in kJ/kg

#Calculation
h2=h1+hfg1; # specific enthalpy in kJ/kg 
# At point 2
p2=p1; T2=T1;
z=0.9986;
r=18.015;
A2=(0.4278/(pc*10**4))*(Tc/T2)**2.5; # Constants
B=(0.0867/(pc*10**4))*(Tc/T2); # Constants
h2_h3=R_1*(T2/r)*(((-3/2)*(A2/B)*math.log (1+(B*p2/z)))+z-1); # Enthalpy difference between state 2 & 3
# At point 5
z1=0.9373;
A2=(0.4278/(pc*10**4))*(Tc/T5)**2.5; # Constants
B=(0.0867/(pc*10**4))*(Tc/T5); # Constants
h5_h4=R_1*(T5/r)*(((-3/2)*(A2/B)*math.log (1+(B*p5/z1)))+z1-1); # Enthalpy difference between state 5 & 4
a=1.6198;b=6.6*10**-4; # Constants
h4_h3=a*(T5-T1)+b*(T5**2-T1**2)/2; # Enthalpy difference between state 3 & 4
h5=h2-h2_h3+h5_h4+h4_h3; # Specific enthalpy at state 5 

#Result
print "Specific enthalpy at state 5 = ",round(h5,1),"kJ/kg    (roundoff error)"
Specific enthalpy at state 5 =  3308.3 kJ/kg    (roundoff error)

Example 11.4, Page No:527

In [3]:
#Variable declaration
T2=373; # Temperature of CO2 gas in kelvin
p2=100; # Pressure of CO2 gas in atm
T1=0; # Reference state temperature in kelvin
# The crictical constants for CO2 are 
Tc=304.2; # Temperature in kelvin
Pc=72.9; # Pressure in atm
zc=0.275;

#Calculation
# Refer figure 11.7 for state definition
h1_0=((-3.74*T2)+((30.53/(100**0.5))*((T2**1.5)/1.5))-((4.1/100)*((T2**2)/2))+((0.024/(100**2))*((T2**3)/3)));
Tr=T2/Tc; Pr=p2/Pc; # Reduced properties
# From generalized chart figure 11.6
hR_Tc=10.09;
h1_2=hR_Tc*Tc;
M=44; # Molecular weight
h10=h1_0/M; h12=h1_2/M;
h373=h10-h12; # The required enthalpy of CO2 gas at 373 K and 100 atm

#Result
print "The required enthalpy of CO2 gas at 373 K and 100 atm = ",round(h373,0),"kJ/kg"
The required enthalpy of CO2 gas at 373 K and 100 atm =  168.0 kJ/kg

Example 11.5, Page No:531

In [4]:
import math

#Variable declaration
p1=11; # Initial pressure in bar
T1=40; # Initial temperature in degree celcius
p2=60; #  Final pressure in bar
R_1=8.3143; # Universal gas constant  in kJ/kmol K
# The crictical properties for natural gas 
Tc=161; # Temperature in kelvin
Pc=46.4; # Pressure in bar

#Calculation
# Reduced properties are
Pr1=p1/Pc; Pr2=p2/Pc;
Tr1=(T1+273)/Tc;
# T2=T1, The ideal gas enthalpy h2*=h1*=h1
h21=-47.5; # From generalized enthalpy departure chart
M=16; # Molecular weight
Sp2_1=(R_1/M)*math.log (p2/p1)# for the difference in ideal gas entropies
Sp2_Sp_2=-0.1125; Sp_2_Sp_1=-2.1276; # Entropies in kJ/kg K
s2_s1=(Sp2_Sp_2)+(Sp_2_Sp_1);
q=(T1+273)*s2_s1; # Heat transfer
w=q-h21; # Work of compression

#Result
print "Heat transfer = ",round(q,1),"kJ/kg","\nWork of compression = ",round(w,0),"kJ/kg"
Heat transfer =  -701.2 kJ/kg 
Work of compression =  -654.0 kJ/kg

Example 11.8, Page No:538

In [5]:
#Variable declaration
p1=10; # Initial pressure in MPa
T1=263; # Initial temperature in Kelvin
p2=1.5; #  Final pressure in MPa
R_1=8.3143; # Universal gas constant  in kJ/kmol K
M=28; # Molecular mass
# The crictical properties for nitrogen gas 
Tc=126.2; # Temperature in kelvin
Pc=3.39; # Pressure in MPa

#Calculation
# Reduced properties are
Pr1=p1/Pc; Pr2=p2/Pc;
Tr1=T1/Tc;
# From the generalized chart for enthalpy departure at Pr1 & Tr1
h_11=8.7*Tc/M;
# The solution involves iteration procedure. Assume T2 and check if h2_h1=0
# First approximation T2=200 K
T2=200; # In K
Tr2=T2/Tc;
Cpr=1.046;
h_21=Cpr*(T2-T1);
# From the generalized chart for enthalpy departure at Pr1 & Tr1
h_22=1*Tc/M;
h2_h1=h_11-T2+T1-h_22;
# Second approximation 
T2=190; # In K
Tr2=T2/Tc;
Cpr=1.046;
h_21=Cpr*(T2-T1);
# From the generalized chart for enthalpy departure at Pr1 & Tr1
h_22=1.5*Tc/M;
h2_h1=h_11-T2+T1-h_22;

#Result
print "Here also h2-h1 != 0. Therefore the temperature is dropping. Thus Joule-Thomson coefficient is positive."
print "There is cooling in this process"
Here also h2-h1 != 0. Therefore the temperature is dropping. Thus Joule-Thomson coefficient is positive.
There is cooling in this process

Example 11.9, Page No:544

In [6]:
#Variable declaration
Tcammonia=405.9;
Tcwater=647.3;
Tr=0.576; # Condition of similarity

#Calculation
Twater=Tcwater*Tr; # At reduced temperature Temperature of water
Tammonia=Tcammonia*Tr;#At reduced temperature Temperature of  ammonia
# From steam table at Twater
hfgwater=2257;# specific enthalpy in kJ/kg 
hfgammonia=Tcammonia/Tcwater *hfgwater; # Latent heat of vaporization of ammonia

#Result
print "Latent heat of vaporization of ammonia =",round(hfgammonia,0),"kJ/kg"
Latent heat of vaporization of ammonia = 1415.0 kJ/kg