Week 2 Air standard Cycle
Otto Cycle
Aim- To study otto cycle
Objective-
- To study otto cycle
- To write program in python to get P-V diagram of otto cycle
- To calculate thermal efficiency of otto cycle
Theory-
Otto cycle was developed by Nicolas Otto in 1861 for spark ignition engines used petrol/gasoline as a fuel.
Otto cycle consists of total five processes
- 0-1 Suction Stroke-Air fuel mixture taken into engine cylinder
- 1-2 Compression Stroke- Air and fuel mixture compressed adiabatically
- 2-3 Ignition Stroke- Constant Volume Heat addition i.e burning of fuel by ignition
- 3-4 Expansion Stroke-Air fuel mixture will expand
- 4-0 Exhaust Stroke- Burnt out gases will be removed from engine cylinder
Fig1. Otto Cycle
Problem Statement-
4S SI engine have following parameters
Bore=0.15m
Stroke=0.15m
Connecting rod Length =0.25m
Compression ratio=6
Atmospheric Pressure =101325Pa
Atmospheric Temperature=300K
Maximum Temperature=1400
Adiabatic Index=1.4
For getting plots pressure vs. volume, we can program it by using python
Calculation-
Bore = d =0.15m
Stroke= s= 0.15m
Connecting rod Length = l = 0.25m
Compression ratio = cr = 6
Atmospheric Pressure = p1 = 101325Pa
Atmospheric Temperature = t1 = 300K
Maximum Temperature = t3 = 1400K
Adiabatic Index = γ =1.4
- Calculation of stroke volume
vs= π/4 d2 s
- Calculation of compressed volume
vc=vs/(rc-1)
- Calculation of suction volume
v1=vc+vs
- Calculation of v2
As per relation
v2=vc
- Calculation of p2
Using adiabatic equation
p1v1γ = p2v2γ
p2 = (p1v1γ)/ v2γ
- Calculation of t2
Using ideal gas equation
p1v1/t1 = p2v2/t2
t2 = (p2v2t1)/(p1v1)
- Calculation of v3
As per constant volume heat addition process
v3=v2
- Calculation of p3
Using ideal gas equation
P2v2/t2 = p3v3/t3
p3=(p2v2t3)/(t2v3)
- As per constant volume heat rejection process
v4=v1
- Calculation of p4
p3v3γ = p4v4γ
p4 = (p3v3γ)/ v4γ
- Calculation of t4
Using ideal gas equation
p3v3/t3=p4v4/t4
t4=(p4v4t3)/(p3v3)
- For getting volume at any given crank angle
V/Vc=1+0.5(rc-1)[R+1-cosϴ-(R2-sin2ϴ)0.5
- Cal0culation of thermal efficiency
Ƞ=1/(1-rcγ-1)
#importing required libraries
import math
import matplotlib.pyplot as plt
# taking all engine inputs
bore=0.15
stroke=0.15
con_rod=0.25
cr=6
p1=101325
t1=300
t3=1400
gamma=1.4
#calculation of all engine volumes,pressures,temperatures
vs=math.pi/4*pow(bore,2)*stroke
vc=vs/(cr-1)
v1=vc+vs
v2=vc
v3=v2
v4=v1
p2=p1*pow(v1,gamma)/pow(v2,gamma)
t2=(p2*v2*t1)/(p1*v1)
p3=(p2*v2*t3)/(t2*v3)
p4=p3*pow(v3,gamma)/pow(v4,gamma)
t4=(p4*v4*t3)/(p3*v3)
#defining function to calculate and store volume in array
def engine_kinematiks(bore,stroke,cr,start_angle,end_angle):
V=[]
n=500
a=stroke/2
R=con_rod/a
sc=math.radians(start_angle)
ec=math.radians(end_angle)
for i in range(0,n):
theta=sc+i*(ec-sc)/(n-1)
vs=math.pi/4*pow(bore,2)*stroke
vc=vs/(cr-1)
v1=vs+vc
tr1=cr-1
tr2=R+1-math.cos(theta)
tr3=pow(R,2)-pow(math.sin(theta),2)
tr5=1+0.5*(tr1)*(tr2-pow(tr3,0.5))
V.append(vc*tr5)
return V
# defining function to calculate thermal efficiency of otto cycle
def otto_cycle_efficiency(compression_ratio):
cr=compression_ratio
tr7=pow(cr,(gamma-1))
tr8=1/tr7
efficiency=1-tr8
return efficiency
E=otto_cycle_efficiency(cr)
print(E)
# calling fuction to get arrays of volume and pressure during compression
v_compression=engine_kinematiks(bore,stroke,cr,180,0)
constant1=p1*pow(v1,gamma)
p_compression=[]
for v5 in v_compression:
p_compression.append(constant1/pow(v5,gamma))
# calling fuction to get arrays of volume and pressure during expansion
v_expansion=engine_kinematiks(bore,stroke,cr,0,180)
constant2=p3*pow(v3,gamma)
p_expansion=[]
for v6 in v_expansion:
p_expansion.append(constant2/pow(v6,gamma))
# plotting p-v diagram
plt.plot([v2,v3],[p2,p3])
plt.plot([v4,v1],[p4,p1])
plt.plot(v_compression,p_compression)
plt.plot(v_expansion,p_expansion)
plt.show()
Explanation-
- Imported math module for calculation
- Imported matplotlib model for plotting PV diagram
- Defined engine parameters i.e. lengths, diameter, connecting rod length etc.
- Calculated all volumes, pressures, temperatures
- Defined function to return volume array at any given crank angle
- Defined function to calculate thermal efficiency
- Called function for getting compression volumes and compression at different crank angles
- Called function for getting expansion volumes and expansion at different crank angles
- Plotted PV diagram using plt.
Result-
- Thermal efficiency of otto cycle is 0.511
- P-V diagram

Conclusion-
Successfully calculated thermal efficiency of otto cycle and plotted P-V diagram
References-
[1]https://www.google.com/search?q=otto+cycle&authuser=2&tbm=isch&source=iu&ictx=1&fir=tZyeb2LbiCbADM%252CjcBxSZwdTm4v-M%252C_%253BDrn6EOBZ2wzO_M%252Cc2-G-L-1qY_irM%252C_%253BFDTFxa_xYpodmM%252CpXSulY5jUZDVEM%252C_%253BkWoQH78UkQOuYM%252C_gdC5SXH8L5omM%252C_%253BFy7fjbppdZQGXM%252CUI2eBRNQw2wftM%252C_&vet=1&usg=AI4_-kTiEvxc8QNGvv8A_SfE3ADJa3GdgQ&sa=X&ved=2ahUKEwiqiZ6mnbXzAhXCV3wKHZQBDVkQ_B16BAg9EAE#imgrc=tZyeb2LbiCbADM
