Project

P-V DIAGRAM OF OTTO CYCLE AND EFFICIENCY OF THE OTTO CYCLE

#otto ycle
#by ABHISHEK PARMAR
import matplotlib.pyplot as plt 
import math


def engine_k(stroke,bore,cr,con_rod,start_angle,end_angle):
	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_angle)
	ec=math.radians(end_angle)
	np=50
	dtheta=(ec-sc)/(np-1)
	v=[]
	for i in range(0,np):
		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)
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_c+v_s
#state point 2
v2=v_c
p2=(p1*pow(v1,gamma))/(pow(v2,gamma))
t2=(p2*v2*t1)/(p1*v1)
const=p1*pow(v1,gamma)
v_comp=engine_k(stroke,bore,cr,con_rod,0,180)
p_comp=[]
for i in v_comp:
	p_comp.append(const/(pow(i,gamma)))
#state at third point
v3=v2
p3=(p2*t3)/t2
#state at fourth point
v4=v1
p4=(p3*pow(v3,gamma))/(pow(v4,gamma))
t4=(p4*v4*t3)/(p3*v3)
const1=p3*pow(v3,gamma)
v_exp=engine_k(stroke,bore,cr,con_rod,180,0)
p_exp=[]
for v  in v_exp:
	p_exp.append(const1/(pow(v,gamma)))
plt.plot([v2,v3],[p2,p3])
plt.plot([v4,v1],[p4,p1])
plt.plot(v_comp,p_comp)
plt.plot(v_exp,p_exp)
plt.xlabel(\'volume\')
plt.ylabel(\'pressure\')
plt.show()
#efficiency of ic engine is given as net work done divided by heat supplied
cv=718 #specific heat at constantvalume in j/kgk
q_supplied=cv*(t3-t2)
print(\'Heat supplied at constant volume in (joule/kg)=%s\' %q_supplied)
q_rej=cv*(t4-t1)
print(\'Heat rejected at constant volume in (joule/kg)=%s\' %q_rej)
net_work=(q_supplied-q_rej)
print(\'Net work output of the cycle in (joule/kg)=%s\' %net_work)
effi=(net_work/q_supplied)*100
print(\'Efficiency of the otto cycle is given as=%s\' %effi)

\"\"

\"\"

Thermal efficiency of otto cycle is defined as (Net work done)/(Heat supplied), as it is a cycle so net work done is equal to (heat supplied-heat rejected) and heat supplied and heat rejection both occure at constant volume which is given as (q=mc_v(T_2-T_1)). this is what has been implemented the python code

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.