Challenge

Project 2 - Rankine cycle Simulator

AIM: to create a rankine cycle simulator using octave/matlab

THEORY:

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. figure 1 shows the idealized rankine cycle. the rankine cycle operates in the following steps:

FIG:Schematic representation of rankine cycle

  1. 1-2 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% to increase the life of turbine blade.
  2. 2-3 isobaric heat rejection: the vapor-liquid mixture leaving the turbine (2) 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.
  3. 3-4 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.
  4. 4-1 isobaric heat transfer: high pressure liquid enters the boiler from the feed pump (4) and is heated to the saturation temperature . further addition of energy causes evaporation of the liquid until it is fully converted to saturated steam (1).

OBJECTIVE:

  • calculate the output of net work.
  • calculate the back work ratio.
  • ploting the T-S & H-S diagrams for given inputs.

PROCEDURE:

  • the program start with close all,clear all,clc.
  • using display command to create the rankine cycle simulator and 4 steps to print at command window
  • using input command to input the variables t1,p1,p2 to enter at command window
  • STATE 1: h_pT, s_pT, hL_p, sV_p etc.... are the default variables whose value is stored in XSteam file.
  • Pressure, Temperature, Enthalpy, Entropy for all the State Variables are Extracted as a function of the dependent variable from the XSteam File.
  • Values for Enthalpy & Entropy are extracted as a function of Pressure & Temperature.
  • STATE 2:Condenser inlet where the High-Pressure Steam is converted into Low-Pressure Water and hence Dryness Fraction, Enthalpy & Entropy for Saturated Vapour & Saturated Water are considered to Calculate the Specific Enthalpy.
  • STATE 3: water is condensed back to its Saturation Temperature and fed to the Pump, This temperature of water at the exit of the Condenser and entry of Pump is the same.
  • STATE 4: is constant pressure heat addition, hence pressure is equal to p1, but the temperature increases on heating at constant pressure & constant volume as our entropy remains same and hence cp/cv=gamma is considered to find temperature t4.
  • define two more points 5 and 6 to plot cycle in detail.finally work done and heat evolved & ssc are calculated by basic formulae.
  • to plot the saturation curve, a temperature range is defined using linspace command and for the overall length of this temperature values of enthalpy and entropy are calculated at every temperature point. the break in the saturation curve separates the liquid phase & vapour phase.
  • now all the necessary data is found out, plotting is done for both t-s & h-s curves using the plot commands. annotations are assigned using text command.results of the cycle simulation is displayed over comand window using fprintf command.

CODE:

close all
clear all
clc

% Creating Rankine Cycle Simulator
disp('RANKINE CYCLE SIMULATOR')
disp('1-2 : Isentropic Expansion in the Turbine')
disp('2-3 : Isobaric Heat Rejection by the Condenser')
disp('3-4 : Isentropic Compression in the Pump')
disp('4-1 : Isobaric Heat Addition by the Boiler')
disp(' ')
 
t = linspace(0,373.15,300);
 
% Inputs to be specified
T1 = input('Enter the Temperature at the Turbine Inlet (in Degree Celsius): ');
P1 = input('Enter the Pressure at the Turbine Inlet (in bar): ');
P2 = input('Enter the Pressure at the Condenser (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 Diagram
figure(1), clf
hold on
 
% Saturation curve
for i = 1:length(t)
    plot(XSteam('sL_T',t(i)),t(i),'y.')
    plot(XSteam('sV_T',t(i)),t(i),'y.')
end
 
% Rankine Cycle
plot([s1 s2],[T1 T2],'linewidth',2,'color','b')
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','b')
    text(s1,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(s1,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','b')
end
 
plot([s_l1 s_g1],[T_sat1 T_sat1],'linewidth',2,'color','b')
text(s_l1,T_sat1,'4','FontSize',15,'VerticalAlignment','bottom')
xlabel('Entropy(kJ/kg-K)')
ylabel('Temperature(k)')
title('T-s Diagram')
 
% h-s Diagram
figure(2), clf
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')
 
 
% Calculation of desired quantities
 
% 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('At 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/kgK\n',s1)
disp(' ')
 
disp('At 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/kgK\n',s2)
disp(' ')
 
disp('At 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/kgK\n',s3)
disp(' ')
 
disp('At 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/kgK\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/kWh\n', SSC)

OUTPUT:

ERRORS:

most errors are paranthesis missing,invalid expressions.

RESULTS:

T-S DIAGRAM:

H-S DIAGRAM:

CONCLUSION:

The Rankine Cycle Simulator has been established with required inputs fed. The required variables have been calculated and respective plots have been set up. It is possible to modify the Rankine Cycle by adding desired equipment based on our preference of functionality.

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.