Challenge

Project 2 - Rankine cycle Simulator

The Rankine cycle is an ideal cycle if water passes through the four components without irreversibilities and pressure drops. The ideal Rankine cycle consists of the following four processes, as shown on the T-s diagram on the right:

  • 1-2: Isentropic compression in a pump
  • 2-3: Constant pressure heat addition in a boiler
  • 3-4: Isentropic expansion in a turbine
  • 4-1: Constant pressure heat rejection in a condenser

All four components associated with the ideal Rankine cycle are steady-flow devices, and thus all four processes that make up the Rankine cycle can be analyzed as steady-flow process. The kinetic and potential energy changes of water are small relative to the heat and work terms, are thus neglected. Energy analysis of the four components are given below.

Pump (process 1-2): Pump pressurized the liquid water from the condenser prior to going back to the boiler. Assuming no heat transfer with the surroundings, the energy balance in the pump is

wpump, in = h2 - h1

Boiler (process 2-3): Liquid water enters the boiler and is heated to superheated state in the boiler. The energy balance in the boiler is

qin = h3 - h2

Turbine (process 3-4): Steam from the boiler, which has an elevated temperature and pressure, expands through the turbine to produce work and then is discharged to the condenser with relatively low pressure. Neglecting heat transfer with the surroundings, the energy balance in the turbine is

wturbine, out = h3 - h4

Condenser (process 4-1): Steam from the turbine is condensed to liquid water in the condenser. The energy balance in the condenser is

qout = h4 - h1

For the whole cycle, the energy balance can be obtained by summarizing the four energy equations above. It yields,

(qin- qout) - (wturbine, out - wpump, in) = 0

The thermal efficiency of the Rankine cycle is determined from

ηth = wnet ,out/qin = 1 - qout/qin

where the net work output from the cycle is

wnet ,out = wturbine, out - wpump, in

Application

PROGRAMM

close all
clear all
clc
fprintf('\n Rankine cycle \n')
fprintf('1-2 is isentropic expansion in turbine\n')
fprintf('2-3 is constant pressure heat removal process\n')
fprintf('3-4 is isentropic compression in pump\n')
fprintf('4-1 is constant pressure heat addition in boiler\n')
% Inputs Given
p1=30; %pressure at turbine inlet
T1=400; % Temp. at turbine inlet
p2=0.05; % pressure at condenser
% State-1 Data
h1=XSteam('h_pT',p1,T1); %Enthalpy at pressure & temp-1
S1=XSteam('s_pT',p1,T1); % Entropy at pressure and temp-1
%State-2 Data
S2=S1; %Because of Isentropic Expansion
Sf2=XSteam('sL_p',p2); %Saturated liquid entropy at pressure -2
Sg2=XSteam('sV_p',p2); % Saturated vapoure entropy at pressure-2
X2=(S2-Sf2)/(Sg2-Sf2); % vapour fraction at state-2
hf2=XSteam('hL_p',p2); %Saturated liquid enthalpy at pressure -2
hg2=XSteam('hV_p',p2); % Saturated vapoure enthalpy at pressure-2
h2=hf2+(X2*(hg2-hf2)); % Enthalpy at state -2
% State-3 Data
p3=p2 ; % Constant pressure heat removal process
S3=XSteam('sL_p',p3); % Saturated entropy at pressure-3
h3=XSteam('hL_p',p3); % Saturated Liquid enthalpy at-3
% state-4 data
S4=S3; % isentropic compression process
p4=p1; % constant pressure heat rejection
% Work done in turbine
W_T=h1-h2;
% Workdone on pump
V3=XSteam('vL_p',p3); %Saturated liquid vopour at pressure 3
W_P=V3*(p4-p3)*100; % workdone on pump
h4=h3-W_P; % Enthalpy at -4
% net workdone for Rankine cycle
W_net=W_T-W_P;
% Heat rejection from system
Q_out=h2-h3;
% Heat addition to system
Q_in=h1-h4;
% Thermal efficiency
T_eff=(W_net/Q_in)*100;
% Specific steam consumption= mass flow rate/net work done
Sp_S=(3600/W_net);
% Calculate temperature at all states
T3=XSteam('Tsat_p',p3); % saturated temp. at pressure-3
T2=T3; % because of constant pressure heat addition
Cp4=XSteam('cp_ps',p4,S4); %specific isobaric heat capacity
Cv4=XSteam('cv_ps',p4,S4); %specific isochoric heat capacity
gamma=Cp4/Cv4;
T4=T3*((p3/p4)^((1-gamma)/gamma)); % temp. at-4
% other constant
T6=XSteam('Tsat_p',p1); %satuated temp at p1
S5=XSteam('sL_p',p1); %saturated liquid entropy at p1
S6=XSteam('sV_p',p1); % Saturated vapour entropy at p1
h5=XSteam('hL_p',p1); % Saturated liquid enthalpy at p1
h6=XSteam('hV_p',p1); % Saturated vapour enthalpy at p1
T5=T6;
% plotting for saturation line
T=linspace(1,560,1000);
for i=1: length(T)
Sf(i)=XSteam('sL_T',T(i)); % saturated Liquid entropy
Sg(i)=XSteam('sV_T',T(i)); % saturated vapour entropy
hf(i)=XSteam('hL_T',T(i)); % saturated Liquid enthalpy
hg(i)=XSteam('hV_T',T(i)); % saturated vapour enthalpy
end
%plotting T-S diagram for Rankine cycle
figure(1)
hold on
plot(Sf,T,'color','b','LineWidth',2)
plot(Sg,T,'color','b','LineWidth',2)
plot([S1 S2],[T1 T2],'Color','r','LineWidth',3)
plot([S2 S3],[T2 T3],'Color','r','LineWidth',3)
plot([S3 S4],[T3 T4],'Color','r','LineWidth',3)
plot([S4 S5],[T4 T5],'Color','r','LineWidth',3)
plot([S5 S6],[T5 T6],'Color','r','LineWidth',3)
S_1=linspace(S6,S1,1000);
for j=1:length(S_1);
Tc(j)=XSteam('T_ps',p1,S_1(j));
end
plot(S_1,Tc,'color','r','linewidth',3);
text(S1+0.1,T1,'1')
text(S2+0.1,T2,'2')
text(S3,T3-20,'3')
text(S4,T4+20,'4')
title('Temp. vs Entropy')
xlabel('Entropy (kj/kg-k)')
ylabel('Temp(Deg-celcius)')
legend('saturation curve')
%Plotting for H-S
figure(2)
hold on
plot(Sf,hf,'Color','b','LineWidth',2)
plot(Sg,hg,'Color','b','LineWidth',2)
plot([S1 S2],[h1 h2],'Color','r','LineWidth',3)
plot([S2 S3],[h2 h3],'Color','r','LineWidth',3)
plot([S3 S4],[h3 h4],'Color','r','LineWidth',3)
hc=linspace(h4,h5,100);
for k=1:length(hc);
S_c(k)=XSteam('S_ph',p1,hc(k));
end
plot(S_c,hc,'Color','r','LineWidth',3)
plot([S5 S6],[h5 h6],'color','r','LineWidth',3)
for l=1:length(S_1);
h_c(l)=XSteam('h_ps',p1,S_1(l));
end
plot(S_1,h_c,'Color','r','LineWidth',3)
text(S1+0.1,h1,'1')
text(S2+0.1,h2,'2')
text(S3,h3-100,'3')
text(S4,h4+100,'4')
title('Enthalpy vs Entropy')
xlabel('Entropy(kj/kg-k)')
ylabel('Enthalpy(kj/kg)')
legend('saturation curve')
% Displaying the results
% Value at state-1
disp('\n RESULTS \n')
disp ('At State-1')
fprintf('p1 is : %.2f Bar \n',p1);
fprintf('T1 is : %.2f Deg celcius \n',T1);
fprintf('h1 is : %.2f kj/kg \n',h1);
fprintf('S1 is : %.2f kj/kgk \n',S1);
fprintf('\n')
disp ('\n At State-2 \n')
fprintf('p2 is : %.2f Bar \n',p2);
fprintf('T2 is : %.2f Deg celcius \n',T2);
fprintf('h2 is : %.2f kj/kg \n',h2);
fprintf('S2 is : %.2f kj/kgk \n',S2);
fprintf('\n')
disp (' \n At State-3 \n')
fprintf('p3 is : %.2f Bar \n',p3);
fprintf('T3 is : %.2f Deg celcius \n',T3);
fprintf('h3 is : %.2f kj/kg \n',h3);
fprintf('S3 is : %.2f kj/kgk \n',S3);
fprintf('\n')
disp ('\n At State-4 \n')
fprintf('p4 is : %.2f Bar \n',p4);
fprintf('T4 is : %.2f Deg celcius \n',T4);
fprintf('h4 is : %.2f kj/kg \n',h4);
fprintf('S4 is : %.2f kj/kgk \n',S4);
fprintf('\n')
% Turbine work
fprintf('Wt is %.2f kj/kg \n',W_T);
% pump work
fprintf('Wp is %.2f kj/kg \n',W_P);
% Net Work
fprintf('Wnet is %.2f kj/kg \n',W_net);
% Thermal efficiency
fprintf('thermEff is %.2f kj/kg \n',T_eff);
% Specific Steam consuption
fprintf('ssc is %.2f kj/kg \n',Sp_S);
https://skill-lync.com/student-projects/project-2-rankine-cycle-simulator-159
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.