OTTO CYCLE
AIM:
- To determine the efficiency of the otto cycle and to plot P-V diagram of Otto cycle.
INTRODUCTION:
Otto Cycle is an idealized thermodynamic cycle that describes the functioning of a petrol engine.It is also called as constant volume cycle because the combustion takes place at constant volume.The typical otto cycle is depicted in the following figure.
OBJECTIVES:
- To understand the Otto cycle and find the state co-ordinates .
- To write a matlab program to illustrate the otto cycle.
- To Plot a P-V diagram for otto cycle usimg Matlab.
- To determine the efficiency of otto cycle.
DESCRIPTION:
The various processes in otto cycle are:
- Process 1-2: Isentropic compression process where `p_1 v_1^γ=p_2 v_2^γ`
- process 2-3: Constant volume Heat Addition process where `v_2=v_3`
- process 3-4: Isentropic Expansion process where `p_3v_3^gamma=p_4v_4^gamma`
- process 4-1: Constant volume Heat Rejection process `v_4=v_1`
GOVERNING EQUATIONS:
In order to draw the plot we need to find the co-ordinates of the state points and then join them using the curved lines using the piston Kinematics equation.
In order to find the state points first we need to get the Engine parameters.
Let the Engine Specifications be as follows:
- Bore Diameter (d): 0.089 mm
- Stroke length (L): 0.0903 mm
- Connecting Rod Length (`L_c`): 0.15 mm
- Compression Ratio (`r_c`=`v_1/v_2`) : 10
- Ratio of specific heats (`γ=c_p/c_v`) : 1.4
Calculating the Swept and Clearance Volumes:
Swept Volume:It is the volume inside the cylinder for a given Stroke Length.It is given as,
`V_s` = `pi/4``d^2`L
Clearance Volume: It is the volume between the cylinder head and piston top when the piston is at BDC.It is given by,
`V_c` = `V_s/(r_c-1)`
TO FIND THE STATE CO-ORDINATES:
STATE 1:
`p_1`=1.01325 bar=101325 pascal(assumed for air).
`v_1`=`V_s+V_c`.
`t_1`=`500°K`
STATE 2:
`v_2=V_c`
Since 1-2 is a isentropic process, `p_1 v_1^γ=p_2 v_2^γ`
Therefore, `p_2=p_1 [v_1/v_2 ]^γ`
or `p_2=p_1r_c^gamma`
Applying Ideal gas equation ,`(p_1v_1)/t_1=(p_2v_2)/t_2`
Therefore, `t_2=(p_2v_2)/(p_1v_1)*t_1`
STATE 3:
`v_3=v_2=V_c`(Constant volume heat addition process 2-3)
`t_3=2300°k`
For a constant Volume process from 2-3, `p_2/t_2=p_3/t_3`
Therefore, `p_3=p_2*t_3/t_2`
STATE 4:
`v_4=v_1`(Constant volume Exhaust process)
Since process 3-4 is a Isentropic process, `p_3v_3^gamma=p_4v_4^gamma`
Therefore, `p_4=p_3 [v_3/v_4 ]^γ`
or `p_4=p_3/r_c^gamma`
PISTON KINEMATIC EQUATIONS:
In order to get a curved line between the state Co-ordinates we need to consider the variation of volume inside the cylinder of an IC Engine depending upon the crank angle(`theta`).This is given by the following equation:
`v/V_c=1+1/2(r_c-1)[R+1-costheta-(R^2-sin^2theta)^(1/2)]`
where,
`v` = Instantaneous volume of air-fuel mixture inside the cylinder
R = Ratio of Crankpin Radius to Length of Connecting Rod =`a/L_c`
a = Crankpin Radius=`L/2`
`theta`= Crank angle
EFFICIENCY OF OTTO CYCLE:
The efficiency of an otto cycle is given by,
`eta=1-1/r_c^(gamma-1)`
where `eta` is Efficiency
MATLAB PROGRAM TO PLOT P-V DIAGRAM FOR OTTO CYCLE:
clear all
close all
clc
% Engineparameters
% bore
d=0.089;
% stroke
L=0.0903;
% Length of connecting Rod
Lc=0.15;
% compression ratio
cr=10;
% Ratio of specific heats
gamma=1.4;
% swept volume
v_s=3.14*d^2*L;
% clearance volume
v_c=v_s/(cr-1);
%state variables
% STATE 1
p1=101325;
t1=500;
v1=v_s+v_c;
% Finding the constant
c=p1*v1^gamma;
v_compression=Engine_kinematics(L,Lc,cr,v_c,180,0);
p_compression=c./(v_compression.^gamma);
% STATE 2
v2=v_c;
p2=p1*cr^gamma;
% IDEAL GAS EQUATION p2v2/t2=p1v1/t1
t2=(p2*v2/(p1*v1))*t1;
% STATE 3
v3=v2;
t3=2300;
% CONSTANYT VOLUME PROCESS(p2/t2=p3/t3)
p3=p2*t3/t2;
% constant c1
c1=p3*v3^gamma;
v_expansion=Engine_kinematics(L,Lc,cr,v_c,0,180);
p_expansion=c1./(v_expansion.^gamma);
% STATE 4
v4=v1;
p4=p3/cr^gamma;
% Plotting the state points
hold on;
plot(v1,p1,'*');
plot(v_compression,p_compression,'linewidth',2,'color',[0.9856 0.7372 0.2537]);
plot(v2,p2,'*');
plot(v3,p3,'*');
line([v2 v3],[p2 p3],'linewidth',2,'color',[0.9 0 0.1]);
plot(v_expansion,p_expansion,'linewidth',2,'color',[0.0265 0.6137 0.8135]);
plot(v4,p4,'*');
line([v4 v1],[p4 p1],'linewidth',2,'color',[0 0 0]);
xlabel('Pressure(P)');
ylabel('Volume(V)');
%Efficiency of the Otto cycle
eff= (1-1/cr^(gamma-1))*100
In the above program it includes a function called Engine_Kinematics to draw a curved line .This function includes the piston Kinematic equations and inputs various parameters such as the range of crank angle,stroke length,clearance volume, connecting rod length and compression ratio.The Matlab function is given below.
function [v]=Engine_kinematics(L,Lc,cr,v_c,start_crank,end_crank)
% Crank pin Radius
a=L/2;
% Value of theta
theta=linspace(start_crank,end_crank,180);
% Value of R
R=Lc/a;
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
EXPLANATION:
The above program is written in Matlab.The program is explained through the following steps:
- Initializing the recquired variables depending on the given Engine parameters like bore,stroke etc.
- Determine the swept and clearance volume using the appropriate formulae.
- Find the state variables like pressure,volume and Temperature at the corresponding state points.
- Plot the state point 1.
- At state 1, The piston will be at BDC and hence `theta` will be `180°` .After state 1 the piston starts moving towards TDC and hence `theta` varies from `180°` to `0°`.For all these values of crank angle the variation of volume inside the cylinder need to be calculated. Hence we introduce the new function into the program to implement the piston kinematic equations.The value of crank angle ranges as : start_crank`<= theta<=`end_crank where start_crank and end_crank are the crank angles at the start and end of the process.
- Creating a function Engine_kinematics that takes various inputs such as stroke length, connecting rod length, compression ratio, range of crank pin angle .This output from the function is the volume matrix.
- Calling the function from the main program and assigning the output from the function to a variable called V_compression.
- For all the values of V_compression, the P_compresion values are found out using the appropriate formula.
- A graph of P_compression v/s V_compression is plotted and a curved line is obtained.
- Now, the state point 2 is calculated and the point is plotted.
- Process 2-3 is a constant volume process and hence we must get a straight line parallel to y-axis.
- A line is drawn using the line command .
- At state 3 ,The piston will be at TDC. After state 3 the piston starts to move from TDC to BDC Hence `theta` changes from `0° to 180°`.
- This range of `theta` is given as an input while calling the function for second time.
- Process 2-3 is called as Expansion process and hence the output from the function is stored in the variable V_expansion.
- For all the values of V-expansion matrix ,the pressure matrix P_expansion is calculated.
- A graph of P_expansion v/s V_expansion is plotted and a curved line is obtained.
- The state point 4 is calculated and plotted.
- Process 4-1 is a constant volume expansion process and hence we get a straight line parallel to y-axis.
- Thus otto cycle is plotted.
- Since we are using a plot function we need to use the command 'hold on' because if we don't use this ,only the last plot will be visible since plot command shows only the last or recent plot.
- After all this we still need to find the efficiency of the otto cycle.
- This is calculated using the appropriate formula and displayed in the output screen.
- The output and the plot of P-V diagram for the otto cycle is given below.
OUTPUT:
eff =
60.1893
ERRORS OCCURED:
- One of the error that I have faced is that I had executed the code without using the command 'hold on' command.When I did this I got the plot as follows.
This indicates that the hold command holds the previous plot and if we don't use that we will be getting only the last state point plotted and the line is displayed by line command.
CORRECTION : Use hold on;
- The second major and Basic error that I have got is displaying clear all ,close all and clc before the function that is:
Error in otto_cycle (line 26)
v_compression=Piston_Kinematics(L,Lc,cr,v_c,180,0);
If we display clear all,close all and clc above the function then the function will not be having any input parameters .It is explained as follows:
As when the control executes the function call statement in main program the main program calls the function by sending some values .But if we have clear all,close all and clc commands in the begining of the function then the input parameters for the function get vanished and hence the function does not return any valid output to the main program.
CORRECTION: Avoid using clear all,close all and clc at the begining of the function.
The following points must be strictly considered while dealing with functions:
- The function name and the name in which the function is saved should be same.
- The function name should satisfy the rules for naming the file name.
- The function should be called by sending the exact number of input parameters that the function recquires.
- The main program and the function should be saved in the same folder.
CONCLUSION:
Thus the recquired Objectives are achieved and the P-V Diagram is plotted for the otto cycle based on the Engine parameters and Efficiency is found out as `60.1893%`
FURTHER IMPROVEMENTS:
The Project can be further improved to T-S diagrams and even for Diesel Engine Cycle.