Week 2 Air standard Cycle
Week 2 Air standard Cycle
Air standard Cycle
AIM- To Plot the PV Diagram of Otto cycle and derive the thermal efficiency of the otto cycle
OBJECTIVE
- Write a program to plot the curves of PV- diagram of the Otto Cycle.
- Find the Thermal Efficiency of the Otto Cycle.
GOVERNING EQUATIONS
Otto cycle - An ideal thermodynamic combustion cycle consists of 4 processes as follows: a compression at constant entropy; a constant-volume heat transfer to the system; an expansion at constant entropy; and a constant-volume heat transfer from the system.
Calculation of different parameters of otto cycle
Engine Geometric Parameters:-
Bore – 0.1
Stroke – 0.1
Connecting Rod Length – 0.15
Compression Ratio (CR) – 12
Swept Volume = ( /4)*Bore^2*Stroke
Clearance Volume = SweptVolume/(CR-1)
Given Parameters
P1 = 101325 Pa
T1 = 500 K
T3 = 2300 K
Gamma = 1.4
Parameters for State Point-1
V1 = Swept Volume + Clearance Volume
V2= Clearance Volume
Parameters for State Point-2
P2V2^ = P1V1^gamma
P2 = P1(V1/V2)^gamma
T2 = P2V2T1/P1V1
Parameters for State Point-3
V3 = V2
P3 = P2V2T3/T2V3
Parameters for State Point-4
V4 = V1
P4 = P3(V3/V4)^gamma
Calculation of Thermal Efficiency Of Otto Cycle
Thermal Efficiency = 1-(1/CR^(gamma-1))
% Thermal Efficiency = Thermal Efficiency* 100
Volume Trace – V/Vc = 1 + ½(CR-1)[R +1 – costheta – (R^2 – sintheta^2)^(1/2)
Where,
a = Stroke/2
R = connecting Rod length/a
PYTHON CODE
import math
import matplotlib.pyplot as plt
def Engine_Kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):
#Inputs
a = stroke/2
R = con_rod/a
# 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
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 = 12
# 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)
# 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))
# state point-3
v3 = v2
#p2v2/t2 = p3v3/t3 = rhs | 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 = p3*pow(v3,gamma)/pow(v4,gamma)
rhs = p3*v3/t3
t4 = p4*v4/rhs
# plotting the graph
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.show()
# Thermal Efficiency
Therm_eff = 1 - (pow(cr,(1 - gamma)))
print(Therm_eff)
EXPLAINATION OF MAIN CODE
- First we set the given value of the offer i.e.; Gamma, T3, P1, T1, Engine Geometry Parameters such as Bore, Stroke, connecting rod length, competitive rating.
- After that we calculate the Swept Volume and Clearance Volume calculation using the engine geometry. V1 = hot volume + and specified volume
- Where the changing conditions of State 2 are found i.e.; V2 = acquisition volume.
- P2 and T2 are also calculated with state-2.
- V_compression and P_compression values are calculated using engine kinematics function.
- Thereafter the State variance rates in the state area - 3 were counted.
- V3 and P3 are listed.
- V_expension adjustment is calculated using engine kinematics function.
- Condition variability in point-4 is calculated. P4 and V4 are listed.
- P_compression and V_compression writing sites are listed after P1, V1 architecture.
- P_expension and V_expension placement sites are provided after the P3, V3 building order.
Output Plots
Conclusion
Therefore, the otto cycle plot is submitted and thermal efficiency is calculated.