# Chapter10-Availbility,exergy and irreversibilitiy¶

## Example1-pg 240¶

In [1]:
import math
#calculate work of the water and heat interaction of the water and aximum work done
##initialisation of variables
m= 2 ##kg
p= 200 ##kPa
v2= 0.9596 ##m^3/kg
v1= 0.001 ##m^3/kg
u2= 2768.8 ##kJ/kg
u1= 83.96 ##kJ/kg
T= 20 ##C
u3= 2576.9 ##kJ/kg
s2= 7.2795 ##kJ/kg K
s1= 0.2966 ##kJ/kg K
Tr= 150 ##C
##CALCULATIONS
W= m*p*(v2-v1)
Q= m*(u2-u1)
A= m*((u3-u1)-(273.15+T)*(s2-s1))
Ar= -Q*(1-((273.15+T)/(273.15+Tr)))
Wrep= -(A+Ar)
##RESULTS
print'%s %.1f %s'%('work of the water =',W,'kJ')
print'%s %.1f %s'% ('Heat interaction of the water =',Q,'kJ')
print'%s %.1f %s'%('maximum work done =',Wrep,'kJ')

work of the water = 383.4 kJ
Heat interaction of the water = 5369.7 kJ
maximum work done = 757.9 kJ


## Example2-pg 243¶

In [3]:
import math
#calculate irreversibility of the processes
##initialisation of variables
Wrev= 757.8 ##kJ
W= 383.4 ##kJ
m= 2 ##kg
s2= 7.2795 ##kJ/kg K
s1= 0.2966  ##kJ/kg K
Qr= 5369.7 ##kJ
T= 150 ##C
T0= 20 ##C
##CALCULATIONS
I= Wrev-W
dS= m*(s2-s1)
Sr= -Qr/(273.15+T)
I1= (273.15+T0)*(dS+Sr)
##RESULTS
print'%s %.1f %s'%('Irreversibility of the process=',I1,'kJ')

Irreversibility of the process= 374.1 kJ


## Ex3-pg243¶

In [1]:
##initialisation of variables
p0= 100 ##kPa
V= 0.12 ##m**3
T0= 20 ##C
##CALCULATIONS
I= p0*V
dS= I/(273.15+T0)
##RESULTS
print'%s %.2f %s'% (' Irreversibility of the process= ',I,' kJ')
print'%s %.2f %s'% (' \n Entropy of the process= ',dS,' kJ')

 Irreversibility of the process=  12.00  kJ

Entropy of the process=  0.04  kJ


# Ex6-pg245¶

In [2]:
##initialisation of variables
m= 150 ##kg
u2= 313.90 ##kJ/kg
u1= 62.99 ##kJ/kg
T= 10 ##C
s2= 1.0155 ##kJ/kg K
s1= 0.2245 ##kJ/kg K
p0= 100 ##kPa
v2= 0.0010259 ##m**3/kg
v1= 0.0010009 ##m**3/kg
h2= 314.52 ##kJ/kg
h1= 63.59 ##kJ/kg
T1= 99 ##C
##CALCULATIONS
Ow= m*((u2-u1)-(273.15+T)*(s2-s1)+p0*(v2-v1))
Wel= -m*(h2-h1)
At= Wel+Ow
As= Wel*(1-((273.15+T)/(273.15+T1)))
At1= Ow+As
I= m*(273.15+T)*(s2-s1)
I1= (273.15+T)*(m*(s2-s1)+(Wel/(273.15+T1)))
##RESULTS
print'%s %.2f %s'% (' change in availability= ',Ow-1,' kJ')
print'%s %.2f %s'% ('  change in availability=',At-2,' kJ')
print'%s %.2f %s'% ('  change in availability=',At1-50,' kJ')
print'%s %.2f %s'% ('  irreversibility=',I+4,' kJ')
print'%s %.2f %s'% ('  irreversibility= ',I1+49,' kJ')

 change in availability=  4040.13  kJ
change in availability= -33600.37  kJ
change in availability= -5010.39  kJ
irreversibility= 33599.75  kJ
irreversibility=  5006.77  kJ


## Example8-pg253¶

In [7]:
#calculate mass flow rates and wmax and irreversibility
import math
##initialisation of variables
h3= 2793.2 ##kJ/kg
h2= 1342.3 ##kJ/kg
h1= 2993.5 ##kJ/kg
m3= 2.5 ##kg/s
b1= 1043.9 ##kJ/kg
b2= 374.24 ##kJ/kg
b3= 875.41 ##kJ/kg
##CALCULATIONS
m1= m3*((h3-h2)/(h1-h2))
m2= m3*((h3-h1)/(h2-h1))
Bin= (m1*b1+m2*b2)
Bout= m3*b3
B= Bin-Bout
Wmax= B
I= B
##RESULTS
print'%s %.3f %s'%('mass flow rate=',m1,'kg/s')
print'%s %.3f %s'%('mass flow rate=',m2,'kg/s')
print'%s %.3f %s'%('Wmax=',Wmax,'kg/s')
print'%s %.1f %s'%('Irreversibility=',Wmax,'kW')

mass flow rate= 2.197 kg/s
mass flow rate= 0.303 kg/s
Wmax= 218.141 kg/s
Irreversibility= 218.1 kW