Project

Calculation of thermal efficiency of Otto Cycle & obtain P-V plot using Matlab program

Aim- Matlab program for the PV plot and calculation for thermal efficiency of Otto Cycle

Theory-

Otto Cycle - Otto Cycle is a idealized thermodynamic cycle, that describes the functioning of a typical spark ignition piston engine. The Otto cycle is the name of the cycle used in spark ignition internal combustion engine such as hydrogen and gasoline fuelled automobile engine. The Otto cycle consists of following processes-
1. Process 0-1 a mass of air is drawn into piston/cylinder arrangement at constant pressure.
2. Process 1-2 is an adiabatic(isentropic) compression of the charge as the piston moves from bottom dead centre(BDC) to top dead centre(TDC)
3. Process 2-3 is a constant volume heat addition to the working gas from an external source while the piston is at top dead centre. This process is intended to represent the ignition of the fuel-air mixture & the subsequent rapid burning.
4. Process 3-4 is a adiabatic(isentropic) expansion (power stroke).
5. Process 4-1 completes the cycle by a constant-volume process in which heat is rejected from the air while the piston is at bottom dead centre.
6. Process 1-0 the mass of air is released th the atmosphere in a constant pressure proces

Efficiency of the cycle- The theoretical efficiency of the Otto cycle deoends on the compression ratio and the specific heat ratio γ of the gas in the combustion chamber.
Compression ratio(r) is the ratio of the volume of the cylinder & the combustion chamber when the piston is at the bottom, & the volume of the combustion chamber when the piston at the top.For better fuel efficiency & fuel economy automobiles are to be designed with higher compression ratio. However, the compression ratio of Otto cycle engines is limited by the need to prevent the uncontrolled combustion known as knocking. Modern engines have compression ratio in the range of 8 to 11, resulting in ideal efficiency of 56% to 61%.
r = Vmax/Vmin = V1/V2
Specific Heat Ratio(γ) of a gas is the ratio of specific heat at constant pressure Cp to the specific heat at constant volume Cv.
γ = Cp/Cv

Matlab Program

% Matlab Program of Otto Cycle 
clear all
close all
clc
%Inputs
gamma = 1.4;
t3 = 2600;
%State Variables
p1 = 101325;
t1 = 400;
%Engine Geometric Parameters 
bore = 0.1;
stroke = 0.2;
con_rod = 0.20;
cr = 12;
% Calculating swept volume & clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
v1= v_swept + v_clearance;
v2 = v_clearance;

% State Variables at state point 2
p2 = p1*cr^gamma;
t2 = p2*v2*t1/(p1*v1);
constant_c = p1*v1^gamma;
V_compression = Piston_Kinematics(bore,stroke,con_rod,cr,0,180);

P_compression = constant_c./V_compression.^gamma;

% State Variables at state 3
v3 = v2;
p3 = p2*t3/t2;

constant_c = p3*v3^gamma;
V_expansion = Piston_Kinematics(bore,stroke,con_rod,cr,0,180);
P_expansion = constant_c./V_compression.^gamma;

% State Variables of state point 4
v4 = v1;
p4 = p3*(v3/v4)^gamma;
t4 = p4 * cr* t3/p3;

%Thermal Efficiency
Thermal_efficiency = 1-(1/(cr-1)^(gamma-1));

% Plotting of otto cycle
figure(1)
hold on 
plot(v1,p1,'color','r')
plot(V_compression,P_compression,'color','r')
plot(v2,p3,'color','r')
plot(v3,p3,'color','r')
plot([v2,v3],[p2,p3],'color','b')
plot(V_expansion,P_expansion,'color','g')
plot(v4,p4,'color','r')
plot([v4,v1],[p4,p1],'color','k')
grid on
title('P-V Diagram of Otto Cycle')
xlabel('Volume (m^3)')
ylabel('Pressure (Pa)')

For the function used in the script

function [V] = Piston_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(0,180,100)
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 of code:
1. First of all give all inputs , state variables and Engine parameters.
2. Than define the formula of the swept volime and clearance volume.
3. Give the relation between V1 & V2, and define the state inputs of point 2.
4. Than define the function Piston_Kinematics in the function subscript & save it.
5. with the help of this function define compression, and than define the state points of state 3 using property equation & mention them in comments.
6. similarly define the expamsion with the help of same function & give the state points of state 4.
7. Mention the thermal efficiency formula.
8. Now using plot command write the variables, color of line and title of the plot.
9. now save the program & run thr program.
10. Record the output plot displayed and find out thermal efficiency by entering Thermal_efficiency in the command window.

Results- The above program generates the following plots

Conclusion
1. The thermal efficiency was calculated to be 61.68%.
2. P-V diagram clearly shows that changes in isentropic processes are a curve not a straight line.

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.