In [4]:

```
from __future__ import division
from math import pi
# Initialisation of Variables
D=20.3#................#Diameter in cm
L=30.5#.................#Length in cm
N=300#................#Engine rpm
eta=78#.................#Efficiency in percentage
afr=4/1#.................#Air Fuel Ratio
#Calculations
StV = ((pi)/4)*((D/100)**2)*(L/100)#.......#Calculating the stroke volume
Vinh= (eta/100)*StV#...................#Volume Inhaled
Gainh= (Vinh/(4+1))#..............#Gas Inhaled
Gainhpm = Gainh*(N/2)#
print "Gas Inhaled per minute : %0.2f m**3/min "%(Gainhpm)
```

In [9]:

```
from __future__ import division
#Initializing the variables
N=3600#................#engine rpm
T=15#................#Inlet temperature in degree Celsius
Tk = T+273#..............#Inlet temperature in Kelvin
p=760#................#Inlet pressure in mm of Hg i.e. 1.013 x 10**5 Pa
ppa=1.013*(10**5)#.........# Inlet pressure in Pascals
pdv=4066#..............#Total piston displacement volume in cm**3
pdvsi=pdv*(10**(-6))#.............#Total piston displacement volume in m**3
afr=14/1#...................#Air fuel ratio is 14:1
bsfc=0.38#..................# b.s.f.c in kg/kWh
BP=86#.............#power output in kW
R=287#................#Gas constant for air in J/kg.K
#Calculations
m = (BP*bsfc*afr)/60#...............#Air consumption
V = (m*R*Tk)/ppa#
DV= pdvsi*(N/2)#.........#Displacement Volume
VE=V/DV#...............#Volumetric Efficiency
print "Volumetric efficiency of the engine is : %0.2f"%(VE)
```

In [1]:

```
from __future__ import division
from math import sqrt,pi
#Initializing the variables
n=4#..............#No of cylinders
d=5#.............#diameter of orifice in cm
dsi=d/100#..........# diameter in m
Cd=0.6#.............#Co-efficient of discharge
D=10#..............#Engine bore in cm
Dsi=d/100#............#Engine bore in m
L=12#................#Engine stroke in cm
Lsi=L/100#............#Engine stroke in m
N=1200#...............#Engine rpm
hw=0.046#............#Pressure drop across orifice in m of water
T = 17#..........#Ambient Temparature in Degree Celsius
Tk = T+273#..........# Ambient Temperature in Kelvin
Pbar = 1#.............# Ambient pressure in bar
Ppa = 1 * (10**5)#.......#Ambient pressure in Pascal
R = 287#.............# Gas constant in J/kg.K
rhow = 1000#............#Density of water in kg/m**3
g=9.81#...............#Acceleration due to gravity
#Calculations
rhoa= Ppa/(R*Tk)#.........#Density of air
ha= (hw*rhow)/rhoa#
av= sqrt(2*g*ha)#.............#Air velocity
area = (pi/4)*(dsi**2)#
Vact = Cd*area*av#.............# V actual
Vswt = n*(pi/4)*(Dsi**2)*Lsi*(N/60*2)#
eff = Vact/Vswt#...............#Volumetric efficiency
print "The volumetric efficiency based on the free air condition : %0.2f"%(eff)
```

In [1]:

```
from __future__ import division
#Initializing the variables
n=1#...................#No of cylinders
k=0.5#
Vs=7000#............#displacement volume in cm**3
Vssi= Vs*(10**(-6))#........#displacement volume in m**3
OP=14.7#...................#Power developed in kW
N=450#..................#Engine rpm
sfc=0.272#................#Specific fuel consumption in kg/kWh
#Fuel used is C7H16
mC=12#.............#mass of carbon in amu
mH=1#.................#mass of hydrogen in amu
mO=16#.................#mass of oxygen in amu
pi=1.013 * (10**5)#................#initial pressure in pascal
T=30#...................#initial temperature in degree celsius
Tk=30+273#................#initial temperature in degree kelvin
R=287#..................#Gas constant for air in J/kg.K
#calculations
print "The given fuel C7H16 requires 11(O2) for complete combustion"
mf=(7*mC)+(16*mH)#
print "Hence, Mass of fuel is : %0.2f"%(mf)
MO=11* 2 * mO#
print "Mass of Oxygen required is : %0.2f"%(MO)
ma = MO/0.23#.......#mass of air
#Air contains 23% of oxygen by weight
afr = ma/mf#...............#air fuel ratio is the ratio of mass of air to mass of fuel
print "The air fuel ratio is : %0.2f"%(afr)
MF = sfc * OP#...........#actual fuel consumed in kg/h
MA = afr*MF#
AAS = MA * (1+0.3)#....................#actual air supplied in kg/h
M = AAS + MF#................#mass of charge in kg/h
VCS = ((M/60)*R*Tk)/pi#.............#Volume of charge sucked in m**3/min
DVM = Vssi * (N/2)#..............#Displacement volume/min
eta = VCS/DVM#
print "The volumetric efficiency of the engine is = %0.2f %%"%(eta*100)
```

In [2]:

```
from __future__ import division
#Initializing the variables
n=6#................#No of cylinders
vsi=730*(10**(-6))#..........#Piston displacement per cylinder in m**3
BP=80#.............#Power produced per cylinder in kW
N=3100#...........#Engine rpm
C=44*(10**6)#...........#Calorific value of petrol in J/kg
Pc=28#........#Petrol consumed per hour in kg
afr = 13/1#.......#air fuel ratio
pi=0.88*(10**5)#..............#Intake pressure in pa
T=300#............#Intake temperature in Kelvin
R = 287#.........#gas constant in J/kg.K
#calculations
ma = (Pc*afr)/60#...........#air comsumed
rhoa = pi/(R*T)#.......#Density of air
etaV=ma/(rhoa*vsi*n*(N/2))#
print "The volumetric efficiency is = %0.2f %%"%(etaV*100)
mf = Pc/3600#...............#Fuel consumed per sec
etaBT = (BP*1000)/(mf*C)#
print "The brake thermal efficiency is = %0.2f %%"%(etaBT*100)
T=(BP*60*1000)/(2*(pi)*N)#
print "The brake torque = %0.2f Nm "%(T)
```

In [3]:

```
from __future__ import division
from math import sqrt
#Initializing the variables
etaV1 = 0.8#.........#Volumetric efficiency
pi1 = 1.013#.......#Inlet pressure
pe1= 1.013
pi2= 1.013#
pe2 = 1.15#.........#Exhaust pressure
Tk1 = 298#...........#Temperature in Kelvin
Tk2 = 318#...........#Temperature in Kelvin
r = 7.5#........#compression ratio
ga=1.4#..........#degree of freedom for gas
#calculations
#For pressure change
eta_V2 = r - (pe2/pi2)**(1/ga)#
eta_V1 = r - (pe1/pi1)**(1/ga)#
x=eta_V2/eta_V1#
#For inlet temperature change
y = sqrt(Tk2/Tk1)#
#For volumetric efficiency, considering both pressure and temperature
etaV2 = etaV1*x*y#
print "The volumetric efficiency is = %0.2f %%"%(etaV2*100)
PO=((etaV1/Tk1)-(etaV2/Tk2))/(etaV1/Tk1)#
print "Percentage Reduction in Output = %0.2f %%"%(PO*100)
```

In [4]:

```
from __future__ import division
from math import sqrt
#Initializing the variables
pi1 = 1.013#.......#Inlet pressure
pe1= 1.013
pi2= 1.3#
pe2 = 1.013#.........#Exhaust pressure
Tk1 = 300#...........#Temperature in Kelvin
Tk2 = 333#...........#Temperature in Kelvin
r = 14#........#compression ratio
ga=1.4#..........#degree of freedom for gas
R=287#...........#gas constant in J/kg.K
#calculations
#For pressure change
eta_V2 = r - (pe2/pi2)**(1/ga)#
eta_V1 = r - (pe1/pi1)**(1/ga)#
x=eta_V2/eta_V1#
#For inlet temperature change
y = sqrt(Tk2/Tk1)#
#For volumetric efficiency, considering both pressure and temperature
pive = ((x*y)-1)#.........#percentage increase in volumetric efficiency
print "The percentage increase in volumetric efficiency is = %0.2f %%"%(pive*100)
rho1 = (pi1*10**5)/(R*Tk1)#
rho2 = (pi2*10**5)/(R*Tk2)#
z = (rho2/rho1)*x*y#
pip = (z-1)#
print "The percentage increase in power = %0.2f %%"%(pip*100)
```

In [5]:

```
from __future__ import division
from math import sqrt
#Initializing the variables
IP1 = 32#...............#Indicated power output in kW
etamech=80#............#Mechanical efficiency at sea level
p1=1.013#.............#initial pressure at sea level in bar
tk1 = 308#...............#Initial temperature at sea level in Kelvin
tk2 = 278#..................#temperature atop the hill in Kelvin
rhoHg=13600#..............#Density of mercury in kg/m**3
h=2000#.....................#Hill altitude
g = 9.81#................#Acceleration due to gravity
delp = 10#..............#drop of mercury in mm Hg per every 100 m climb
#calculations
print "There is no change in volumetric efficiency due to inlet and exhaust pressure change"
print "For inlet temperature change"
x = sqrt(tk2/tk1)#................#for inlet temperature change
#x is the ratio of the efficiencies at the beginning and on hill top
print "Percentage decrease = %0.2f %%"%((1-x)*100)
dp = rhoHg*g*((delp/1000)*(h/100))*(10**(-5))#........#Drop in pressure at hill station
p2=p1-dp#
IP_1 = p1/tk1#
IP_2 = (x*p2)/tk2#
k = IP_2/IP_1#..............#Ratio of indicative power output during initial and final conditions
IP2 = (IP1 * k)/(etamech/100)#
#Since the engine speed is the same at two places, the friction and hence mechanical efficiency remains unchanged
BP2 = IP2*(etamech/100)#
print "Brake power of the engine on the hill station = %0.2f kW "%(BP2)
```

In [6]:

```
from __future__ import division
from math import sqrt
#Initializing the variables
etaV1 = 0.81#.........#Volumetric efficiency
pi1 = 1.01#.......#Inlet pressure before supercharger
pe1= 1.01#...........#Exhaust pressure before supercharger
pi2= 1.38#............#Inlet pressure after supercharger
pe2 = 1.01#.........#Exhaust pressure in bar after addition of super charger
Tk1 = 300#...........#Temperature in Kelvin
Tk2 = 321#...........#Temperature in Kelvin
r = 7.5#........#compression ratio
ga=1.4#..........#degree of freedom for gas
R=287#.............#Gas constant for air in J/kgK
IP1=75#...............#Indicated power output before addition of supercharger
#calculations
#For pressure change
eta_V2 = r - (pe2/pi2)**(1/ga)#
eta_V1 = r - (pe1/pi1)**(1/ga)#
x=eta_V2/eta_V1#
#For inlet temperature change
y = sqrt(Tk2/Tk1)#
#For volumetric efficiency, considering both pressure and temperature
etaV2 = etaV1*x*y#
print "The volumetric efficiency of supercharged engine = %0.2f %%"%(etaV2*100)
rho1 = (pi1*10**5)/(R*Tk1)#....#density of air before addition of supercharger
rho2 = (pi2*10**5)/(R*Tk2)#..#density of air after addition of supercharger
IP2 = IP1 * (etaV2*rho2)/(etaV1*rho1)#
print "Indicated power of supercharged engine is = %0.2f kW "%IP2
```

In [7]:

```
from __future__ import division
from math import sqrt,pi
#Initializing the variables
n=1#.....#No of cylinders
D=0.32#.....#Bore of the cylinder in m
L=0.38#......#Stroke of the cylinder in m
N = 280#....#Engine rpm
CV = 18600#....#calorific value of fues in kJ/m**3
Tk1 = 300#....#Initial temperature in Kelvin
p1 = 1.013#.....#Initial pressure in bar
ma = 3.36#.......#mass of air consumed per min
tgc = 0.25#......#test gas consumption in m**3/min
pw = 120#.........#pressure of water in mm during the test gas consumption
tgct = 300#.......#Temperature in Kelvin during test gas consumption
rhow = 1000#.....#density of water in kg/m**3
R=287#...........#Gas constant in J/kg.K
#calculations
V= (ma*R*Tk1)/(p1*(10**5))#...#Volume of air consumed at inlet condition
gsp = p1 +(pw/rhow)/10.2#...................#Gas supply pressure
#1 bar = 10.2 m
gcic = tgc*(gsp/p1)#..........#Gas consumption at inlet condition
Vi = gcic+V#.....#Volume of mixture at inlet condition
Vswt = (pi/4)*(D**2)*L*(N/2)#......#Swept volume
etaV = Vi/Vswt#.....#Volumetric efficiency
print "The volumetric efficiency of the engine = %0.2f %%"%(etaV*100)
hv = (gcic/Vi)*CV#......#Heating value
print "The heating value of 1 m**3 of charge at 25 degree Celsius = %0.2f kJ.m**3"%hv
```

In [8]:

```
from __future__ import division
from math import sqrt,pi
#Initializing the variables
Z=0.55#.............#Mach Index
Dcy=0.11#............#Engine Bore in m
L = 0.14#............#stroke length in m
N = 2400#.............#Engine rpm
N1 = 2800#............#Engine rpm after modification
N2=4800#.............#Max rpm for unmodified engine
p = 0.88#.........#pressure at intake valve in bar
t=340#...............#temperature at intake valve in Kelvin
ki = 0.33#...........#Inlet flow co-efficient
ga = 1.4#...............#degree of freedom of the gas
R = 287#.................#Gas constant for air in J/kg.K
#calculations
Us = sqrt(ga*R*t)#......#sonic velocity of air-fuel mixture at the inlet valve
Up = (2*L*N)/60#...........#piston speed
Div = sqrt(((Dcy**2)*Up)/(Z*ki*Us))#...............#Nominal diameter of the inlet valve in m
print "(i)Nominal diameter of the inlet valve = %0.2f m or %0.2f mm"%(Div,Div*1000)
Div1 = sqrt(((Dcy**2)*2*L*N1)/(Z*ki*Us*60))#.......# Nominal diameter of inlet valve for the modified engine in m
print "(ii)When the engine is modified to develop max indicative power at 2800rpm, nominal diameter of the inlet valve = %0.2f m or %0.2f mm"%(Div1, Div1*1000,)
Up1=(2*L*N1)/60#............#New piston speed for modified engine
Z1 = ((Dcy/Div)**2)*(Up1/(ki*Us))#
print "(iii)The new mach index value is : %0.2f"%(Z1)
print "Hence the volumetric efficiency drops (There is a steady decrease in volumetric efficiency of an engine if there is an increase in the mach index beyond 0.55, Refer the FIG 7_12)"
Up2 = (2*L*N2)/60#..............#Piston speed at max rpm for unmodified engine
Z2 = ((Dcy/Div)**2)*(Up2/(ki*Us))#
print "(iv)The mach index for the unmodified engine : %0.2f"%Z2
print "The volumetric efficiency is approximately 56% (from the FIG 7_12)"
```