Challenge

Week 2 Air standard Cycle

Otto cycle Challenge:

Introduction: 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 Otto cycle is a description of what happens to a mass of gas as it is subjected to changes of pressure, temperature, volume, addition of heat, and removal of heat. It consists of basically 4 processes namely, suction, compression, combustion and expansion. Each process start and end point are calculated here and named as state points 1,2,3 and 4. Finding the values of P, V and T at these 4 state points is not enough we also need to find the relation between P and V to plot the actual curve equation between these points.

Explanation:

Bore=0.1

Stroke=0.1

Connecting rod=0.15

Compression ratio=12= max volume/min volume = (v_c+v_s)/v_c

Gamma=1.4

A=crank pin radius=stroke/2

R=constant=connecting rod/a

Total volume(v)= clearance volume(v_c)+ swept volume(v_s)

swept volume(v_s)= volume of cylinder = pi/4 x stroke x bore2

v_c=v_s/(cr-1)

We find the equation that defines the relation of change in volume with change in theta i.e crank angle movement, then we find relation of this volume with pressure. We also calculate p and v values at 4 state points when piston is at TDC and BDC. Hence, we all this information we plot the points which forms a otto cycle.

State point-1: when piston is at BDC

Total volume is v = v_c+ v_s

Theta =0

This is the suction stage.

P=atmospheric pressure

T=initial temperature=500C

State Point-2 When piston is at TDC

This is the compression stage.

Theta =180

Total volume is the clearance volume.

Using gas equation and adiabatic equation , we can find the pressure at temperature at this stage.

State point-3 when Piston is at TDC

This is the combustion stage.

Here the ignition has just begun and volume is still equal to the clearance volume

T=temperature of combustion=2500 C.

We can find the pressure at this stage using the gas equation.

State point-4- When piston is at BDC

Theta =0

This is the expansion stage.

V=swept volume+ clearance volume

Here the ignition has fully taken place and expansion has started, by which the piston again reaches the BDC.

Finally, we calculate the temperature and pressure at this stage using the gas equation and the adiabatic equation.

Relation between volume and theta:

Term1= 0.5*(cr-1)

Term2= R+1-cos(theta)

term4=pow(term3,0.5)

Term3= R2-(sin(theta))2

Term4=term30.5

V=V_c x (1+(term1*(term2-term4)))

Using this we get the adiabatic relation between different state points (1-2 and 3-4).

Finally using for loop we find the value of pressure also corresponding to this volume and then we can plot the otto cycle curve easily.

Code:

import math
import matplotlib.pyplot as plt
#otto cycle code

#defining function
def engine_kinematics(bore,stroke,con_rod,cr,sc,ec):
	start_crank=math.radians(sc)
	end_crank=math.radians(ec)
	n_theta=50
	d_theta=(end_crank-start_crank)/(n_theta-1)
	V=[]
	for i in range(0,n_theta):
		theta=start_crank+i*d_theta
		term1=0.5*(cr-1)
		term2=R+1-math.cos(theta)
		term3=pow(R,2)-pow(math.sin(theta),2)
		term4=pow(term3,0.5)
		V.append(v_c*(1+(term1*(term2-term4))))
	return V

t1=500
t3=3000
p1=101325
stroke=0.1
bore=0.1
con_rod=0.15
cr=12
gamma=1.4
#a= crank pin radius|R=constant used n equation for V
a=stroke/2
R=con_rod/a
v_s=math.pi/4*stroke*pow(bore,2)
v_c=v_s/(cr-1)

# point 1 is at start i.e atBDC, point 2 is after compression
v1=v_s+v_c
v2=v_c
#using adiabatic equation for solving p2
p2=(p1*pow(v1,gamma))/pow(v2,gamma)
#using gas equation for solving t2
rhs=p1*v1/t1
t2=p2*v2/rhs
V_compression=engine_kinematics(bore,stroke,con_rod,cr,180,0)
print(V_compression)
#writing code for p_compression 
p_compression=[]
constant=p1*pow(v1,gamma)
for v in V_compression:
	p_compression.append(constant/pow(v,gamma))

#state 3 is at combustion
v3=v_c
rhs_1=p2*v2/t2
p3=t3*rhs_1/v3

#state 4 is expansion

V_expansion=[]
V_expansion=engine_kinematics(bore,stroke,con_rod,cr,0,180)
print(V_expansion)
#writing code for p_compression and p_expansion
p_expansion=[]
constant=p3*pow(v3,gamma)
for v in V_expansion:
	p_expansion.append(constant/pow(v,gamma))
#state 4 points
v4=v_c+v_s
p4=(p3*pow(v3,gamma))/pow(v4,gamma)
rhs2=p3*v3/t3
t4=p4*v4/rhs2
#calculating thermal efficieny
Eff=1-(1/(pow(cr,gamma-1)))
print(Eff)
#plotting the curve
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()

Thermal Efficiency:

Here the thermal efficiency comes out to be 62.9 %. Efficiency increases with increase in compression ratio and specific heat and is independent of heat added and initial conditions.

Output:

Efficiency-62.9%

1st array in this console screen is for compression, 2nd is for expansion and at the end the value printed is for efficiency fraction.

Conclusion:
The process in the otto cycle is observed to be adiabatic to constant volume(clearance volume) to adiabatic to again constant volume(total volume). This can be seen in the curve. In reality, the process are not generally adiabatic but some heat is released. Otto cycle describes the engine cycles in a spark ignition piston engine.This cycle turns chemical energy into thermal energy and then into motion

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.