Deisel 12
Deisel 12
clc
% fprintf('------Date------------programmer------\n');
% fprintf('---------------------------------------\n');
%% Ideal Cycle Simulation(ICS) ############
%--------Name--abrham worku ----id 0140/13----------------############
% fprintf('---------------------------------------\n');
% calculate p, V, T values at the end of each processof the cycle
%the thermal efficiency
%the mean effective pressure
fprintf('----------INPUT PARAMERS ARE-------------\n');
fprintf('-----------Enter B: 110-----------------\n');
fprintf('-----------Enter S: 80------------------\n');
fprintf('-----------Enter cr: 15------------------\n');
fprintf('-----------Enter Cp: 1.004---------------\n');
fprintf('-----------Enter Cv: 0.717 -------------\n');
fprintf('-----------Enter P1: 1-------------------\n');
fprintf('-----------Enter r: 15-------------------\n');
fprintf('-----------Enter T1:100----------------- \n');
%Inputs
B=input('Enter B: ');
S=input('Enter S: ');
r=input('Enter r: ');
cr=input('Enter cr: ');
Cp=input('Enter Cp: ');
Cv=input('Enter Cv: ');
T1=input('Enter T1: ');
P1=input('Enter P1: ');
phi=3.141;
%calculate
Vdisp = (phi/4)*B^2*S*10^-3;
% TELL USER
fprintf('Vdisp = %.3f \n',Vdisp);
%calculate
Vbdc=r/(r-1)*Vdisp;
% TELL USER
fprintf('Vbdc = %.3f \n',Vbdc);
%calculate
Vtdc=Vbdc-Vdisp;
% TELL USERfprintf('Vtdc = %.3f \n',Vtdc);
T1 =500;
V1=Vbdc;
k=1.4;
%calculate
P2 = P1*r^k;
fprintf('P2 = %.3f \n',P2);
%calculate
T2=T1*(r^(k-1));
fprintf('T2 = %.3f \n',T2);
V2=Vtdc;
fprintf('V2 = %.3f \n',V2);
%At point 3 (at the end of heat transfer):
fprintf('point 3 (at the end of heat transfer)\n');
fprintf('P2 = %.3f \n',P2);
rc =4 ;
T3=rc*T2;
fprintf('T3 = %.3f \n',T3);
V3=rc*V2;
fprintf('V3 = %.3f \n',V3);
fprintf('At point 4 (end of expansion \n');
V4=V1;
P3=P2;P4=P3*(V3/V4)^k;
fprintf('P4 = %.3f \n',P4);
T4=T3*(V3/V4)^(k-1);
fprintf('T4 = %.3f \n',T4);
V4 = Vbdc;
fprintf('V4 = %.3f \n',V4);
Wexp = Cv*(T3 - T4);
fprintf('Wexp = %.3f \n',Wexp);
R=0.287;
Wcom=R*(T3 - T2);
fprintf('Wcom = %.3f \n',Wcom);Wcomp=Cv*(T2 - T1);
Hadd =Cp*(T3 - T2);
fprintf('Hadd = %.3f \n',Hadd);
fprintf('Wcomp = %.3f \n',Wcomp);
Wnet=Wexp + Wcom -Wcomp;
fprintf('Wnet = %.3f \n',Wnet);
EFF= Wnet/Hadd;
fprintf('EFF = %.3f \n',EFF);meanEFF =(Wnet/Vdisp)*(P1*V1/R*T1);
fprintf('meanEFF = %.3f \n',meanEFF);
C1=P1*V1^(1.4);
for k=1:1001
V(k)=V1+(k-1)*(V2-V1)/1000;
P(k)=C1*(V(k)^-1.4);
end
comet(V,P);
hold on
for k=1:1001
V(k)=V2+(k-1)*(V3-V2)/1000;
P(k)=P(1001);
end
comet(V,P);
hold on
C2=P(1001)*V3^(1.4);
for k=1:1001
V(k)=V3+(k-1)*(V1-V3)/1000;
P(k)=C2*(V(k)^-1.4);
end
comet(V,P);
hold on
P4=P(1001);
for k=1:1001
V(k)=V(1001);
P(k)=P4+(k-1)*(P1-P4)/1000;
end
comet(V,P);
xlabel('volume V');
ylabel('pressure P');
title('diesil cycle');