AIR STANDARD CYCLE USING PYTHON
AIM OF THE PROJECT:
Write a code on otto cycle and plot a PV diagram. and also calculate the thermal efficiency of the engine.
THEORY:
Air standard cycle:
The four strokes of a 4 stroke engine are –
1. Suction/Intake Stroke :-
In this stroke, the piston moves from TDC to BDC .The piston moves downward sucking the air-fuel mixture from the intake valve.
2. Compression Stroke :-
Here, the piston moves from BDC to TDC compressing the air-fuel mixture.
3. Power Stroke :-
Power stroke begins with the expansion of air-fuel mixture ignited with the help of spark plug. Here, the piston moves from TDC to BDC.
4. Exhaust Stroke :-
Again the momentum of flywheel moves the piston up from BDC to TDC thereby driving the exhaust gases outside through the exhaust valve.
0-1 INTAKE STROKE
p1=p0
1-2 ISOTROPIC COMPRESSION STROKE
P1*V1/T1=P2*V2/T2
2-3 CONSTANT VOLUME HEAT ADDITION
V3=V2
3-4 ISTROPIC EXPANSION STROKE
P3*V3/T3=P4*V4/T4
4-1 CONSTANT VOLUME HEAT REJECTION
V4=V1
1-0 EXHAUST AT CONSTANT TEMPERATURE
P0=P1
**Equation showing change in volume with different start_crank angle and end_crank angle.
** Thermal efficiency of the engine is:
import math
import matplotlib.pyplot as plt
def engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank):
#engine parameters
a=stroke/2
r=con_rod/a
v_s=(math.pi/4)*pow(bore,2)*stroke
v_c=v_s/(cr-1)
# defining angles
sc=math.radians(start_crank)
ec=math.radians(end_crank)
num_value=100
dtheta=(ec-sc)/(num_value-1)
v=[]
for i in range(0,num_value):
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
gama=1.4
t3=2300
#geometric parameter
bore=0.11
stroke=0.1
con_rod=0.15
cr=12
#voiume 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
#p2*pow(v2,gama)=p1*pow(v1,gama)
p2=p1*pow(v1,gama)/pow(v2,gama)
#p1*v1/t1=p2*v2/t2
t2=p2*v2*t1/(p1*v1)
v_compression=engine_kinematics(bore,stroke,con_rod,cr,180,0)
constant=p1*pow(v1,gama)
p_compression=[]
for v in v_compression:
p_compression.append(constant/pow(v,gama))
#state ppint 3
v3=v2
#p3*v3/t3=p2*v2/t2
p3=p2*v2*t3/(v3*t2)
v_expansion=engine_kinematics(bore,stroke,con_rod,cr,0,180)
constant=p3*pow(v3,gama)
p_expansion=[]
for v in v_expansion:
p_expansion.append(constant/pow(v,gama))
#state point 4
v4=v1
#p4*pow(v4,gama)=p3*pow(v3,gama)
p4=p3*pow(v3,gama)/pow(v4,gama)
#p4*v4/t4=p3*v3/t3
t4=p4*v4*t3/(p3*v3)
#plotting
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 of engine
n1=pow(cr,gama-1)
n=1-(1/n1)
print(\"thermal efficiency of engine is\")
print(n)