Challenge

Project 2 - Rankine cycle Simulator

Rankine Cycle Simulation

Aim – To create a simulation for Rankine Cycle.

Objective –

Calculating the state points of Rankine Cycle.

Plotting T-S and H-S diagrams for given set of inputs.

Introduction –

The Rankine cycle is the process widely used by power plants such as coal-fired power plants or nuclear reactors. In this, a fuel is used to produce heat within a boiler, converting water into steam which then expands through a turbine producing useful work. This is a thermodynamic cycle which converts heat into mechanical energy which usually gets transformed into electricity by electrical generation.

Process 1-2 : Isentropic Expansion Process

The vapor is expanded in the turbine, thus producing work which may be converted to electricity. In practice the expansion is limited by the temperature of cooling medium and by erosion of turbine blades by liquid entrainment in vapor steam as process moves further into two phase region. Exit vapor qualities should be greater than 90%.

Process 2-3 : Isobaric Heat Rejection Process

The vapor-liquid mixture leaving the turbine is condensed at low pressure of vapor is well below atmospheric pressure, approaching the saturation pressure of the operating fluid at the cooling water temperature.

Process 3-4 : Isentropic Compression Process

The pressure of the condensate is raised in the feed pump. Because of the low specific volume of liquids, the pump work is relatively small and often neglected in thermodynamic calculations.

Process 4-1 : Isobaric Heat Addition Process

High pressure liquid enters the boiler from the feed pump and is heated to the saturation temperature. Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam.

Program

%Rankine Cycle Simulation
clear all
close all
clc

%Process Information
disp('Rankine Cycle')
disp('1-2 : Isentropic Expansion Process')
disp('2-3 : Constant Pressure Heat Rejection Process' )
disp('3-4 : Isentropic Compression Process' )
disp('4-1 : Constant Pressure Heat Addition Process' )
disp(' ')

t = linspace(0,373.15,300);

%Inputs
T1 = input('Enter Temperature at Turbine inlet(in Degree Celsius): ');
P1 = input('Enter pressure at Turbine inlet(in Bar): ');
P2 = input('Enter pressure at Condensor inlet(in Bar): ');
disp(' ')

%State Point 1
h1 = XSteam('h_pT',P1,T1);
s1 = XSteam('s_pT',P1,T1);
h_l1 = XSteam('hL_p',P1);
h_g1 = XSteam('hV_p',P1);
s_l1 = XSteam('sL_p',P1);
s_g1 = XSteam('sV_p',P1);
T_sat1 = XSteam('Tsat_p',P1);

%State Point 2
s2 = s1;
s_l2 = XSteam('sL_p',P2);
s_g2 = XSteam('sV_p',P2);

%Dryness Fraction
x = (s2 - s_l2)/(s_g2 - s_l2);

h_l2 = XSteam('hL_p',P2);
h_g2 = XSteam('hV_p',P2);
h2 = h_l2 + x*(h_g2 - h_l2);
T2 = XSteam('T_ph',P2,h2);
T_sat2 = XSteam('Tsat_p',P2);

%State Point 3
h3 = h_l2;
s3 = s_l2;
P3 = P2;
T3 = T2;

%State Point 4
s4 = s3;
P4 = P1;
h4 = XSteam('h_ps',P4,s4);
T4 = XSteam('T_ps',P4,s4);

%Plotting 
%T-S Curve
figure(1)
hold on

%Saturation Curve
for i = 1:length(t)
    plot(XSteam('sL_T',t(i)),t(i),'r.')
    plot(XSteam('sV_T',t(i)),t(i),'r.')
end

%Rankine Cycle
plot([s1 s2],[T1 T2],'linewidth',2,'color','g')
text(s1,T1,'1','FontSize',15)

%Beyond Saturation Curve
if x > 1
    T3 = T_sat2;
    plot([s2 s_g2 s3 s4],[T2 T_sat2 T3 T4],'linewidth',2,'color','g')
    text(s2,T2,'2','FontSize',15)
    text(s3,T3,'3','FontSize',15,'HorizontalAlignment','left','VerticalAlignment','top')
    
%Beneath Saturation Curve
else
    plot([s2 s3 s4],[T2 T3 T4],'linewidth',2,'color','g')
    text(s2,T2,'2','FontSize',15)
    text(s3,T3,'3','FontSize',15,'HorizontalAlignment','left','VerticalAlignment','top')
end

n = linspace(T1,T2,500);
for i = 1:length(n)
    plot(XSteam('s_pT',P1,n(i)),n(i),'.','linewidth',2,'color','g')
end

plot([s_l1 s_g1],[T_sat1 T_sat1],'linewidth',2,'color','g')
text(s_l1,T_sat1,'4','FontSize',15,'HorizontalAlignment','left','VerticalAlignment','top')
xlabel('Entropy (KJ/Kg-k)')
ylabel('Tempearture (K)')
title('T-s Diagram')
hold off

%H-S Diagram
figure(2)
hold on

%Saturation Curve
for i = 1:length(t)
    plot(XSteam('sL_T',t(i)),XSteam('hL_T',t(i)),'r.')
    plot(XSteam('sV_T',t(i)),XSteam('hV_T',t(i)),'r.')
end

%Rankine Cycle
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'linewidth',2,'color','g')
text(s1,h1,'1','FontSize',15)
text(s2,h2,'2','FontSize',15)
text(s3,h3,'3','FontSize',15)
text(s4,h4+90,'4','FontSize',15)

xlabel('Entropy (KJ/Kg-K)')
ylabel('Enthalpy (Kj/Kg)')
title('H-S Diagram')
hold off

%Calculation of desired Outputs
%Work done by turbine
W_t = h1 -h2;

%Work done by pump
W_p = h4 - h3;

%Net work done
W_net = W_t - W_p;

%Thermal Efficiency
n_thermal = (1 -((h2 - h3)/(h1 - h4)))*100;

%Back work ratio
BWR = W_p/W_t;

%Specific Steam Conductivity
SSC = 3600/W_t;

%Displaying results in command window
disp('RESULTS:')

disp('State Point 1:')
fprintf('P1 = %.2f Bar\n',P1)
fprintf(['T1 = %.2f' char(176) 'C\n'],T1)
fprintf('h1 = %.2f KJ/Kg\n',h1)
fprintf('s1 = %.2f KJ/Kg-K\n',s1)
disp(' ')

disp('State Point 2:')
fprintf('P2 = %.2f Bar\n',P2)
fprintf(['T2 = %.2f' char(176) 'C\n'],T2)
fprintf('h2 = %.2f KJ/Kg\n',h2)
fprintf('s2 = %.2f KJ/Kg-K\n',s2)
disp(' ')

disp('State Point 3:')
fprintf('P3 = %.2f Bar\n',P3)
fprintf(['T3 = %.2f' char(176) 'C\n'],T3)
fprintf('h3 = %.2f KJ/Kg\n',h3)
fprintf('s3 = %.2f KJ/Kg-K\n',s3)
disp(' ')

disp('State Point 4:')
fprintf('P4 = %.2f Bar\n',P4)
fprintf(['T4 = %.2f' char(176) 'C\n'],T4)
fprintf('h4 = %.2f KJ/Kg\n',h4)
fprintf('s4 = %.2f KJ/Kg-K\n',s4)
disp(' ')

fprintf('Work done by turbine = %.2f KJ/Kg\n',W_t)
fprintf('Work done by pump = %.2f KJ/Kg\n',W_p)
fprintf('Net work done = %.2f KJ/Kg\n',W_net)
fprintf('Thermal Efficiency = %.2f %\n',n_thermal)
fprintf('Back Work ratio = %f\n',BWR)
fprintf('Specific steam Conductivity = %.2f Kg/KW-Hr\n',SSC)

Program Explanation

-The values of "P1", "T1" and "P2" were given as input. And the temperature value array "t" was created using "linspace" command.

-Using the provided "XSteam" library the values of various physical parameters i.e. Enthalpy ,Entropy , Saturated liquid/vapour - enthalpy/entropy ,stauration temperature at 4 state points were calculated.

-Later using basic relations between work and physical parameters and "basic mathematical operations in octave" the "W_net" , "back_wr" etc. were calculated.

-Next to plot the T-S curve and H-S Curve we used the provided "XSteam" library function to plot the Curve at different temperature array values. Then along with the state points the curve was plotted.

-Then the values of physical parameters at the state points were displayed in the output window.

-The final results i.e. "W_net" "W_turbine" "W-pump" "back_wr" "ssc" "therm_eff" were printed.

Results

Plots

T - S Plot

H - S Plot

Errors

Typing error that were corrected later.

Conclusion

The Rankine Cycle Simulator has been established with required inputs. The required variables have been calculated and respective plots have been setup.

References

https://en.wikipedia.org/wiki/Rankine_cycle

http://www.thermopedia.com/content/1072/

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.