To draw PV diagram for otto cycle using MATLAB
AIM:
To find efficiency and draw PV diagram for otto cycle using MATLAB
GOVERNING EQUATIONS:
1.Volume at particular instance in the engine cylinder
V/Vc = 1 + ½ (rc - 1) [R + 1 – cos`theta`–(`R^2`-`sin^2theta)^0.5`
V = volume at particular instance in engine cylinder
Vc = clearance volume
rc = compression ratio
R = length of connecting rod/crank pin radius
`theta` = crank angle
2.Thermal efficiency of otto cycle
Efficiency = (work done/heat added)*100
OBJECTIVES OF THE PROJECT:
1.To make pv graph for otto cycle
2.To find thermal efficiency of the process
THEORY:
In this project we consider the thermodynamics of a four-stroke internal combustion engine. The engine is called a four-stroke engine because there are four movements, or strokes, of the piston during one cycle. A stroke refers to the full travel of the piston along the cylinder, in either direction. The four separate strokes are termed:
- Intake: The fuel is taken inside the engine cylinder.
- Compression: The air fuel mixture is compressed and a spark is ignited (heat addition).
- Combustion: Due to spark ignition combustion of the fuel takes place which results in a power stroke (expansion).
- Exhaust: This action expels the spent air-fuel mixture and the combustion products through the exhaust valve (heat rejection).
Processes involved in ideal otto cycle:
1.Process 1-2 is isentropic compression process in which piston moves from bottom dead centre (BDC) to top dead centre (TDC)
2.Process 2-3 is constant volume heat addition process while piston is at top dead centre
3.Process 3-4 is isentropic expansion process in which work done by system.
4.Process 4-1 is constant volume heat rejection process from air while piston is at bottom dead centre
PROGRAM:
programming language used : MATLAB
program for calculating state variables and plotting PV diagram for otto cycle:
clear all
close
clc
% engine geometric parameters
bore= 0.1; % bore diameter in metre
stroke = 0.1; % length of stroke in metre
con_rod = 0.15; % length of connecting rod in metre
cr = 12; % compression ratio v1/v2
% other input parameters
gamma = 1.4;
cv = 0.714;
cp = 1;
% calculating the swept volume and the clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
% state variabeles at state point1
p1 = 101325;
t1 = 500;
v1 = v_swept + v_clearance;
% starte variables at state point 2
% p2v2*gamma = p1v1^gamma | p2 = p1*(v1/v2)^gamma = p1*cr^gamma
p2 = p1*cr^gamma;
v2 = v_clearance;
% p1v1/t1 = p2v2/t2 | t2 = p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1);
constant_c = p1*v1^gamma;
v_compression = piston(bore, stroke, con_rod, cr, 180, 0)
p_compression = constant_c./v_compression.^gamma;
% state variable at state point 3
t3 = 2300;
v3 = v2;
% p3v3/t3 = p2v2 | p3 = p2*t3/t2
p3 = p2*t3/t2;
constant_c = p3*v3^gamma;
v_expansion = piston(bore, stroke, con_rod, cr, 0, 180)
p_expansion = constant_c./v_expansion.^gamma;
% state variable at state pint 4
v4 = v1;
% p3v3*gamma = p4v4*gamma | p4 = p3(v3/v4)gamma
p4 = p3*(v3/v4)^gamma;
t4 = p4*t1/p1;
% thermal efficiency of otto cycle
heat_added = cv*(t3-t2);
heat_rejected = cv*(t4-t1);
work_done = heat_added - heat_rejected;
thermal_efficiency = (work_done/heat_added)*100;
% plotting pv graph
hold on
process12 = plot(v_compression, p_compression, 'color', 'y', 'linewidth', 1);
plot([v2 v3],[p2,p3], 'color', 'g', 'linewidth', 1);
plot(v_expansion, p_expansion, 'color', 'r', 'linewidth', 1);
plot([v4 v1],[p4 v1], 'color', 'b', 'linewidth', 1);
xlabel('volume');
ylabel('pressure');
title('pv diagram for otto cycle');
text(v1,p1,'1');
text(v2,p2,'2');
text(v3,p3,'3');
text(v4,p4,'4');
Program for the function for determining the behavior of volume during isentropic process:
function [v_trace] = piston(bore, stroke, con_rod, cr, start_crank, end_crank)
% crank pin radius
a = stroke/2;
% ratio of connecting rod and crank pin radius
R = con_rod/a;
%calculating the swept volume and the clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
theta = linspace(start_crank,end_crank,100);
term1 = 0.5*(cr-1);
term2 = R+1-cosd(theta);
term3 = (R^2 - sind(theta).^2).^0.5;
v_trace = (1+ term1*(term2 - term3))*v_clearance;
end
EXPLAINATION OF THE PROGRAM:
- Program starts with taking in various engine geometric parameters inputs.
- Then the swept volume and clearance volume is calculated.
- After that the state variables are calculated at point-2 in the otto cycle , with help of the state variables at state 1.
- Using the ‘engine_kinematics’ function , behavior of volume during isentropic compression process is determined. And using this volume behavior the pressure behavior is also determined for the isentropic compression process (Process 1-2).
- Then state variables are calculated at point-3 and point-4 in the otto cycle , with help of the inputs.
- Again using the ‘engine_kinematics’ function , behavior of volume during isentropic expansion process is determined. And using this volume behavior the pressure behavior is also determined for the isentropic expansion process (Process 3-4).
- Thermal eciency is calculated using the formula.
- At the end we plot the four processes in the otto cycle.
RESULT:
The PV diagram for otto cycle:
Thermal efficiency displayed on command window:
CONCLUSION:
1.The efficiency of otto cycle is 62.9893%
2.We can observe pv diagram for otto cycle