VAPOUR POWER CYCLE - ENTHALPY -ENTROPY TEMP-ENTROPY DIAGRAM
clear all
close all
clc
disp(\'RANKINE CYCLE SIMULATOR\');
disp(\'PROCESS 1-2: Isentropic Expansion in the turbine\');
disp(\'PROCESS 2-3: Constant Pressure Heat Rejection by the Condenser\');
disp(\'PROCESS 3-4: Isentropic Compression in the Pump\');
disp(\'PROCESS 4-1: Constant Pressure Heat Addition by the Boiler\');
p1=input(\'Enter the Pressure at the Turbine Inlet(in bar):\');
t1=input(\'Enter the temperature at the Turbine Inlet(in degree Celcius):\');
p2=input(\'Enter the Pressure at the Condenser(in bar):\');
%Turbine inlet values of temp, entropies
tsat=XSteam(\'Tsat_p\',p1);
sf1=XSteam(\'sL_p\',p1);
sg1=XSteam(\'sV_p\',p1);
if t1>tsat
tsup=t1;
h1=XSteam(\'h_pT\',p1,tsup);
s1=XSteam(\'s_pT\',p1,tsup);
elseif t1==tsat
h1=XSteam(\'hL_p\',p1);
s1=XSteam(\'sL_p\',p1);
else
disp(\'Temperature entered must be greater than or equal to saturation temperature\')
end
% Inlet values at condenser
t2=XSteam(\'Tsat_p\',p2);
hf2=XSteam(\'hL_p\',p2);
hg2=XSteam(\'hV_p\',p2);
s2=s1;
sg2=XSteam(\'sV_p\',p2);
sf2=XSteam(\'sL_p\',p2);
x2=(s2-sf2)/(sg2-sf2);
h2=hf2+(x2*(hg2-hf2));
%Exit values at condensor
p3=p2;
t3=t2;
h3=hf2;
s3=sf2;
% Inlet values to Boiler
p4=p1;
s4=s3;
cp4=XSteam(\'Cp_ps\',p4,s4);
cv4=XSteam(\'Cv_ps\',p4,s4);
gamma=cp4/cv4;
t4=t3*(p4/p3)^((gamma-1)/gamma);
vf=XSteam(\'vL_p\',p3);
wp=vf*(p1-p2)*100;
h4=wp+h3;
wt=h1-h2;% work output from turbine
Qin=h1-h4;%heat input
Qout=h2-h3;%heat output
wnet=wt-wp; %net work
therm_efficiency=(wnet/Qin)*100;% thermalefficiency
ssc=3600/wnet;%specific fuel consumption
%plotting of T-S and H-S diagram
%T-S diagram
figure(1)
hold on
%plotting saturation lines
temp = linspace(1, 373, 500);
for i = 1 : length(temp)
hl(i) = XSteam(\'hL_T\', temp(i));
hv(i) = XSteam(\'hV_T\', temp(i));
sl(i) = XSteam(\'sL_T\', temp(i));
sv(i) = XSteam(\'sV_T\', temp(i));
end
plot(sl, temp, \'k\', \'linestyle\',\'-\',\'linewidth\', 1.5)
plot(sv, temp, \'k\', \'linestyle\',\'-\',\'linewidth\', 1.5)
xlabel(\'Specific Entropy (kJ/kgK)\')
ylabel(\'Temprature (degC)\')
title(\'T-S diagram\');
plot([s1 s2 s3 s4 sf1 sg1],[t1 t2 t3 t4 tsat tsat],\'color\',\'g\',\'linewidth\', 1.5)
text(s1,t1,\'1\')
text(s2,t2,\'2\')
text(s3,t3-10,\'3\')
text(s4,t4+10,\'4\')
t=linspace(tsat,tsup,1000);
for j =1:length(t)
sp(j) = XSteam(\'s_pT\',p1,t(j));
end
plot(sp,t,\'color\',\'g\',\'linewidth\', 1.5);
%H-S diagram
figure(2)
hold on
title(\'H-S diagram\');
plot(sl, hl, \'r\',\'linestyle\',\'-\', \'linewidth\', 1.5)
plot(sv, hv, \'r\',\'linestyle\',\'-\', \'linewidth\', 1.5)
plot([s1 s2 s3 s4 s1], [h1 h2 h3 h4 h1], \'color\', \'black\',\'linewidth\', 1.5);
text(s1,h1,\'1\')
text(s2,h2,\'2\')
text(s3,h3-100,\'3\')
text(s4,h4+100,\'4\')
ylabel(\'Specific Enthalpy (kJ/kg)\')
xlabel(\'Specific Entropy (kJ/kgK)\')
%output
%at state 1
disp(\'RESULTS\');
disp(\'At State point 1:\');
fprintf(\'P1 is : %.2f Bar\',p1);
fprintf(\'nT1 is : %.2f Deg Celcius\',t1);
fprintf(\'nH1 is : %.2f kJ/kg\',h1);
fprintf(\'nS1 is : %.2f kJ/kgKrn\',s1);
%at state 2
disp(\'At State point 2:\');
fprintf(\'P2 is : %.2f Bar\',p2);
fprintf(\'nT2 is : %.2f Deg Celcius\',t2);
fprintf(\'nH2 is : %.2f kJ/kg\',h2);
fprintf(\'nS2 is : %.2f kJ/kgKrn\',s2);
%at state 3
disp(\'At State point 3:\');
fprintf(\'P3 is : %.2f Bar\',p3);
fprintf(\'nT3 is : %.2f Deg Celcius\',t3);
fprintf(\'nH3 is : %.2f kJ/kg\',h3);
fprintf(\'nS3 is : %.2f kJ/kgKrn\',s3);
%at state 4
disp(\'At State point 4:\');
fprintf(\'P4 is : %.2f Bar\',p4);
fprintf(\'nT4 is : %.2f Deg Celcius\',t4);
fprintf(\'nH4 is : %.2f kJ/kg\',h4);
fprintf(\'nS4 is : %.2f kJ/kgKrn\',s4);
fprintf(\'Wt is : %.2f kJ/kg\',wt);
fprintf(\'nWp is : %.2f kJ/kg\',wp);
fprintf(\'nWnet is : %.2f kJ/kg\',wnet);
fprintf(\'nNtherm is : %.2f Percent\',therm_efficiency);
fprintf(\'nS.S.C is : %.2f kg/kWh\',ssc);
TEMPERATURE ENTROPY DIAGRAM:
ENTHALPY ENTROPY DIAGRAM:
RANKINE CYCLE SIMULATOR
PROCESS 1-2: Isentropic Expansion in the turbine
PROCESS 2-3: Constant Pressure Heat Rejection by the Condenser
PROCESS 3-4: Isentropic Compression in the Pump
PROCESS 4-1: Constant Pressure Heat Addition by the Boiler
Enter the Pressure at the Turbine Inlet(in bar):45
Enter the temperature at the Turbine Inlet(in degree Celcius):350
Enter the Pressure at the Condenser(in bar):6
RESULTS
At State point 1:P1 is : 45.00 BarnT1 is : 350.00 Deg CelciusnH1 is : 3081.47 kJ/kgnS1 is : 6.52 kJ/kgKrn
At State point 2:P2 is : 6.00 BarnT2 is : 158.83 Deg CelciusnH2 is : 2650.78 kJ/kgnS2 is : 6.52 kJ/kgKrn
At State point 3:P3 is : 6.00 BarnT3 is : 158.83 Deg CelciusnH3 is : 670.50 kJ/kgnS3 is : 1.93 kJ/kgKrn
At State point 4:P4 is : 45.00 BarnT4 is : 235.05 Deg CelciusnH4 is : 674.79 kJ/kgnS4 is : 1.93 kJ/kgKrn
Wt is : 430.69 kJ/kgn
Wp is : 4.29 kJ/kgn
Wnet is : 426.40 kJ/kgn
Ntherm is : 17.72 Percentn
S.S.C is : 8.44 kg/kWh