In [1]:

```
from __future__ import division
#Variable Declaration:
p1 = 0.2 #Pressure at which steam is supplied(in MPa):
T = 250 #Temperature of steam(in C):
p2 = 0.3 #Pressure upto which steam is expanded(in bar):
p3 = 0.05 #Pressure at which it is finally released(in bar):
#From steam tables:
h1 = 2971 #kJ/kg
s1 = 7.7086 #kJ/kg.K
s2 = s1
h2 = 2601.97 #kJ/kg
v2 = 5.1767 #m**3/kg
hf = 137.82 #kJ/kg
Tmax = 393.23 #K
Tmin = 305.88 #K
#Calculations:
W = h1-h2+v2*(p2-p3)*10**2 #Work output from engine cycle per kg of steam(in kJ/kg):
Q = h1-hf #Heat input per kg of steam(in kJ/kg):
n = W/Q*100 #Efficiency of modified Rankine cycle:
nc = (1-Tmin/Tmax)*100 #Carnot efficiency:
#Results:
print "Modified Rankine cycle efficiency: ",round(n,2),"%"
print "Carnot efficiency: ",round(nc,2),"%"
```

In [2]:

```
from __future__ import division
from math import pi
#Variable Declaration:
p1 = 10 #Pressure at which steam is supplied(in bar):
d = 0.3 #Diameter of the cylinder(in m):
L = 0.6 #Length of stroke(in m):
p2 = 0.75 #Pressure to which steam is expanded(in bar):
p3 = 0.25 #Pressure at which steam is released in the condensor(in bar):
#From steam tables:
h1 = 2676.2 #kJ/kg
s1 = 7.3614 #kJ/kg.K
v2 = 2.1833 #m**3/kg
h2 = 2628.35 #kJ/kg
h4 = 271.93 #kJ/kg
h6 = 2459.38 #kJ/kg
s6 = 7.3614 #kJ/kg.K
v6 = 5.784 #m**3/kg
#Calculations:
s2 = s1
s6 = s2
W = h1-h2+v2*(p2-p3)*10**2 #Work output from engine cycle per kg of steam(in kJ/kg):
Q = h1-h4 #Heat input per kg of steam(in kJ/kg):
n = W/Q*100 #Efficiency of modified Rankine cycle:
V = pi*d**2*L/4 #Volume of the cylinder(in m**3):
m = V/v2 #Mass of steam in a stroke(in kg):
V1 = m*v6 #Volume requiremnet at 6(in m**3):
L1 = V1*4/(pi*d**2) #New stroke length(in m):
#Results:
print "Modified Rankine cycle efficiency: ",round(n,2),"%"
print "New stroke length:",round(L1*100,2),"cm"
```

In [3]:

```
from __future__ import division
from math import log,pi
#Variable Declaration:
d = 0.3 #Diameter of the bore(in m):
L = 0.6 #Length of the stroke(in m):
r1 = 0.4 #Occerance od cut-off:
p1 = 7.5 #Pressure at which steam enters(in bar):
p3 = 0.1 #Pressure at exhaust(in bar):
n = 180 #Rpm of the engine:
d1 = 0.6 #Diagram factor:
#Calculations:
r = 1/r1 #Expansion ratio:
mep = p1/r*(1+log(r))-p3 #Hypothetical mean effective pressure(in bar):
mepa = mep*d1 #Actual mean effective pressure(in bar):
IP = mepa*L*pi*d**2*2*n*10**2/(4*60)#Indicated power(in kW):
#Results:
print "Indicated power: ",round(IP,2),"kW"
```

In [4]:

```
from __future__ import division
from math import log,pi
#Variable Declaration:
p1 = 15 #Steam is admitted at pressure(in bar):
p3 = 0.75 #Pressure at which steam exhausts(in bar):
r1 = 0.25 #Cut-off occuring at:
P = 150 #Power produced by the engine(in hp):
n = 240 #Rpm of engine:
nm = 0.85#Mechanical efficiency:
d1 = 0.7 #Diagram factor:
nb = 0.2 #Brake thermal efficiency:
r2 = 1.5 #Stroke to bore ratio:
h15 = 2803.3 #From steam tables:
hf = 384.39
#Calculations:
r = 1/r1 #Expansion ratio:
mep = p1/r*(1+log(r))-p3 #Hypothetical mean effective pressure(in bar):
mepa = mep*d1 #Actual mean effective pressure(in bar):
IP = P/nm #Indicated horse power(in kW):
d = ((IP*4*60*0.7457)/(mepa*10**2*r2*pi*n))**(1/3) #Diameter of bore(in m):
L = d*r2 #Stroke length(in m):
Q = h15-hf #Heat added per kg of steam(in kJ/kg):
m = 0.7457*3600/(nb*Q) #Specific steam consumption(in kg/hp.hr):
#Results:
print "Bore: ",round(d*100,2),"cm"
print "Stroke: ",round(L*100,2),"cm"
print "Specific steam consumption: ",round(m,2),"kg/hp.hr"
```

In [5]:

```
from __future__ import division
from math import log,pi
#Variable Declaration:
m = 18/60 #Steam consumption rate(in kg/a):
IP = 100 #Indicated power(in kW):
n = 240 #Rpm of engine:
d = 0.3 #Bore diameter(in m):
L = 0.4 #Stroke length(in m):
p1 = 10 #Pressure at which steam is admitted(in bar):
p3 = 0.75 #Exhaust pressure(in bar):
r1 = 0.25 #Occurance of cut-off:
h1 = 2875.3 #Enthalpy of steam(in kJ/kg):
hf = 384.39
#Calculations:
Q = h1-hf #Heat added per kg of steam(in kJ/kg):
r = 1/r1 #Expansion ratio:
mep = p1/r*(1+log(r))-p3 #Hypothetical mean effective pressure(in bar):
IPt = mep*L*pi*d**2*n*10**2/(60)#Theoretical indicated power(in kW):
d1 = IP/IPt #Diagarm factor:
n = IPt/(m*Q)*100 #Indicated thermal efficiency:
#Results:
print "Diagram factor: ",round(d1,4)
print "Indicated thermal efficiency: ",round(n,2),"%"
```

In [6]:

```
from __future__ import division
from math import log
#Variable Declaration:
p1 = 10 #Pressure at which steam is aupplied(in bar):
x = 0.9 #Dryness fraction:
p3 = 1 #Pressure at exhaust(in bar):
r1 = 0.6 #Occurence of cut-off:
#From steam tables:
h1 = 2576.58 #kJ/kg
v1 = 0.1751 #m**3/kg
hf = 417.46 #kJ/kg
#Calculations:
Q = h1-hf #Heat added per kg of steam(in kJ/kg):
v2 = v1/r1 #Specific volume at state 2(inm**3/kg):
r = 1/r1 #Expansion ratio:
Wne = v1*(p1-p3)*10**2 #Net expansive work per kg of steam(in kJ/kg):
We = p1*v1*10**2*log(r)-p3*10**2*(v2-v1)#Expansive work per kg of steam(in kJ/kg):
Wt = Wne+We #Total work per kg of steam(in kJ/kg):
r2 = We/Wt*100 #Fraction of work obtained by expansive working:
n = Wt/Q*100 #Thermal efficiency of cycle:
#Results:
print "Fraction of expansive work: ",round(r2,2),"% of total output"
print "Thermal efficiency: ",round(n,2),"%"
```

In [7]:

```
from __future__ import division
from math import log,sqrt,pi
#Variable Declaration:
P = 60 #Power produced(in bhp):
p1 = 12 #Pressure at which steam is admitted(in bar):
p3 = 1 #Pressure at exhaust(in bar):
n = 240 #Rpm of engine:
v = 2 #Piston speed(in m/s):
d = 0.04 #Diameter of piston(in m):
n = 0.60 #Occurence of cut-off:
r1 = 0.05 #Clearance volume to stroke volume ratio:
d1 = 0.8 #Diagram factor:
nm = 0.90 #Mechanical efficiency:
#Calculations:
r = (1+r1)/n #Expansion ratio:
mep = (p1*12*(1+log(r))-1*21-(12-1))/(21-1) #Mean effective pressure(in bar):
mepa = mep*d1 #Actual mean effective pressure(in bar):
A = P*0.7457/(nm*mepa*10**2*v) #Effective area(in m**2):
D = sqrt((A-pi*d**2/4)*4/(2*pi)) #Bore diameter(in m):
#Results:
print "Bore: ",round(D*100,2),"cm"
```

In [8]:

```
from __future__ import division
from math import pi,log
#Variable Declaration:
D = 0.2 #Diameter of cylinder(in m):
L = 0.3 #Length of stroke(in m):
Vc = 2*10**3 #Clearance volume(in cm**3):
ms = 0.05 #Mass of steam used per stroke(in kg):
c = 0.80 #Point at which compression starts:
p4 = 1 #Pressure of steam when compression starts(in bar):
r1 = 0.10 #Cut-off point:
r2 = 0.90 #Release:
p1 = 15 #Pressure at states 1 & 2(in bar):
#From steam tables:
v4 = 1.6940 #m**3/kg
vg15 = 0.13177 #m**3/kg
vg3 = 0.6058 #m**3/kg
u1 = 1590.79 #kJ/kg
u2 = 1216.73 #kJ/kg
#Calculations:
p2 = 3
V6 = Vc*10**(-6) #Clearance volume(in m**3):
V5 = V6
Vs = pi*D**2/4*L #Stroke volume(in m**3):
V3 = V6+Vs #Volume at state 3(in m**3):
V4 = V3-c*(V3-V6) #Volume at state 4(in m**3):
m4 = V4/v4 #Mass of steam at state 4(in kg):
m = m4+ms #Total mass of steam during expansion(in kg):
V1 = V6+r1*(V3-V6) #Volume at cut-off point(in m**3):
x1 = V1/(m*vg15) #Dryness fraction at cut-off point:
V2 = V6+r2*(V3-V6) #Volume at point of release(in m**3):
x2 = V2/(m*vg3) #Dryness fraction at point of release:
n = log(p1/p2)/log(V2/V1) #Index of expansion:
W = (p1*V1-p2*V2)/(n-1)*100 #Work done in a stroke(in kJ):
Ws = W/m #Work done per kg of steam(in kJ/kg):
du = u2-u1 #Change in internal energy(in kJ/kg):
dQ = du-Ws #Heat transfer(in kJ/kg):
#Results:
print "Total mass of steam during expansion: ",round(m,6),"kg"
print "Dryness fraction at cut-off and release: ",round(x1,4),round(x2,4)
print "Heat leakage: ",round(-dQ,2),"kJ/kg steam"
```

In [9]:

```
from __future__ import division
from math import pi
#Variable Declaration:
r1 = 0.3 #Point of sut-off:
p4 = 4 #Pressure at state 4(in bar):
V4 = 0.15 #Volume at state 4(in m**3):
p1 = 12 #Pressure at state 1(in m**3):
p2 = 5 #Pressure at release(in bar):
V2 = 0.5 #Indicated volume at release(in m**3):
d = 0.6 #Bore diameter(in m):
L = 1.20 #Stroke length(in m):
c = 0.10 #Clearance volume ratio:
ms = 1.5 #Mass of steam admitted(in kg/stroke):
nw = 180*60 #Number of working strokes(per second):
#From steam tables:
vg4 = 0.4625 #m**3/kg
vg12 = 0.16333 #m**3/kg
vg5 = 0.3749 #m**3/kg
#Calculations:
Vs = pi*d**2/4*L #Stroke volume(in m**3):
V5 = c*Vs #Clearance volume(in m**3):
V3 = V5+Vs #Total volume of cylinder(in m**3):
V1 = V5+r1*Vs #Volume at cut-off point(in m**3):
m4 = V4/vg4 #Mass of steam at state 4(in kg):
m = m4+ms #Total mass during steam expansion(in kg):
x1 = V1/(m*vg12) #Dryness fraction at cut-off point:
mq1 = (m-m*x1)*nw #Missing quantity per hour(in kg):
x2 = V2/(m*vg5) #Dryness fraction at point of release:
mq2 = (m-m*x2)*nw #Missing quantity per hour(in kg):
P = (mq1-mq2)/mq1*100 #Percentage re-evaporation during expansion:
#Results:
print "Dryness fraction at cut-off: ",round(x1,3)
print "Dryness fraction at release: ",round(x2,3)
print "Missing quanity at cut off: ",round(mq1,2),"kg/hr"
print "Missing quanity at release: ",round(mq2,2),"kg/hr"
print "Percentage re-evaporation: ",round(P,2),"%"
```

In [10]:

```
from __future__ import division
from math import pi,log
#Variable Declaration:
p1 = 1.5*10**3 #Pressure at which steam is supplied(in kPa):
x1 = 0.9 #Dryness fraction:
p4 = 40 #Pressure at exhaust(in kPa):
d1LP = 0.8 #Diagram factor reffered to LP cylinder:
L = 0.38 #Stroke length(in m):
dHP = 0.20 #Bore of HP cylinder(in m):
dLP = 0.30 #Bore of LP cylinder(in m):
N = 240 #Rpm of engine:
#Calculations:
AHP = pi*(dHP**2)/4 #Area of HP cylinder(in m**2):
ALP = pi*(dLP**2)/4 #Area of LP cylinder(in m**2):
p2 = 192 #Intermediate pressure(in kPa):
V2 = AHP*L #Volume at state 2(in m**3):
V1 = V2*p2/p1 #Volume at state 1(in m**3):
VLP = ALP*L #Volume of LP cylinder(in m**3):
r = VLP/V1 #Expansion ratio throughout the engine:
mep = p1/r*(1+log(r))-p4 #Mean effective pressure(in kPa):
mepa = mep*d1LP #Actual mep(in kPa):
IP = mepa*L*ALP*N/60*2 #Indicated power(in kW):
Vs = V1*N*2*60 #Volume of steam admitted per hour(in m**3):
v1 = 0.1187 #Specific volume of steam being admitted(in m**3/kg):
m = Vs/v1 #Steam consumption(in kg/hr):
#Results:
print "Intermidiate pressure: ",round(p2),"kPa"
print "Indicated power: ",round(IP,2),"kW"
print "Steam consumption: ",round(m,2),"kg/hr"
```

In [11]:

```
from __future__ import division
from math import pi,sqrt,log
#Variable Declaration:
p1 = 1.4*10**3 #Pressure at which steam is supplied(in kPa):
p4 = 25 #Pressure at exhaust(in kPa):
r = 8 #Expansion ratio:
N = 240 #Rpm of engine:
d = 0.60 #Bore diameter(in m):
L = 0.60 #Stroke length(in m):
d1 = 0.8 #Diagram factor:
#Calculations:
A = pi*d**2/4 #Area of cylinder(in m**2):
mep = p1/r*(1+log(r))-p4 #Hypothetical mep(in kPa):
mepa = mep*d1 #Actual mep(in kPa):
IP = mepa*L*A*N/60*2 #Indicated power(in kW):
W = mepa*A*L/2 #Work done in HP cylinder(in kJ):
V1 = pi*d**2*L/(4*8) #Volume at state 1(in m**3):
V2 = 2.71**(W/(p1*V1))*V1 #Volume at state 2(in m**3):
D = sqrt(V2*4/(L*pi)) #Diameter of HP cylinder(in m):
p2 = p1*V1/V2 #Intermediate pressure(in kPa):
#Results:
print "Indicated power: ",round(IP,2),"kW"
print "Diameter of HP cylinder: ",round(D*100,2),"cm"
print "Intermediate pressure: ",round(p2,2),"kPa"
```

In [12]:

```
from __future__ import division
from math import pi, log,sqrt
#Variable Declaration:
p1 = 1.5*10**3 #Pressure at which steam is supplied(in kPa):
p4 = 25 #Pressure at exhaust(in kPa):
P = 250 #Power output(in kW):
r = 12 #Expansion ratio:
d = 0.40 #Diameter of LP cylinder(in m):
L = 0.60 #Stroke length(in m):
d1 = 0.75 #Diagram factor:
r1 = 2.5 #Expansion ratio in HP cylinder:
#Calculations:
A = pi*d**2/4 #Area of cylinder(in m**2):
mep = p1/r*(1+log(r))-p4 #Hypothetical mep(in kPa):
mepa = mep*d1 #Actual mep(in kPa):
N = P/(mepa*L*A*2)*60 #Rpm of engine:
V3 = A*L #Volume of LP cylinder(in m**3):
V4 = V3
Vc = V4/r #Cut-off volume in HP cylinder(in m**3):
Vt = Vc*r1 #Total volume in HP cylinder(in m**3):
D = sqrt(Vt*4/(L*pi)) #Diameter of HP cylinder(in m):
print "Speed of engine: ",round(N),"rpm"
print "Diameter of HP cylinder: ",round(D*100,2),"cm"
```

In [13]:

```
from __future__ import division
from math import pi, log
#Variable Declaration:
dhp = 0.25 #Diameter of HP, LP and IP cylinder(in m):
dip = 0.40
dlp = 0.85
mephp = 0.5*10**3 #MEPs of the cylinders(in kPa):
mepip = 0.3*10**3
meplp = 0.1*10**3
p1 = 1.5*10**3 #Pressure at which steam is supplied(in kPa):
p4 = 25 #Pressure at exhaust(in kPa):
r1 = 0.60 #Cut-off occurs at:
#Calculations:
AHP = pi*dhp**2/4 #Area of HP cylinder(in m**2):
AIP = pi*dip**2/4 #Area of IP cylinder(in m**2):
ALP = pi*dlp**2/4 #Area of LP cylinder(in m**2):
mep1 = mephp*AHP/ALP #Mep of HP referred to LP cylinder(in kPa):
mep2 = mepip*AIP/ALP #Mep of IP referred to LP cylinder(in kPa):
mept = mep1+mep2+meplp #Overall mep referred to LP cylinder(in kPa):
r = ALP/(r1*AHP) #Overall expansion ratio:
mep = p1/r*(1+log(r))-p4 #Hypothetical mep(in kPa):
d1 = mept/mep #Overall diagram factor:
P1 = mep1/mept*100 #% of HP cylinder output:
P2 = mep2/mept*100 #% of HP cylinder output:
P3 = meplp/mept*100 #% of HP cylinder output:
#Results:
print "Actual mep referred to LP: ",round(mept,2),"kPa"
print "Hypothetical mep referred to LP: ",round(mep,2),"kPa"
print "Overall diagram factor: ",round(d1,3)
print "Percentage of HP, IP and LP cylinder outputs: ",round(P1,2),"%",round(P2,2),"%",round(P3,2),"% respectively"
```

In [14]:

```
from __future__ import division
from math import pi, log
#Variable Declaration:
p1 = 7 #Pressure at which steam is supplied(in bars):
p5 = 0.25 #Pressure at exhaust(in bars):
dhp = 0.25 #Diameter of HP and LP cylinder(in m):
dlp = 0.50
r1 = 0.30 #Cut-off point of HP and LP cylinders:
r2 = 0.45
c1 = 0.10 #Clearance volume of HP and LP cylinders:
c2 = 0.05
d1hp = 0.8 #Diagram factors of HP and LP cylinders:
d1lp = 0.7
N = 100 #Rpm pf engine:
L = 1 #Let the length of stroke(in m):
#Calculations:
VHP = pi*dhp**2/4*L #Volume of HP cylinder(in m**2):
VLP = pi*dlp**2/4*L #Volume of LP cylinder(in m**2):
V9 = c1*VHP #Clearance volume(in m**2):
V7 = c2*VLP
V2 = VHP+V9 #Total volume of cylinders(in m**3):
V5 = VLP+V7
V1 = V9+r1*VHP #Volume at cut-off in HP cylinder(in m**3):
V3 = V7+r2*VLP
rhp = V2/V1 #Expansion ratio:
rlp = V5/V3
p3 = p1*10**2*V1/V3 #Pressure at state 3(in kPa):
mepahp = d1hp*(p1*10**2*V1*(1+log(rhp))-p3*V2-(p1*10**2-p3)*V9)/VHP #Actual mep for HP cylinder(in kPa):
mepalp = 62.96 #Actual mep for LP cylinder(in kPa):
mepa = mepahp*VHP/VLP #Actual mep of HP reffered to LP cylinder:
mept = mepalp+mepa #Total mep(in kPa):
W = mept*VLP*100/60 #Total output(in kW):
#Results:
print "mep of Hp referred to LP: ",round(mepa,2),"kPa"
print "mep of LP: ",round(mepalp,2),"kPa"
print "Total output: ",round(W,2)," x L kW where L is stroke length"
```

In [15]:

```
from __future__ import division
from math import pi
#Variable Declaration:
t = 15 #Duration of trial(in min):
d = 0.25 #Bore diameter(in m):
L = 0.30 #Stroke length(in m):
bd = 1.5 #Brake diameter(in m):
bl = 300 #Net brake load(in N):
N = 240 #Speed of engine:
p1 = 10 #Steam pressure(in bar):
x = 0.9 #Dryness fraction:
mep = 0.9#Mep at cover end(in bar):
m1 = 15 #Steam utilised(in kg):
#Calculations:
m = m1/t*60 #Steam consumption per hour(in kg/hr):
IP = mep*10**2*L*pi*d**2*240*2/(4*0.7457*60)#Indicated horse power(in kW):
m2 = 60/IP #Steam used per(hp.hr):
#Results:
print "Steam used per ihp.hr: ",round(m2,2),"kg/ihp.hr"
```

In [16]:

```
from __future__ import division
from math import pi
#Variable Declaration:
d = 0.38 #Bore diameter(in m):
L = 0.50 #Stroke length(in m):
pd = 0.05#Piston rod diameter(in m):
N = 150 #Speed of engine(in rpm):
m = 36 #Steam consumption(in kg/min):
F = 7 #Brake load(in kN):
bd = 2 #Brake diameter(in m):
aco = 28 #Area of indicator diagram at cover end(in cm**2):
acr = 26 #Area of indicator diagram at crank end(in cm**2):
l = 0.07 #Length of indicator diagram(in m):
s = 15 #Spring scale(in kPa/mm):
#Calculations:
mepcr = acr*100*s/(l*10**3) #Mep at crank end(in kPa):
mepco = aco*100*s/(l*10**3) #Mep at cover end(in kPa):
IPcr = mepcr*L*pi*(d**2-pd**2)/4*N/60 #IP at crank end(in kW):
IPco = mepco*L*pi*(d**2)/4*N/60 #IP at cover end(in kW):
IP = IPcr+IPco #IP(in kW):
BP = 2*pi*N/60*F*1 #Brake power(in kW):
n = BP/IP #Mechanical efficiency:
ISFC = m*60/IP #ISFC(in kg/kW.h):
BSFC = m*60/BP #BSFC(in kg/kW.h):
#Results:
print "Indicated power: ",round(IP,2),"kW"
print "Brake power: ",round(BP,2),"kW"
print "Indicated specific steam consumption: ",round(ISFC,2),"kg/kW.h"
print "Brake specific steam consumption: ",round(BSFC,2),"kg/kW.h"
```

In [17]:

```
from __future__ import division
from math import pi
#Variable Declaration:
#From steam tables:
hf = 844.89 #kJ/kg
hfg = 1947.3 #kJ/kg
hcond = 209.33 #kJ/kg
#Calculations:
BP = 2*pi*150*(120*9.81-100)*(100/2)*10**(-2)/(1000*60)#Brake power(in kW):
IPco = 1.8*10**2*0.34*pi/4*(0.24)**2*150/60#IP at cover end(in kW):
IPcr = 1.6*10**2*0.34*pi/4*(0.24**2-0.05**2)*150/60 #IP at crank end(in kW):
IP = IPco+IPcr #Total IP(in kW):
n = BP/IP #Mechanical efficiency:
hs = hf+0.98*hfg #Enthalpy of steam at inlet(in kJ/kg):
E = hs-hcond #Energy supplied by the steam(in kJ/kg):
m = 4*60 #Steam consumption rate(in kg/hr):
nbth = 3600/((m/BP)*E)*100 #Brake thermal efficiency:
ISFC = m/IP #Indicated steam consumption(in kg/kW.h):
#Results:
print "Brake thermal efficiency: ",round(nbth,2),"%"
print "Indicated specific steam consumption: ",round(ISFC,2),"kg/kW.h"
```