# Chapter14:THERMODYNAMIC RELATIONS¶

## Ex14.1:Pg-567¶

In :
#ques1
#to determine the sublimation pressure of water
import math
#from table in appendix B.1.5
T1=213.2;#K, Temperature at state 1
P2=0.0129;#kPa, pressure at state 2
T2=233.2;#K, Temperature at state 2
hig=2838.9;#kJ/kg, enthalpy of sublimation
R=.46152;#Gas constant
#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2)
P1=P2*math.exp(-hig/R*(1/T1-1/T2));
print" Sublimation Pressure ",round(P1,5),"kPa"

 Sublimation Pressure  0.00109 kPa


## Ex14.1E:Pg-567¶

In :
#ques1
#to determine the sublimation pressure of water
import math
#from table in appendix B.1.5
T1=-70+460.7;# R, Temperature at state 1
P2=0.0019 # lbf/in^2 pressure at state 2
T2=-40+460.7;# R, Temperature at state 2
hig=1218.7;#Btu/lbm, enthalpy of sublimation
R=85.67;#Gas constant
#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2)
P1=P2*math.exp(-hig*778/R*(1/T1-1/T2));
print" Sublimation Pressure ",round(P1,5),"lbf/in^2"

 Sublimation Pressure  0.00025 lbf/in^2


## Ex14.4:Pg-579¶

In :
#ques4
#Volume expansivity, Isothermal and Adiabatic compressibility

#known data
ap=5*10**-5;#K^-1 Volume expansivity
bt=8.6*10**-12;#m^2/N, Isothermal compressibility
v=0.000114;#m^3/kg, specific volume
P2=100*10**6;#pressure at state 2 in kPa
P1=100;#pressure at state 1 in kPa
w=-v*bt*(P2**2-P1**2)/2;#work done in J/kg
#q=T*ds and ds=-v*ap*(P2-P1)
#so q=-T*v*ap*(P2-P1)
T=288.2;#Temperature in K
q=-T*v*ap*(P2-P1);#heat in J/kg
du=q-w;#change in internal energy in J/kg
print" Change in internal energy =",round(du,3),"J/kg"

#the answer is correct within given limts


 Change in internal energy = -159.372 J/kg


## Ex14.5:Pg-586¶

In :
#ques5

#from table A.2
P1=20;#pressure at state 1 in MPa
P2=2;#pressure at state 2 in MPa
T1=203.2;#Temperature at state 1 in K
Pr1=P1/3.39;#Reduced pressure at state 1
Pr2=P2/3.39;#Reduced pressure at state 2
Tr1=T1/126.2;#Reduced temperature
#from compressibility chart h1*-h1=2.1*R*Tc
#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)
#h2*-h2=0.5*R*Tc
#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.5*R*Tc
R=0.2968;#gas constant for given substance
Tc=126.2;#K, Constant temperature
Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg
T2=146;#temperature at state 2
dh=-1.6*R*Tc+Cp*(T1-T2);#
print" Enthalpy change =",round(dh,3),"kJ/kg \n"
print" Since Enthalpy change is nearly ",-round(dh),"kJ/kg so Temperature =",round(T2,3),"K"

 Enthalpy change = -0.35 kJ/kg

Since Enthalpy change is nearly  0.0 kJ/kg so Temperature = 146.0 K


## Ex14.6:Pg-589¶

In :
#ques6
import math
#from table A.2
P1=8;#pressure at state 1 in MPa
P2=0.5;#pressure at state 2 in MPa
T1=150.0;#Temperature at state 1 in K
Pr1=P1/3.39;#Reduced pressure at state 1
Pr2=P2/3.39;#Reduced pressure at state 2
Tr1=T1/126.2;#Reduced temperature
T2=125.0;#temperature at state 2
#from compressibility chart h1*-h1=2.1*R*Tc
#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)
#h2*-h2=0.5*R*Tc
#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.15*R*Tc
R=0.2968;#gas constant for given substance
Tc=126.2;#K, Constant temperature
Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg
dh=(2.35)*R*Tc+Cp*(T2-T1);#
print" Enthalpy change =",round(dh),"kJ/kg"
#change in entropy
#ds= -(s2*-s2)+(s2*-s1*)+(s1*-s1)
#s1*-s1=1.6*R
#s2*-s2=0.1*R
#s2*-s1*=Cp*log(T2/T1)-R*log(P2/P1)
#so
ds=1.6*R-0.1*R+Cp*math.log(T2/T1)-R*math.log(P2/P1);
print" Entropy Change =",round(ds,3),"kJ/kg.K "

 Enthalpy change = 62.0 kJ/kg
Entropy Change = 1.078 kJ/kg.K


## Ex14.7:Pg-596¶

In :
#ques7
#percent deviation using specific volume calculated by kays rule and vander waals rule
import math

#a-denotes C02
#b-denotes CH4
T=310.94;#Temperature of mixture K
P=86.19;#Pressure of mixture in MPa
#Tc- critical Temperature
#Pc-critical pressure
Tca=304.1;#K
Tcb=190.4;#K
Pca=7.38;#MPa
Pcb=4.60;#MPa
Ra=0.1889;#gas constant for a in kJ/kg.K
Rb=0.5183;#gas constant for b in kJ/kg.K
xa=0.8;#fraction of CO2
xb=0.2;#fraction of CH4
Rm=xa*Ra+xb*Rb;#mean gas constant in kJ/kg.K
Ma=44.01;#molecular mass of a
Mb=16.043;#molecular mass of b
#1.Kay's rule
ya=xa/Ma/(xa/Ma+xb/Mb);#mole fraction of a
yb=xb/Mb/(xa/Ma+xb/Mb);#mole fraction of b
Tcm=ya*Tca+yb*Tcb;#mean critical temp in K
Pcm=ya*Pca+yb*Tcb;#mean critical pressure n MPa
#therefore pseudo reduced property of mixture
Trm=T/Tcm;
Prm=P/Pcm;
Zm=0.7;#Compressiblity from generalised compressibility chart
vc=Zm*Rm*T/P/1000;#specific volume calculated in m^3/kg
ve=0.0006757;#experimental specific volume in m^3/kg
pd1=(ve-vc)/ve*100;#percent deviation
print" Percentage deviation in specific volume using Kays rule =",round(pd1,1),"percent \n"

#2. using vander waals equation
#values of vander waals constant
Aa=27*(Ra**2)*(Tca**2)/(64*Pca*1000);
Ba=Ra*Tca/(8*Pca*1000);
Ab=27*(Rb**2)*(Tcb**2)/(64*Pcb*1000);
Bb=Rb*Tcb/(8*Pcb*1000);
#mean vander waals constant
Am=(xa*math.sqrt(Aa)+xb*math.sqrt(Ab))**2;
Bm=(xa*Ba+xb*Bb);
#using vander waals equation we get cubic equation
#solving we get
vc=0.0006326;#calculated specific volume in m^3/kg
pd2=((ve-vc)/ve)*100;
print" Percentage deviation in specific volume using vander waals eqn =",round(pd2,1),"percent"

 Percentage deviation in specific volume using Kays rule = 4.8 percent

Percentage deviation in specific volume using vander waals eqn = 6.4 percent