Challenge

Project 2 - Rankine cycle Simulator

AIM -

Aim of this project is to create a Rankine Cycle Simulator using MATLAB.

OBJECTIVE -

  • This CODE should calculate the state points of the Rankine Cycle based on user inputs.
  • Then plot the corresponding T-s and h-s plots for the given set of inputs.

THEORY -

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. Figure1 shows the idealized Rankine cycle.

The pressure-enthalpy (p-h) and temperature-entropy (T-s) diagrams of this cycle are given in Figure2. The Rankine cycle operates in the following steps:

  • 1-2-3 Isobaric Heat Transfer. High pressure liquid enters the boiler from the feed pump (1) and is heated to the saturation temperature (2). Further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (3).

  • 3-4 Isentropic Expansion. 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 the cooling medium and by the erosion of the turbine blades by liquid entrainment in the vapor stream as the process moves further into the two-phase region. Exit vapor qualities should be greater than 90%.

  • 4-5 Isobaric Heat Rejection. The vapor-liquid mixture leaving the turbine (4) is condensed at low pressure, usually in a surface condenser using cooling water. In well designed and maintained condensers, the pressure of the vapor is well below atmospheric pressure, approaching the saturation pressure of the operating fluid at the cooling water temperature.

  • 5-1 Isentropic Compression. 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.

Figure 1
Figure 2
Figure 3. Rankine cycle in a nuclear power plant
MATLAB CODE -
clear all
close all
clc

%Introduction
fprintf('RANKINE CYCLE SIMULATOR \n')
fprintf('1-2 is isentropic expansion in the Turbine \n')
fprintf('2-3 is Constant Pressure Heat Rejection by the Condenser \n')
fprintf('3-4 is isentropic Compression in pump \n')
fprintf('4-1 is Constant Pressure Heat Addition by the Boiler \n')

% User Inputs
p1 = input('Enter the Pressure at the Turbine Inlet (bar): ');
t1 = input('Enter the Temprature at the Turbine Inlet (Degree Celcius): ');
p2 = input('Enter the Pressure at the Turbine Outlet (bar): ');

% State1
h1 = XSteam('h_pt',p1,t1);  %Enthalpy
s1 = XSteam('s_pt',p1,t1);  %Entropy
hf1 = XSteam('hL_p',p1);    %Enthalpy of saturated liquid
hg1 = XSteam('hV_p',p1);    %Enthaply of saturated vapour
ts1 = XSteam('Tsat_p',p1);  %Saturation Temprature
sf1 = XSteam('sL_p',p1);    %Entropy of saturated liquid
sg1 = XSteam('sV_p',p1);    %Entropy of saturated vapour

% State2
s2 = s1;
sf2 = XSteam('sL_p',p2);
sg2 = XSteam('sV_p',p2);
x = (s2-sf2)/(sg2-sf2);     % Dryness fraction
hf2 = XSteam('hL_p',p2);
hg2 = XSteam('hV_p',p2);
h2 = hf2 + x*(hg2-hf2);
t2 = XSteam('T_ph',p2,h2);
ts2 = XSteam('Tsat_p',p2);   

% State3
h3 = hf2;
s3 = sf2;
t3 = t2;
p3 = p2;

% State4
p4 = p1;
s4 = s3;
h4 = XSteam('h_ps',p4,s4);
t4 = XSteam('T_ps',p4,s4);

temp = linspace(0,374,500);    % temp space for plotting saturation cutves

%Plot T-S Diagram 
figure(1)
hold on
%Saturation Curve
for i = 1 : length(temp)
   plot(XSteam('sL_T',temp(i)),temp(i),'.','color','r')
   plot(XSteam('sV_T',temp(i)),temp(i),'.','color','r')
end
%Cycle
plot([s1 s2],[t1 t2],'linewidth',2,'color','k')
if x>1
    t3 = ts2;
    plot([s2 sg2 s3 s4],[t2 ts2 t3 t4],'linewidth',2,'color','k')
    t2 = ts2;
else
    plot([s2 s3 s4],[t2 t3 t4],'linewidth',2,'color','k')
end
l = linspace(t1,t2,1000);
for i = 1 : length(l)
    plot(XSteam('s_pT',p1,l(i)),l(i),'.','color','k')
end
plot([sf1 sg1],[ts1 ts1],'linewidth',2,'color','k')
xlabel('Entropy [KJ/Kg-K]')
ylabel('Temprature [K]')
title('T-S Diagram')

%Plot H-S Diagram
figure(2)
hold on
%Saturation Curve
for i = 1 : length(temp)
    plot(XSteam('sL_T',temp(i)),XSteam('hL_T',temp(i)),'.','color','r')
    plot(XSteam('sV_T',temp(i)),XSteam('hV_T',temp(i)),'.','color','r')
end
%Cycle
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'linewidth',2,'color','k')
xlabel('Entropy [KJ/Kg-K]')
ylabel('Enthalpy [KJ/Kg]')
title('H-S Diagram')

% calculations
% Turbine Work
Wt = h1-h2;

% Pump Work
Wp = h4-h3;

% Heat Addition
Qin = h1-h4;

% Heat Rejection
Qout = h2-h3;

% Net Work
Wnet = Wt-Wp;

% Efficiency
Ntherm = (Wnet/Qin)*100;

% Specific steam consumption
SSC = 3600/Wnet;

% Back Work Ratio
BWR = Wp/Wt;

% Print Results
fprintf('\nResults\n')
fprintf('At State1:\n')
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/Kg-K\n',s1)

fprintf('\nAt State2:\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/Kg-K\n',s2)

fprintf('\nAt State3:\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/Kg-K\n',s3)

fprintf('\nAt State4:\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/Kg-K\n',s4)

fprintf('\nWt : %.2f KJ/Kg\n',Wt)
fprintf('Wp : %.2f KJ/Kg\n',Wp)
fprintf('Wnet : %.2f KJ/Kg\n',Wnet)
fprintf('Thermal Efficiency : %.2f percent\n',Ntherm)
fprintf('S.S.C. : %.2f Kg/KWh\n',SSC) 
fprintf('Back Work Ratio : %.3f ',BWR)​
Explanation -
  • First step is to accept user input. 'input()' is used to provide the user input for temperature and pressure before entry to the turbine and pressure after exiting to the turbine.
  • Then 4 state points are calculated. Thermodynamic parameters include enthalpy h, entropy s, temperature t, pressure p, and dryness factor x at state 2. For calculating these parameters given file 'XSteam.m' steam table is used.
  • After calculating all parameters, next pump work, turbine work, net work output, back ratio, and thermal efficiency are calculated.
  • Now displaying all the results in the command window which is done by using command 'fprintf()'.
  • Next plotying the graph for H-S and T-S. First plotting the graph to plot the saturation curve which is calculated using for loop.Plotting these calculated values, the plot of saturation curve is obtained. Other processes are plotted by plotting respective values of h, s, t.
Results -
1.Command Window
2. Plots
2.1. T-S Plot
2.2. H-S Plot
Conclusion -
  • The required output values are obtained for the given input parameters:
      • Net work output = 1117.87 KJ/Kg
      • Back work ratio = 0.003
  • Thus, the Rankine cycle is successfully simulated using MATLAB.
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.