Project

RANKINE-CYCLE

1) Main Program

close all
clear all
clc

disp(\'1-2 is Isentropic Expansion in the Turbine\')
disp(\'2-3 is Constant Pressure Heat Rejection by the Condenser\')
disp(\'3-4 is Isentropic Compression in the Pump\')
disp(\'4-1 is Constant Pressure Heat Addition by the Boiler\')
disp(\'   \')
p1=input(\'Enter the Pressure at the Turbine Inlet in Bar: \');
t1=input(\'Enter the Temperture at the Turbine Inlet(in degree celcius): \');
p2=input(\'Enter the Pressure at Condenser in Bar: \');
disp(\'    \')

%state 1
disp(\'At State point 1\')


h1=XSteam(\'h_pT\',p1,t1);

s1=XSteam(\'s_pT\',p1,t1);
fprintf(\'P1 is : %2.3f Bar \\n\',p1);                        %p1
fprintf(\'T1 is : %2.3f Degree Celcius \\n\',t1);             %t1
fprintf(\'H1 is : %2.3f kJ/kg \\n\',h1);                      %h1
fprintf(\'S1 is : %2.3f kJ/kg \\n\',s1);                      %s1

disp(\'    \')

%state 2
disp(\'At State point 2\')

s2=s1;

t2=XSteam(\'T_ps\',p2,s2);
h2=XSteam(\'h_ps\',p2,s2);



fprintf(\'P2 is : %2.3f Bar \\n\',p2);                        %p2
fprintf(\'T2 is : %2.4f Degree Celcius \\n\',t2);             %t2
fprintf(\'H2 is : %2.3f kJ/kg \\n\',h2);                      %h2
fprintf(\'S2 is : %2.3f kJ/kg \\n\',s2);                      %s2
disp(\'   \')

%state 3
disp(\'At State point 3\')
p3=p2;
t3=t2;

s3=XSteam(\'sL_T\',t3);
h3=XSteam(\'hL_T\',t3);



fprintf(\'P3 is : %2.3f Bar \\n\',p3);                        %P3
fprintf(\'T3 is : %2.3f Degree Celcius \\n\',t3);             %t3
fprintf(\'H3 is : %2.3f kJ/kg \\n\',h3);                      %h3
fprintf(\'S3 is : %2.3f kJ/kg \\n\',s3);                      %s3

disp(\'   \')

%state 4
disp(\'At State point 4\')
p4=p1;
s4=s3;
h4=XSteam(\'h_ps\',p4,s4);
t4=XSteam(\'T_ps\',p4,s4);
fprintf(\'P4 is : %2.3f Bar \\n\',p4);                        %P4
fprintf(\'T4 is : %2.3f Degree Celcius \\n\',t4);             %t4
fprintf(\'H4 is : %2.3f kJ/kg \\n\',h4);                      %h4
fprintf(\'S4 is : %2.3f kJ/kg \\n\',s4);                      %s4

disp(\'   \')



%Work calculation



wt=h1-h2;
wp=h3-h4;
wnet=wt+wp;
ntherm=(wnet/(h1-h4));
ssc=3600/(h1-h2);
fprintf(\'Work done by Turbine is: %2.3f \\n\',wt); 
fprintf(\'Work supplied to the Compressor is: %2.3f \\n\',abs(wp)); 
fprintf(\'Net Work done is: %2.3f \\n\',wnet); 
fprintf(\'Net efficiency is: %2.3f or %2.3f percent \\n\',ntherm,ntherm*100);
fprintf(\'Specific Steam Consumption is: %2.3f [kg/kW.hr]\',ssc);
disp(\'  \')

%plot
%T-S Diagram
figure(1)
tsat1=linspace(0,1000,1000);

for i=1:length(tsat1)
ss1(i)=XSteam(\'sL_T\',tsat1(i));
end

for j=1:length(tsat1)
ss2(j)=XSteam(\'sV_T\',tsat1(j));
end

snet=[ss1 ss2];
plot(ss1,tsat1,\'b\')
hold on
plot(ss2,tsat1,\'r\')
hold on

plot(s1,t1,\'g*\')
hold on
plot(s2,t2,\'g*\')
hold on
plot(s3,t3,\'g*\')
hold on
plot(s4,t4,\'g*\')
hold on


axis([-1 max(snet)+1 -10 700])


srsatl=XSteam(\'sL_p\',p1);
srsatv=XSteam(\'sV_p\',p1);
trsatl=XSteam(\'Tsat_p\',p1);
trsatv=XSteam(\'Tsat_p\',p1);


hold on

plot([s1 s2 s2 s3 s3 s4 s4 srsatl srsatl srsatv srsatv s1],[t1 t2 t2 t3 t3 t4 t4 trsatl trsatl trsatv trsatv t1],\'k\',\'linewidth\',3)
title(\'Temperature-Entropy Diagram\',\'fontsize\',20)
xlabel(\'Entropy [kJ/kgK]\')
ylabel(\'Temperature(C)\')


%H-S Diagram

figure(2)

for i=1:length(tsat1)
hh1(i)=XSteam(\'hL_T\',tsat1(i));
end

for j=1:length(tsat1)
hh2(j)=XSteam(\'hV_T\',tsat1(j));
end

hnet=[hh1 hh2];
plot(ss1,hh1,\'b\')
hold on
plot(ss2,hh2,\'r\')
axis([-1 max(snet)+1 -10 7000])
xlabel(\'Entropy [kJ/kgK]\')
ylabel(\'Enthalpy[kJ/kg]\')
hold on
hsat1=XSteam(\'hV_p\',p1);
hsat2=XSteam(\'hL_p\',p1);
plot([s1 s2 s2 s3 s3 s4 s4 srsatl srsatl srsatv srsatv s1],[h1 h2 h2 h3 h3 h4 h4 hsat2 hsat2 hsat1 hsat1 h1],\'k\',\'linewidth\',3)
hold on
plot(s1,h1,\'g*\')
hold on
plot(s2,h2,\'g*\')
hold on
plot(s3,h3,\'g*\')
hold on
plot(s4,h4,\'g*\')

title(\'Enthalpy-Entropy Diagram\',\'fontsize\',20)

Images

\"OUTPUT

\"OUTPUT

\"T-S

\"H-S

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.