Rankine Cycle Using MATLAB
AIM:
To simulate Rankine cycle using the MATLAB
1-2 The fluid is pumped to the boiler at high pressure and it is isentropic process
2-3 Heat is supplied on the fluid through the boiler
3-4 The fluid is expanded through isentropically through the turbine
4-1 Heat is rejected through the condenser
Code for rankine cycle
clear all
close all
clc
p1=44;
p2=5.83;
t1=538;
tsat=XSteam('Tsat_p',p1);
h1=XSteam('h_pt',p1,t1);
s1=XSteam('s_pt',p1,t1);
s2=s1;
sf2=XSteam('sL_p',p2);
sg2=XSteam('sV_p',p2);
x2=(s2-sf2)/(sg2-sf2)
if x2==1
h2=XSteam('hV_p',p2)
t2=XSteam('Tsat_p',p2);
hf2=XSteam('hL_p',p2)
elseif x2>1
t2=XSteam('Tsat_p',p2)
h2=XSteam('h_ps',p2,s2)
hf2=XSteam('hL_p',p2)
else
t2=XSteam('T_ps',p2,s2);
hf2=XSteam('hL_p',p2);
hg2=XSteam('hV_p',p2);
h2=hf2-(x2*(hg2-hf2))
end
t3=t2;
s3=sf2;
h3=hf2;
t5=tsat;
h5=XSteam('hL_p',p1);
s5=XSteam('sL_p',p1);
h6=XSteam('hV_p',p1);
s6=XSteam('sV_p',p1);
s4=s3
p4=p1
p3=p2
h4=XSteam('h_ps',p4,s4)
%t4=XSteam('T_ps',p4,s4)
cp=XSteam('Cp_ps',p4,s4)
cv=XSteam('Cv_ps',p4,s4)
ac=cp/cv
t4=t3*((p4/p3)^((ac-1)/ac))
t=linspace(10,374,500);
for i=1:length(t)
s(i)=XSteam('sL_t',t(i));
S(i)=XSteam('sV_t',t(i));
h(i)=XSteam('hL_t',t(i));
H(i)=XSteam('hV_t',t(i));
end
a=linspace(tsat,t1,500);
for i=1:length(a)
d(i)=XSteam('s_pt',p1,a(i));
end
b=linspace(t4,t5,50);
figure(1)
plot(s,t)
hold on
plot(S,t)
plot([s1,s2],[t1,t2])
plot([s2,s3],[t2,t3])
plot([s3,s4],[t3,t4])
plot([s5,s4],[t5,t4])
axis([1,10,100,600])
plot([s5,s6],[t5,tsat])
plot(d,a)
xlabel('ENTROPHY')
ylabel('TEMPERATURE')
figure(2)
plot(s,h)
hold on
plot(S,H)
plot([s1,s2],[h1,h2])
plot([s2,s3],[h2,h3])
plot([s3,s4],[h3,h4])
plot([s4,s5,s6,s1],[h4,h5,h6,h1])
xlabel('ENTROPHY')
ylabel('ENTHALPHY')
wt=h1-h2
wp=h4-h3
wnet=wt-wp
qs=h1-h4
eff=wnet/qs
ssc=3600/wnet
Initially, XSTEAM file is downloaded. After assigning the initial value we have to find the saturation temperature at point 1 so that we have checked the initial temperature is less than TSAT or greater than the TSAT.
If it is less than the TSAT we have to find the properties in the liquid state. If it is greater than the TSAT we have to find the properties in the vapour state
1-2 is the isentropic process both states have the same entropy and to find the dryness fraction in point 2 using entropy formula and based on the value we have to assume the point 2 state and to find the properties at the point 2
2-3 is the heat rejection process. At point 3 state is a saturated liquid state so the property of a fluid is taken from the liquid region
3-4 is the isentropic process and to find the t4 value we have to find cp and cv at point 4 and using the adiabatic formula we get t4 and then corresponding state points are calculated
To obtain the saturation curve we have to find the saturation value for all temperatures in liquid and vapour state and we plot the result. Thus we get the plot on the saturated curve
By using the formula we have to find the turbine work, pump work, efficiency of cycle and specific steam consumption
OUTPUT GRAPH
Command Window
THANK YOU