Project

Air standard cycle simulation using MATLAB

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 MATLAB.

Software used: Octave

Introduction:

OTTO CYCLE-

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; however, these are often omitted in a simplified review.
PROCESS OF OTTO CYCLE AND IT'S P-V DIAGRAM:
The different processes are described by-
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.
BASIC ENGINE GEOMETRIC PARAMETERS:
Bore - engine cylinder diameter
TDC - top dead centre
BDC- bottom dead centre
Stroke- distance between TDC and BDC
Vc - combustion chamber volume
Vs - swept volume
Vt - total volume cylinder
Vt/Vc- compression ratio.
BASIC FORMULAE USED:
COMPRESSION RATIO:
It is defined as the sum of the volume clearance and the volume swept by the volume clearance. It is expressed as-
Cr = V swept + V clearance / V clearance
TOTAL VOLUME CYLINDER:
It refers to the total volume of the cylinder in which (Otto cycle) takes place.
Total cylinder volume= Vc + Vs
V1=V4
VOLUME SWEPT:
v= (3.14)/4*d^2*l
where d----> bore of the cylinder
l-----> stroke of the cylinder
STROKE VOLUME:
It is the difference between the total cylinder volume and the clearance volume.
Stroke Volume, vs= total cylinder volume - clearance volume
CLEARANCE VOLUME:
The minimum volume of the space inside the cylinder at the end of the compression stroke is called clearance volume.
V2=Vc
THERMAL EFFICIENCY:
CODE :
Subprogram for a function-
First, we have to define a function named as engine kinematics.
function [V] = engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)
    a= stroke/2;
    r= con_rod/a;
    
    v_swept=pi/4*bore^2*stroke;
    v_c=v_swept/(cr-1);
    
    theta=linspace(start_crank,end_crank,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;
end
Program for plotting P-V diagram and thermal efficiency of Otto Cycle:
clear all 
close all
clc

%inputs
gamma=1.4;
t3=2300;

%state variables
p1=101325;
t1=500;

%engine geometric parameters 
bore=0.1;
stroke=0.1;
conrod=0.15;
cr=12;

%calculating the swept volume and the clearnce volume 
v_swept=(pi/4)*bore^2*stroke;
v_clearnce=v_swept/(cr-1);
v1=v_swept+v_clearnce;
v2=v_clearnce;

%state variables at point 2

%p2v2^gamma=p1v1^gamma
%p2=p1*(v1/v2)^gamma=p1*cr^gamma
p2=p1*cr^gamma;

%p1v1/t1=p2v2/t2
%t2=p2*v2*t1/(p1*v1)
t2=p2*v2*t1/(p1*v1);

constant_c=p1*v1^gamma;
V_compression=engine_kinematics(0.1,0.1,0.15,12,180,0);
p_compression=constant_c./V_compression.^gamma;

%state variables at state point 3
v3=v2;

%p3v3/t3= p2v2/t2 ; p3=p2*t3/t2
p3=p2*t3/t2;

constant_c=p3*v3^gamma;
V_expansion=engine_kinematics(0.1,0.1,0.15,12,0,180);
p_expansion=constant_c./V_expansion.^gamma;

%state variables at sate point 4
v4=v1;

%p3v3^gamma=p4v4^gamma ; p4=p3(v3/v4)^gamma
p4=p3*(v3/v4)^gamma;

%thermal efficiency
thermal_efficiency=1-[(1/cr^(gamma-1))];

figure(1)
hold on
plot(v1,p1,'*','color','r')
plot(V_compression,p_compression)
plot(v2,p2,'*','color','r')
plot(v3,p3,'*','color','r')
plot(V_expansion,p_expansion)
plot(v4,p4,'*','color','r')
plot([v2 v2],[p2 p3])
plot([v4 v4],[p4 p1])
xlabel('V')
ylabel('P')
EXPLANATION OF THE CODE:
Firstly, we have to define the inputs like bore, stroke, connecting rod, compression ratio, gamma, temp and pressure at state point 1 and temp at state point 3. Then, by using the ideal gas equation, we can find the other values of pressure, temperature and volume at different state points. Now, we can plot the P-V diagram, but the plot will not be smooth. To get an accurate P-V diagram, we have to use engine kinematics. Therefore, we have to define a function called engine kinematics, by doing so we can change the angle and find the actual volume in the engine. In the main code, we now call the engine kinematics function, to find the different values of volume at different angles of compression and expansion. Now, we get accurate values of pressure, temperature and volume at different state points from 1-4.
OUTPUT:
CONCLUSION:
The program to plot the P-V diagram is executed and the thermal efficiency of the otto cycle is also calculated.
Thermal efficiency is 62.98 %
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.