In [2]:

```
#Input data
mw=15 #Water steam
ms=185 #Dry steam
#Calculation
x=((ms)/(ms+mw))*100 #Dryness fuction of steam in %
#Output
print("Dryness fuction of steam=",x,"%")
```

In [3]:

```
#Input data
sps=150 #saturation pressure of the steam in degree celsius
#Output
P=4.76 #From steam table
print("saturation pressure=",P,"bar")
```

In [4]:

```
#Input data
P1=28 #Absolute pressure in bar
P2=5.5 #Absolute pressure in MPa
P3=77 #Absolute pressure in mm of Hg
#Calcutation
ts1=230.05 #Saturation temperature in degree celsius
ts2=269.93 #Saturation temperature in degree celsius
ts3=45.83 #Saturation temperature in degree celsius
#Output
print("Saturation temperature= ",ts1,"degree celsius")
print("Saturation temperature= ",ts2,"degree celsius")
print("Saturation temperature= ",ts3,"degree celsius")
```

In [12]:

```
#Input data
P=15 #Absolute pressure in bar
#From steam table (pressure basis at 15 bar)
ts=198.3 #In degree celsius
hf=844.7 #In KJ/Kg
hfg=1945.2 #In KJ/Kg
hg=2789.9 #In KJ/Kg
tsup=300 #In degree celsius
x=0.8
Cps=2.3
hg=2789.9
#Calculation
h1=hf+x*hfg #Enthalpy of wet steam in KJ/KG
h=hg #Enthalpy of dry and saturated steam in KJ/KG
h2=hg+Cps*(tsup-ts)#Enthalpy of superheated steam in KJ/KG
#Output
print("Enthalpy of wet steam= ",h1,"KJ/Kg")
print("Enthalpy of dry and saturated steam= ",h,"KJ/KG")
print("Enthalpy of superheated steam= ",h2,"KJ/Kg")
```

In [1]:

```
#Input data
ti=30 #Temperature in degree celsius
m=2 #Water in Kg
pf=8 #Steam at 8 bar
x=0.9 #Water to dry
tb=30
#From steam table at 30 degree celsius
hf=125.7
#h1=hf initial enthalpy of water
#From steam table at 8 bar
ts=170.4 #In degree celsius
hf1=720.9 #In KJ/KG
hfg=2046.6 #In KJ/KG
hg=2767.5 #In KJ/KG
#Calculation
h=hf1+(x*hfg) #Final Enthalpy of the steam in KJ/Kg
Qha=m*(h-hf) #Quantity of the heat in KJ/Kg #Calculation mistake m is not multiplied by (h-hf) in book
#Output
print("Final Enthalpy of the steam= ",h,"KJ/Kg")
print("Quantity of the heat= ",round(Qha,1),"KJ/Kg")
```

In [5]:

```
#Input data
IT=25 #Initial temperature
m=5 #Heat required to generate steam in kg
pf=10 #Final pressure in bar
tsup=250 #Water temperature
#From steam table (temp basis)at 25degree celsius
#and at 10 bar(pressure basis)
hf=104.8 #In KJ/KG
h1=104.8 #In KJ/KG
ts=179.9 #In degree celsius
hf1=792.6 #In KJ/KG
hfg=2013.6 #In KJ/KG
hg=2776.2 #In KJ/KG
Cps=2.1
#Calculation
h=hg+Cps*(tsup-ts) #Enthalpy of superheated steam in KJ/Kg
H=m*(h-h1) #Quantity of heat added in KJ/Kg
#Output
print("Enthalpy of superheated steam= ",h,"KJ/Kg")
print("Quantity of heat added= ",round(H,),"KJ/Kg")
```

In [6]:

```
#Input data
P=15 #Absolute pressure in bar
#From steam table (pressure basis at 15 bar)
ts=198.3+273 #In degree celsius
vg=0.1317 #In m**3/Kg
vf=0.001154 #In m**3/Kg
x=0.8
Tsup=300+273 #Degree celsius
#Calculation
v=(1-x)*vf+x*vg #Volume of wet steam in m**3/Kg
vg=0.1317 #Dry and saturated steam in m**3/Kg
vsup=vg*(Tsup/ts) #Volume of superheated steam m**3/Kg
#Output
print("Volume of wet steam= ",round(v,4),"m**3/Kg")
print("Dry and Saturated Steam= ",vg,"m**3/Kg")
print("volume of superheated steam= ",round(vsup,4),"m**3/Kg")
```

In [21]:

```
#Input data
P=25 #Absolute pressure
ts=223.9 #Volume
#Frome steam table (pressure basis at 25 bar)
vf=0.001197 #In m**3/Kg
vg=0.0799 #In m**3/Kg
v=8 #In m**3/Kg
#Calculation
m=v/vg #Mass of steam in Kg
#Output
print("Mass of steam= ",round(m,3),"Kg")
```

In [12]:

```
#Input data
P=12*10**5 #Absolute pressure
#From steam table (pressure basis at 12 bar)
ts=188+273 #In degree celsius
vf=0.001139 #In m**3/Kg
vg=0.1632 #In m**3/Kg
hf=798.4 #In KJ/Kg
hfg=1984.3 #In KJ/Kg
hg=2782.7 #In KJ/Kg
x=0.94
Cps=2.3
tsup=350+273 #In degree celsius
#Calcuation
h=hf+x*hfg #Enthalpy of wet steam in KJ/Kg
v=(1-x)*vf+x*vg #Volume of wet steam m**3/Kg
u=h-((P*v)/10**3) #Internal Energy in KJ/Kg
hg=2782.7 #Enthalpy of dry & saturated steam in KJ/Kg
v1=vg #Volume of dry & saturated steam m**3/Kg
u1=hg-((P*vg)/10**3) #Internal Energy in KJ/Kg
h1=hg+Cps*(tsup-ts) #Enthalpy of superheated steam in KJ/Kg
vsup=vg*(tsup/ts) #Volume of superheated steam in m**3/Kg
u2=h1-((P*v)/10**3) #Internal Energy in KJ/Kg
#Output
print("Enthalpy of wet steam= ",h,"KJ/Kg")
print("Volume of wet steam= ",round(v,5),"m**3/Kg")
print("Internal Energy= ",round(u,2),"KJ/Kg")
print("Enthalpy of dry & saturated steam= ",hg,"KJ/Kg")
print("Volume of dry & saturated steam= ",v1,"m**3/Kg")
print("Internal Energy= ",u1,"KJ/Kg")
print("Enthalpy of superheated steam= ",round(h1,1),"KJ/Kg")
print("Volume of superheated steam= ",round(vsup,3),"m**3/Kg")
print("Internal Energy= ",round(u2,1),"KJ/Kg")
```

In [23]:

```
#Input data
P1=10*10**5 #Pressure of steam in bar
tsup1=300+273 #Temperature of steam n degree celsius
P2=1.4*10**5 #Internal energy of steam
x2=0.8 #Dryness fraction
Cps=2.3
#from steam table properties of saturated steam (temp basis)
#at 25 degree celsius and at 10 bar(pressure basis)
ts1=179.9+273
vf=0.001127 #In m**3/Kg
vg=0.1943 #In m**3/Kg
hf=762.6 #In KJ/Kg
hfg=2013.6 #In KJ/Kg
hg1=2776.2 #In KJ/Kg
#at 1.4 bar
ts=109.3 #In degree celsius
vf1=0.001051 #In m**3/Kg
vg1=1.2363 #In m**3/Kg
hf1=458.4 #In KJ/Kg
hfg1=2231.9 #In KJ/Kg
hg=2690.3 #In KJ/Kg
#calculation
h1=hg1+Cps*(tsup1-ts1) #Enthalpy of superheated steam in KJ/Kg
v1=vg*(tsup1/ts1) #Volume of superheated steam in m**3/Kg
u1=h1-((P1*v1)/10**3) #Internal energy in KJ/Kg
h2=hf1+x2*hfg1 #Enthalpy of wet steam in KJ/Kg
Vwet=(1-x2)*vf1+x2*vg1 #Volume of wet steam in m**3/Kg
u2=h2-((P2*Vwet)/10**3) #Internal energy in KJ/Kg
DeltaU=u1-u2 #Change of Internal energy in KJ/Kg
#Output
print("Enthalpy of superheated steam= ",h1,"KJ/Kg")
print("Volume of superheated steam= ",round(v1,4),"m**3/Kg")
print("Internal energy= ",round(u1,1),"KJ/Kg")
print("Enthalpy of wet steam= ",h2,"KJ/Kg")
print("Volume of wet steam= ",round(Vwet,5),"m**3/Kg")
print("Internal energy= ",round(u2,1),"KJ/Kg")
print("Change of Internal energy= ",round(DeltaU,1),"KJ/Kg")
```

In [26]:

```
#Input data
import math
P=15 #Absolute pressure
#From steam table (pressure basis at 15 bar)
ts=198.3+273 #In degree celsius
Sf=2.3145 #In KJ/KgK
Sfg=4.1261 #In KJ/KgK
Sg=6.4406 #In KJ/KgK
tsup=300+273
Cps=2.3
x=0.8
#calculation
S=Sf+x*Sfg #Entropy of wet steam in KJ/Kg
S1=Sg #Entropy of superheated steam in KJ/Kg
S2=Sg+Cps*(math.log(tsup/ts)) #Entropy of superheated steam in KJ/Kg
#Output
print("Entropy of wet steam",round(S,3)," KJ/Kg")
print("Entropy of dry and saturated steam",S1," KJ/Kg")
print("Entropy of superheated steam",round(S2,2)," KJ/Kg")
```

In [31]:

```
#Input data
#Input data
import math
m=1.5 #Entropy of the steam
P=10*10**5 #Absolute pressure in bar
#From steam table properties of saturated steam
#(pressure basis)at 10 bar
ts=179.9+273 #Indegree celsius
vf=0.001127 #In m**3/Kg
vg=0.1943 #In m**3/Kg
hf=762.6 #In KJ/Kg
hfg=2013.6 #In KJ/Kg
hg=2776.2 #In KJ/Kg
Sf=2.1382 #In KJ/KgK
Sfg=4.4446 #In KJ/KgK
Sg=6.5828 #In KJ/Kg
Cps=2.3
tsup=250+273
#Calculation
#(1)Enthalpy of dry and saturated steam
h=hg #Enthalpy of dry and saturated steam
EODS=hg*m #Enthalpy of 1.5Kg of dry and saturated steam
v=vg #volume of dry and saturated steam
u=h-((P*v)/10**3) #Internal Energy
IES=u*m #Internal energy of the steam
s=6.5858 #Entropy of dry and saturated steam
EODSS=s*m #Entropy of 1.5Kg dry and saturated steam
x=0.75
#(2)Enthalpy of wet steam
h1=hf+x*hfg #Enthalpy of wet steam
EWS=h1*m #Enthalpy of1.5Kg of wet steam
Vwet=x*vg #Volume of steam
u1=h1-((P*Vwet)/10**3) #Internal energy
IES1=u1*m #Internal energy of1.5Kg of the steam
s1=Sf+x*Sfg #Entropy of wet steam
EWS1=s1*m #Entropy of1.5Kg of wet steam
#(3)Enthalpy of superheated steam
h2=hg+Cps*(tsup-ts) #Enthalpy of superheated steam
EOSHS=h2*m #Enthalpy of 1.5Kg of superheated steam
Vsup=vg*(tsup/ts) #Volume of superheated steam
u2=h2-((P*Vsup)/10**3) #Internal energy
IES2=u2*m #Internal energy of 1.5Kg of the steam
s2=Sg+Cps*(math.log(tsup/ts))#Entropy of superheated steam
EOSHS1=s2*m #Entropy of 1.5Kg of superheated steam
#Output
print("Enthalpy of dry and saturated steam= ",h,"KJ/Kg")
print("Enthalpy of 1.5Kg of dry and saturated steam= ",round(EODS,2),"KJ")
print("volume of dry and saturated steam= ",v,"m**3/kg")
print("Internal Energy= ",round(u,2),"KJ/Kg")
print("Internal energy of the steam= ",round(IES,2),"kJ")
print("Entropy of dry and saturated steam = ",s,"KJ/KgK")
print("Entropy of 1.5kg of dry and saturated steam= ",EODSS,"KJ/K")
print("Enthalpy of wet steam= ",round(h1,2),"KJ/Kg")
print("Enthalpy of1.5Kg of wet steam= ",EWS,"KJ")
print("Volume of steam= ",Vwet,"m**3/Kg")
print("Internal energy= ",u1,"KJ/Kg")
print("Internal energy of1.5Kg of the steam= ",round(IES1,2),"KJ")
print("Entropy of wet steam= ",round(s1,2),"KJ/KgK")
print("Entropy of 1.5Kg of wet steam= ",EWS1,"KJ/K")
print("Enthalpy of superheated steam= ",h2,"KJ/Kg")
print("Enthalpy of 1.5Kg of superheated steam= ",round(EOSHS,1),"KJ")
print("Volume of superheated steam= ",round(Vsup,4),"m**3/Kg")
print("Internal energy= ",round(u2,4),"")
print("Internal energy of1.5Kg of the steam= ",round(IES2,1),"KJ")
print("Entropy of superheated steam= ",round(s2,4),"KJ/KgK")
print("Entropy of 1.5Kg of superheated steam= ",round(EOSHS1,2),"KJ/K")
```

In [40]:

```
#Input data
V=0.04 #Volume of vessel in m**3
x=1
t=250+273 #Saturated steam temp in degree celsius
mw=9 #Mass of liquid in Kg
#From steam table(temp basis,at t=250)
P=39.78*10**5 #in bar
Vf=0.001251 #In m**3/kg
Vg=0.05004 #In m**3/Kg
hf=1085.7 #KJ/Kg
hfg=2800.4 #KJ/Kg
hg=1714.7 #KJ/Kg
#Calculation
Vw=mw*Vf #Volume occupied by water in m**3
Vs=V-Vw #Volume of waterin m**3
ms=Vs/Vg #Volume of dry and saturated steam in Kg
m=mw+ms #Total mass of steam in Kg
x=ms/(ms+mw) #Dryness fraction of steam
Vwet=(1-x)*Vf+x*Vg #Specific volume of steam in m**3/Kg
h=hf+x*hfg #Enthalpy of wet steam in KJ/Kg
EOWS=h*m #Enthalpy of 9.574 Kg of wet steam KJ
u=h-((P*Vwet)/10**3) #Internal Energy in KJ/Kg
IEOS=u*m #Internal energy of 9.574 Kg of steam in KJ
#Output
print("Volume occupied by water= ",round(Vw,5),"m**3")
print("Volume of water= ",round(Vs,5),"m**3")
print("Volume of dry and saturated steam= ",round(ms,3),"Kg ")
print("Total mass of steam= ",round(m,3),"Kg")
print("Dryness fraction of steam= ",round(x,2),)
print("Specific volume of steam= ",round(Vwet,6)," m**3/Kg")
print("Enthalpy of wet steam= ",round(h,1),"KJ/Kg")
print("Enthalpy of 9.574 Kg of wet steam= ",round(EOWS,),"KJ")
print("Internal Energy= ",round(u,1),"KJ/Kg")
print("Internal energy of 9.574 Kg of steam= ",round(IEOS),"KJ")
```

In [7]:

```
#Input Data
P=7 #Absolute pressure in bar
t=200 #Absolute temperature
ts=165 #In degree celsius from steam table
#Calculation
dos=t-ts #Degree of superheat in degree celcius
#Output
print("Degree of superheat= ",dos,"degree celcius")
```

In [8]:

```
#Input data
P=15 #Absolute pressure in bar
#From steam table (pressure basis at 15 bar)
h=1950 #In KJ/Kg
ts=198.3 #In degreee celsius
hf=844.7 #In KJ/Kg
hfg=1945.2 #In KJ/Kg
hg=2789.9 #In KJ/Kg
#calculation
x=((h-hf)/hfg) #Enthalpy of wet steam
#Output
print("Enthalpy of wet steam= ",round(x,3),"")
```

In [9]:

```
#Input data
P=15 #Absolute pressure in bar
#From steam table (pressure basis at 15 bar)
h=3250 #In KJ/Kg
ts=198.3 #In degree celsius
hf=844.7 #In KJ/Kg
hfg=1945.2 #In KJ/Kg
hg=2789.9 #In KJ/Kg
Cps=2.3
#Calculation
tsup=(h-hg+(Cps*ts))/2.3 #Enthalpy of superheated steam in degree celsius
dos=tsup-ts #Degree of superheated in degree celsius
##The value of ts in not used according to data in book instead of ts=198.3 author used ts=165
#Output
print("Enthalpy of superheated steam= ",round(tsup,2),"degree celcius")
print("Degree of superheated= ",round(dos,2),"degree celcius")
```

In [10]:

```
#Input data
P=7 #Absolute pressure in bar
v=0.2 #Specific volume in m**3/Kg
#from steam table (pressure basis at 7 bar)
ts=165 #In degree celsius
vf=0.001108 #In m**3/Kg
vg=0.2727 #In m**3/Kg
#calculation
x=v/vg #Volume of steam dryness fraction
#Output
print("Volume of steam dryness fraction= ",round(x,3),)
```

In [11]:

```
#Input data
P=7 #Absolute pressure in bar
v=0.3 #Specific volume in m**3/Kg
#From steam table (pressure basis at 7 bar)
ts=165+273 #In degree celsius
vf=0.001108 #In m**3/Kg
vg=0.2727 #In m**3/Kg
#Calculation
#v=vg*tsup/ts
tsup=((v/vg)*ts)-273 #Temp of superheated steam in degree celsius
DOS=tsup+273-ts #Degree of superheated in degree celsius
#Output
print("Temp of superheated steam= ",round(tsup,2),"degree celsius")
print("Degree of superheated= ",round(DOS,2),"degree celsius")
```

In [12]:

```
#Input data
m=2 #steam of vessel in Kg
V=0.1598 #volume of vessel in M**3
P=25 #Absolute pressure of vessel in bar
#Calculation
v=V/m #Quality of steam in m**3/Kg
#Output
print("Quality of steam",v," m**3/Kg")
```

In [13]:

```
#Input data
P=10*10**2 #Absolute pressure in bar
x1=0.9 #Dryness enters
tsup2=300+273 #Temperature in degree celsius
#From steam table at 10 bar
ts=179.9+273 #In degree celsius
Vg=0.1943 #In m**3/Kg
hf=762.6 #In KJ/Kg
hfg=2013.6 #InK/Kg
hg=2776.2 #In KJ/Kg
#Calculation
h1=hf+x1*hfg #Initial enthalpy of steam in KJ/Kg
V1=x1*Vg #Initial specific volume of steam
u1=h1-P*V1 #Initial internal energy of steam in KJ/Kg
h2=hg+Cps*(tsup2-ts) #Final enthalpy of steam in KJ/Kg
V2=Vg*(tsup2/ts) #Final specific volume of steam in m**3/Kg
u2=h2-P*V2 #Final internal energy of steam in KJ/K
deltah=h2-h1 #Heat gained by steam in KJ/Kg
deltaU=(u2-u1) #Change in internal energy in KJ/Kg
#Output
print("Initial enthalpy of steam= ",h1,"KJ/Kg")
print("Initial specific volume of steam= ",V1,)
print("Initial internal energy of steam= ",round(u1,2),"KJ/Kg")
print("Final enthalpy of steam= ",h2,"KJ/Kg")
print("Final specific volume of steam= ",round(V2,4),"m**3/Kg")
print("Final internal energy of steam= ",round(u2,3),"KJ/Kg")
print("Heat gained by steam= ",round(deltah,2),"KJ/Kg")
print("Change in internal energy= ",round(deltaU,2),"KJ/Kg")
```

In [14]:

```
#Input data
m=4 #Steam in Kg
P=13 #Absolute pressure in bar
tsup1=450 #Absolute temp in degree celsius
deltaH=2.8*10**3 #loses in MJ
#from steam table at 13 bar
ts=191.6 #In degree celsius
Vg=0.1511 #In m**3/Kg
hf=814.7 #In m**3/Kg
hfg=1970.7 #In KJ/Kg
hg=2785.4 #In KJ/Kg
#Calculation
h1=hg+Cps*(tsup1-ts) #Initial enthalpy of steam in KJ/Kg
Deltah=deltaH/m #Change in enthalpy/unit mass in KJ/Kg
h2=h1-Deltah #Final enthalpy of steam in KJ/Kg
x2=(h2-hf)/hfg #wet & dryness fraction
#Output
print("Initial enthalpy of steam= ",round(h1,2)," KJ/Kg")
print("Change in enthalpy/unit mass= ",Deltah,"KJ/Kg")
print("Final enthalpy of steam= ",round(h2,2),"KJ/Kg")
print("wet & dryness fraction= ",round(x2,4),)
```

In [15]:

```
#Input data
m=2 #Steam in Kg
x=0.7 #Initial dryness
P=15 #Constant pressure in bar
#V2=2V1
#from steam table properties of
#saturated steam(pressure basis) at 15 bar
Ts=198.3+273 #In degree celsius
Vg=0.1317 #In m**3/Kg
hf=844.7 #In KJ/Kg
hfg=1945.2 #In KJ/Kg
hg=2789.9 #In KJ/Kg
Cps=2.3
#Calculation
V1=x*Vg #Initial specific volume of steam in m**3/Kg
V2=2*V1 #Final specific volume of steam in m**3/Kg
Tsup=(V2/Vg)*Ts #Steam is superheated in degree celsius
FSS=Tsup-Ts #Degree of superheated in degree celsius
h1=hf+x*hfg #Initial enthalpy of steam in KJ/Kg
h2=hg+Cps*(Tsup-Ts) #Final enthalpy of steam in KJ/Kg
Q=(h2-h1)*m #Heat transferred in the process in KJ
W1=P*(m*V2-m*V1) #Work transferred in the process in KJ
#Output
print("Initial specific volume of steam= ",round(V1,4),"m**3/Kg")
print("Final specific volume of steam= ",round(V2,4),"m**3/Kg")
print("Steam is superheated= ",round(Tsup,2),"K")
print("Degree of superheated= ",round(FSS,2),"degree celsius")
print("Initial enthalpy of steam= ",h1,"KJ/Kg")
print("Final enthalpy of steam= ",round(h2,2),"KJ/Kg")
print("Heat transferred in the process= ",round(Q,2),"KJ")
print("Work transferred in the process= ",round(W1,3),"KJ")
```

In [16]:

```
#Input data
ms=1000 #Steam in Kg/h
P=16 #Absolute pressure in bar
x2=0.9 #Steam is dry
t1=30+273 #temperature in degree celsius
tsup=380 #tmperature rised in degree celsius
#from steam table(pressure basis at 16 bar)
h1=125.7 #in KJ/Kg
ts=201.4 #In degree celsius
hf=858.5 #in kJ/Kg
hfg=1933.2 #in kJ/Kg
hg=2791.7 #in kJ/Kg
Cps=2.3
#Calculation
h2=hf+x2*hfg #Final enthalpy of wet steam in KJ/Kg
Q1=(ms*(h2-h1))*10**-3 #Constant pressure process in KJ/h
h3=hg+Cps*(tsup-ts) #Final enthalpy of superheated steam in KJ/g
Q2=(ms*(h3-h2))*10**-3 #Suprheated steam in KJ/h
#Output
print("Final enthalpy of wet steam= ",round(h2,1),"KJ/Kg ")
print("Constant pressure process= ",round(Q1,1)," KJ/h ")
print("Final enthalpy of superheated steam= ",round(h3,1)," KJ/g")
print("Suprheated steam= ",round(Q2,1),"KJ/h")
```

In [1]:

```
#Input data
FB=15 #First boiler in bar
SB=15 #Second boiler in bar
tsup1=300 #Temperature of the steam in degree celsius
tsup2=200 #Temperature of the steam in degree celsius
#From steam table (pressure basis at 15 bar )
ts=198.3 #In degree celsius
hf=844.7 #In KJ/Kg
hfg=1945.2 #In KJ/Kg
hg=2789.9 #In KJ/I
Cps=2.3
#Calculation
h1=hg+Cps*(tsup1-ts) #Enthalpy of steam of first boiler in KJ/Kg
h3=hg+Cps*(tsup2-ts) #Enthalpy of steam in steam main in KJ/Kg
h2=2*h3-h1 #Energy balance in KJ/Kg
x2=(h2-hf)/hfg #Enthalpy of wet steam
#OUTPUT
print("Enthalpy of steam of first boiler= ",round(h1,1),"KJ/Kg")
print("Enthalpy of steam in steam main= ",round(h3,1),"KJ/Kg")
print("Energy balance= ",round(h2,1),"KJ/Kg")
print("Enthalpy of wet steam= ",round(x2,3),)
```

In [2]:

```
#Input data
V=0.35 #Capacity of vessel in m**3
P1=10*10**2 #Absolute pressure in bar
tsup1=250+273 #Absolute temperature in degree celsius
P2=2.5*102 #Absolute pressure in the vessel fall in bar
#From steam table (pressure basis at 10 bar)
ts1=179.9+273 #In degree celsius
Vg1=0.1943 #In m**3/Kg
hf1=762.6 #In KJ/Kg
hfg1=2013.6 #In KJ/Kg
hg1=2776.2 #In KJ/Kg
#From steam table(pressure basis at 2.5 bar)
V2=0.2247 #In m**3/Kg
ts2=127.4 #In degree celsius
Vg2=0.7184 #In m**3/Kg
hf2=535.3 #In KJ/Kg
hfg2=2181.0 #In KJ/Kg
hg2=2716.4 #In KJ/Kg
#Calculation
V1=Vg1*(tsup1/ts1) #Initial specific volume of steam in m**3/Kg
m=V/V1 #Initial mass of steam in Kg
x2=V2/Vg2 #Final condition of wet steam
h1=hg1+Cps*(tsup1-ts1) #Initial enthalpy of steam in KJ/Kg
u1=h1-P1*V1 #Initial internal energy of steam in KJ/Kg
h2=hf2+x2*hfg2 #Final enthalpy of steam in KJ/Kg
u2=h2-P2*V2 #Final internal energy of steam in KJ/Kg
deltaU=(u2-u1)*m #Change in internal energy in KJ
#Output
print("Initial specific volume of steam= ",round(V1,4),"m**3/Kg")
print("Initial mass of steam= ",round(m,4),"Kg")
print("Final condition of wet steam= ",round(x2,4),)
print("Initial enthalpy of steam= ",h1,"KJ/Kg")
print("Initial internal energy of steam= ",round(u1,2),"KJ/Kg")
print("Final enthalpy of steam= ",round(h2,1)," KJ/Kg")
print("Final internal energy of steam= ",round(u2,3),"KJ/Kg")
print("Change in internal energy= ",round(deltaU,1),"KJ")
```

In [3]:

```
#Input data
m=1.5 #Saturated steam in Kg
x1=1
x2=0.6
P1=5*10**5 #Absolute pressure in bar
#From steam table at pressure basis 5 bar
hg1=2747.5 #In KJ/Kg
Vg1=0.3747 #In m**3/Kg
V1=0.3747 #In m**3/Kg
V2=0.3747 #In m**3/Kg
#From steam table at Vg2 is 2.9 bar
P2=2.9*10**5 #Absolute pressure in bar
t2=132.4 #In degree celsius
hf2=556.5 #In KJ/Kg
hfg2=2166.6 #In KJ/Kg
#Calculation
Vg2=V2/x2 #Constant volume process in m**3/Kg
u1=hg1-((P1*Vg1)/1000) #Initial internal energy in KJ/Kg
u2=(hf2+x2*hfg2)-((P2*V2)/1000) #Final internal energy in KJ
deltaU=(u1-u2)*m #Heat supplied in KJ
#Output
print("Constant volume process= ",round(Vg2,4),"m**3/Kg")
print("Initial internal energy= ",u1,"KJ/Kg")
print("Final internal energy= ",round(u2,1),"KJ")
print("Heat supplied= ",round(deltaU,2),"KJ")
```

In [4]:

```
#Input data
P1=20 #Initial steam in bar
x1=0.95 #dryness throttled
P2=1.2 #Absolute pressure in bar
#From steam table (pressure basis at 20 bar)
ts=212.4 #In degree celsius
hf=908.6 #In KJ/Kg
hfg=1888.6 #In KJ/Kg
hg=2797.2 #In KJ/Kg
#From steam table (pressure basis at 1.2 bar)
h2=h1 #In KJ/Kg
ts2=104.8 #In degree celsius
hf2=439.3 #In KJ/Kg
hfg2=2244.1 #In KJ/Kg
hg2=2683.4 #In KJ/Kg
Cps=2.3
#Calculation
h1=hf+x1*hfg #Enthalpy of steam in KJ/Kg
tsup2=((h1-hg2)/Cps)+ts2 #Enthalpy of wet steam in degree celsius
DOS=tsup2-ts2 #Degree of superheat in degree celsius
#Output
print("Enthalpy of steam= ",h1,"KJ/Kg")
print("Enthalpy of wet steam= ",round(tsup2,2),"degree celsius")
print("Degree of superheat= ",round(DOS,2),"degree celsius")
```

In [5]:

```
#Input data
P1=12 #Throttled steam
x1=0.96 #Dryness is brottled
x2=1 #Constant enthalpy process
#From steam table at12 bar
ts=188 #In degree celsius
hf=798.4 #In KJ/Kg
hfg=1984.3 #In KJ/Kg
hg=2782.7 #In KJ/Kg
#Calculation
h1=hf+x1*hfg #Enthalpy of the steam in KJ/Kg
h2=h1 #Enthalpy after throttling in KJ/Kg
#Output
print("Enthalpy of the steam= ",round(h1,2),"KJ/Kg ")
print("Enthalpy after throttlin= ",round(h2,2),"KJ/Kg ")
```

In [6]:

```
#Input data
import math
P1=15 #Initial steam in bar
tsup1=250+273 #Temperature of steam in degree celsius
P2=0.5 #Steam turbine in bar
#From steam table at 15 bar
ts1=198.3+273 #In degree celsius
hg1=2789.9 #In KJ/Kg
sf1=2.3145 #In KJ/KgK
sfg1=4.1261 #In KJ/KgK
sg1=6.4406 #In KJ/KgK
#From steam table at 0.5 bar
ts2=81.53 #In degree celsius
sf2=1.0912 #In KJ/Kg
sfg2=6.5035 #In KJ/Kg
sg2=7.5947 #In KJ/Kg
hf2=340.6
Cps=2.3
hfg2=2646
#Calculation
S1=sg1+Cps*(math.log(tsup1/ts1)) #Entropy of superheated steam in KJ/KgK
S2=S1 #Entropy after isentropic processes in KJ/KgK
x2=(S2-sf2)/sfg2 #Enthalpy of wet steam
h1=hg1+Cps*(tsup1-ts1) #Enthalpy of steam at 15 bar
h2=hf2+x2*hfg2 #Enthalpy of wet steam at 0.5 bar
WOT=h1-h2 #Work output of the turbine
#OUTPUT
print("Entropy of superheated steam= ",round(S1,2),"KJ/KgK")
print("Entropy after isentropic processes= ",round(S2,2),"KJ/KgK")
print("Enthalpy of wet steam= ",round(x2,2),"")
print("Enthalpy of steam= ",h1,"KJ/Kg")
print("Enthalpy of wet steam= ",round(h2,2),"KJ/Kg")
print("Work output of the turbine= ",round(WOT,2),"KJ/Kg")
```