Simulation of Otto Cycle using MATLAB
AIM :
To Simulate the Otto Cycle using MATLAB
THEORY :
Otto Cycle
An Otto Cycle is a gas power cycle that is used in spark-ignition internal combustion engines ( modern petrol engines ). This cycle was introduced by Dr. Nikolaus August Otto, a German Engineer.
Internal Combustion Engine
An Internal Combustion Engine [ IC engine ] is a heat engine where the combustion of the air-fuel mixture occurs inside the combustion chamber that produces high temperature and high gas pressure. This gas pressure pushes the piston over a distance and transforms the chemical energy into thermal energy which is used for performing the mechanical work.
An Otto Cycle consists of four processes :
- Two isentropic ( reversible adiabatic ) processes
- Two isochoric ( constant volume ) processes
These processes can be easily understood if we understand p-V ( Pressure-Volume ) diagram of the Otto cycle.
p-V Diagram of Otto Cycle :
Total volume = Swept Volume + Clearance Volume
Swept Volume
Swept Volume is volume between top dead centre and bottom dead centre. As piston moves from one dead centre to another it sweeps this volume, so it is called swept volume. It is also called displacement volume. Which is mentioned in unit CC ( Cubic Centimeter ).
`V_S = π/4 × d^2 ×l`
`V_S =` Total Volume - Clearance Volume `= V_1- V_2`
Clearance Volume
Clearance volume is volume left above top dead centre. This is the volume left when piston reaches it's topmost point. It tells how much original volume has been compressed.
`V_C = V_2`
Compression Ratio ( r )
`r = (Total Volume)/(Cl earance Volume)`
`r = V_1/V_2 = V_4/V_3`
Processes in Otto Cycle :
As stated earlier, the Otto Cycle consists of four processes. They are as follows :
Process 1-2: Isentropic Compression
In this process, the piston moves from the bottom dead center ( BDC ) to top dead center ( TDC ) position. Air undergoes reversible adiabatic ( Isentropic ) compression. We know that compression is a process in which volume decreases and pressure increases. Hence, in this process, the volume of air decreases from V1 to V2 and pressure increases from p1 to p2.
For this process, the relation between T and V is as follows :
`T_2/T_1 = (V_1/V_2 )^(γ-1) = r^(γ-1)`
`T_2 = T_1 × r^(γ-1)`
Process 2-3: Constant Volume Heat Addition
Process 2-3 is isochoric ( constant volume ) heat addition process. Here, piston remains at the top dead centre for a moment. Heat is added at constant volume ( V2 = V3 ) from an external heat source. Temperature increases from T2 to T3 and pressure increases from p2 to p3.
In this process,
Heat Supplied = mCv(T3 – T2)
where,
m → Mass
Cv → Specific heat at constant volume
Process 3-4: Isentropic Expansion
In this process, the piston moves from the top dead center ( TDC ) to bottom dead center ( BDC ) position. Air undergoes reversible adiabatic ( Isentropic ) expansion. Here, pressure decreases from p3 to p4, volume rises from V3 to V4, the temperature falls from T3 to T4 and entropy remains constant ( s3 = s4 ).
The relation between T and V in this process is similar to the relation between T and V in process 1-2 :
`T_3/T_4 = (V_4/V_3 )^(γ-1) = r^(γ-1)`
`T_3 = T_4 × r^(γ-1)`
Process 4-1: Constant Volume Heat Rejection
The piston rests at BDC for a moment and heat is rejected at constant volume ( V4 = V1 ). In this process, the pressure falls from p4 to p1 and temperature decreases from T4 to T1.
In this process,
Heat Rejected = mCv(T4 – T1)
Thermal Efficiency ( Air-Standard Efficiency ) of Otto Cycle,
`η` `= (Heat Supplied - Heat Rejected )/(Heat Supplied)`
`η` `=1 - ((T_4 - T_1 ) )/((T_3 - T_2 ) )`
`η` `=1 - ((T_4 - T_1 ) )/((T_4 r^(γ-1) - T_1 r^(γ-1) ) )`
`η` `=1 - ((T_4 - T_1 ) )/((T_4 - T_1 ) (r)^(γ-1) )`
`η` `=1 - 1/(r)^(γ-1)`
Combined Gas Law :
Combined gas law is a combination of Boyle's Law and Charles' Law. The relationship between pressure, volume, and absolute temperature are all present in the combined gas law. It is written mathematically as :
`(PV)/T = k` (constant)
The following equation shows the relationship between the Crank angle and Volume inside the I.C Engine Combustion Chamber :
`V/V_C =1 + 1/2 (r-1)[ R +1-cosθ- (R^2- sin^2θ )^(1/2) ]`
where,
V = Volume inside cylinder when piston is at an angle .
R = Ratio of length of connecting rod to crank pin radius ( a ).
Crank pin radius ( a ) = stroke length ( l ) / 2
OBJECTIVE :
- Write a Program to Plot the PV - diagrams of the Otto Cycle for different compression ratios.
- Find the Thermal Efficiencies of the Otto Cycle for different compression ratios.
MAIN CODE :
close all
clear
clc
% Inputs
gamma = 1.4;
T3 = 2500;
% State Variables at State point 1
p1 = 100000;
T1 = 500;
% Engine Geometric Parameters
bore = 0.2;
stroke = 0.2;
con_rod_length = 0.25;
j = 6;
for i = 1:4
r = j;
% Calculating the Swept Volume and Clearance Volume
Vs = (pi/4) * bore^2 * stroke;
Vc = Vs / (r - 1);
v1 = Vc + Vs;
v2 = Vc;
% State Variables at State point 2
% p2v2^gamma = p1v1^gamma | p2 = p1*(v1/v2)^gamma = p1*(r)^gamma
p2 = p1 * (r) ^ gamma;
% p1v1/T1 = p2v2/T2 | T2 = p2v2T1 / (p1v1)
T2 = p2 * v2 * T1 / (p1 * v1);
constant_c = p1 * v1^gamma;
V_compression = Engine_Kinematics(bore,stroke,con_rod_length,r,180,0);
P_compression = constant_c ./ ((V_compression).^gamma);
% State Variables at State point 3
v3 = v2;
% p3v3/T3 = p2v2/T2 | p3 = p2T3/T2
p3 = (p2 * T3) / T2;
constant_c = p3 * v3^gamma;
V_expansion = Engine_Kinematics(bore,stroke,con_rod_length,r,0,180);
P_expansion = constant_c ./ ((V_expansion).^gamma);
% State Variables at State point 4
v4 = v1;
% p3v3^gamma = p4v4^gamma | p4 = p3(v3/v4)^gamma
p4 = p3 * (v3 / v4)^gamma;
% p3v3/T3 = p4v4/T4 | T4 = p4v4T3 / (p3v3)
T4 = p4 * v4 * T3 / (p3 * v3);
% Plotting
figure(i)
hold on
plot(V_compression,P_compression,'linewidth',2,'color','b')
plot([v3 v2],[p3 p2],'linewidth',2,'color','r')
plot(V_expansion,P_expansion,'linewidth',2,'color','black')
plot([v4 v1],[p4 p1],'linewidth',2,'color','magenta')
xlabel('Volume [ m^3 ]','linewidth',4)
ylabel('Pressure [ N/m^2 ]','linewidth',4)
grid on
title('p-V Diagram of Otto Cycle')
legend('Isentropic Compression','Constant Volume Heat Addition','Isentropic Expansion','Constant Volume Heat Rejection')
% Thermal Efficiency
Thermal_Efficiency = 1 - (1/r^(gamma-1))
j = j + 2;
end
Explanation
Step 1 : Defined all the Inputs.
All known engine geometric parameters such as bore diameter, stroke length, connecting rod length, compression ratio and state variables such as pressure at state point 1, temperature at state point 1 and state point 3 were defined.
Step 2 : Then, the swept volume and clearance volume were calculated.
Step 3 : With the help of Isentropic formulas of process 1-2 and 3-4, all the state variables were calculated.
Step 4 : Now, we got all the four-points of the p-V diagram but for understanding how the volume changes at every crank angle inside the engine cylinder, we defined a function called Engine_Kinematics which calculates the volume for Isentropic processes at every crank angle.
FUNCTION CODE :
function V = Engine_Kinematics(bore,stroke,con_rod_length,cr,start_crank,end_crank)
a = stroke / 2;
R = con_rod_length / a;
% Calculating the Swept Volume and Clearance Volume
Vs = (pi/4) * bore^2 * stroke;
Vc = Vs / (cr - 1);
% Change in Volume inside the Cylinder
theta = linspace(start_crank,end_crank,180);
V = Vc .* (1 + 0.5 * (cr - 1) * (R + 1 - cosd(theta) - (R.^2 - sind(theta).^2).^0.5));
end
Step 5 : For this function, bore diameter, stroke length, connecting rod length, compression ratio and crank angle were given as arguments.
The above diagram shows how the volume changes with respect to crank angle when the piston moves from the top dead center ( TDC ) to bottom dead center ( BDC ) position.
Step 6 : Then, the function was called into the main program to find out V_compression, P_compression, V_expansion and P_expansion.
Step 7 : Then, the p-V diagrams for different compression ratios were plotted by the help of for loop.
Step 8 : And then, the Thermal Efficiencies for different compression ratios were also calculated.
RESULTS :
p-V Diagrams of Otto Cycle :
p-V diagram for compression ratio 6 :
p-V diagram for compression ratio 8 :
p-V diagram for compression ratio 10 :
p-V diagram for compression ratio 12 :
In the above p-V diagrams we can see that for heat addition and heat rejection process, the volume is constant but for the Isentropic processes, the volume is changing with respect to pressure.
Workspace Values :
Thermal Efficiencies for different Compression Ratios :
|
Compression Ratio |
Thermal Efficiency |
|
6 |
51.16 % |
|
8 |
56.47 % |
|
10 |
60.19 % |
|
12 |
62.99 % |
CONCLUSION :
From the above experiment we got to know that the thermal efficiency depends on the compression ratio. So it can be concluded that engines with a higher compression ratio will have high thermal efficiency.
Air standard cycles are ideal cycles based on lot of assumptions. In reality the modern petrol engines have a maximum thermal efficiency of about 20% to 35% when used to power a car.