p-V Diagram and Thermal Efficiency of an Otto Cycle Engine
Aim:
To Create a P-V Diagram of an Otto cycle engine and calculate it’s Thermal Efficiency.
Objective:
The main objective is to calculate the Efficiency of the engine and construct a PV Diagram.
Working Principle:
- 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 internal combustion engine working on the principle of the Otto cycle is called Spark Ignition (SI) engine in which used gasoline as the fuel.
- The four strokes of the Otto cycle or four-stroke engine are suction of fuel, compression of fuel, combustion, and expansion of fuel and exhaust of burnt fuel.
1-2: Reversible Adiabatic (Isentropic) Compression
2-3: Constant Volume (Isochoric) Heat Addition
3-4: Isentropic Expansion
4-1: Isochoric Heat Rejection
- Suction Stroke: During this stroke the piston moves from Top Dead Centre (TDC) to Bottom Dead Centre (BDC). The inlet valve opens and the appropriate air-fuel mixture is sucked into the cylinder. The exhaust valves remain closed during this stroke.
- Compression Stroke: In this Stroke, the piston moves from 1-2 towards TDC and compresses the mixture drawn from a suction stroke. The pressure of the mixture increases. Just before the end of the stroke the spark plug initiates a spark that ignites the mixture and combustion takes place at Constant Volume (2-3). During this stroke both the valves remain closed.
- Expansion Stroke: When the mixture is ignited the hot gases are produced which move the piston from TDC to BDC and the work is obtained in this stroke while the other 3 strokes remain idle. The expansion of gases is shown in 3-4. Both the valves are closed initially but when the piston reaches BDC the exhaust valve opens
- Exhaust Stroke: Here the gases from which the work has been collected become useless after completion of a previous stroke. In 4-1, they are made to escape through the exhaust valve to the atmosphere. The piston moves from BDC to TDC and the exhaust gases are taken out of the engine. This is represented by the line (1-5)
Equations used:
1. Relation between crank angle and Volume in the Combustion chamber:
`V/V_c =1+ 1/2(r_c-1)[R+1-cosθ- (R^2-sin^2θ)^(1/2)]`
Where,
V = Compression or Expansion Volume
`V_c`=Clearance Volume
`r_c`=Compression ratio
R = Crankpin Radius
`θ`= Crank Angle
2. Swept Volume (`V_s`):
The swept volume is the volume of air displaced by the piston\'s diameter in one full stroke from the Bottom Dead Centre (BDC) to the Top Dead Centre (TDC).
`V_s=π/4×(\"Bore\")^2×Stroke`
Where,
Bore = Diameter of each cylinder.
Stroke = Length that it travels when moving from BDC to TDC of a piston.
3. Clearance Volume (`V_c`):
Clearance Volume is the volume between the cylinder head and the piston top when the piston is at the Top Dead Centre (TDC).
(Or)
The volume of the Cylinder that is not swept by the piston is called the Clearance Volume.
`V_c=V_s/((r_c-1))`
4. Reversible Adiabatic process:
`P×V^γ=C`
Where,
P = Pressure
V = Volume
`γ=C_p/C_v`
where `C_p` = Specific heat for constant pressure
`C_v` = Specific heat for constant volume
5. Ideal gas law:
`PV=nRT`
Where,
P = Pressure of the Gas
V= Volume of the Gas
n = Amount of Substances/ Number of moles.
R = Ideal or Universal Gas Constant
T = Absolute Temperature of the gas
6. Thermal Efficiency of the Engine:
`η=1-1/r_c^((γ-1))`
Where,
η = Thermal Efficiency of the Engine.
Body:
- The code is written in Sublime Text 3 for Python.
- Initially, we have to take a few prerequisite values such as
- Bore=0.2m,
- Stroke=0.1m ,
- Connecting Rod=0.15m,
- Adiabatic Index(`γ`)= 1.4
- Pressure at Point 1 (`P_1`)= 101325 pa (1atm =101325 Pa),
- Temperature at point 1 (`T_1`)= 500 K
- Temperature at point 3 (`T_3`)= 2300 K
- Compression Ratio(`r_c`)= 10
\"\"\"
Plotting the PV Diagram and Calculating the Thermal Efficiency
1-2: Reversible Adiabatic (Isentropic) Compression
2-3: Constant Volume (Isochoric) Heat Addition
3-4: Isentropic Expansion
4-1: Isochoric Heat Rejection
\"\"\"
import math
import matplotlib.pyplot as plt
def engine_kinematics(bore, stroke, con_rod, cr, start_crank, end_crank):
a= stroke/2 #a is crank Pin Radius
R= con_rod/a #R = Constant
v_s= ((math.pi)/4)*pow(bore,2)*stroke #V_s is the Swept Volume
v_c= v_s/(cr-1) #V_c is the Clearance Volume
sc= math.radians(start_crank)
ec= math.radians(end_crank)
num_value= 100
dtheta= (ec-sc)/(num_value-1)
V=[]
for i in range (0, num_value):
theta = sc+ i*dtheta
term1= (1/2)*(cr-1)
term2= R + 1- math.cos(theta)
term3= pow(R,2) - pow(math.sin(theta),2)
term3 = pow(term3, (1/2))
V.append((1 + term1*(term2-term3))*v_c)
return V
#Inputs
p1= 101325 #Pressure at State 1
t1= 500 #Temperature at state 1
gamma=1.4 #Adiabatic Index
t3= 2300 #Temperature at State 3
#Geometric parameters
bore=0.2 #Bore is the Diameter of the Piston Cylinder
stroke=0.1 # Stroke is the Length it that travels from BDC to TDC
con_rod=0.15
cr=10 #cr is Compression Ratio
#Volume computation
v_s=(math.pi/4)*pow(bore,2)*stroke
v_c= v_s/(cr-1)
#Volume at State 1
v1=v_c + v_s
#State 2
v2= v_c
#p2v2^gamma= p1v1^gamma
p2 = p1*pow(v1,gamma)/pow(v2,gamma)
#Temperature at 2, Ideal Gas Law | p2v2/t2= P1V1/T1 == rhs= P1V1/T1
#rhs= P2V2/T2== T2=P2V2/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 3
v3 = v2
#p3v3/t3=p2v2/t2
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 4
v4=v1
#p4v4^gamma = p3v3^gamma
p4=p3*pow(v3,gamma)/pow(v4,gamma)
#t4= p4v4/rhs
t4=(p4*v4)/rhs
#Thermal Efficiency of the engine
x= 1 - (1/pow(cr,(gamma-1)))
Eff = x*100
print(\"The Thermal Efficiency of the Engine is \", Eff, \"%\")
#Plotting the P-V graph
plt.plot(V_compression, P_compression, label = \'1-2: Isentropic Compression\')
plt.plot([v2,v3],[p2,p3], label= \'2-3: Isochoric Heat Addition\')
plt.plot(V_expansion,P_expansion, label= \'3-4: Isentropic Expansion\')
plt.plot([v4,v1],[p4,p1], label= \'4-1: Isochoric Heat Rejection\')
plt.xlabel(\'Volume\')
plt.ylabel(\'Pressure\')
plt.title(\'p-V Diagram of the Four Stroke Otto Cycle Engine\')
plt.annotate(\'1\', xy=(v1,p1), ha= \'left\', va= \'top\', fontsize= 10)
plt.annotate(\'2\', xy=(v2,p2), ha= \'right\', va= \'top\', fontsize= 10)
plt.annotate(\'3\', xy=(v3,p3), ha= \'right\', va=\'bottom\', fontsize= 10)
plt.annotate(\'4\', xy=(v4,p4), fontsize= 10)
plt.legend()
plt.savefig(\'PV Diagram\')
plt.show()
- It then calculates the required values to create a graph
- The thermal efficiency of the engine.
Conclusion:
The PV Diagram has been plotted and the efficiency is calculated.
(Final Output showing the Thermal Efficiency after Executing the program)
(Final Output showing the PV Diagram after Executing the Program.)
There were few difficulties faced initially on how to calculate the thermal efficiency and the technical Terms which can be overcome by reading textbooks to get the basic idea of the Otto cycle and its working. The book I\'ve used is \'Automobile Engineering by Er.R.K. Rajput\' and \'Thermodynamics by P.K.Nag\'. These books are good to gain a basic knowledge of the subject.
Apart, from the technical Aspect, there were few issues faced while plotting the graph. To make the graph more effective the Labels and points were added in it to get a clear idea of how the graph will look. I had to google some of the codes to be used to reach the above conclusion.