Write a program on DIESEL cycle using matlab and simulation
Program in MATLAB for simulation of air standard DIESEL cycle.
Objectives:-
- To study working on diesel cycle.
- To calculate thermal efficiency of cycle using state variables point.
- To plot graph pv diagram using state variables point.
Introduction:-
It is a combustion process of reciprocating IC engine. In it fuel is ignified by heat generated during the compression of air in the combustion chamber into whhich fuel is then injected.this is in contrast to igniting the air-fuel mixture with a spark plug as in the otto cycle. Diesel engine are used in aircraft, automobiles, power generation, diesel electric locomotive, and both surfacr ships and submarines.
Theory:-
This process is ideal, combustion is replaced by heat addition to the air, and exhaust is replaced by a heat rejection process which restores the air to the initial state.
Process 1-2 is the adiabatic compression process. In this process temperature of the air increases during the compression process and with a large compression ratio it will reach the ignition temperature of the injected fuel.
Process 2-3 is the contant pressure process. its also known as isobaric process. In this process the burnt gasses are simply exhausted and replaced by a fresh charge of air.
Process 3-4 is the adiabatic expansion process. In this process ithe inside air is expand and then the power will be generated mixture of air-fuel piston goes down.
Process 4-1 is the constant volume process. In this process heat is removed from the system by flushing out the combusted gases.
Some Formulaes using in program:-
1] Compression ratio (Cr) :-
`Cr = frac{v1}{v2}` , where v1 & v2 = volume at state point 1 & state point 2.
2] Cut off ratio (COr) :-
`COr = (Cr-1)*cut off+1` Or `COr = frac{v3}{v2}`
where v2 & v3 = volume at state point 2 & 3.
3] Swept volume (Vs) :-
`Vs = pi/4*D^2*L` ,
where D = diameter of cylinder or Bore of cylinder
L = length of stroke.
4] Clearance volume (Vc) :-
`Vc = frac{Vs}{Cr-1}`
5] Thermal Efficiency (Nth) :-
`Nth = 1-frac{1}{Cr^(gamma-1)}*[frac{COr^gamma-1}{gamma(COr-1)}]`
where gamma = cp/cv, constant of pressure and constant of volume = 1.4
COr = cut off ratio,
Cr = Compression ratio.
6] Total Volume (V) :-
`frac{V}{Vc} = 1+frac{1}{2}*(Cr-1)[R+1-cos theta-(R^2-sintheta^2)^(1/2)]`
where , R = ratio of connecting rod length to crank pin radius
`R = frac{Conrod}{a}`
where a = half of stroke length
`a = frac{L}{2}`
where L = stroke length.
Inputs:-
Bore of engine (D) = 0.20 (m)
Stroke length (L) = 0.30 (m)
Connecting rod (Conrod) = 0.42 (m)
Cut off = 8% = 8/100 = 0.08
Compression ratio (Cr) = 15
p1 = 1 (bar) = 1*10^5 (Pa)
t1 = 27 (C) = 27+273 = 300 (k)
gamma = 1.4
Process:-
- Start the program clearing all back data.
- Put all inputs and calculate swept volume, clearance volume, cut off ratio.
- Calculate all state variables point like pressure at point 2,3,4 and temp at point 2,3,4 using ideal gas law.
- Create function calculating of actual total volume of piston we call the func name as actual_volume which have one output variable and six geometric parameters which are defined.
- After calculation of actual total volume we can calculate compression and expansion volume for plotting the pv diagram.
- For the calculation of compression volume crank angle will be change in 180 to 0 same as expansion volume 0 to 180.
- After calculation all equation we can give plot command.
- Labeling x and y axis and give title name for graph.
Main code:-
clear all
close all
clc
%inputs
D = 0.20; %cylinder diameter or bore of cylinder in [m]
L = 0.30; %stroke length in [m]
conn_rod = 0.42; %Connecting rod length in [m]
Cr = 15; %Compression ratio
cutoff = 8/100;
%Calculate cut off ratio
%COr = cut off ratio
%cut_off = (COr-1)/(Cr-1)
%COr-1 = (Cr-1)*Cutoff
COr = (Cr-1)*cutoff+1;
gamma = 1.4; %cp/cv constant
%State variables
p1 = 1*10^5; %pressure at point 1 in [pascal]
t1 = 27+273; %temp at point 1 in [kelvin]
%Calculate Swept Volume & Clearance Volume
Vs = pi/4*D^2*L; %swept volume
Vc = Vs/(Cr-1); %clearance volume
%Isentropic compression process
%State variables at point 1-2
v1 = Vs+Vc;
constant = p1*v1^gamma;
V_comp = prac(D,L,Cr,conn_rod,180,0);
P_comp = constant./V_comp.^gamma;
%Constant pressure heat addition process
%state variables at point 2-3
v2 = Vc;
%p2*v2^gamma = p1*v1^gamma
%Cr = v1/v2
p2 = p1*(Cr)^gamma;
%t2/t1 = (v2/v2)^(gamma-1)
t2 = t1*(v2/v1)^(gamma-1);
%state variables at point 3-4
%COr = v3/v2
v3 = COr*v2;
p3 = p2; %pressure at point 2 & 3 are remains same
%t3/t2 = v3/v2
t3 = t2*(COr);
constant = p3*v3^gamma;
V_exp = prac(D,L,Cr,conn_rod,0,180);
for i = 1:length(V_exp);
if V_exp(i)<v3;
V_exp(i)=v3;
end
end
P_exp = constant./V_exp.^gamma;
%state variables at point 4-1
v4 = v1; %volume at point 1 & 4 are remains same
%p3*v3^gamma = p4*v4^gamma
p4 = p3*(v3/v4)^gamma;
%t4/t3 = (v4/v3)^(gamma-1)
t4 = t3*(v4/v3)^(gamma-1);
%efficiency of diesel cycle [Nth]
%Nth = 1-(1/gamma*(Cr)^(gamma-1))*[COr^gamma-1/COr-1]
term1 = 1/(gamma*(Cr)^(gamma-1));
term2 = (COr^gamma-1)/(COr-1);
N = 1-term1*term2
Nth = N*100
%plotting
hold on
plot(v1,p1,'*','color','k')
plot(V_comp,P_comp,'color','k')
text(v1,p1,'State 1','color','g')
plot(v2,p2,'*','color','k')
text(v2,p2,'State 2','color','g')
plot(v3,p3,'*','color','k')
plot(V_exp,P_exp,'color','k')
text(v3,p3,'State 3','color','g')
plot(v4,p4,'*','color','k')
text(v4,p4,'State 4','color','g')
line([v2 v3],[p2 p3],'color','k')
line([v4 v1],[p4 p1],'color','k')
title('PV Diagram "Diesel Cycle"')
xlabel('Volume')
ylabel('pressure')
Function code:-
%clear all
%close all
%clc
function V = prac(D,L,Cr,conn_rod,start_crank,end_crank)
%D = 0.20; %bore
%L = 0.30; %stroke
%Cr = 15; %compression ratio
%conn_rod = 0.42; %connecting rod
a = L/2;
R = conn_rod/a;
theta = linspace(start_crank,end_crank,100);
%calculate swept volume and clearance volume
Vs = (pi/4)*D^2*L;
Vc = Vs/(Cr-1);
%calclute formula
%V/Vc = 1+0.5*(Cr-1)[(R+1-cosd(theta)) - (R^2-sin(theta)^2)^0.5]
term1 = 0.5*(Cr-1);
term2 = R+1 - cosd(theta);
term3 = (R^2 - sind(theta).^2).^0.5;
V = (1+term1*(term2-term3)).*Vc;
end
Generated PV diagram:-

Result:-
As we calculated all equations and we get thermal efficiency of diesel cycle engine is 59.77%.
Conclusion:-
The efficiency of diesel cycle engine is increased by increasing compression ratio.
Thank you,
Dharmesh Bonde