Challenge

Week 2 Air standard Cycle

OTTO CYCLE

AIM – Write python program to create Otto cycle pressure-volume relationship diagram and calculate thermal efficiency of the cycle.

OBJECTIVES-

  1. Write a program to simulate the piston kinematics of the engine to use it as a function for Otto cycle.
  2. Plot PV diagram and determine the value the value of efficiency.

INTRODUCTION-

An Otto cycle is an idealized thermodynamic cycle that describes the functioning of a typical spark ignition piston engine. The Otto cycle is constructed from:

Top and bottom of the loop: a pair of quasi-parallel and isentropic process.

Left and right sides of the loop: a pair of parallel isochoric process.

The processes are described by:

  • Process 1–2 is an adiabatic (isentropic) compression of the charge as the piston moves from bottom centre (BDC) to top dead centre (TDC).
  • Process 2–3 is a constant-volume heat transfer to the working gas from an external source while the piston is at top dead centre. This process is intended to represent the ignition of the fuel-air mixture and the subsequent rapid burning.
  • Process 3–4 is an adiabatic (isentropic) expansion (power stroke).
  • Process 4–1 completes the cycle by a constant-volume process in which heat is rejected from the air while the piston is at bottom dead centre.
  • Process 1–0 the mass of air is released to the atmosphere in a constant pressure process.

The Otto cycle consists of isentropic compression, heat addition at constant volume, isentropic expansion, and rejection of heat at constant volume. In the case of a four-stroke Otto cycle, technically there are two additional processes: one for the exhaust of waste heat and combustion products at constant pressure (isobaric), and one for the intake of cool oxygen-rich air also at constant pressure; however, these are often omitted in a simplified analysis. Even though those two processes are critical to the functioning of a real engine, wherein the details of heat transfer and combustion chemistry are relevant, for the simplified analysis of the thermodynamic cycle, it is more convenient to assume that all of the waste-heat is removed during a single volume change.

Top dead centre refers to the position of the crank shaft at a crank angle of 0o. This position is otherwise known as the clearance volume, Vc. At bottom dead centre 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:

At a given crank angle the volume is given by:

V = Vc + π/4 b2 (2)

Piston Cylinder Geometry

Again using geometry, a relationship for x can be developed:

Geometric solution for x

The compression ratio is defined as the ratio between the maximum and minimum volume, r = V1/Vo. For Otto ignition r = 8 and for a diesel engine the compression ration varies from 12 to 24. Substituting the maximum volume with the displacement volume yields:

r = 1 + Vd/Vc

Solving for Vc results in:

Vo = Vd / r-1

Substituting equations (3) and (5) into equation (2), results in the following relationship for the cylinder volume.

Where:

R = l/a

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

PROCEDURE-

  1. Use following input values
    • Ratio of specific heat capacities (gamma)=1.4
    • Geometric parameters
      • Bore diameter =0.1 m
      • Stroke=0.1 m
      • Length of connecting rod=0.15 m
      • compression ratio=8
  • STATE1
    • Pressure =101325 Pa
    • Temperature= 500K
  • STATE3
    • Temperature= 2300K
  1. Create a function for generating values of volume and pressure for both isentropic expansion and compression.
  2. Write program to plot isochoric process through end state points and call function to generate curve for isentropic process.
"""
Program to simulate Otto cycle 
by Sushant Kumar Mishra
"""

import math
import matplotlib.pyplot as plt 

def engine_kinematics (bore,stroke,c_d,c_r,start_crank,end_crank):
	"""
	Engine kinematics
	"""

	#geometric parameters
	#crank pin radius
	a= stroke/2
	R=c_d/a

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

	n=100
	sc= math.radians(start_crank)
	ec= math.radians(end_crank)
	dtheta=(ec-sc)/(n-1)

	v=[]

	for i in range(0,n):
		theta=sc +i*dtheta
		term1=0.5*(c_r-1)
		term2=R+1 -math.cos(theta)
		term3=pow(R,2)-pow(math.sin(theta),2)
		term3=pow(term3,0.5)
		#Volume at any instant
		v.append((1+term1*(term2-term3))*v_c)
	return v

#inputs
gamma=1.4

#STATE1
#pressure(Pa)
p1=101325
#temperature(K)
t1=500

#geometric parameters
#bore diameter(m) 
bore=0.1
#stroke(m)
stroke=0.1
#length of connecting rod(m)
c_d=0.15
#compression ratio
c_r=8

#sweep volume
v_s= (math.pi/4)*pow(bore,2)*stroke
#clearance volume
v_c=v_s/(c_r-1)
#volume
v1= v_s+v_c

v_compression=engine_kinematics(bore,stroke,c_d,c_r,180,0)
p_compression=[]
constant= p1*pow(v1,gamma)
#p_compression*v_compression^gamma=constant
for volume in v_compression:
	p_compression.append(constant/pow(volume,gamma))

#STATE2
#volume
v2=v_c
# as p1v1^gamma=p2v2^gamma
#pressure 
p2=p1*pow(c_r,gamma)
#as p1v1/t1=p2v2/t2=rhs =>t2=p2v2/rhs
rhs=p1*v1/t1
#temperature
t2=p2*v2/rhs

#STATE3
#temperature(K)
t3=2300
#volume(m^3)
v3=v2
#p3v3/t3=rhs
#pressure
p3=rhs*t3/v3

v_expansion=engine_kinematics(bore,stroke,c_d,c_r,180,0)
p_expansion=[]
constant= p3*pow(v3,gamma)
#p_compression*v_compression^gamma=constant
for volume in v_expansion:
	p_expansion.append(constant/pow(volume,gamma))

#STATE4
#volume
v4=v1
#p3v3^gamma=p4v4^gamma
p4=p3*pow(v3,gamma)/pow(v4,gamma)
#p4v4/t4=rhs
t4=p4*v4/rhs

#Thermal efficency 
efficiency= 1-(1/pow(c_r,gamma-1))
print(efficiency)

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.title('Otto cycle')
plt.show()

PLOT-

Efficiency-

CONCLUSION AND EXPLANATIONS-

  1. Thermal efficiency of given cycle = 0.5647247183519379
  2. Take care of indentation, parenthesis and giving correct input for function.
  3. To generate smooth curve in isentropic processes use high values of n
  4. Keep compression ratio in range 6 to 12.
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.