Challenge

Project 2 - Rankine cycle Simulator

AIM: Create a Rankine cycle simulator using matlab/octave for the given input parameters:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

Calculate the followings:

  • Net work output
  • Back work ratio

INTRODUCTION: The Rankine cycle is a model used to predict the performance of steam turbine systems. It was also used to study the performance of reciprocating steam engines. The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing phase change.The ideal Rankine cycle consists of the following four processes:

  • Pump: Compression of the fluid to high pressure using a pump.
  • Boiler: The compressed fluid is heated to the final temperature, therefore, a phase change occurs—from liquid to vapor.
  • Turbine: Expansion of the vapor in the turbine.
  • Condenser: Condensation of the vapor in the condenser where the waste heat goes to the final heat sink.

FORMULAE USED:

  • Net work= Work output from turbine-Work input from pump.
  • Back work ratio= Pump work/Turbine work

Programming codes:

clear all
close all
clc

disp('Rankine cycle');
disp('1-2 is isentropic expansion ');
disp('2-3 is constant pressure heat removal');
disp('3-4 is isentropic compression');
disp('4-1 is constant pressure heat addition');

%Obtaining the input values
p1= input('nValue of pressure at inlet at turbine,p1(in bar)= ');
T1= input('nValue of temperature at inlet,(in degree.C)= ');
p2= input('nValue of temperature at condenser inlet,p2(in bar)= ');

%Extracting data
%State 1
h1= XSteam('h_pT',p1,T1);
s1=XSteam('s_pT' ,p1,T1);
%State2
s2=s1;
sf2= XSteam('sL_p', p2);
sg2= XSteam('sV_p', p2);
x2= (s2-sf2)/(sg2-sf2);
hf2= XSteam('hL_p', p2);
hg2= XSteam('hV_p', p2);
h2= hf2+(x2*(hg2-hf2));

%state3
p3=p2;
s3= XSteam('sL_p', p3);
h3= XSteam('hL_p', p3);

%State4
s4= s3;
p4= p1;

%Turbine work
Work_T= h1-h2;
%Work done on pump
v3= XSteam('vL_p', p3);
Work_p= v3*(p4-p3)*100;
h4= h3+Work_p;

%Net work
Work_net= Work_T-Work_p;

%Bck work ratio
BWR= Work_p/Work_T;

%Heat input to system
Q_input= h1-h4;
%Heat output of system
Q_output= h2-h3;
%Thermal efficiency
Eff_T= (Work_net/Q_input)*100;
%Specific steam consumption
%SSC= mass flow rate/power
SSC= (3600/Work_net);

%Temperatures at state points
T3= XSteam('Tsat_p', p3);
T2=T3;
Cp4= XSteam('Cp_ps',p4,s4);
Cv4= XSteam('Cv_ps',p4,s4);
k= Cp4/Cv4;
T4= T3/((p3/p4)^((k-1)/k));

%Calculating temperature, entropy and enthalpy
T6= XSteam('Tsat_p', p1);
s5= XSteam('sL_p', p1);
s6= XSteam('sV_p', p1);
h5= XSteam('hL_p', p1);
h6= XSteam('hV_p', p1);
T5=T6;

%Plotting the saturation curve
T= linspace(1,375,1000);
for i= 1:length(T)
sf(i)= XSteam('sL_T', T(i));
sg(i)= XSteam('sV_T', T(i));
hf(i)= XSteam('hL_T', T(i));
hg(i)= XSteam('hV_T', T(i));
end

%Plottingthe T-S Diagram
figure(1)
hold on
plot(sf,T,'linewidth',2,'color','g')
plot(sg,T,'linewidth',2,'color','g')
plot([s1,s2],[T1,T2],'linewidth',3,'color','r')
plot([s2,s3],[T2,T3],'linewidth',3,'color','r')
plot([s3,s4],[T3,T4],'linewidth',3,'color','r')
plot([s4,s5],[T4,T5],'linewidth',3,'color','r')
plot([s5,s6],[T5,T6],'linewidth',3,'color','r')
sc1= linspace(s6,s1,1000);
for j= 1:length(sc1)
 Tc1(j)= XSteam('T_ps', p1, sc1(j));
end
plot(sc1,Tc1,'linewidth',3,'k')
text(s1+0.1,T1,'1')
text(s2+0.1,T2,'2')
text(s3,T3-20,'3')
text(s4,T4+20,'4')
title('Temperature vs Entropy')
xlabel('Entropy')
ylabel('Temperature')
legend('Saturation curve')

%Plotting the h-s curve
figure(2)
hold on
plot(sf,hf,'linewidth',3,'color','b')
plot(sg,hg,'linewidth',3,'color','b')
plot([s1,s2],[h1,h2],'k','linewidth',3)
plot([s2,s3],[h2,h3],'k','linewidth',3)
plot([s3,s4],[h3,h4],'k','linewidth',3)
hc= linspace(h4,h5,100);
for k=1:length(hc)
sch(k)= XSteam('s_ph', p1,hc(k));
end
plot(sch,hc,'k','linewidth',3)
plot([s5,s6],[h5,h6],'k','linewidth',3);
for n=1:length(sc1)
hc1(n)= XSteam('h_ps', p1, sc1(n));
end
plot(sc1,hc1,'k','linewidth',3)
text(s1+0.1,h1,'1')
text(s2+0.1,h2,'2')
text(s3,h3-100,'3')
text(s4,h4+200,'4')
title('Enthalpy vs Entropy')
xlabel('Entropy')
ylabel('Enthalpy')
legend('Saturation curve','location','northwest')

%Displaying the outcomes
disp('RESULTS')
fprintf('At state point 1:n');
fprintf('p1: %8.3f barn', p1);
fprintf('T1:%8.3f Cn', T1);
fprintf('h1: %8.3f KJ/kgn', h1);
fprintf('s1: %8.3f KJ/kgKnn', s1);
fprintf('At state point 2:n');
fprintf('p2: %8.3f barn', p2);
fprintf('T2: %8.3f Cn', T2);
fprintf('h2: %8.3f KJ/kgn', h2);
fprintf('s2: %8.3f KJ/kgKn', s2);
fprintf('x2: %8.3fnn', x2);
fprintf('At state point 3:n');
fprintf('p3: %8.3f barn', p3);
fprintf('T3: %8.3f Kn', T3);
fprintf('h3: %8.3f KJ/kgn', h3);
fprintf('s3: %8.3f KJ/kgKnn', s3);
fprintf('At state point4:n');
fprintf('p4: %8.3f barn', p4);
fprintf('T4: %8.3f Kn', T4);
fprintf('h4: %8.3f KJ/kgn', h4);
fprintf('s4: %8.3f KJ/kgKnn', s4);
fprintf('Work_T: %8.3f KJ/kgn', Work_T);
fprintf('Pump work: %8.3f KJ/kgn', Work_p);
fprintf('Wnet: %8.3f KJ/kgn', Work_net);
fprintf('Efficiency: %8.3f Percent n', Eff_T);
fprintf('S.S.C: %8.3f KJ/kWh', SSC);

EXPLANATION OF CODES:

  1. To start with clear all, close all ,clc to clear the window and workspace.
  2. Print 'Rankine cycle ' and all the processes of rankine cycle in command window using 'disp' command.
  3. Using the XSteam table to define the values of specific heat(Cp) for liquid and vapour both.
  4. Defining the saturation temperature using steam table.
  5. Defining the specific enthalpy and entropy from the steam table.
  6. Calculating the values of enthalpy at point 1,2,3,4.
  7. Calculate the values of entropy at points 1,2,3,4.
  8. Calculate the work done by turbine and pump.
  9. Find the values of net work done , thermal efficiency and specific steam consumption(SSC).
  10. Plot the T-S and H-S diagram.
  11. Finally, the values calculated is displayed in the command window.

RESULTS:

  • Net work output= 1117.852 KJ/kgn
  • Back work ratio= 0.0026863.

Back work ratio calculated.

OUTPUT PLOTS:

ERRORS FACED:

Actually ,there was a slight error in the formula of back work ratio which has been easily detected and resolved immediately.

REFERENCES:

https://energyeducation.ca/encyclopedia/Rankine_cycle

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.