Challenge

Week 2 Air standard Cycle

Aim:

To plot a P-V diagram for the Air Standard Cycle or Otto cycle and to compute the thermal efficiency of the engine using Python.

Theory:

  • The Otto cycle consists of isentropic compression, heat addition at constant volume, isentropic expansion, and heat rejection at constant volume.
  • It measures the thermal efficiency of a typical spark-ignition piston engine. This is a cycle most commonly found in automobiles.
  • An Otto cycle is a definition of what happens to a mass of gas when it is subject to changes in pressure, temperature, volume, heat supplement and heat removal.
  • The mass of gas that undergoes these changes is called the system.
  • In this case, the system is defined as the fluid (gas) within the cylinder.
  • By describing the changes that take place within the system, it will also describe in the inverse, the system's effect on the environment.
  • In the case of a four-stroke Otto cycle, there are technically two more processes; one for exhausting waste heat and combustion products at constant pressure (isobaric); and one for the intake of constant pressure cool oxygen air

Otto Cycle process and pv diagram:

  • Process 0-1: A mass of air is drawn into the piston/ cylinder arrangement at constant pressure.
  • Process 1-2: This process is an adiabatic(isentropic) compression of the charge as the piston moves from the bottom dead centre (BDC) to top dead centre (TDC).
  • Process 2-3: This is a constant volume heat transfer to the working gas from an external source while the piston is at top dead centre. This process is intended to represent the ignition of the fuel-air mixture and the subsequent rapid burning.
  • Process 3-4: This is an adiabatic(isentropic) expansion(power stroke).
  • Process 4-1: This process completes the cycle by a constant-volume process in which heat is rejected from the air while the piston is at the bottom dead centre.
  • Process 1-0: Here, the mass of the air is released to the atmosphere in a constant pressure process.
  • In an Otto cycle, the compression ratio is the crucial factor.

Formula used:

  • Swept Volume= pi/4*bore^2*stroke
  • Clearance Volume= Swept Volume/ (cr-1)
  • pressure*volume^gamma=constant
  • pressure*volume/temperature=constant
  • Efficiency=(1-(1/cr)^gamma))*10

Procedure:

1. Import the module.

2. Define parmaters:

3. Define and calculate diffirent crank angle.

4. Calculate volume parameters.

5. Trace the volume curve at different strokes.

6. Input engine parameters and point 1 parameters.

7. Calculate volume at point 1.

8. Compute volume and pressure of point 2.

9. Compute volume and pressure of point 3.

10. Compute volume and pressure of point 4.

11. Plot diagram and label the diagram.

12. Calculate the thermal efficiency of Engine.

Python Code:

#Otto cycle simulator

#Importing the basic libraries / modules

import math

import matplotlib.pyplot as plot

def engine_kinematics(bore,stroke,conrod,cr,start_crankangle,end_crankangle):

"""

EngineKinematics

"""

# Input engine parameters

a = stroke/2

R = conrod/a

# defining angles

sc = math.radians(start_crankangle)

ec = math.radians(end_crankangle)

numvalues=100

dtheta = (ec-sc)/(numvalues-1)

# Volume computation

vs = (math.pi/4)*pow(bore,2)*stroke

vc = vs/(cr-1)

V = []

# tracing the volume curve

for i in range(0,numvalues):

theta = sc+i*dtheta

term1 = 0.5*(cr-1)

term2 = R+1-math.cos(theta)

term3 = pow(pow(R,2)-pow(math.sin(theta),2),0.5)

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

return V

# Inputs Point1

p1 = 101325

t1 = 500

gamma = 1.4

t3 = 2500

# Engine parameters

bore = 0.1

stroke = 0.1

conrod = 0.15

cr = 10

# Volume Computation

vs = (math.pi/4)*pow(bore,2)*stroke

vc = vs/(cr-1)

v1 = vc+vs

# point2

# p2v2/t2=p1v1/t1

v2 = vc

p2 = p1*pow(v1/v2,gamma)

t2 = p2*v2*t1/(p1*v1)

Vcompress = engine_kinematics(bore,stroke,conrod,cr,180,0)

constant = p1*pow(v1,gamma)

pcompress = []

# Point3

# p3v3/t3=p2v2/t2

for v in Vcompress:

pcompress.append(constant/pow(v,gamma))

v3 = v2

p3 = p2*v2*t3/(v3*t2)

Vexpand = engine_kinematics(bore,stroke,conrod,cr,180,0)

constant = p3*pow(v3,gamma)

pexpand = []

# point4

for v in Vexpand:

pexpand.append(constant/pow(v,gamma))

v4 = v1

p4 = p3*pow(v3/v4,gamma)

t4 = p4*v4*t3/(p3*v3)

# Plotting the P-V diagram

plot.plot([v2,v3],[p2,p3])

plot.plot(Vcompress,pcompress)

plot.plot(Vexpand,pexpand)

plot.plot([v4,v1],[p4,p1])

plot.xlabel('Volume (V)')

plot.ylabel('Pressure (P)')

plot.title('Otto Cycle')

plot.show()

# Thermal Efficiency Calculation

n = 1-(pow(cr,(1-gamma)))

print (n)

Result:

PV Diagram

Engine Efficiency

Engine Efficiency = 0.6018928294465027 x 100 = 60.18 %

Conclusion: The plotting of PV diagram of otto cycle and calculating of thermal efficiency is done successfully.

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.