In [1]:

```
import math
# Variables
print ("Part (i) : For dry saturated steam at 17.8 bar")
p= 17.8; # in bar
p1= 17.5; # in bar
p2= 18.0; # in bar
Vs1= 0.1135; # in litre/kg
Vs2= 0.1104; # in litre/kg
Hs1= 2796.1; # in kJ/kg
Hs2= 2796.4; # in kJ/kg
L1= 1918; # in kJ/kg
L2= 1912; # in kJ/kg
phi_s1= 6.389; # in kJ/kg K
phi_s2= 6.379; # in kJ/kg K
# Calculations and Results
Vs= Vs1-(Vs2-Vs1)/(p2-p1)*(p-p1); # in litre/kg
Hs= Hs1+(Hs2-Hs1)/(p2-p1)*(p-p1); # in kJ/kg
L= L1- (L1-L2)/(p2-p1)*(p-p1); # in kJ/kg
phi_s= phi_s1- (phi_s1-phi_s2)/(p2-p1)*(p-p1); # in kJ/kg K
print ("Part (i) : For dry saturated steam at 17.8 bar")
print "The specific volume in litre/kg is : ",Vs
print "The enthalpy in kJ/kg is : ",Hs
print "The latent heat in kJ/kg is : ",L
print "The entropy in kJ/kg K",phi_s
print ("Part (ii) : For superheated steam at 16 bar and 340°C")
T= 340.; # in K
T1= 300.; # in K
T2= 350.; # in K
Vsup1= 0.1585; # in m**3/kg
Vsup2= 0.1743; # in m**3/kg
Hsup1= 3030; # in kJ/kg
Hsup2= 3142; # in kJ/kg
phi_sup1= 6.877; # in kJ/kg K
phi_sup2= 7.063; # in kJ/kg K
Vsup= Vsup1+(Vsup2-Vsup1)/(T2-T1)*(T-T1); # in m**3/kg
Hsup= Hsup1+(Hsup2-Hsup1)/(T2-T1)*(T-T1); # in kJ/kg
phi_sup= phi_sup1+(phi_sup2-phi_sup1)/(T2-T1)*(T-T1); # in kJ/kg
print "The specific volume in m**3/kg is : ",Vsup
print "The enthalpy in kJ/kg is : ",Hsup
print "The entropy in kJ/kg K is : ",phi_sup
```

In [1]:

```
# Variables
h_sen = 798.43; # in kJ/kg
L = 1984.3; # in kJ/kg
H_total_wet = 2665.7;
# Calculations and Results
# H_total_wet= h_sen+x*L
x = (H_total_wet - h_sen)/L;
print "The value of x is : %.3f"%x
# Part (b)
h_total_sup= 2961; # in kJ/kg
Cps= 2.112; # in kJ/kg
H_total_dry= 2782.7; # in kJ/kg
# Let deltaT= T_sup-T_sat
# h_total_sup = h_sen+L+h_sup = H_total_dry +Cps*deltaT
deltaT= (h_total_sup-H_total_dry)/Cps; # in °C
print "Degree of superheat in °C is : %.2f"%deltaT
```

In [3]:

```
# Variables
H2 = 3055; # in kj per kg
H3 = 2550; # in kj per kg
fie_1 = 7.15; # kj per kg k
fie_2 = 7.57; # kj per kg k
# Calculations and Results
d_fie= fie_2 - fie_1; # in kj per kg k
print "Change in entropy during throttling process in kJ/kg-K is :",d_fie
dH = H2 - H3; # in kj per kg
print "in enthalpy during isentropic process in kJ/kg is : ",dH
```

In [4]:

```
# Exa 9.4
import math
# Variables
H_w = 670.4; # in kJ/kg
L = 2085; # kJ per kg
T_sat = 158.8; # in degree c
m = 4; # in kg
x = 0.5;
h_sen = 670.4; # in kJ/kg
# Calculations and Results
H_totalwet = m * ( h_sen + (x *L)); # in kJ
x1 = 0.95
H_totalwet1 = m *( h_sen + (x1 *L)); # in kJ
Q1 = H_totalwet1 - H_totalwet; # in kJ
print "Part (i) The quantity of heat in case first in kJ is : ",Q1
# Part (b)
x2 = 1;
H_totaldry = m *( h_sen + (x2 *L)); # in kJ
Q2 = H_totaldry - H_totalwet; # in kJ
print "Part (ii) The quantity of heat in case second in kJ is : ",Q2
# Part (c)
H_totalsup = 3062.3; # in kJ per kg
H_totalsup = m * H_totalsup; # in kJ
Q3 = H_totalsup - H_totalwet; # in kJ
print "Part (iii) The quantity of heat in case third in kJ is : ",Q3
# Part (d)
H_totalsup = 2950.4; # in kj per kg
H_totalsup = m * H_totalsup; # in kj
Q4 = H_totalsup - H_totalwet; # in kj
print "(iv) The quantity of heat in case forth in kJ is : ",Q4
```

In [2]:

```
# Variables
p1 = 2.5; # Mpa
p1 = p1 * 10**6; # in pa
p1 = p1 * 10**-5; # in bar
p2 = 10; # in kpa
p2 = p2 * 10**3; # in pa
p2 = p2 * 10**-5; # in bar
H1 = 2878; # in kJ/kg at 25 bar and 250°C
H2 = 2583.9; # in kJ/kg at 0.1 bar for dry saturated steam
AHD= H1-H2; # actual heat drop in kJ/kg
H2_desh = 2110; # in kj per kg
# Calculations and Results
IHD = H1 - H2_desh; # Isentropic heat drop in kJ/ kg
Eta_Isentropic = (AHD/IHD) * 100; # in %
print "Isentropic efficiency in %% is : %.2f"%Eta_Isentropic
# H1 + v1**2/2 + g*z1 + Q = H2 + v2**2/2 + g*z2 + W
W = H1 - H2; # in kJ/kg (as v1=v2, z1= z2 and Q=0)
print "Turbine work is in kJ/kg is :",W
```

In [3]:

```
# Variables
p1 = 11; # in bar
p2 = 1.2; # in bar
H_w1 = 781.1; #in kJ/kg
L1 = 2000; # in kJ/kg
t1 = 120; # in degree c
t1 = t1 + 273; # in K
t2 = 104.81; # in degree c
t2 = t2 + 273; # in K
H_dry2 = 2683.4; # in kJ/kg
C_p = 2.607; # in kJ/kgK
# Calculations and Results
# From Hw1+x*L1 = H_dry2+Cp*(t1-t2)
x = (H_dry2 + (C_p * (t1 - t2)) - H_w1) / L1;
print "Dryness fraction of steam is : %.2f"%x
x1 = (H_dry2 - H_w1)/L1;
print "Maximum dryness fraction of steam is : %.3f"%x1
```

In [4]:

```
# Variables
W = 21.; # in kg
w_wp = 2.; # in kg
h1 = 781.15; # in kJ/kg
L1 = 1998.5; # in kJ/kg
m = 2.; # in kg
h2 = 420.5; # in kJ/kg
L = 2255.9; # in kJ/kg
t_sat = 100.4; # in degree c
t1 = 110.; # in degree c
C_ps = 2.; # in kJ/kgK
# Calculations
x1 = W / (W + w_wp);
x2 = (h2 + L + m * (t1-t_sat) - h1)/ L1;
x = x1 * x2;
# Results
print "The dryness fraction for sample steam is : %.3f"%x
```

In [9]:

```
# Variables
h_sen = 417.4; # in kJ/kg
h_totaldry = 2675.4; # in kJ/kg
L = 2258; # in kJ/kg
v = 5; # in m**3
v_v = 4.95; # in m**3
# Calculations
x = v_v/v;
Q = h_totaldry -(h_sen +x*L); # in kJ/kg
# Results
print "Heat transfered per kg in kJ/kg is : ",Q
```

In [5]:

```
# Variables
m = 1; # in kg
p = 10; # in bar
p = p * 10**2; # in kpa
x = 0.94;
h_sen = 762.61; # in kJ/kg
L = 2013.6; # in kJ/kg
v_s = 0.1942; # in m**3 per kg
# Calculations and Results
w_ext = p * x * v_s * m; # in kJ/kg
print "The work done during evaporation in kJ/kg is : %.2f"%w_ext
# Part (b)
L_internal = (x * L) - w_ext; # in kJ/kg
print "Internal latent heat in kJ/kg is : %.2f"%L_internal
# Part (c)
U_wet = h_sen+x*L-p*x*v_s; # in kJ/kg
print "Internal energy in kJ/kg is : %.2f"%U_wet
```

In [7]:

```
import math
# Variables
T_sat = 179.88; # in degree c
T_sat = T_sat + 273; # in k
T_sup = 200; # in degree c
T_sup = T_sup + 273; # in k
L = 2013.6; # in kJ/kg
C_ps = 2.326;
C_pw = 1;
x = 0.8;
# Calculations and Results
phi_wet = C_pw *math.log(T_sat/273) + ( (x * L)/T_sat); # in kJ/kg-K
print "Entropy of wet steam in kJ/kg-K is : %.3f"%phi_wet
# Part (b)
phi_dry =C_pw * math.log(T_sat/273)+L/T_sat; # in kJ/kg
print "Entropy of dry and saturated steam in kJ/kg-K is : %.3f"%phi_dry
# Part (c)
phi_sup = phi_dry+C_ps *math.log(T_sup/T_sat); # in kJ/kg
print "Entropy at 200°C in kJ/kg-K is : %.3f"%phi_sup
```

In [1]:

```
# Variables
m = 1; # in kg
x = 0.9;
p = 1; # N/mm**2
p = p * 10**1; # in bar
p = p * 10**2; # in kPa
h_sen = 762.61; # in kJ/kg
L = 2013.6; # in kJ/kg
v_s = 0.1944; # in m**3 per kg
# Calculations and Results
H_totalwet = h_sen + x*L; # in kJ/kg
U_wet = H_totalwet - (p * x * v_s); # in kJ/kg
I = U_wet / H_totalwet; # internal energy as a fraction of total heat
I = I * 10**2; # in %
print "The internal energy in %% is : %.2f"%I
# Part (b)
v_s = 0.1542; # in m**3/kg
h_sen = 815; # in kJ/kg
L = 1972; # in kJ/kg
H_totaldry = 2787; # in kJ/kg
C_ps = 2.199;
t_sup = 250; # in °C
t_sup = t_sup + 273; # in K
t_sat = 190.74; # in °C
t_sat = t_sat + 273; # in K
p1 = 13 * 10**2; # in kPa
v_ssup = v_s*t_sup/t_sat; # in m**3/kg
print "The volume of superheated steam in m**3/kg is : %.4f"%v_ssup
# Part (c)
t_sat = t_sat - 273; # in °C
t_sup = t_sup - 273; # in °C
U_sup =h_sen+L+C_ps*(t_sup-t_sat)-p1*v_ssup; # in kJ
del_U = U_sup - U_wet; # in kJ
print "Change in internal energy in kJ is : %.1f"%del_U
# rounding off error
```

In [2]:

```
# Variables
m = 0.5; # in kg
M = 6.6; # in kg
x1 = M / (M+m);
h_dry = 2683; #in kJ/kg
C_p = 2.1;
h_sen = 814.5; #in kJ/kg
L = 1973; # in kJ/kg
t_sup = 120; # in °C
t_sat = 104.8; # in °C
# Calculations
x2 =(h_dry+C_p*(t_sup - t_sat)-h_sen)/ L;
x = x2 * x1;
# Results
print "the dryness fraction of steam is : %.4f"%x
```