Project

Air Standard Cycle

Aim: To write a code that can solve an otto cycle and obtain a P-V diagram and also calculate the thermal efficiency.

Software used: Octave

Theory

An Otto cycle is an idealized thermodynamic cycle that describes the functioning of a typical spark ignition piston engine. It is the thermodynamic cycle most commonly found in automobile engines.

The processes are described by

  1. Process 1–2 is an adiabatic (isentropic) compression of the charge as the piston moves from bottom dead centre(BDC) to top dead centre (TDC).
  2. Process 2–3 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.
  3. Process 3–4 is an adiabatic (isentropic) expansion (power stroke).
  4. Process 4–1 completes the cycle by a constant-volume process in which heat is rejected from the air while the piston is at bottom dead centre.

Assumptions for air standard cycle

  1. The working fluid is pure air and behaves as a perfect gas
  2. The working fluid is homogeneous throughout the cycle
  3. Compression and expansion cycles are truly adiabatic and frictionless
  4. The specific heats Cp and Cv and their ratios are all having constant volumes

Explosion ratio(`alpha`)=P3/P2

Isentropic Expansion ratio=V4/V3

Isentropic Compression ratio=V1/V2

Isentropic processes are adiabatic reversible processes and the state variables obey the following equations:

  • P1⋅V1`gamma`=P2⋅ V2`gamma`
  • T1⋅ V1`gamma`-1 =T2⋅ V2`gamma`-1

Isochoric processes take place in a constant volume and pressure and temperature obey ideal gas law:

  • V1=V2
  • P1/T1=P2/T2

Thermal efficiency of Otto cycle is given by,

Function Code

function [V]= piston_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)
  
a = stroke/2;
r= con_rod/a;
V_s=(pi/4)*bore^2*stroke;
V_c=V_s/(cr-1);
theta=linspace(0,180,100);
term1=0.5*(cr-1);
term2=r+1-cosd(theta);
term3=(r^2-sind(theta).^2).^0.5;
V=(1+term1*(term2-term3)).*V_c;

endfunction

Main Program

clear all
close all
clc

%program for otto cycle
%inputs
gamma=1.4;
T3=2300;

%Engine geometric parameters
bore=0.1;
stroke=0.1;
con_rod=0.15;
cr=8;

% variables at state point1
P1=101325; %Pascals
T1=500;  % Kelvin

%calculating swept volume and clearance volume
V_swept=(pi/4)*bore^2*stroke;
V_clearance=V_swept/(cr-1);
V1=V_swept+V_clearance;
V2=V_clearance;

% variables at state point2
% P2V2^gamma=P1V1^gamma
P2=P1*(V1/V2)^gamma;
constant_c=P1*V1^gamma;
V_compression=piston_kinematics(bore,stroke,con_rod,cr,180,0);
P_compression=constant_c./V_compression.^gamma;
%P1V1/T1=P2V2/T2
T2=P2*V2*T1/(P1*V1);

% variables at state point3
V3=V2;
%P3V3/T3=P2V2/T2
P3=P2*T3/T2;
constant_c=P3*V3^gamma;
V_expansion=piston_kinematics(bore,stroke,con_rod,cr,0,180);
P_expansion=constant_c./V_expansion.^gamma;

% variables at state point4
V4=V1;
% P3V3^gamma=P4V4^gamma
P4=P3*V3^gamma/V4^gamma;

% thermal efficiency
Thermal_efficiency=1-1/cr^(gamma-1)

% plotting
hold on
plot(V_compression,P_compression,'color','g')
plot([V2 V3],[P2 P3],'color','b')
plot(V_expansion,P_expansion,'color','r')
plot([V4 V1],[P4 P1],'color','k')
plot(V1,P1,'*','color','r')
plot(V2,P2,'*','color','r')
plot(V3,P3,'*','color', 'r' )
plot(V4,P4,'*','color','r')
xlabel('Volume(m^3)')
ylabel('Pressure(Pa)')
legend('Isentropic Compression','Constant Volume Heat Addition','Isentropic Expansion','Constant Volume Heat Rejection')
title('P-V Diagram of Otto Cycle')

Explanation of Code

1.Start the program with clear all, close all and clc

2.Input all the engine geometric parameters

3.The Swept volume and clearance volume are calculated using the inputs provided

4.A function ‘piston_kinematics’ is created to calculate the variation of volume inside the cylinder with different crank angle

5.The state variables at state point 2,3 and 4 are calculated using the isentropic and ideal gas equations.

6.The above created function is called in the compression and expansion state points

7.Plotting the PV diagram and calculating the thermal efficiency of otto cycle using the formula

Plot

Errors Obtained:Simple errors were obtained and were rectified easily.

Result:

Conclusion: Code to solve an otto cycle was written and P-V diagram was obtained .The Thermal efficiency of the engine was also calculated and was found to be around 56.47%.

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.

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.