Project

OTTO CYCLE P-V DIAGRAM PLOTTING & EFFICIENCY CALCULATION USING MATLAB

AIM: Plot P-V diagram of otto cycle using MATLAB programming.

OBJECTICES:

  • Write program to plot P-V diagram.
  • Calculate efficiency of otto cycle.

THEORY:

  • An otto clycle is used in the spark ignition combustion engine. The cycle basically uses Petrol (gasoline) as fuel. The cycle has following major processes to run any prime mover like vehicle.
  • The schematic of a typical otto cycle P-V diagram shown in following figure.

The processes includes:

1-2 → Isentropic Compression:

In this process the mixture of fuel and air is compressed from volume V1 to V2. By the compression the pressure and temperature increases.

2-3 → Constant Volume Heat Addition:

In this process the volume remains same and the spark is ignited to generate heat to burn the mixture.

3-4 → Isentropic Expansion:

In this process the piston expands from TDC to BDC and the volume decreases to V3. Likewise pressure and temperature also decreases.

4-1 → Constant Volume Heat Rejected:

In this process the volume remains constant and the heat is rejected from the engine cylinder. The pressure and temperature drops.

FORMULAS:

  • The engine geometric parameters are defined as

1) Bore Diameter = D

2) Stroke Length = L

3) Ratio of specific heats γ = 1.4

4) Compression Ratio = `r_c`

5) Swept Volume `V_s = pi/4D^2*L`

6) Clearance Volume `V_c = V_s/(r_c-1)`

Variables like Pressure, Volume and Temperatures can be calculated by following formulas:

1) `P_1`, `T_1` & `T_3` are to be known.

2) `V_1 = V_s+V_c`

3) `V_2 = V_c`

4) `P_2 = P_1*(V_1/V_2)^gamma`

5) `T_2 = (P_2*V_2*T_1)/(P_1*V_1)`

6) `V_3 = V_2`

7) `P_3 = P_2*(T_3/T_2)`

8) `V_4 = V_1`

9) `P_4 = P_3*(V_3/V_4)^gamma`

10) `T_4 = (P_4*V_4*T_3)/(P_3*V_3)`

Efficiency of the cycle:

`eta = 1-1/r_c^(gamma-1)`

BODY OF CONTENT:

  • The MATLAB used for programming the syntax of otto cycle.
clear all
close all
clc

%Program to simulate Otto Cycle
%I have picked one NPTEL Otto clycle problem data

%Inputs to the cycle
gamma = 1.4
%Highest Temperature of the cycle
T3 = 1373 %(K)

%Engine Geometric Parameters
%bore diameter (m^2)
D = 0.2
%Stroke length (m)
L = 0.15
%Connecting Rod length (m)
con_r = 0.3
%compression ratio
c_r = 7

%State 1 Variables
P1 = 100 %(kPa)
T1 = 308 %(K)

%Calculation of Swept volume 
V_s = (pi/4)*D^2*L

%Calculation of Clearance volume
V_c = V_s/(c_r-1)

V1 = V_s + V_c

%Trace of volume during compression
V_comp = engine_kinematics(D,L,con_r,c_r,180,0);
constant = P1*V1^gamma;
P_comp = constant./V_comp.^gamma;

%State 2 Variables
V2 = V_c
P2 = P1*(V1/V2)^gamma %from P1*V1^gamma = P2*V2^gamma
T2 = P2*V2*T1/(P1*V1) %from P1*V1/T1 = P2*V2/T2

%State 3 Variables
V3 = V2
P3 = T3*P2/T2 %from P2*V2/T2 = P3*V3/T3

%Trace of volume during expansion
V_exp = engine_kinematics(D,L,con_r,c_r,0,180);
constant = P3*V3^gamma;
P_exp = constant./V_exp.^gamma;

%State 4 Variables
V4 = V1
P4 = P3*(V3/V4)^gamma %from P3*V3^gamma = P4*V4^gamma
T4 = P4*V4*T3/(P3*V3) %from P3*V3/T3 = P4*V4/T4

%Calculation of Efficiency
disp('Efficiency of cycle')
H = [1-(1/(c_r^(gamma-1)))]*100;
disp(H)

%Plotting
figure(1)
hold on
plot(V1,P1,'*','color','r')
plot(V_comp,P_comp,'linewidth',3)
plot(V2,P2,'*','color','r')
plot([V2 V3],[P2 P3],'linewidth',3)
plot(V_exp,P_exp,'linewidth',3)
plot(V3,P3,'*','color','r')
plot([V4 V1],[P4 P1],'linewidth',3)
plot(V4,P4,'*','color','r')

axis([0 6*10^(-3) 0 3500])
xlabel('Volume')
ylabel('Pressure')
title('P-V diagram of Otto cycle')
  • In this program initially all the inputs are coded such as engine geometric parameters, known state variables.
  • The swept volume and clearance volume are formulated for calculation in programming.
  • Then the state variables at each state are defined and the syntax for their programming is written for calculation of particular variable.
  • A new function is to be developed for the tracing of the volume in the compression and the expansion process. The syntax for that function is given below.
%Defining function for getting volume trace in otto cycle
function [V] = engine_kinematics(D,L,con_r,c_r,start_crank,end_crank)

%where D = bore diameter
%      L = stroke length
%      con_r = connecting rod length
%      c_r = compression ratio
%      start_crank = starting angle of crank
%      end_crank = ending angle of crank

%Inputs
%crank pin radius
cp_r = L/2;
%ration of connecting rod length to crank pin radius
R = con_r/cp_r;

%Swept volume
V_s = (pi/4)*D^2*L;

%Clearance volume
V_c = V_s/(c_r-1);

%Crank angle range
theta = linspace(start_crank,end_crank,180);

%volume trace formula-> V = [1 + (1/2)*(c_r-1)*(R+1-cosd(theta)-(R^2-sind(theta)^2)^(1/2))]*V_c 
%The above formula is separated in three variables as menstioned below

A = 0.5*(c_r-1);
B = R+1-cosd(theta);
C = (R^2-sind(theta).^2).^0.5;

%the volume trace formula can be written as
V = (1 + A*(B - C)).*V_c;

end
  • After the trace is calculated the plotting of all the lines and traces is to done and the X & Y axis are to be labeled and the title to the graph is given.

OUTPUT:

The Efficiency of the cycle is calculated and the answer for that is 54.0843 %.

The plot of P-V diagram for otto cycle is given below:

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.