Week 2 Air standard Cycle
Aim:- Prgramme to calculate the effeciency of otto cycle.
- Prgramme to plot PV diagram of otto cycle.
Introduction:- The Otto cycle is an air-standard cycle which approximates the processes in petrol or diesel engines. It is based on constant volume heat addition (combustion) and heat rejection processes, and isentropic compression and expansion. The actual p–V diagram for an engine has rounded corners because of the processes of combustion take place at a finiterate. The Otto cycle has sharp corners because the ‘combustion’ is switched on and off instantaneously.
In a four-stroke engine the piston executes two complete revolutions of the crankshaft, and uses two strokes while the gas is pushed out by the piston on the up stroke, and then the intake valve is opened to enable air to be induced. In a two-stroke engine the intake and exhaust strokes occur at the end and the beginning of the expansion and compression strokes, respectively. These processes are called the gas exchange processes, and are one of the main reasons why real engines are not heat engines. The other reason is the combustion process, when the air is used to burn the fuel. This process of combustion means that the fluid in the engine cannot undergo a cycle.
The basic Otto cycle is made up of four processes:
- Process 1–2 is an adiabatic (isentropic) compression.
- Process 2–3 is a constant-volume heat transfer.
- Process 3–4 is an adiabatic (isentropic) expansion (power stroke).
- Process 4–1 is a constant-volume process in which heat is rejected.
code:-
''' To plot PV diagram of air standard cycle'''
from numpy import *
import math
import matplotlib.pyplot as plt
#Declaring input parameters
pressure_1 = 10000 #N/m^2
temprature_1 = 500 #kelvin(K)
temprature_3 = 2200 #kelvin(K)
#Declaring engine parameters
bore = 0.1 #meter
stroke = 0.1 #meter
connecting_rod = 0.15 #connecting rod length (meter)
compression_ratio = 12 #compression ratio
a = stroke/2 #crank pin radius
r = connecting_rod/a
# Calculating parameters at point 1
volume_swept = (math.pi/4)*bore**2*stroke
volume_clearance = volume_swept/(compression_ratio-1)
volume_1 = volume_swept + volume_clearance
volume_2 = volume_clearance
# Calculation parameters at point 2
gamma = 1.4;
pressure_2 = pressure_1*compression_ratio**gamma
temprature_2 = (pressure_2*volume_2*temprature_1)/(pressure_1*volume_1)
#Calculating parameters at point 3
volume_3 = volume_2
pressure_3 = pressure_2*(temprature_3/temprature_2)
#Caculating parameters at point 4
volume_4 = volume_1
pressure_4 = pressure_3*(volume_3/volume_4)**gamma
def engine_kinematics(bore,stroke,connecting_rod,compression_ratio,start_crank,end_crank):
a = stroke/2 #crank pin radius
r = connecting_rod/a
volume_swept = (math.pi/4)*bore**2*stroke
volume_clearance = volume_swept/(compression_ratio-1)
theta = linspace(start_crank,end_crank,120)
#V = 1 + 1/2 (cr-1) [r + 1-cosd(theta)-(r^2 - sind(theta)^2)^0.5]
V = []
for i in range(len(theta)):
term1 = 0.5*(compression_ratio-1);
term2 = r+1-math.cos(theta[i]);
term3 = (r**2-math.sin(theta[i])**2)**0.5
V.append((1 + term1*(term2-term3))*volume_clearance)
return V
constant_C = pressure_1*pow(volume_1,gamma)
#we will call the function engine_kinematics to calculate V_compression and V_expansion
volume_compression = engine_kinematics(bore,stroke,connecting_rod,compression_ratio,math.pi,0);
pressure_compression = []
for j in volume_compression:
pressure_compression.append(constant_C/j**gamma)
constant_c = pressure_3*(volume_3**gamma)
#constant for expansion will be diff than one for compression
volume_expansion = engine_kinematics(bore,stroke,connecting_rod,compression_ratio,0,math.pi);
pressure_expansion = []
for k in volume_expansion:
pressure_expansion.append(constant_c/k**gamma)
#Thermal effiencency of otto cycle
Effeciency = (1-(1/(compression_ratio**(gamma-1))))*100
print('Effeciency of otto cycle = '+ str(Effeciency) + ' %')
#Result plotting
plt.plot([volume_3, volume_2],[pressure_3, pressure_2],'red')
plt.plot([volume_4, volume_1],[pressure_4, pressure_1],'green')
plt.plot(volume_expansion,pressure_expansion,'black')
plt.plot(volume_compression,pressure_compression,'blue')
plt.xlabel('Volume (m^3)')
plt.ylabel('Pressure (N/m^2)')
plt.title('P V Diagram Of Otto Cycle')
plt.show()
Screenshot :-
plot :-
Result:-
- The effeciency of otto cycle is 62.5%