Project

SIMULATION OF RANKINE CYCLE

RANKINE CYCLE SIMULATOR

Introduction:

rankine cycle: The Rankine cycle is the fundamental operating cycle of all power plants where an operating fluid is continuously evaporated and condensed. The selection of operating fluid depends mainly on the available temperature range.

  • it was used to predict the performance of the steam turbines
  • it is used to study the performance of the steam engines also.
  • rankine cycle was an idealized thermodynamic cycle produces the mechanical work by under going some phase changes.

The rankine cycle consists of 4 thermodyncmic cycles

  1. (1-2)-isentropic compression process
  2. (2-3)-adiabatic heat addition at constant volume
  3. (3-4)-isentropic expnsion process
  4. (4-1)- adiabatic heat rejection at constant volume

Objective:

  • To calculate the state points of the Rankine Cycle based on the given inputs.
  • To plot the corresponding T-s and h-s plots for the given set of inputs.

Code for the rankine cycle simulator was

clear all 
close all
clc

disp(\'Rankine Cycle\')
disp(\'Process 1-2 Isentropic Compression in the pump\')
disp(\'Process 2-3 Constant Pressure Heat addition by Boiler\')
disp(\'Process 3-4 Isentropic Expansion in the Turbine\')
disp(\'Process 4-1 Constant Pressure Heat Rejection by Condensor\')

p3= input( \'Enter the pressure at the entry of the Turbine in Bar \\n\');
T3= input( \'Enter the temperature at the entry of the Turbine in degree celcius \\n\');
p4= input( \'Enter the pressure at the exit of the Turbine in Bar \\n\');

p1=p4;
p2=p3;

% state point 1

h1=XSteam(\'hL_p\',p1);
v1=XSteam(\'vL_p\',p1);
T1=XSteam(\'T_ph\',p1,h1);
s1=XSteam(\'sL_T\',T1);

% state piont 2

wp= v1*(p2-p1)*100; % work done by the pump
h2= h1 +wp;
s2=s1;
% To find T2
cp2=XSteam(\'CpL_p\',p1); 
cv2=XSteam(\'CvL_p\',p1);
gamma=cp2/cv2;
powterm= (gamma-1)/gamma;
prratio= p2/p1;
T2= T1*(prratio)^powterm;

% state point 3

h3= XSteam(\'h_pT\',p3,T3);
s3= XSteam(\'s_pT\',p3,T3);
v3=XSteam(\'v_pT\',p3,T3);
wt=v3*(p3-p4);  % work done by turbine

% state point 4

sf4= XSteam(\'sL_p\',p4);
sg4= XSteam(\'sV_p\',p4);
hf4= XSteam(\'hL_p\',p4);
hg4= XSteam(\'hV_p\',p4);
s4=s3;
T4=T1;
x4= (s4-sf4)/(sg4-sf4);
h4= hf4 + x4*(hg4-hf4);

Qin= h3-h2; % heat input to the system
Qout= h4-h1; % heat Output by the system
wnet= Qin+wp;
N_thermaal=(1-(Qout/wnet))*100;


%Plot of T-S diagram

Tsat=linspace(0,374,500);

for i=1:length(Tsat)
    
    sll(i)=XSteam(\'sL_T\', Tsat(i));
    svl(i)=XSteam(\'sV_T\', Tsat(i));
    hll(i)=XSteam(\'hL_T\', Tsat(i));
    hvl(i)=XSteam(\'hV_T\', Tsat(i));
end


figure(1)
title(\'T-S Diagram\')
xlabel(\'Entropy in kJ/kg\')
ylabel(\'Temperature in deg celcius\')

hold on


plot(sll,Tsat)
plot(svl,Tsat)
plot(s1,T1,\'*\',\'color\',\'r\')
text(s1,T1,\' 1\')
plot(s2,T2,\'*\',\'color\',\'g\')
text(s2,T2,\' 2\')
plot(s3,T3,\'*\',\'color\',\'b\')
text(s3,T3,\' 3\')
plot(s4,T4,\'*\',\'color\',\'y\')
text(s4,T4,\' 4\')
plot([s1 s2],[T1 T2],\'linewidth\', 1,\'color\',\'r\')
Tsatb=XSteam(\'Tsat_p\',p2);
ssatbb= XSteam(\'sL_T\',Tsatb);
plot([s2 ssatbb], [T2 Tsatb],\'linewidth\', 1,\'color\',\'g\')
sstab=XSteam(\'sL_p\',p2);
ssatb2=XSteam(\'sV_p\',p2);
plot([sstab ssatb2 ],[Tsatb Tsatb ],\'linewidth\', 1, \'color\',\'g\')
plot([ssatb2 s3], [Tsatb T3],\'linewidth\', 1,\'color\',\'g\')
plot([s3 s4], [T3 T4],\'linewidth\', 1,\'color\',\'b\')
plot([s4 s1],[T1 T4],\'linewidth\', 1,\'color\',\'y\')
legend(\'saturated liq line\', \'saturated vap line\',\'state piont 1\',\'state piont 2\',\'state piont 3\',\'state piont 4\', \'isentropic compression\', \'const pr heat addtn\',\'\',\'\',\'isentropic heat rej\', \'const pr heat rem\',\'location\',\'northwest\')

% plot of H-S diagram

figure(2)

hold on

plot(sll,hll)
plot(svl,hvl)
plot(s1,h1,\'*\',\'color\',\'r\')
text(s1,h1,\' 1\')
plot(s2,h2,\'*\',\'color\',\'g\')
text(s2,h2,\' 2\')
plot(s3,h3,\'*\',\'color\',\'b\')
text(s3,h3,\' 3\')
plot(s4,h4,\'*\',\'color\',\'y\')
text(s4,h4,\' 4\')

plot([s1 s2], [h1 h2])
plot([s2 s3], [h2 h3])
plot([s3 s4], [h3 h4])
plot([s4 s1], [h4 h1])

title(\'H-S Diagram\')
xlabel(\'Entropy\')
ylabel(\'Enthalpy\')
legend(\'saturated liq line\', \'saturated vap line\',\'state piont 1\',\'state piont 2\',\'state piont 3\',\'state piont 4\', \'isentropic compression\', \'const pr heat addtn\',\'isentropic heat rej\', \'const pr heat rem\',\'location\',\'northwest\')


% Output Screen to show the values at various state points

fprintf(\'\\n\')
fprintf(\'Pressure,Enthalpy, Entropy and Temperature values at state points\')
fprintf(\'\\n\')
fprintf(\'At State Point 1:\\r\\n\')
fprintf(\'P1 is : %f Bar\\r\\n\',p1)
fprintf(\'T1 is : %f Deg Celcius\\r\\n\',T1)
fprintf(\'H1 is : %f KJ/Kg\\r\\n\',h1)
fprintf(\'S1 is : %f KJ/KgK\\r\\n\',s1)
fprintf(\'\\n\')

fprintf(\'At State Point 2:\\r\\n\')
fprintf(\'P2 is : %f Bar\\r\\n\',p2)
fprintf(\'T2 is : %f Deg Celcius\\r\\n\',T2)
fprintf(\'H2 is : %f KJ/Kg\\r\\n\',h2)
fprintf(\'S2 is : %f KJ/KgK\\r\\n\',s2)
fprintf(\'\\n\')

fprintf(\'At State Point 3:\\r\\n\')
fprintf(\'P3 is : %f Bar\\r\\n\',p3)
fprintf(\'T3 is : %f Deg Celcius\\r\\n\',T3)
fprintf(\'H3 is : %f KJ/Kg\\r\\n\',h3)
fprintf(\'S3 is : %f KJ/KgK\\r\\n\',s3)
fprintf(\'\\n\')

fprintf(\'At State Point 4:\\r\\n\')
fprintf(\'P4 is : %f Bar\\r\\n\',p4)
fprintf(\'T4 is : %f Deg Celcius\\r\\n\',T4)
fprintf(\'H4 is : %f KJ/Kg\\r\\n\',h4)
fprintf(\'S4 is : %f KJ/KgK\\r\\n\',s4)

% Output of the thermal efficiency
fprintf(\'\\r\\n\')
fprintf(\'Heat Input to the system : %f \\r\\n\',Qin)
fprintf(\'Heat Output of the system : %f \\r\\n\',Qout)
fprintf(\'Thermal Efficiency of the Rankine cycle is : %.3f  percent \\r\\n\',N_thermaal)

results:

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.