Project

Solving air standard cycle/ Otto cycle using MATLAB

An Otto cycle is a thermodynamic cycle that describes the ideal the functioning of a spart ignition engine. This cycle is commonly represented on a PV Diagram. The cycle starts from state 1, follows isoentropic compression process to reach state 2, and then follows an isochoric process(consant volume) to reach state 3, then follows an isoentripic expansion process to reach state 4 and finally isochoric process to reach back to state 1. A typical PV diagram for the otto cycle is shown:

In this project, the entire otto cycle is evaluated using MATLAB to find the PV plots and calculate the thermal efficiency of the cycle.

The code to evaluate the otto cycle is given. The state variables at state 1, the adiabatic index 'gamma' and the temperature (in Kelvin )after combustion at state 3 are the input variables.

% air standard cycle/otto cycle and finding thermal efficiency
clear all
close all
clc
%inputs
gamma=1.4;  %defining the adiabic index
t3=2800; % temperature at the end of combustion as input

% engine geometric parameters
bore= 0.1;  % bore diameter of the cyclinder
stroke=0.1; % stroke length of the piston inside cylinder
con_rod=0.15; % connecting rod length
cr=12     % compression ratio


% calculating the swept volume and clearance volume
v_swept=(pi/4)*stroke*bore^2; % Calculate the swept volume by the piston
v_clearance= v_swept/(cr-1);  % the clearance volume for the cylinder


%state variable at state 1
p1=101325; % intitial given parameter values.
t1=500;
v1=v_swept+v_clearance; % the total volume at state 1 is the sum of clearance and swept volume


% state variables at point 2

p2=p1*(cr)^gamma; % using the isoentropic law p1*v1^gamma=p2*v2^gamma
v2=v_clearance;
t2=p2*v2*t1/(p1*v1);  %using the ideal gas law, p1*v1/t1= p2*v2/t2

constant_c=p1*v1^gamma; % defining the constant of the isoentropic process
V_compression=engine_kinematics(bore,stroke,con_rod,cr,180,0); % calling the defined function of engine_kinematics
p_compression=constant_c./V_compression.^gamma; %finding the compression pressure value for the first isoentropic process

% state variables at point 3
v3=v2;
p3=p2*(t3/t2);   %using the ideal gas law, p2*v2/t2= p3*v3/t3

constant_c2=p3*v3^gamma;
V_expansion=engine_kinematics(bore,stroke,con_rod,cr,0,180);
p_expansion=constant_c2./V_expansion.^gamma;


% state variables at point 4
v4=v1;
p4=p3*(v3/v4)^gamma

figure(1)
hold on % hold on command to plot all the plots in a single figure(1)
plot(v1,p1,'*','color','r')  %plot the point of first state
text(v1,p1, 'v1,p1') % labelling the state 1 points as(v1,p1)
plot(V_compression,p_compression,'color','r') % plot the isoentropic curve from state 1 to 2
plot(v2,p2,'*','color','r') %%plot the point of second state
text(v2,p2, 'v2,p2')

plot([v2 v3],[p2 p3]) % plotting the isochoric process (straight line) from state 2 to state 3
plot(v3,p3,'*','color','r')%plot the point of third state
text(v3,p3, 'v3,p3')
plot(V_expansion,p_expansion) % plot the second isoentropic curve from state 3 to state 4
plot(v4,p4,'*','color','r') % plot the point of fourth state
text(v4,p4, 'v4,p4')

plot([v4 v1],[p4 p1]) % plotting the isochoric process (straight line) from state 4 to state 1

xlabel('volume')
ylabel('pressure')
% calculating the thermal efficiency of the standard air cycle
thermal_efficiency=1- (1/(cr)^(gamma-1))

The PV plot is shown.

State 1 to state 2 represents the compression process by piston, it follows the isoentropic process given by the equation: `PV^gamma=text{constant}`

State 2 to state3 represents heat addition process by spark ignition at constant volume, ideal gas law equation is followed given by: `frac{PV}{T}=text{constant}`

State 3 to state 4 represents the combustion or power stroke, then state 4 to state 1 is heat release at constant volume to reach the initial stage again.

The thermal efficiency of the cycle is calculated using the formula:

`eta=1-frac{1}{text{(cr)}^{gamma-1}`

Here cr is the compression ratio.

The value of thermal efficiency comes out to be approximately 0.63 or 63%.

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.