Project

Otto Cycle (Air Standard Cycle)

AIM:

To write a MATLAB code for Otto Cycle associated with IC engines to find out the PV diagram and thermal efficiency of the engine.

INTRODUCTION:

An Otto Cycle is an idealized thermodynamic cycle which is used in spark ignition piston engines. In this cycle, there are four different thermodynamic processes involved:

1->2 : Isentropic Compression;

2->3 : Isochoric Heat Addition;

3->4 : Isentropic Expansion;

4->1 : Isochoric Heat Rejection.

This cycle is being used in petrol engines. Other than the processes stated, there are some other processes like suction, exhaust etc.,

PROCEDURE:

1. A MATLAB code is written to perform the mathematical calculations and for finding state points in the thermodynamic cycle for a given set of engine parameters and initial conditions.

2. A PV diagram is plotted to see a graphical representation of the state variables and the curves connecting the state points that represent the type of thermodynamic processes.

3. The thermal efficiency of the Otto Cycle is calculated by using standard mathematical formula.

INITIAL CONDITIONS:

1. Initial Temperature (`T_1`) = 400 K

2. Initial Pressure (`P_1`) = 1 bar

3. Compression Ratio (CR) = 9.5

4. Ratio of Specific Heats (`gamma`) = 1.4

IMPORTANT FORMULAE INVOLVED:

1. `P*V^gamma = const`

2. `T*V^(gamma-1) = const`

3. Swept Volume = `pi/4 * d^2 * l`

4. Clearance Volume = Swept Volume / (CR-1)

5. Instantaneous Volume = Clearance Volume * (`1 + 1/2 (CR-1) *(R + 1 - costheta - sqrt(R^2 - sintheta^2))`)

6. Thermal Efficiency = `1 - 1/(CR)^(gamma-1)`

CODE EXPLANATION:

1. The engine parameters and the initial conditions are used to calculate the numerical value for the state point variables. The necessary formula is used to calculate each and every variable's value.

%Otto_Cycle_Piston_Kinematics
clear all
close all
clc

%Input values
gamma = 1.4;

%Engine geometry parameters
bore = 0.2;
stroke = 0.2;
con_rod = 0.25;
cr = 9.5;

V_swept = (pi/4)*bore^2*stroke;
V_clearance =  V_swept/(cr-1);


%State variables at state 1
P1 = 101325;
T1 = 400;
V1 = V_swept + V_clearance;

constant_c1 = P1*V1^gamma;


%State variables at state 2
P2 = P1*cr^gamma;
V2 = V_clearance;

T2 = T1 * cr^(gamma-1);

V_Compression = Engine_Kinematics(bore, stroke, con_rod, cr, 180, 0);
P_Compression = constant_c1./V_Compression.^gamma;


%State variables at state 3
P3 = 40*P1;
V3 = V2;

T3 = P3*(T2/P2);

%State variables at state 4
V4 = V1;
P4 = P3 / cr^gamma;
T4 = T3/cr^(gamma-1);

constant_c2 = P3*V3^gamma;

V_Expansion = Engine_Kinematics(bore, stroke, con_rod, cr, 0, 180);
P_Expansion = constant_c2./V_Expansion.^gamma;


figure(1)
plot(V1,P1,'r*');
hold on;
plot(V2,P2,'r*');
plot(V_Compression,P_Compression);
plot(V3,P3,'r*');
plot([V2,V3],[P2,P3]);
plot(V4,P4,'r*');
plot(V_Expansion,P_Expansion);
plot([V4,V1],[P4,P1]);
grid on;
hold off;

%Thermal efficiency in percentage
thermal_efficiency = (1 - 1/cr^(gamma-1))*100;

FUNCTION TO CALCULATE INSTANTANEOUS VOLUME:

A separate function is created to find out the instantaneous volumes from given starting crank angle to ending crank angle. This function is called into the main program by a function calling statement.

function [V] = Engine_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(start_crank, end_crank, 100);

term1 = 0.5*(cr - 1);
term2 = R + 1 -cosd(theta);
term3 = (R^2 - sind(theta).^2).^0.5;

V = V_c*(1 + term1.*(term2 - term3));

end

THE STATE POINT VARIABLES AND OTHER VALUES AS CALCULATED:

Thermal Efficiency of the Otto Cycle for the given initial conditions and engine parameters is `59.3640%`

PV DIAGRAM:

ERRORS ENCOUNTERED:

No errors were encountered in the process of writing the code other than an error that occured because I tried to run the function alone.

CONCLUSION:

Hence the objective of finding the PV diagram and thermal efficiency for the Otto Cycle is achieved.

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.