# Chapter 7: Entropy¶

## Example 7-1 ,Page No.335¶

In [2]:
#given data
Q=750;#heat transfered in kJ
Tsys=300.0;#temperature of liquid-water mixture in K

#calculations
dSsys=Q/Tsys;
print'Entropy change in the process %f kJ/K'%round(dSsys,1)

Entropy change in the process 2.500000 kJ/K


## Example 7-2 ,Page No.338¶

In [4]:
#given data
Qsink=2000.0;#heat lost in kJ
Qsource=-Qsink;
Tsource=800.0;#temp of heat loss in K

#calculations
#part - a
Tsink=500.0;
dSsource=Qsource/Tsource;
dSsink=Qsink/Tsink;
Sgena=dSsource+dSsink;
print'entropy generated in part a %f kJ/K'%round(Sgena,1);
#part - b
Tsink=750;
dSsource=Qsource/Tsource;
dSsink=Qsink/Tsink;
Sgenb=dSsource+dSsink;
print'entropy generated in part b %f kJ/K'%round(Sgenb,1);
if Sgena>Sgenb :
print('part a is more irreversible');
elif(Sgena == Sgenb) :
print('heat transfer is equally irreversible');
else:
print('part b is more irreversible');

entropy generated in part a 1.500000 kJ/K
entropy generated in part b 0.200000 kJ/K
part a is more irreversible


## Example 7-3 ,Page No.341¶

In [6]:
#given data
m=5.0;#mass of refrigerant 134-a in kg
P1=140.0;#intial pressure in kPa
T1=20.0;#temperature in C
P2=100.0;#final pressure in kPa

#from refrigerant-134a data
#at P1 and T1
s1=1.0624;
v1=0.16544;
#at P2
v2=v1;
vf=0.0007529;
vg=0.19254;
sf=0.07188;
sfg=0.87995;

#calculations
# vf < v2 <vg
x2=(v2-vf)/(vg-vf);
s2=sf+x2*sfg;
dS=m*(s2-s1);
print'entropy change in the process %f kJ/k'%round(dS,3)

entropy change in the process -1.175000 kJ/k


## Example 7-4 ,Page No.342¶

In [7]:
#given data
m=3;#mass of water in lbm
P1=20;#pressure in psia
T1=70+460;#temperature in R

#from Table A-6E
#at P1 and T1
s1=0.07459;
h1=38.08;

#calculations
#Ein - Eout = dEsystem
#Qin = m*(h2 - h1)
h2=Qin/m+h1;
#from Table A-6E
#At P2 and h2
s2=1.7761;
dS=m*(s2-s1);
print'entropy change %f Btu/R'%round(dS,3);

entropy change 5.105000 Btu/R


## Example 7-5 ,Page No.343¶

In [11]:
#given data
P1=5.0;#entry pressure in MPa
T1=450.0;#entry temperature in C
P2=1.4;#pressure at exit MPa

#calculations
#Ein - Eout = dEsystem/dt
#Ein = Eout
#Wout = m*(h1-h2)
#At P1 and T1
h1=3317.2;
s1=6.8210;
s2=s1;
#At P2 and s2
h2=2967.4;
Wout=h1-h2;
print'work output per unit mass %f kJ/kg'%round(Wout,1)

work output per unit mass 349.800000 kJ/kg


## Example 7-7 ,Page No.352¶

In [2]:
from math import log
#given values
P1=1;#pressure at state 1 in kPa
T1=110.0;#temperature at state 1 in K
P2=5;#pressure at state 2 in kPa
T2=120.0;#temperature at state 2 in K

#from Table
#At P1 and T1
s1=4.875;
cp1=3.471;
#at P2 and T2
s2=5.145;
cp2=3.486;

#calculations
#part - a
dSa=s2-s1;
print'change in entropy %f kJ/kg K using tabulated properties'%round(dSa,3);
#part - b
cavg=(cp1+cp2)/2.0;
dSb=cavg*log(T2/T1);
print'change in entropy %f kJ/kg K approximating liquid methane as an incompressible substance'%round(dSb,3);
E=(dSb-dSa)/dSa;
print'Error is %f'%round(E,4)

change in entropy 0.270000 kJ/kg K using tabulated properties
change in entropy 0.303000 kJ/kg K approximating liquid methane as an incompressible substance
Error is 0.121000


## Example 7-8 ,Page No.353¶

In [3]:
#Annual power savings has a 0.005% error due to approximation in textbook

#given data
P1=5;#pressure at state 1 in MPa
V1=0.280;#volimetric flow rate in m^3/s
T1=115;#temperature at state 1 in K
P2=1;#pressure at state 2 in MPa
dt=8760;#time in h/yr
UC=0.075;#unit cost in $#from Table #at P1 and T1 h1=232.3; s1=4.9945; p1=422.15; s2=s1; #at P2 and s2 h2=222.8; #calculations m=p1*V1; #Ein - Eout = dEsystem/dt #Ein = Eout #Wout = m*(h1-h2) Wout = m*(h1-h2); print'maximum amount of power that can be produced %i kW'%round(Wout) APP=Wout*dt;#annual power production APS=APP*UC;#annual power savings print'Annual power savings$%i/yr'%round(APS)

maximum amount of power that can be produced 1123 kW
Annual power savings $737758/yr  ## Example 7-9 ,Page No.357¶ In [7]: from math import log #given data P1=100.0;#inlet pressure in kPa T1=290.0;#inlet temperature in K P2=600.0;#outlet temperature in kPa T2=330.0;#outlet temperature in K #from Table A-17 s02=1.79783; s01=1.66802; #Table A-2b cpavg=1.006; #constants used R=0.287;#in kJ/kg -K #calculations #part-a s21=s02-s01-R*log(P2/P1);#stands for s2 - s1 print'entropy change using property values from air table %f kJ/kg-K'%round(s21,4); s21=cpavg*log(T2/T1)-R*log(P2/P1);#stands for s2 - s1 print'entropy change using average specific heat %f kJ/kg-K'%round(s21,4)  entropy change using property values from air table -0.384400 kJ/kg-K entropy change using average specific heat -0.384200 kJ/kg-K  ## Example 7-10 ,Page No.360¶ In [25]: #given data P1=95;#intial pressure in kPa T1=295;#intial temperature in K r=8;#ratio of V1/V2 #calculations #for closed systems V2/V1 = v2/v1 #At T1 vr1=647.9; vr2=vr1/r; #at vr2 T2=662.7; print'the final temperature %f K'%T2  the final temperature 662.700000 K  ## Example 7-11 ,Page No.361¶ In [28]: #given data P1=14.0;#intial pressure in psia T1=50+460.0;#intial temperature in R T2=320+460.0;#final temperature in R #constants used k=1.667; #calculations P2=P1*(T2/T1)**(k/(k-1)); print'exit pressure %f psia'%round(P2,1)  exit pressure 40.500000 psia  ## Example 7-12 ,Page No.364¶ In [29]: #given data P2=1000;#final pressure in MPa P1=100;#intial pressure in MPa #from Table A-5 #At P2 v1=0.001043; #calculations Wrev=v1*(P2-P1); print'compressor work as saturated liquid at inlet %f kJ/kg'%round(Wrev,2) #from Table A-5 #at P1 as sat. vapour h1=2675.0; s1=7.3589; s2=s1 #from Table A-6 #at P2 and s2 h2=3194.5; Wrev=h2-h1; print'compressor work as saturated vapor at inlet %f kJ/kg'%round(Wrev,1)  compressor work as saturated liquid at inlet 0.940000 kJ/kg compressor work as saturated vapor at inlet 519.500000 kJ/kg  ## Example 7-13 ,Page No.368¶ In [34]: from math import sqrt #given data P1=100;#intial pressure in kPa T1=300;#intial temperature in K P2=900;#final pressure in kPa #constants used R=0.287;#in kJ/kg -K #calculations #part - a k=1.4; Wcomp=k*R*T1/(k-1)*((P2/P1)**((k-1)/k)-1); print'compression work in case of isentropic compression %f kJ/kg'%round(Wcomp,1); #part - b n=1.3; Wcomp=n*R*T1/(n-1)*((P2/P1)**((n-1)/n)-1); print'compression work in case of polytropic compression %f kJ/kg'%round(Wcomp,1); #part - c Wcomp=R*T1*log(P2/P1); print'compression work in case of isothermal compression %f kJ/kg'%round(Wcomp,1); #part - d Ps=sqrt(P1*P2); Wcomp=2*n*R*T1/(n-1)*((Ps/P1)**((n-1)/n)-1); print'compression work in case of two-stage compression with intercooling %f kJ/kg'%round(Wcomp,1);  compression work in case of isentropic compression 263.200000 kJ/kg compression work in case of polytropic compression 246.400000 kJ/kg compression work in case of isothermal compression 189.200000 kJ/kg compression work in case of two-stage compression with intercooling 215.300000 kJ/kg  ## Example 7-14 ,Page No.371¶ In [35]: #given data P1=3000;#intial pressure in kPa T1=400;#intial temperature in C P2=50;#final pressure in kPa T2=100;#final temperature in C Wout=2000;#power output in kW #from Table A-6 #at P1 h1=3231.7; s1=6.9235; #at 2a h2a=2682.4; #from Table A-6 #at 2s s2s=s1; sf=1.0912; sg=7.5937; hf=340.54; hfg=2304.7 x2s=(s2s-sf)/(sg-sf); h2s=hf+x2s*hfg; nT=(h1-h2a)/(h1-h2s); print'isentropic efficiency is %f'%round(nT,3) #Ein = Eout m=Wout/(h1-h2a); print'mass flow rate %f kg/s'%round(m,2)  isentropic efficiency is 0.667000 mass flow rate 3.640000 kg/s  ## Example 7-15 ,Page No.374¶ In [37]: #given data P1=100;#intial pressure in kPa T1=285;#intial temperature in K P2=800;#final pressure in kPa m=0.2;#mass flow rate in kg/s nc=0.8;#isentropic efficiency #from Table A-17 #at T1 h1=285.14; Pr1=1.1584; #calcualtions Pr2=Pr1*(P2/P1); #at Pr2 h2s=517.05; h2a=(h2s-h1)/nc+h1; #at h2a T2a=569.5; print'exit temperature of air %f K'%T2a; #Ein = Eout Wa=m*(h2a-h1); print'required power input %i kW'%round(Wa)  exit temperature of air 569.500000 K required power input 58 kW  ## Example 7-16 ,Page No.375¶ In [42]: from math import sqrt #given data P1=200.0;#intial pressure in kPa T1=950.0;#intial temperature in K P2=80.0;#final pressure in kPa nN=0.92;#isentropic efficiency #from Table A-2b cp=1.099; k=1.354; #calculations T2s=T1*(P2/P1)**((k-1)/k); #ein = eout V2s=sqrt(2*cp*(T1-T2s)*1000);#factor of 1000 for conversion to m^2/s^2 print'maximum possible exit velocity %i m/s'%(V2s); T2a=T1-nN*(T1-T2s); print'exit temperature %i K'%round(T2a); V2a=sqrt(nN*V2s**2); print'actual exit velocity %i m/s'%(V2a)  maximum possible exit velocity 666 m/s exit temperature 764 K actual exit velocity 639 m/s  ## Example 7-17 ,Page No.382¶ In [44]: #given data Qin=1035.0;#rate of heat transfer in W Tin=20+273.0;#inner temperature in K Qout=Qin; Tout=5+273.0;#outer temperature in K #calculations # Sin - Sout + Sgen = dSsystem/dt Sgen=(Qout/Tout)-(Qin/Tin); print'entropy generation in the wall %f W/K'%round(Sgen,3); Ts1=300.0;Ts2=273.0;#Boundary temperatures Sgen=(Qout/Ts2)-(Qin/Ts1); print'total entropy generation %f W/K'%round(Sgen,3);  entropy generation in the wall 0.191000 W/K total entropy generation 0.341000 W/K  ## Example 7-18 ,Page No.383¶ In [10]: #given data P1=7;#intial pressure in MPa T1=450;#intial temperature in K P2=3;#final pressure in MPa #from steam tables #at P1 and T1 h1=3288.3; s1=6.6353; #at P2 h2=h1; s2=7.0046; #calculations # Sin - Sout + Sgen = dSsystem/dt Sgen=s2-s1; print'the entropy generated %f kJ/kg-K'%round(Sgen,4)  the entropy generated 0.369300 kJ/kg-K  ## Example 7-19 ,Page No.385¶ In [3]: from math import log #given data m=50;#mass of iron block in kg T1=500.0;#temperature of iron block in K T2=285.0;#temperature of lake in K #from Table A-3 Cavg=0.45; #calculations dSiron=m*Cavg*log(T2/T1); print'entropy change of the iron block %f kJ/K'%round(dSiron,2); # Ein - Eout = dEsystem Qout=m*Cavg*(T1-T2); dSlake=Qout/T2; print'entropy change of the lake %f kJ/K'%round(dSlake,2); # Sin - Sout + Sgen = dSsystem/dt Sgen=(Qout/T2)+dSiron; print'entropy change in the process %f kJ/K'%round(Sgen,2)  entropy change of the iron block -12.650000 kJ/K entropy change of the lake 16.970000 kJ/K entropy change in the process 4.330000 kJ/K  ## Example 7-20 ,Page No.386¶ In [12]: #given data P=20;#pressure of water in psia T1=50+460.0;#temperature of water in R T2=240.0;#steam temperature in F T3=130.0;#leaving temperauture in F m1=300.0;#mass flow rate in lbm/min Qout=180.0;#heat losses in Btu/min #from steam tables #at P and T1 h1=18.07; s1=0.03609; #at P and T2 h2=1162.3; s2=1.7406; #at P and T3 h3=97.99; s3=0.18174; #calculations # Qout = m1*h1 + m2*h2 - (m1+m2)*h3 m2= (Qout-m1*h1+m1*h3)/(h2-h3); m3=m1+m2; # Sin - sout + Sgen = dSsystem/dt Sgen=m3*s3-m1*s1-m2*s2+Qout/T1; print'the rate of entropy generation %f Btu/min R'%round(Sgen,2)  the rate of entropy generation 8.670000 Btu/min R  ## Example 7-21 ,Page No.388¶ In [13]: #given data T=100+273.0;#temperature of water in K Q=-600.0;#heat transferred in kJ Tb=25+273.0;#temperature of surroundings in K #calculation dSsys=Q/T; print'entropy change of water %f kJ/K'%round(dSsys,2); # Sin - sout + Sgen = dSsystem Sgen= -Q/Tb + dSsys; print'total entropy generation %f kJ/K'%round(Sgen,2)  entropy change of water -1.610000 kJ/K total entropy generation 0.400000 kJ/K  ## Example 7-22 ,Page No.394¶ In [14]: from math import pi,sqrt #given data T1=20+273.0;#average temperature of inlet in C T2=24+273.0;#average temperature of compressed air in C P1=101.0;#pressure of air inlet in kPa P2=801.0;#pressure of compressed air in kPa D=3.0/1000.0;#ihole diameter n m Cdischarge=0.65;#discharge coefficient ncomp=0.8;#compressor efficiency nmotor=0.92;#motor efficiency UC=0.078;#unit cost in$/kWh

#constants used
R=0.287;#in kJ/kg K
k=1.4;
n=1.4;

#calculations
Win=n*R*T1/(ncomp*(n-1))*((P2/P1)**((n-1)/n)-1);
A=pi*D**2/4;
mair=Cdischarge*(2/(k+1))**(1/(k-1))*P2*A/(R*T2)*sqrt(k*R*1000*2/(k+1)*T2);#factor of 1000 to m^2/s^2
PW=mair*Win;#Power wasted
ES=PW*4200/nmotor;#4200 is operating hours ES stands for Energy savings
print'Energy savings %i kWh/yr'%round(ES);
CS=ES*UC;
print'cost savings %i S/yr'%round(CS)

Energy savings 11698 kWh/yr
cost savings 912 S/yr


## Example 7-23 ,Page No.398¶

In [15]:
#given data
P1=85.6;#pressure of air inlet in kPa
P2=985.6;#pressure of actual compressed air in kPa
P2r=885.6;#pressure of required compressed air in kPa
CC=12000;#current cost in \$/yr

#constants used
n=1.4;

#calulation
freduction=1-(((P2r/P1)**((n-1)/n)-1)/((P2/P1)**((n-1)/n)-1));
CS=CC*freduction;
print'cost savings %i Dollar/yr'%(round(CS))

cost savings 719 Dollar/yr