Week 2 Air standard Cycle
AIM-
- Create PV diagram.
- Output of thermal efficiency of the engine.
THEORY-
Otto cycle-
- An otto cycle us an idealize thermodynamic cycle that describes the functioning of a typical Spart ignition piston engine.
- This cycle turns chemical energy into thermal energy and then into motion.
In Otto cycle undergoes a series of four internally irreversible process; two isentropic (reversible adiabatic), heat addition at contact volume and heat rejection at constant volume process as following manner
- State 1 to state 2 – Isentropic compression
- State 2 to state 3- constant volume heat addition
- State 3 to state 4- Isentropic expansion
- State 4 to state 1- constant volume heat rejection

Fig- Pressure Volume diagram of Otto cycle
The four-stroke engine comprises:
- Intake stroke – The piston moves from top dead center (TDC) to bottom dead center (BDC) and the cycle passes points 0 → 1. In this stroke the intake valve is open while the piston pulls an air-fuel mixture into the cylinder by producing vacuum pressure into the cylinder through its downward motion.
- Compression stroke – The piston moves from bottom dead center (BDC) to top dead center (TDC) and the cycle passes points 1 → 2 . In this stroke both the intake and exhaust valves are closed, therefore the fuel-air mixture is compressed. At the end of this stroke the fuel-air mixture is ignited by a spark, which causes further increase in pressure and temperature in the chamber. At the end of this stroke the crankshaft has completed a full 360 degree revolution.
- Power stroke – The piston moves from top dead center (TDC) to bottom dead center (BDC) and the cycle passes points 2 → 3 → 4. In this stroke both the intake and exhaust valves are closed. At the beginning of the power stroke, a spark ignites the fuel-air mixture in the combustion chamber, which in turn causes a very rapid combustion of the fuel. In this stroke the piston is driven towards the crankshaft, the volume in increased, and the pressure falls as work is done by the gas on the piston.
- Exhaust stroke. The piston moves from bottom dead center (BDC) to top dead center (TDC) and the cycle passes points 4 → 1 → 0. In this stroke the exhaust valve is open while the piston pulls an exhaust gas out of the chamber. At the end of this stroke the crankshaft has completed a second full 360-degree revolution.
Thermal Efficiency of Otto cycle-
- Thermal efficiency of heat engine defines as the ratio of the work done, W, to the heat input at the high temperature.

- In terms of compression ratio, the efficiency of an ideal Otto cycle is

PROGRAM-
"""
Otto cycle PV diagram
"""
import math
import matplotlib.pyplot as plt
def engine_kinematics(bore, stroke, con_rod, cr, start_crank, end_crank):
"""
Engine Kinematics
"""
# piston kinematics
a = stroke / 2
R = con_rod / a
# volume calculation
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
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
# piston parameter
p1 = 101325
t1 = 500
gamma = 1.4
t3 = 2300
# piston kinematics
bore = 0.1
stroke = 0.1
con_rod = 0.15
cr = 10
# volume calculation
v_s = (math.pi/4)*pow(bore,2)*stroke
v_c = v_s/(cr-1)
v1 = v_c + v_s
# process 1-2
v2 = v_c
p2 = p1* pow(v1,gamma)/pow(v2,gamma)
# p2v2/t2 = p1v1/t1
rhs = p1*v1/t1
t2 = p2*v2/ rhs
V_compression = engine_kinematics(bore, stroke,con_rod,cr, 180,0)
#P_compression*V_compression^gamma = constant
Constant = p1*pow(v1,gamma)
P_compression = []
for v in V_compression:
P_compression.append(Constant/pow(v,gamma))
# process 2-3 heat addition process
v3 = v2
# p3v3/t3 = p2v2/t2
rhs = p2*v2/t2
p3 = rhs*t3/v3
# process 3-4
v4 = v1
# p4v4^gamma = p3v3^gamma
p4 = p3*pow(v3,gamma)/pow(v4,gamma)
# p4v4/t4 = p3v3/t3
rhs = p3*v3/t3
t4 = p4*v4/rhs
V_expansion = engine_kinematics(bore, stroke,con_rod,cr, 180,0)
#P_expansion*V_expansion^gamma = constant
Constant = p3*pow(v3,gamma)
P_expansion = []
for y in V_expansion:
P_expansion.append(Constant/pow(y,gamma))
plt.plot([v2,v3],[p2,p3])
plt.plot(V_compression, P_compression)
plt.plot([v4,v1],[p4,p1])
plt.plot(V_expansion, P_expansion)
plt.show()
# thermal efficiency of Otto cycle
thermal_effi = (1-1/(pow(cr,(gamma-1))))*100
print(thermal_effi)
EXPLAINATION-
- For calculating PV diagram for Otto cycle, we need to consider state variable parameters of each point and Engine kinematics terms like Bore, stroke, Connecting Rod, compression ratio and crank angle.
- By using Engine piston calculation, we find out Swept volume, clearance volume and state variables.
- While calculating each parameter, the pressure at state 2 is always greater than pressure at state 1.
- Important note- While saving function file, name of the file and name of function should be exactly same.
- In function file, we calculate the value of Swept volume and clearance volume by using standard mathematical relation.
- While calculating total volume, we split main formula into three different terms as term1, term2 and term3.
- For calculating pressure compression (P_compression) and volume of compression (V_compression), we use ‘Function definition‘ command i.e engine_kinematics.
- Similarly, for calculating, the value of pressure of expansion (P_expansion) and volume of expansion (V_expansion), we use ‘function definition’ command i.e engine_kinematics.
To plot PV diagram, we used ‘plot’ command with all state variables.

- For calculating Thermal efficiency of Otto cycle, we need value of compression ratio and gamma.

RESULT-
- While calculating PV diagram for Otto cycle, it is necessary to understand Engine kinematics.
- To

- In our program, thermal efficiency as below.
