Challenge

Project 2 - Rankine cycle Simulator

  • Aim :-Create a Rankin Cycle Simulator using OCTAVE/MATLAB.
  • Objective :-
  • To calculate the state points of the rankine cycle based on user input.
  • To plot the corresponding T-s and h-s plots for the given set of inputs.
  • Theory
  • Basic 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. Figure 1 shows the idealized Rankine cycle.
  • The pressure-enthalpy (p-h) and temperature-entropy (T-s) diagrams of this cycle are given in Figure 2. 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. Rankine cycle.

  • Figure 2. T-s and p-h diagrams.
  • The efficiency of power cycles is defined as
  • Values of heat and work can be determined by applying the First Law of Thermodynamics to each step. The steam quality x at the turbine outlet is determined from the assumption of isentropic expansion, i.e.,
  • where is the entropy of vapor and Si* the entropy of liquid.

Technical terms :-

Enthalpy :- the sum of the internal energy and the product of the pressure and volume of a thermodynamic system.

Entropy :- the measure of a system’s thermal energy per unit temperature that is unavailable for doing useful work. Because work is obtained from ordered molecular motion, the amount of entropy is also a measure of the molecular disorder, or randomness, of a system.

Formulae :-

Applying steady flow energy equation (S.F.E.E.) to boiler, turbine, condenser and pump :

(i) For boiler (as control volume),

we get

(ii) For turbine (as control volume), we get

(iii) For condenser, we get

(iv) For the feed pump, we get

Now, efficiency of Rankine cycle is given by

When hf4 – hf3 value is very small then

IMPORTANT TERMS RELATING STEAM FORMATION

  1. Sensible heat of water (hf ). It is defined as the quantity of heat absorbed by 1 kg of water when it is heated from 0°C (freezing point) to boiling point. It is also called total heat (or enthalpy) of water or liquid heat invariably. It is reckoned from 0°C where sensible heat is taken as zero. If 1 kg of water is heated from 0°C to 100°C the sensible heat added to it will be 4.18 × 100 = 418 kJ but if water is at say 20°C initially then sensible heat added will be 4.18 × (100 – 20) = 334.4 kJ. This type of heat is denoted by letter hf and its value can be directly read from the steam tables.

Note. The value of specific heat of water may be taken as 4.18 kJ/kg K at low pressures but at high pressures it is different from this value.

  1. Latent heat or hidden heat (hfg). It is the amount of heat required to convert water at a given temperature and pressure into steam at the same temperature and pressure. It is expressed by the symbol hfg and its value is available from steam tables. The value of latent heat is not constant and varies according to pressure variation.
  1. Dryness fraction (x). The term dryness fraction is related with wet steam. It is defined as the ratio of the mass of actual dry steam to the mass of steam containing it. It is usually expressed by the symbol ‘x’ or ‘q’.

If ms = Mass of dry steam contained in steam considered, and

mw = Weight of water particles in the steam considered,

Then,

  1. Total heat or enthalpy of wet steam (h). It is defined as the quantity of heat required to convert 1 kg of water at 0°C into wet steam at constant pressure. It is the sum of total heat of water and the latent heat and this sum is also called enthalpy.

In other words, h = hf + xhfg

If steam is dry and saturated, then x = 1 and hg = hf + xhfg

  1. Superheated steam. When steam is heated after it has become dry and saturated, it is called superheated steam and the process of heating is called superheating. Superheating is always carried out at constant pressure. The additional amount of heat supplied to the steam during superheating is called as ‘Heat of superheat’ and can be calculated by using the specific heat of superheated steam at constant pressure (cps), the value of which varies from 2.0 to 2.1 kJ/ kg K depending upon pressure and temperature.

If Tsup., Ts are the temperatures of superheated steam in K and wet or dry steam, then

(Tsup – Ts) is called ‘degree of superheat’.

The total heat of superheated steam is given by

hsup = hf + hfg + cps (Tsup – Ts )

  1. Volume of wet and dry steam. If the steam has dryness fraction of x, then 1 kg of this steam will contain x kg of dry steam and (1 – x) kg of water. If vf is the volume of 1 kg of water and vg is the volume of 1 kg of perfect dry steam (also known as specific volume), then volume of 1 kg of wet steam = volume of dry steam + volume of water.

= xvg + (1 – x)vf

Note. The volume of vf at low pressures is very small and is generally neglected. Thus is general, the

volume of 1 kg of wet steam is given by, xvg and density 1 xvg kg/m3 .

= xvg + vf – xvf

= vf + x(vg – vf )

= vf + xvfg

= vf + xvfg + vfg – vfg

= (vf + vfg) – (1 – x) vfg

= vg – (1 – x)vfg

  1. Volume of superheated steam. As superheated steam behaves like a perfect gas its volume can be found out in the same way as the gases.

If, vg = Specific volume of dry steam at pressure p,

Ts = Saturation temperature in K

Tsup = Temperature of superheated steam in K, and

vsup = Volume of 1 kg of superheated steam at pressure p,

Or

Steam condition :-

Based on the nature of the steam in the turbine inlet, the three types of condition is proposed. The three conditions are,

  • Wet steam (x<1)
  • Saturated steam (x=1)
  • Super saturated steam (x>1)

The ‘x’ value is defined as the dryness fraction based on the dryness fraction value the conditions can be classified. The ‘x’ value can be calculated by using the formula given below,

Hi = hfi + x(hfgi) where I is the position in which all datas are known.

Main Code -

clear all
close all
clc

% Simulating Rankine Cycle
% Process Description
fprintf('1-2 Isobaric heat Transfer\n')
fprintf('2-3 Isentropic Expansion\n')
fprintf('3-4 Isobaric heat rejection\n')
fprintf('4-1 Isentropic compression\n')

% Inputs
p1 = input('Enter the pressure at the turbine inlet(in bar)');
t1 = input('Enter the Temperature at the inlet(in Degree Celcius)');
p2 = input('Enter the pressure at condenser(in bar)');

%Input conditions
t = XSteam('Tsat_p',p1);
if t1>=t
h1 = XSteam('h_pT',p1,t1);
s1 = XSteam('s_pT',p1,t1);
end
%State points Evaluation
p4 = p1;
p3 = p2;
h3 = XSteam('hL_p',p3);
s3 = XSteam('sL_p',p3);
t3 = XSteam('Tsat_p',p3);
s2 = s1;
t2 = t3;
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);
s4 = s3;
h4 = XSteam('h_ps',p4,s4);
cp4 = XSteam('Cp_ps',p4,s4);
cv4 = XSteam('Cv_ps',p4,s4);
g4 = cp4/cv4; 
o = (g4 - 1)/g4;
t4 = t3*((p4/p3)^o);

% Turbine & Pump Work
wt = h1 - h2;
wp = h4 - h3;

% net work
wnet = wt - wp;

% heat supplied
qs = h1 - h4;

% Efficiency
n_per = (wnet/qs)*100;

%Steam rate per second
stm_rate = 3600/(wt - wp);

% For process 4-1, which is isobaric we use the expression dH = Cp*dT
t5 = XSteam('Tsat_p',p1);
s5 = XSteam('sL_p',p1);
s6 = XSteam('sV_p',p1);

% output
fprintf('\n\tRESULT\n')
fprintf('At state point 1:\np1 is :%4.2 Bar\nT1 is :%4.2f Degree celcius\nH1 is :%4.2f KJ/Kg \nS1 is :%4.2f KJ/Kgk\n\n',p1,t1,h1,s1)
fprintf('At state point 2:\np2 is :%4.2 Bar\nT2 is :%4.2f Degree celcius\nH2 is :%4.2f KJ/Kg \nS2 is :%4.2f KJ/Kgk\n\n',p2,t2,h2,s2)
fprintf('At state point 3:\np3 is :%4.2 Bar\nT3 is :%4.2f Degree celcius\nH3 is :%4.2f KJ/Kg \nS3 is :%4.2f KJ/Kgk\n\n',p3,t3,h3,s3)
fprintf('At state point 4:\np4 is :%4.2 Bar\nT4 is :%4.2f Degree celcius\nH4 is :%4.2f KJ/Kg \nS4 is :%4.2f KJ/Kgk\n\n',p4,t4,h4,s4)
fprintf('Wt is :%4.2f KJ/Kg\nWp is :%4.2f KJ/Kg\nWnet is :%4.2f KJ/Kg\nNtherm is :%4.2f percent\nS.S.C is :%4.2f Kg/kWh',wt,wp,wnet,n_per,stm_rate)

% Vapour Line
temp = linspace(1,400,100);
for i = 1:length(temp)
    ent_l(i) = XSteam('sL_T',temp(i));
    ent_v(i) = XSteam('sV_T',temp(i));
    enth_l(i) = XSteam('hL_T',temp(i));
    enth_v(i) = XSteam('hV_T',temp(i));
end

% Plotting
subplot(1,2,1)
plot([s1 s2 s3 s4 s5 s6 s1],[t1 t2 t3 t4 t5 t5 t1],'color','k','linewidth',2,'markersize',2,'markerfacecolor','b','MarkerEdgeColor','b')
hold on
plot(ent_l,temp,'color','r')
plot(ent_v,temp,'color','r')
axis([0 10 0 700])
text(s1,t1,'1','FontSize',15)
text(s2,t2,'2','FontSize',15)
text(s3,t3,'3','FontSize',15,'HorizontalAlignment','left')
text(s4,t4,'4','FontSize',15,'HorizontalAlignment','right')
xlabel('Entropy')
ylabel('Temperature')
subplot(1,2,2)
plot([s1 s2 s3 s4 s1],[h1 h2 h3 h4 h1],'color','k','LineWidth',2,'marker','o','MarkerFaceColor','b','MarkerEdgeColor','b')
axis([0 10 300 5000])
hold on
plot(ent_v,enth_v,'color','r')
plot(ent_l,enth_l,'color','r')
text(s1,h1,'1','FontSize',15)
text(s2,h2,'2','FontSize',15)
text(s3,h3,'3','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','top')
text(s4,h4,'4','FontSize',15,'HorizontalAlignment','right','VerticalAlignment','bottom')
xlabel('Entropy')
ylabel('Enthalpy')

Code Explanation :-

1. We will use standard XStream library to get the steam table data for water, is given below. It must be used to calculate the points in between the state variables.

2. Clearing workspace, command window and closing all plots

3. The user inputs that have to be entered by the usedr are:

Pressure at the turbine inlet (In bar)

Temperature at the turbine inlet (in Degree C)

Pressure at the condenser(in bar)

4. Based on the inputs we will calculate state variables by using equation of state and X_steam liabrary which is a stream table and we can directrly read values of state variables using it.

5.After calculating the state varuables at each state point we have calculated the turbine and pump work done.

6.At the end we plotted the corresponding T-s and h-s plots for the given set of inputs.

Abravitives Used -

XSteam - provides accurate steam and water properties from 0 - 1000 bar and from 0 - 2000 deg C
T Temperature (deg C)
p Pressure (bar)
h Enthalpy (kJ/kg)
v Specific volume (m3/kg)
rho Density
s Specific entropy
u Specific internal energy
Cp Specific isobaric heat capacity
Cv Specific isochoric heat capacity
w Speed of sound
my Viscosity
tc Thermal Conductivity
st Surface Tension
x Vapour fraction
vx Vapour Volume Fraction
%*** Valid Steam table functions.
%Temperature
Tsat_p Saturation temperature
T_ph Temperture as a function of pressure and enthalpy
T_ps Temperture as a function of pressure and entropy
T_hs Temperture as a function of enthalpy and entropy
Pressure
psat_T Saturation pressure
p_hs Pressure as a function of h and s.
p_hrho Pressure as a function of h and rho. Very unaccurate for solid water region since it's almost incompressible!
%Enthalpy
hV_p Saturated vapour enthalpy
hL_p Saturated liquid enthalpy
hV_T Saturated vapour enthalpy
hL_T Saturated liquid enthalpy
h_pT Entalpy as a function of pressure and temperature.
h_ps Entalpy as a function of pressure and entropy.
h_px Entalpy as a function of pressure and vapour fraction
h_prho Entalpy as a function of pressure and density. Observe for low temperatures (liquid) this equation has 2 solutions.
h_Tx Entalpy as a function of temperature and vapour fraction
%
Specific volume
vV_p Saturated vapour volume
vL_p Saturated liquid volume
vV_T Saturated vapour volume
vL_T Saturated liquid volume
v_pT Specific volume as a function of pressure and temperature.
v_ph Specific volume as a function of pressure and enthalpy
v_ps Specific volume as a function of pressure and entropy.
%
%Density
%rhoV_p Saturated vapour density
rhoL_p Saturated liquid density
rhoV_T Saturated vapour density
rhoL_T Saturated liquid density
rho_pT Density as a function of pressure and temperature.
rho_ph Density as a function of pressure and enthalpy
rho_ps Density as a function of pressure and entropy.
Specific entropy
sV_p Saturated vapour entropy
sL_p Saturated liquid entropy
sV_T Saturated vapour entropy
sL_T Saturated liquid entropy
s_pT Specific entropy as a function of pressure and temperature (Returns saturated vapour entalpy if mixture.)
s_ph Specific entropy as a function of pressure and enthalpy
Specific internal energy
uV_p Saturated vapour internal energy
uL_p Saturated liquid internal energy
uV_T Saturated vapour internal energy
uL_T Saturated liquid internal energy
u_pT Specific internal energy as a function of pressure and temperature.
u_ph Specific internal energy as a function of pressure and enthalpy
%u_ps Specific internal energy as a function of pressure and entropy.
Specific isobaric heat capacity
CpV_p Saturated vapour heat capacity
CpL_p Saturated liquid heat capacity
CpV_T Saturated vapour heat capacity
CpL_T Saturated liquid heat capacity
Cp_pT Specific isobaric heat capacity as a function of pressure and temperature.
Cp_ph Specific isobaric heat capacity as a function of pressure and enthalpy
Cp_ps Specific isobaric heat capacity as a function of pressure and entropy.
Specific isochoric heat capacity
CvV_p Saturated vapour isochoric heat capacity
vL_p Saturated liquid isochoric heat capacity
CvV_T Saturated vapour isochoric heat capacity
CvL_T Saturated liquid isochoric heat capacity
Cv_pT Specific isochoric heat capacity as a function of pressure and temperature.
Cv_ph Specific isochoric heat capacity as a function of pressure and enthalpy
Cv_ps Specific isochoric heat capacity as a function of pressure and entropy.
%
%Speed of sound
wV_p Saturated vapour speed of sound
wL_p Saturated liquid speed of sound
wV_T Saturated vapour speed of sound
wL_T Saturated liquid speed of sound
w_pT Speed of sound as a function of pressure and temperature.
w_ph Speed of sound as a function of pressure and enthalpy
w_ps Speed of sound as a function of pressure and entropy.
Viscosity
Viscosity is not part of IAPWS Steam IF97. Equations from
"Revised Release on the IAPWS Formulation 1985 for the Viscosity of Ordinary Water Substance", 2003 are used.
%Viscosity in the mixed region (4) is interpolated according to the density. This is not true since it will be two fases.
my_pT Viscosity as a function of pressure and temperature.
my_ph Viscosity as a function of pressure and enthalpy
my_ps Viscosity as a function of pressure and entropy.
%Thermal Conductivity
Revised release on the IAPS Formulation 1985 for the Thermal Conductivity of ordinary water substance (IAPWS 1998)
tcL_p Saturated vapour thermal conductivity
tcV_p Saturated liquid thermal conductivity
tcL_T Saturated vapour thermal conductivity
tcV_T Saturated liquid thermal conductivity
tc_pT Thermal conductivity as a function of pressure and temperature.
tc_ph Thermal conductivity as a function of pressure and enthalpy
tc_hs Thermal conductivity as a function of enthalpy and entropy

Results :-

Calculate the followings,

  • Net work output = 1117.87 KJ/Kg
  • Back work ratio = 3.22 Kg/kWh.
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.