Challenge

Week 2 Air standard Cycle

Air-Standard Otto Cycle

The Otto cycle is the theoretical cycle of interest when one is considering reciprocating SI engines. The four-stroke Otto cycle is made up of the following four internally reversible processes: 1–2, isentropic compression; 2–3, constant-volume heat addition; 3–4, isentropic expansion; and 4–1, constant-volume heat rejection.

The Otto cycle is the ideal cycle for spark-ignition (SI) engines. Description of the processes is given as follows:

•

Process 1-2: isentropic compression of the working fluid occurs as the piston moves from the bottom dead center (BDC) to top dead center (TDC).

•

Process 2-3: here, with the SI, a rapid burning occurs inside the piston; therefore, the heat addition takes place at the constant volume.

•

Process 3-4: in this process, the working fluid expands isentropically and produces useful work for the cycle.

•

Process 4-1: heat removal at constant volume. In practical applications, the heat is removed by expelling the exhaust gas to the atmosphere.

P-V and T-S diagram of the otto cycle is shown in the above figure.

Thermodynamic analysis of the Otto cycle produces a simple relationship among the thermal efficiency of the Otto cycle ηth, Otto, compression ratio r, and specific-heat ratio k:

`n_(thermal) = 1 - 1/(r^(k-1)`

The Otto cycle engine kinematic

"""
otto cycle
Amit Tiwari
"""
import math 
import matplotlib.pyplot as plt
import numpy as np

def otto_engine(bore,stroke,cr,con_rod,start_crank,end_crank):
	"""
	Engine kinematics
	"""
	# a = crank pin  
	a = stroke/2
	# R = constant 
	R = con_rod/a
	# swept Volume of the cylinder
	V_s = (math.pi/4)*pow(bore,2)*stroke
	# clearnce volume
	V_c = V_s/(cr-1)

	num_value = 40
	CA_start = math.radians(start_crank)
	CA_end = math.radians(end_crank)

	dtheta = (CA_end - CA_start)/(num_value-1)

	V = []

	for i in range(0,num_value):
		theta = CA_start + 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
		


# cylinder parameter 

bore = 0.1
stroke = 0.1 
con_rod = 0.15 
cr = 10 
gamma = 1.4
T3 = 2200

# volume calulation 
v_s = (math.pi/4)*pow(bore,2)*stroke
v_c = v_s/(cr-1)


# input at state 1 
P1 = 101325 
T1 = 400 
V1 = v_s + v_c

# input at state 2
V2 = v_c
# P1V1/T1 = P2V2/T2! rhs = P1V1/T1  
rhs = (P1*V1/T1)
P2 = P1*pow(V1,gamma)/pow(V2,gamma)
T2 = (P2*V2)/rhs
# adiabatic condition P1V1*gamma = P2V2*gamma!
compression_volume = otto_engine(bore,stroke,cr,con_rod,180,0)
constant = P1*pow(V1,gamma)

P_compression = []
for vol in compression_volume:
	P_compression.append(constant/pow(vol,gamma))
	


# input at state 3 
# isochronic condition V2 = V3! P2V2/T2 = P3V3/T3
V3 = V2
rhs = P2*V2/T2
P3 = rhs*T3/V3

# input at state 4 
# adiabatic conditon P3V3*gamma = P4V4*gamma!
V4 = V1
P4 = P3*pow(V3,gamma)/pow(V4,gamma)

T4 = P4*V4/rhs
expansion_volume = otto_engine(bore,stroke,cr,con_rod,0,180)
constant = P3*pow(V3,gamma)
P_expansion = []
for vol in expansion_volume:
	P_expansion.append(constant/pow(vol,gamma))


plt.plot([V2,V3],[P2,P3])
plt.plot(compression_volume,P_compression)
plt.plot(expansion_volume,P_expansion)
plt.plot([V1,V4],[P1,P4])
plt.title('Otto cycle pressure vs volume diagram')
plt.xlabel('Volume(m^3)')
plt.ylabel('Pressue(Pa)')
plt.show()

# Thermal Efficiency calculation
# Thermal efficiency = area under the curve of 1-2-3-4-1 
# thermal effficiency calculation is 1-1/cr^(gamma-1)

cal = pow(cr,gamma-1)
Thermal_efficiency = 1 -1/cal
print(Thermal_efficiency)

The Output of the program is

Result : The Thermal efficiency of the engine is 60.189%

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.