Project

Otto cycle Analysis

In this project, I have used some data for the air standard cycle or Otto cycle and wrote a program to plot the PV diagram and find out the efficiency of the same. Program code is given below -

close all
clear all
clc

%input 
gamma = 1.4;
T3 = 2300;

%state variable 1
P1 = 101325;
T1 = 500;

%engine geometeric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;

%calculating the swept and clearence volume
v_swept = stroke*(pi/4)*bore^2;
v_clearence = v_swept/(cr-1);

V1 = v_clearence + v_swept;
V2 = v_clearence;

%state variable 2
%P2*V2^gamma = P1*V1^gamma = constant
P2 = P1*cr^gamma;

%values of presure and volume for process 1 to 2 for plot
constant_c1 = P1*V1^gamma;
V12 = engine_kinematics(bore, stroke, con_rod, cr, 180, 360);
P12 = constant_c1./V12.^gamma;

%By ideal gas equatoin = P*V/T = constant
T2 = P2*V2*T1/(P1*V1);

%state variable at state point 3
V3 = V2;
P3 = P2*T2/T3; %for isochoric process

%state variable at state point 4
V4 = V1;

%P3*V3^gamma = P4*V4^gamma
P4 = P3*(V3/V4)^gamma;

%values of presure and volume for process 3 to 4 for plot
constant_c2 = P3*V3^gamma;
V34 = engine_kinematics(bore, stroke, con_rod, cr, 0, 180);
P34 = constant_c2./V34.^gamma;

%thermal efficiecy of otto cycle = 1 - 1/cr^(gamma-1)
thermal_efficiecny = 1 - 1/cr^(gamma-1);
fprintf("Thermal efficiency of otto cycle is %d\n", thermal_efficiecny)

figure(1)
hold on
plot(V12,P12)
plot(V34,P34)
plot([V1 V4], [P1 P4])
plot([V2 V3], [P2 P3])
xlabel('Volume')
ylabel('Pressure')

Also, there is a manual function called engine kinematics which takes bore diameter, stroke length, connecting rod length and compression ratio as inputs with start and end angles and gives an output of an array with 100 values of volume of the cylinder at 100 different angles between the start and end angle. The code for this function is given below-

function [V] = engine_kinematics(bore, stroke, con_rod, cr, theta_start, theta_end)
%this function take bore diameter(bore), stroke length(stroke), connecting
%rod length(con_rod) and compression ratio as inputs with start and end
%angle and give output an array of volume of cylinder at different values

%engine geometeric parameters
a = stroke/2;
R = con_rod/a;

%calculating the swept and clearence volume
v_s = stroke*(pi/4)*bore^2; %swept volume
v_c = v_s/(cr-1);   %clearence volume

%for making 100 values between start and end angle
theta = linspace(theta_start, theta_end,100);

%equation for calculating value of volume at an angle theta
%V = v_c.*(1 + 0.5*(cr-1)*(R + 1 - cos(theta) - sqrt(R^2 - sin(theta).^2)));
%above equation is divided into 3 terms
term1 = 0.5*(cr-1);
term2 = R + 1 - cosd(theta);
term3 = sqrt(R^2 - sind(theta).^2);

%calculation of volume v with the help of term1, term2 and term3
V = v_c.*(1 + term1*(term2 - term3));

end

Working - For the program we have given Temperature after combustion(T3) and heat capacity ratio(gamma) as inputs. Pressure, Temperature, and Volume at point 1(i.e. before compression at BDC) and engine parameters like bore diameter, stroke length, compression ratio, etc are known to us. From the given information, we have calculated pressure, volume, and temperature at each stage of the cycle, i.e. after compression(P2, V2, and T3), after combustion(P3, V3, and T3) and after expansion(P4, V4, and T4). Also, from point 1 to 2, and from point 3 to 4 we have calculated values of pressure and volume between them for plotting. At last, it will calculate the efficiency of the Otto cycle and plot the PV diagram for it.

For the function which gives an output of an array with the volume of a cylinder at different angles, it only uses a formula to calculate volume from given geometric data of engine and angle value.

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.