All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To write a Python program that can evaluate an Otto cycle and to plot an output graph. OBJECTIVES: 1) To generate the actual PV diagram with the help of code. 2) To calculate the thermal efficiency at the required compression…
Jayesh Keche
updated on 22 Jul 2021
AIM: To write a Python program that can evaluate an Otto cycle and to plot an output graph.
OBJECTIVES: 1) To generate the actual PV diagram with the help of code.
2) To calculate the thermal efficiency at the required compression ratio.
EQUATIONS :
The important equation used in this topic to find volume trace V in terms of crank angle θ is as follows:
VVc=1+12(CR–1)[R+1−cosθ−(R2–sin2θ)12]
The terms used in this equations are ;
1) R=la
where, l = connecting rod length
a = crank pin radius
2)a=s2
where, s = stroke length
3)Vc=VsCR−1
where, Vc = Clearance Volume
CR = Compression Ratio.
Vs = Swept Volume
4)Vs=π4×b2×s
where, b = bore diameter
Also ,To calculate the Thermal Efficiency of Otto cycle, following quation is used;
η=1−1CRγ−1
RELATIONS:
Below relations are used in this topic;
1)PVγ
This relation is for an adiabatic reversible process which will help to find out state variables at required points for isentropic compression & isentropic expansion.
2) PVT=constant
This ideal gas equation is also used to find out state variables at the required points.
THEORY:
An Otto cycle is an idealized thermodynamic cycle that describes the functioning of a typical spark ignition piston engine. It is the thermodynamic cycle most commonly found in automobile engines.
The Otto cycle describes how heat engines turn gasoline in motion. Like other thermodynamic cycles, this cycle turns chemical energy into thermal energy and then into motion. It describes how internal combustion engines work.
PISTON KINEMATICS :
The geometric parameters of the piston-cylinder are represented in the figure.
Fig: Piston Kinematics
Where ;
b = bore
s = stroke
l = connecting rod length
a = crank radius
q = crank angle
TDC = Top dead centre
BDC = Bottom dead centre
The top dead center refers to the position of the crankshaft at a crank angle of 00. This position is otherwise known as the clearance volume, Vc. At the bottom dead center, the crank angle is at 1800. The volume of the piston-cylinder can be determined as a function of crank angle from the compression ratio, the stroke, bore, and connecting rod length; which is as follows;
V=Vc{[1+12(CR–1)[R+1−cosθ−(R2–sin2θ)12]}
PROCESS INVOLVED :
Fig: PV-Diagram
Here we can say that,
1) V1 = Vs + Vc
2) V2 = Vc
Where ,
Vs = Swept Volume
Vc = Clearance Volume
Also,
V1 = V4 &
V2 = V3
Process 1 – 2 : Isentropic compression
During this phase, the piston will be drawn up i.e. moves from BDC to TDC so that it compresses the air-fuel mixture. Air undergoes isentropic compression. In this process volume of air decreases from V1 to V2 and pressure increases from P1 to P2 due to compression. Also temperature increases from T1 to T2 but there is no heat exchanged thus entropy remains constant i.e. S1 = S2. Hence in thermodynamics, it is referred as a (reversible)adiabatic process. When the cycle reaches point 2, the fuel is met by the spark plug to ignite.
Process 2 – 3: Heat Addition(At Constant volume)
This is where combustion occurs due to the ignition of fuel by the spark plug. Here heat is added at constant volume (V2 = V3) externally. The combustion of the gas is complete at point 3, which results in a highly pressurized chamber that has a lot of heat (thermal energy). In terms of thermodynamics, this is referred to as an isochoric process.
Process 3 – 4: Isentropic Expanssion
In this process, air undergoes isentropic expansion (reversible adiabatic).Thermal energy in the chamber as a result of combustion is used to do work on the piston which pushes the piston down i. from TDC to BDC increasing the volume of the chamber.This is also called the power stroke because it is when the thermal energy is turned into motion to power the machine or vehicle.
Process 4 – 1: Heat Rejection (at constant volume)
When the piston remains at BDC for a while, heat is rejected at constant volume(V4 = V1). As the heat leaves the gas, the molecules of air lose kinetic energy causing the decrease in pressure (from P4 to P1).
PROGRAM CODE:
The programming language used = Python
1)Main Program
import math
import matplotlib.pyplot as plt
def engine_kinematics(bore,stroke,con_rod,cr,start_crank, end_crank):
#Geometric Parameters
a= stroke/2
R=con_rod/a
# volume calculations
v_s=(math.pi/4)*pow(bore,2)*stroke
v_c=v_s/(cr-1)
star_crank_angle = math.radians(start_crank)
end_crank_angle = math.radians(end_crank)
num_values = 50
dtheta= (star_crank_angle- end_crank_angle)/(num_values-1)
V= []
for i in range(0,num_values):
theta=star_crank_angle+i*dtheta
term1 = 0.5*(cr-1)
term2= R+1-math.cos(theta)
term3= pow(R,2) - pow(math.sin(theta),2)
term3 = pow(term3,0.5)
V.append((1+term1*(term2-term3))*v_c)
return V
# inputs
p1=101325
t1=500
t3=2300
gamma= 1.4
#Geometric Parameters
bore= 0.1
stroke= 0.1
con_rod = 0.15
cr= 8
# Volume computation
v_s=(math.pi/4)*pow(bore,2)*stroke
v_c=v_s/(cr-1)
v1= v_c + v_s
# state point 2
v2= v_c
# p2v2^gamma = p1v1^gamma
p2 = p1* pow(v1,gamma)/pow(v2,gamma)
#p2v2/t2 = p1v1/t1 | rhs = p1v1/t1 | p2v2/t2 | t2 = p2v2/ rhs
rhs= p1*v1/t1
t2= p2*v2/rhs
# calling function
V_compression= engine_kinematics(bore,stroke,con_rod,cr,180, 0)
constant= p1*pow(v1,gamma)
p_compression= []
for v in V_compression:
p_compression.append(constant/pow(v,gamma))
#state point 3
v3=v2
#p3v3/t3 = p2v2/t2 | rhs = p2v2/t2 | p3 = rhs*t3/v3
rhs= p2*v2/t2
p3= rhs*t3/v3
# calling function
V_expansion= engine_kinematics(bore,stroke,con_rod,cr,0,180)
constant= p3*pow(v3,gamma)
p_expansion= []
for v in V_expansion:
p_expansion.append(constant/pow(v,gamma))
#state point 4
v4=v1
# p4v4^gamma = p3v3^gamma
p4 = p3* pow(v3,gamma)/pow(v4,gamma)
#p4v4/t4 = rhs
t4 =p4*v4/rhs
# Efficency in percentage
Thermal_Eff= (1-1/pow(cr,(gamma-1)))*100
print(Thermal_Eff)
#Plot
plt.plot([v2,v3],[p2,p3])
plt.plot(V_compression,p_compression)
plt.plot(V_expansion,p_expansion)
plt.plot([v4,v1],[p4,p1])
plt.xlabel('VOLUME')
plt.ylabel('PRESSURE')
plt.show()
OUTPUT:
1)PV diagram
2)Efficiency:
Efficiency is 56.47%
CONCLUSION:
Otto cycle is an important thermodynamic process and this Python program is effective to visualize the PV plot in actual practice.
Also in this program, Thermal Efficiency is calculated which is an important factor in otto cycle. Thermal efficiency depends upon the compression ratio, hence if the compression ratio increases there will be an increase in thermal efficiency.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Roof challenge
Design of Roof Objectives- 1. For the Given Roof styling, Develop the essential flanges and reinforcements, provide appropriate dimensions and check forDraft analysis and also submit your section modulus report on the 0-Y section.2. Start with the creation of a roof ditch area the tool opening angle is only 3 degrees.3.…
30 Jul 2021 04:51 PM IST
Section Modulus calculation and optimization
AIM: Section modulus calculation and optimization OBJECTIVE: Use section of the Hood and calculate the section modulus.Vary the section in such a way that new section is an improved version of previous section. THEORY:Section modulus is to find the geometric property for a given cross-section used in the design.Calculate…
30 Jul 2021 04:51 PM IST
Fender Design Challenge
FENDER: The fender is the car body part that frames the wheel. Its purpose is to prevent sand, dirt, rocks, and other roads spray from beinthrown into the air by the rotating tire and close the engine component. When a vehicle is moving, tires pick up stones and otherand hurl them in all directions. Fenders are basically…
30 Jul 2021 04:51 PM IST
Hood design-Week 2
DESIGNING OF HOOD ASSEMBLY Objective To understand and study the design methodology and mechanisms that goes under designing and developing an AutomotivHood to achieve maximum safety for everyone in and around vehicle. HOOD DESIGN- CHALLANGE Introduction:- Hood is main component of a car at the front portion. It is used…
30 Jul 2021 04:50 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.