Project

AIR STANDARD CYCLE

AIR STANDARD CYCLE

Objective: The main objective of this project is to write a python code and get compiled to visualize the P-V diagram and the thermal efficiency of Otto cycle. In Otto cycle different process are involved such that its thermodynamic relations and engine kinematics are utilized for this project.

CONCEPT:

Otto Cycle: It is basically a thermodynamic cycle which describes the functioning of SI engine which are generally used in Automobile engines. To explain Otto cycle we have to diagrams as follows:

Solution procedure:

  • In this project we are simulating only a closed cycle and hence ignoring the intake and exhaust strokes.
  • To plot the cycle, we need to calculate different variables at four different states i.e at the end of every stroke.
  • Now let’s assume pressure P1,P2,P3,P4 , volume V1,V2,V3,V4 and temperature T1,T2,T3,T4 at four different state points.
  • As air is drawn into engine, let’s assume P1= 101325 Pa and T1= 500K
  • Let’s consider gamma=1.4 for adiabatic process and combustion temperature T3 = 2300 K
  • Now lets assume engine geometric parameters such as bore, stroke, connecting rod length, compression ratio which are written in python code.

Compression stroke(1-2):

  • In this stroke, P1, T1 are assumed and V1 is found using bore, stroke values.

VS = π/4*(B)2*S

  • We need to find the clearance volume inorder to get the total volume at the stroke.

Compression ratio (CR) = (Vs+Vc)/Vc

Vc = Vs / (CR−1)

  • At the end of compression stroke the volume will be the clearance volume i.e, V2 = Vc
  • Since it is a adiabatic process

P2 = P1. V1 γ/ V2 γ

  • As the compression process is continuous process and only two points cannot describe the process completely. In order the get a smooth curve we need to plot different pressure by using volume at each crank angle. The above equation solves the problem of smooth curve.

V/Vc=1+(0.5)⋅(CR−1)((R+1−cos(θ)−(R2−sin(θ)2)0.5)

  • By using the ideal gas equation we can find the temperature T2.

P1V1/T1 = P2V2/T2

Combustion stroke(2-3):

  • During this process, the volume doesn’t change so V3 =V2 and by using ideal gas equation we can find the P3 value with T3 assumed value.

Expansion stroke(3-4):

  • The same process followed for compression stroke is carried out. The only difference should be considered is that, for compression stroke we consider the angles from BDC to TDC for calculating the volume at different angles
  • For Expansion stroke, we consider the angles TDC to BDC for calculating the volumes.
  • In this V4 = V1 as it comes back to BDC after expansion.
  • By using the adiabatic and ideal gas equation we will calculate the pressure and temperature respectively.

Lastly we need to find out the Thermal efficiency of the engine which is written as

Thermal Efficiency (η) = (T4−T1)/(T3−T2)

Now let me present the code written for plotting P-V diagram of Otto cycle

#Program to plot P-V diagram and Thermal efficiency value
import math
import matplotlib.pyplot as plt


def engine_kinematics(bore,stroke,con_rod,Cr,start_crank,end_crank):
            
    #Geometric parameters
    a = stroke/2
    R = con_rod/a

    sc = math.radians(start_crank)
    ec = math.radians(end_crank)

    num_values = 50

    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 = R**2 - pow(math.sin(theta),2)
        term3 = term3**0.5

        V.append((1 + term1*(term2 - term3))*V_c)  
        
    return(V)

#Engine inputs 
Bore = 0.1
stroke = 0.1  
con_rod = 0.15
Cr = 8         #Compression ratio = (Vs+Vc)/Vc
gamma = 1.4 


#At state point 1  constant volume heat rejection process
P1 = 101325     #Atm pressure in N/m^2
T1 = 500        #Atm temp in K
T3 = 2300       # Assuming Max temp inside cylinder in K

#Volume computation
V_s = (math.pi/4)*(Bore**2)*stroke
V_c = (V_s)/(Cr-1)
V1 = V_c + V_s

#At point 2 - Adiabatic compression process

V2 = V_c    #After compresssion volume at pt 2 is equal to clearance volume

P2 = P1*(V1**gamma)/(V2**gamma)       #P2V2^gamma = P1V1^gamma isentropic relation 

#P2V2/T2 = P1V1/T1 (Ideal gas equation)
#Consider RHS = P1V1/T1 | P2V2/T2 = RHS | T2 =P2V2/RHS 
RHS = P1*V1/T1
T2 = P2*V2/RHS

V_compression = engine_kinematics(Bore,stroke,con_rod,Cr,180,0)
constant = P1*(V1**gamma)

P_compression = []
for V in V_compression:
    P_compression.append(constant/(V**gamma))


#At point 3 - Constant volume heat addition

V3 = V2          #constant volume 

#P3V3/T3 = P2V2/T2 | RHS = P2V2/T2 | P3 = RHS*T3/V3

RHS = P2*V2/T2
P3 = RHS*T3/V3
V_expansion = engine_kinematics(Bore,stroke,con_rod,Cr,0,180)
constant = P3*(V3**gamma)

P_expansion = []
for V in V_expansion:
    P_expansion.append(constant/(V**gamma))


#At point 4 - Adiabatic expansion process
V4 = V1
#P4V4^gamma = P3*V3^gamma
P4 = P3*(V3**gamma)/(V4**gamma)

#P4V4/T4 = P3V3/T3
T4 = P4*V4/RHS        #PV/T=C; SO RHS gets same value

#Thermal efficiency = Work done/heat input = 1 - (Ql/Qh)
eff = (T4-T1)/(T3-T2)  
print(eff)
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(V)')
plt.ylabel('PRESSURE(P)')
plt.show()

Defining the function:

  • In this a function is to be defined in order to calculate the engine kinematics.
  • As discussed a equation was considered above for obtaining the volume for different crank angle for obtaining the required pressure to get a smooth curve.
  • In this program a and R defined and then start and end crank angles with number of values are defined.
  • A loop is created for calculating the Volume array and after every calculation its get returned upto the number of values given by us.
  • Then Thermal efficiency value and P-V diagram plots are obtained as shown below.

Results:

  • P-V diagram:

  • Thermal efficiency result obtained as 43.53%.

Discussion: As per the discussion, the P-V diagram plot has been obtained. The thermal effici3ncy of the engine has also been obtained.

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.