Week 2 Air standard Cycle
ASSIGNMENT 3
Air standard Cycle
OBJECTIVE:
The objective of Assignment 3, is to create a PV Diagram, and to Calculate the thermal efficiency of the engine, by using Python program and subline as text editor.
PROBLEM STATEMENT:
In this assignment we have to create the PV diagram, but the problem is that, the volume during process 1-2 has varing linearly, as it is an isentropic process, which is governed by a relation PV^GAMMA, So the variation should be a curve. This can be achieved by using the equation, which shows the relation between the crank angle and the volume inside the combustion chamber.
SOFTWARE USED:
Python3.6 (64bit), subline text3 as text editor.
THEORY:
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. The geometric parameters of the piston cylinder are represented in Figure 1.

- Where:b = bores = strokel = connecting rod lengtha = crank radius (= ½ s)theta = crank angleTDC = top dead centerBDC = bottom dead center
Top dead center refers to the position of the crank shaft at an crank angle of 0o. This position is otherwise known as the clearance volume, Vc. At bottom dead center the crank angle is at 180 o. In this position the cylinder volume is at its maximum, V1. The difference between the maximum and minimum volume, V1- Vo, is defined as the displacement volume, Vd. The displacement volume can also be represented as a function of the bore and stroke:

The final form of the Slider-Crank model is given as a non-dimensional relationship by dividing both sides of equation by Vd.

- WHERE,
- bore = 0.10 (diameter of the cylinder)
- stroke = 0.1 (distance between the TDC to BDC or VICE VERSA.)
- con_rod = 0.15 (Connecting rod length)
- cr = 12 (Compression ratio)
- a = stroke/2 (Crank pin radius)
- R = con_rod/a (R=Constant)
THERMAL EFFICIENCY:

WHERE,
GAMMA = 1.4
r=Compression ratio (cr) = 8
PROCEDURE: to Create the PV DIAGRAM.
1. Open subline text editor.
2. Open a new file and save it as ----.py
3. Write the comment that what is the program is about, which the line is never executed. And write the comment first followed by #(pound) or double quotation codes in starting and as well as at the end of comments. then
import math
import matplotlib.pyplot as plt
4. Define the function "def engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):"
5. Define the inputs of the program like geometric parameters, volume parameters such as
a = stroke/2
R = con_rod/a
stroke Volume v_s = math.pi*(1/4)*pow(bore,2)*stroke
Clearance volume v_c = v_s/(cr-1)
6. Then calculate the Volume by using 'for loop'. don't forget to put colan[:] if we are using the for loop. mention return v, if not it does not display anything in final execution.
7. Then again define the inputs of the otto cycle, geometric parameters.
inputs
p1 = 101325
t1 = 500
gamma = 1.4
t3 = 2300
geometric parameters
bore = 0.1
stroke = 0.1
con_rod = 0.15
cr = 8
8. INPUT the all states like state-1, state-2, state-3, state-4 {P1v1, P2v2, P3v3, and P4v4} along with v_compression, p_compression, and v_expansion, p_expansion. Then calculate the pressure and volume values in all stages.
9. 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')
On the x-axis plot velocity by using plt.xlabel ('volume')
On the y-axis plot drag_force by using plt.ylabel ('pressure')
10. plt.show()
PROGRAM SCREEN SHOT:



FIG PROGRAM
"""
Otto cycle simulator Renukumar
"""
import math
import matplotlib.pyplot as plt
def engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):
"""
Engine kinematics Renu kumar
"""
#geometric parameters
a = stroke/2
R = con_rod/a
#volume parameters
v_s = math.pi*(1/4)*pow(bore,2)*stroke
v_c = v_s/(cr-1)
sc = math.radians(start_crank)
ec = math.radians(end_crank)
num_values = 100
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
#inputs
p1 = 101325
t1 = 500
gamma = 1.4
t3 = 2300
#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 = rhs | 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))
#print(p_compression)
#state point 3
v3 = v2
#p3v3/t3 = p2v2/t2 | rhs = p2v2/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))
#print(p_compression)
#state point 4
v4 = v1
#p4v4^gamma = p3v3^gamma
p4 = p3*pow(v3,gamma)/pow(v4,gamma)
#p4v4/t4 = rhs
t4 = p4*v4/rhs
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()
PROCEDURE: to calculate the thermal efficiency.
1. Open subline text editor.
2. Open a new file and save it as ----.py
3. Write the comment that what is the program is about, which the line is never executed. And write the comment first followed by #(pound) or double quotation codes in starting and as well as at the end of comments. then
import math
4. Then assign the input values for thermal efficiency
cr = 8
gamma = 1.4
5. Then write the formula for thermal efficiency of an OTTO CYCLE = (1-(1/cr^gamma-1))
term1 = 1
term2 = 1
term3 = pow(cr,gamma-1)
thermal_efficiency = term1-(term2/term3)
6. print(thermal_efficiency*100)

RESULT:

THERMAL EFFICIENCY OF AN OTTO CYCLE = 56.47%DISCUSSION:
- The above graph shows the PV diagram of an OTTO cycle.
- The volume does not varies linearly, because it is an isentropic process during process1-2. and it varies in the form of curve.
THERMAL EFFICIENCY OF AN OTTO CYCLE = 56.47%
If the compresion ratio is high the thermal efficiency of an otto cycle will increase, if the compresion ratio is low the thermal efficiency of an otto cycle will decrease.
LINK: https://drive.google.com/drive/folders/1yQK5mgNJeZjqHMEBLVgFNaeXUuHFQN4j?usp=sharing