All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To understand the engine kinematics of an OTTO Cycle using python programming. THEORY: The OTTO Cycle is an air standard cycle of the SI Engine. It is called as the constant volume cycle where the heat additon is carried out at constant volume. The operations which takes place in the cycle are: Process 1-2,Intake:…
Sibi Raj P
updated on 04 Aug 2020
AIM:
To understand the engine kinematics of an OTTO Cycle using python programming.
THEORY:
The OTTO Cycle is an air standard cycle of the SI Engine. It is called as the constant volume cycle where the heat additon is carried out at constant volume. The operations which takes place in the cycle are:
TERMS AND FORMULAS USED:
Vs=π4⋅d2⋅Ls
Where, d = Bore (Internal diameter of the cylinder) or (piston diameter)
Ls = Stroke length
Rc=V1V2
Rc=Vs+VcVc
Vc=Vs+VcRc
Vc−VcRc=VsRc
Vc(Rc−1)Rc=VsRc
Vc=VsRc−1
This is the formula used in the python program to compute the volume of the engine.
ASSUMPTIONS OF AIR STANDARD CYCLE:
Efficiency expression of an OTTO Cycle:
T2T1=(V1V2)γ−1
Qs=m⋅Cv⋅(T3−T2)
P2⋅V2T2=P3⋅V3T3=rhs
P⋅Vγ=C
P3⋅V3T3=P4⋅V4T4=rhs
Governing Equation:
1. VVc=1+(Rc−1)[R+1cos(θ)−(R2−sin2(θ)12]
Here, θ= crank angle
R = Length of Connecting rod
Rc = compression ratio
PYTHON CODE:
#Understanding the simulation the OTTO Cycle
#Importing necessary libraries
import math
import matplotlib.pyplot as plt
#Inputs
p1 = 101325 #(Unit:Pascal)
t1 = 500 #(Unit:Kelvin)
gamma = 1.4
t3 = 2300 #(Unit:Kelvin)
#Geometric Parameters
bore = 0.10 #(Unit:meter)
stroke = 0.1 #(Unit:meter)
con_rod = 0.15 #(Unit:meter)
cr = 12 #(Unit:Compression Ratio)
a = stroke/2 #(a = crank pin)
R = con_rod/a #(Constant)
theta = math.radians(180) #(theta is in radians)
#Volume Computation
v_s = (math.pi/4) * pow(bore,2) * stroke
v_c = v_s/(cr-1)
v1 = v_s + v_c
#State point 2
v2 = v_c
#p1v1^gamma = p2v2^gamma
p2 = p1*pow(v1,gamma)/pow(v2,gamma)
# p1*v1/t1 = p2*v2/t2 | rhs = p1*v1/t1 | p2*v2/t2 = rhs | t2 = p2*v2/rhs
rhs = p1*v1/t1
t2 = p2*v2/rhs
# State point 3
v3 = v2
#p2*v2/t2 = p3*v3/t3 | rhs = p2*v2/t2 | p3 = rhs*t3/v3
rhs = p2*v2/t2
p3 = rhs*t3/v3
# State point 4
v4 = v1
# p4*v4^gamma = p3*v3^gamma
p4 = p3*pow(v3,gamma)/pow(v4,gamma)
print(p4)
# p3*v3/t3 = p4*v4/t4 | rhs = p3*v3/t3 | t4 = p4*v4/rhs
rhs = p3*v3/t3
t4 = p4*v4/rhs
plt.plot([v1,v2,v3,v4,v1],[p1,p2,p3,p4,p1])
plt.xlabel('VOLUME')
plt.ylabel('PRESSURE')
plt.show()
OUTPUT GRAPH:
But this isnt the output that is expected. Instead we have to modify the code to get the exact graph of the OTTO Cycle.
PYTHON CODE:
#Understanding the simulation the OTTO Cycle
#Importing necessary libraries
import math
import matplotlib.pyplot as plt
import numpy as np
def engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):
#Geometric Parameters
a = stroke/2 #(a = crank pin)
R = con_rod/a #(Constant)
theta = math.radians(180) #(theta is in radians)
#Volume Computation
v_s = (math.pi/4) * pow(bore,2) * stroke
v_c = v_s/(cr-1)
sc = math.radians(start_crank)
ec = math.radians(end_crank)
num_values = 50
dtheta = (ec-sc)/(num_values - 1)
V = []
for i in range(0,num_values):
theta = sc + i*dtheta
#Breaking down the governing equation into 3 parts
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 #(Unit:Pascal)
t1 = 500 #(Unit:Kelvin)
gamma = 1.4
t3 = 2300 #(Unit:Kelvin)
#Engine Parameters
bore = 0.10 #(Unit:meter)
stroke = 0.1 #(Unit:meter)
con_rod = 0.15 #(Unit:meter)
cr = 12 #(Unit:Compression Ratio)
#Volume Computation
v_s = (math.pi/4) * pow(bore,2) * stroke
v_c = v_s/(cr-1)
v1 = v_s + v_c
#State point 2
v2 = v_c
#p1v1^gamma = p2v2^gamma
p2 = p1*pow(v1,gamma)/pow(v2,gamma)
# p1*v1/t1 = p2*v2/t2 | rhs = p1*v1/t1 | p2*v2/t2 = rhs | t2 = p2*v2/rhs
rhs = p1*v1/t1
t2 = p2*v2/rhs
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
#p2*v2/t2 = p3*v3/t3 | rhs = p2*v2/t2 | p3 = rhs*t3/v3
rhs = p2*v2/t2
p3 = rhs*t3/v3
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
# p4*v4^gamma = p3*v3^gamma
p4 = p3*pow(v3,gamma)/pow(v4,gamma)
# p3*v3/t3 = p4*v4/t4 | rhs = p3*v3/t3 | t4 = p4*v4/rhs
t4 = p4*v4/rhs
V = engine_kinematics(bore,stroke,con_rod,cr,180,0)
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.xlabel('VOLUME')
plt.ylabel('PRESSURE')
plt.savefig('Otto cycle 2')
plt.show()
eta = (1-t1/t2)*100
print("Efficiency = ",eta)
OUTPUT GRAPH:
EFFIECIENY OF THE CYCLE:
RESULT:
From this report we can conclude that the engine kinematics of an OTTO Cycle is understood using python programming.
REFERENCES:
1. P.K. Nag - Engineering Thermodynamics
2. B. Ramnatham - Engineering Thermodynamics.
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...
Planetary Gear Mechanism Using Solidworks
AIM: To perfrom motion analysis on Planetary gear mechanism with a carrier and to get required plot for the simulation performed. OBJECTIVES: Using the following inputs provided : Ring gear : Module = 2.5 Number of teeth = 46 Sun gear: Number of teeth = 14 Input speed of the gear = 200 rpm. Number of planet gears…
01 May 2021 09:04 AM IST
INTERNAL GENEVA MECHANISM USING MULTIBODY DYNAMICS IN SOLIDWORKS
AIM: TO PERFORM MULTIBODY DYNAMICS ON GENEVA MECHANISM USING SOLIDWORKS. OBJECTIVES: 1) To create 3d models of driver and driven components. 2) Perform motion analysis by rotating the driver wheel at 10 Rpm. 3) We must obtain the following plots: Contact force(between driving and driven wheel) as a function of time.…
31 Jan 2021 01:51 PM IST
FREQUENCY ANALYSIS ON A ROTATING SHAFT
AIM: To perform frequency analysis on a rotating shaft using solid works. We need to find the critical frequencies acting on the rotating shaft. OBJECTIVE: 1) Natural frequency analysis is conducted on a rotating shaft to understand the dynamic behaviour of the system. 2) It helps us to reduce vibrations on the…
04 Dec 2020 09:16 AM IST
ANALYSIS ON A PLATE WITH A HOLE
AIM: To perform Static Analysis on two modes of plates with holes. We have to create the model in Solidworks and perform the analysis. OBJECTIVE: To compare the performance of 2 separate plates with different hole geometries by performing a static structural analysis on plate with a hole using Solidworks Simulation and…
11 Nov 2020 08:53 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.