Analysis of Air Standard cycle using Python
AIR STANDARD CYCLE
1.AIM: To Plot the Air standard cycle for Pressure V/s Volume
2.ASSUMPTIONS:
- The value of gamma(1.4)
- The value of temperature after compression i.e T3 =2500k
- P1 is considered at atmosphere i.e 101325 Pa
- T1=600K
3.GEOMETRIC ASSMUPTIONS:
- Bore Diameter = 0.15 m
- Stroke = 0.15 m
- Compression Ratio (CR)= 10
- Length of Connecting Rod =0.3 m
4.OBJECTIVES:
- To determine the thermal efficiency of the engine
- Create the plot for Pressure V/s Volume for the same engine.
- Assign values to the input variables.
- Assume the geometric parameters.
- Calculate the Swept and Clearance Volumes.
- At point 1:
- V1=Swept+ Clearance
- At point 2:
- V2=Clearance
- P2= `P1 x (CR)^γ`
- T2=`(P2*V2*T1)/(P1*V1)`
- At point 3:
- V2=V3
- P3=`(P2*V3)/ "T2"`
- At point 4:
- V4=V1
- P4=P3 x`("V3"/"V4")^( γ)`
- Calculate thermal Efficiency as follows:`ηth=1-1/"CR^(γ-1)"`
- Create a function for drawing the curves between 1 2 and 3 4. 2 3 and 41 being straight lines.
- In the function we use the equations of volume as given below and return the value of the volume to the main program.
We call the function in the main program and hence plot the curves for Compression and expansion.
7.PYTHON CODE:
import math
import matplotlib.pyplot as plt
def air_standard_cycle (bore,stroke,conrod,cr,start_crank,end_crank): #new function
#geometric parameters
a=stroke/2
R=conrod/a
#volume parameters
V_s=(math.pi)/4*pow(bore,2)*stroke
V_c=V_s/(cr-1)
sc=math.radians(start_crank)
ec=math.radians(end_crank)
num_values=100
dtheta=(ec-sc)/(num_values-1)
v=[]
for i in range(0,num_values):
theta=sc + i*dtheta
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((1+term1*(term2-term4))*V_c) #store all the terms in a single array
return v #return all the values stored in v
#input paramters
p1= 101325 #Pa
t1=600 #K
t3=2500 #K
gamma=1.4
#geomertic dimensions
bore=0.15 #m
stroke=0.15 #m
cr=10
conrod=0.3 #m
#volume
v_s=((math.pi)/4)*pow(bore,2)*stroke
v_c=v_s/(cr-1)
#point 1
v1=v_s+v_c
rhs=p1*v1/t1
#point 2
v2=v_c
p2=p1*pow(v1,gamma)/pow(v2,gamma) #p2v2^gamma=p1v1^gamma
t2=p2*v2/rhs
v_comp=air_standard_cycle (bore,stroke,conrod,cr,180,0)
const=p1*pow(v1,gamma)
p_comp=[]
for V in v_comp:
p_comp.append(const/pow(V,gamma))
#point 3
v3=v2
rhs=p2*v2/t2
p3=(rhs*t3)/v3
v_exp=air_standard_cycle (bore,stroke,conrod,cr,0,180)
const=p3*pow(v3,gamma)
p_exp=[]
for V in v_exp:
p_exp.append(const/pow(V,gamma))
#point 4
v4=v1
p4=p3*pow(v3,gamma)/pow(v4,gamma) #p4v4^gamma=p3v3^gamma
t4=p4*v4/rhs
plt.plot([v2,v3],[p2,p3]) #Heat Addition
plt.plot(v_comp,p_comp) #compression Stroke
plt.plot(v_exp,p_exp) #expansion Stroke
plt.plot([v4,v1],[p4,p1]) #Heat Rejection
plt.xlabel('Volume')
plt.ylabel('Pressure')
plt.savefig('air_standard_cycle')
plt.show()
#thermal efficiency
thermal_eff=1-1/(pow(cr,(gamma-1)))
print(thermal_eff*100)
8.RESULTS:
The Thermal Efficiency of the engine was found.
The plot of Pressure V/s Volume is as follows:
9.CONCLUSION:
The plot of Pressure v/s Volume was obtained and the Thermal Efficiency of the engine was calculated using Python, which was 0.6018.