Project

Rankine cycle Simulator using MATLAB

Aim:

To create rankine cycle simulator using MATLAB. To demonstrate the T-s and h-s plots for the given set of inputs.

Objectives:

  • To create rankine cycle simulator using MATLAB.
  • The code should calculate the state points of the Rankine Cycle (any type of your choice) based on user inputs.
  • The h-s plot and the T-s plot should be demonstrated based on the given input.

Rankine cycle:

Rankine cycle is a model created for analysing the efficiency of the steam turbine systems. The rankine cycle is designed with many assumptions. The rankine cycle is also used to analyse the performance of reciprocating steam engine. Rankine cycle is also used to measure the characteristics of various parameters in thermal power plant. The rankine cycle has four major components. They are, a) Turbine, b) Boiler, c) Pump and d) Condenser. The heat input is converted into work output in the rankine cycle. The heat input is given to the boiler and the work output is obtained from the turbine.

  • Initially, the working fluid is pumped from low pressure to high pressure.
  • The high pressure fluid enters into the boiler where the fluid is heated to made it as a saturated vapour. The heat input is provided to the boiler from some heat source.
  • The dry saturated vapuor is used to run the turbine to get the power output. The dry saturated vapour expands on the turbine to rotate it.
  • The wet vapour from the turbine then enters into the condenser where it is condensed to the constant pressure and changed into saturated form.

Various process in rankine cycle:

Process 1-2 : Isentropic compression.

Process 2-3 : Constant pressure heat addition in boiler.

Process 3-4 : Isentropic expansion.

Process 4-1 : Constant pressure heat rejection in condenser.

Technical terms:

a) Enthalpy:

The enthalpy is the amount of heat content present in a system. It was denoted by 'h'.

b) Entropy:

Entropy is defined as a measure of randomness or disorder of a system. It was denoted by 's'.

Formulae:

1) For boiler:

Q1 = h1 - hf4

2) For turbine:

WT = h1 -h2

3) For condeser

Q2 = h2 - hf3

4) For the feed pump

Wp = hf4 - hf3

5) Efficiency of the rankine cycle

`eta = ((h1 - h2) - (hf4 - hf3))/(h1 - hf4)`

When hf4 - hf3 value is very small then,

`eta = (h1 - h2)/(h1 - hf4)`

Steam conditions:

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

1) Wet steam ( x<1)

2) Saturated steam (x=1)

3) 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.

Rankine cycle simulator code:

clear all
close all
clc

fprintf('RANKINE CYCLE SIMULATOR\n')
fprintf('1-2 is Isentropic Expansion in turbine\n')
fprintf('2-3 is constant pressure heat rejection in condensor\n')
fprintf('3-4 is Isentropic compression in pump\n')
fprintf('4-1 is constant pressure heat addition in boiler\n')

%Inputs
P1 = input('turbine inlet pressure (bar)');
T1 = input('turbine inlet temperature (degree c)');
P2 = input('turbine outlet pressure (bar)');

%Turbine inlet condition
T1_sat = XSteam('Tsat_p',P1);
if T1>T1_sat
    h1 = XSteam('h_pt',P1,T1);
    s1 = XSteam('s_pt',P1,T1);
elseif T1 == T1_sat
    h1 = XSteam('hV_p',P1);
    s1 = XSteam('sV_p',P1);
else
    fprintf('Enter higher temperature value')
end

%Turbine outlet condition
s2 = s1;
s2_sat = XSteam('sV_p',P2);
if s2<s2_sat
    s2_f = XSteam('sL_p',P2);
    s2_g = XSteam('sV_p',P2);
    x2 = (s2 - s2_f)/(s2_g - s2_f);
    h2_f = XSteam('hL_p',P2);
    h2_g = XSteam('hV_p',P2);
    h2 = h2_f + x2*(h2_g - h2_f);
    T2 = XSteam('Tsat_p',P2);
else
    x2 = 1;
    h2 = XSteam('hV_p',P2);
    T2 = XSteam('Tsat_p',P2);
end

%Condensor outlet condition
P3 = P2;
T3 = XSteam('Tsat_p',P3);
h3 = XSteam('hL_p',P3);
s3 = XSteam('sL_p',P3);
v3 = XSteam('vL_p',P3);

%Pump outlet condition
s4 = s3;
P4 = P1;
v4 = XSteam('v_ps',P4,s4);
Cp = XSteam('Cp_ps',P4,s4);
Cv = XSteam('Cv_ps',P4,s4);
g = Cp/Cv;
T4 = T3*((P3/P4)^((1-g)/g));
W_p = v3*(P4-P3)*100;
h4 = h3 + W_p;
T5 = XSteam('Tsat_p',P4);
s5 = XSteam('sL_p',P4);
T6 = T5;
s6 = XSteam('sV_T',T6);

%Calculation of work done, heat and efficiency
W_t = h1 - h2;
W_net = W_t - W_p;
Q_in = h1 - h4;
Q_out = h2 - h3;
efficiency = W_net/Q_in;

%Back work ratio calculation
SSC = 3600/W_net;

%Plotting
%T-S diagram
a=linspace(0,374,500);
figure (1)
hold on
for i=1:length(a)
    plot(XSteam('sL_T',a(i)),a(i),'.','color','r')
    plot(XSteam('sV_T',a(i)),a(i),'.','color','r')
end
plot([s1 s2],[T1 T2],'color','k','linewidth',2)
text(s1,T1,' 1')
text(s2,T2,' 2')
plot([s2 s6],[T1 T6],'color','k','linewidth',2)
plot([s6 s5],[T6 T6],'color','k','linewidth',2)
plot([s5 s4],[T6 T4],'color','k','linewidth',2)
text(s4,T4,' 4')
plot([s4 s3],[T4 T3],'color','k','linewidth',2)
text(s3,T3,' 3')
plot([s3 s1],[T3 T3],'color','k','linewidth',2)
title('T-S diagram')
xlabel('Entropy (KJ/KgK)')
ylabel('Temperature (Deg celcius)')

%H-S diagram
figure (2)
hold on
plot([s1 s2],[h1 h2],'color','k','linewidth',2)
text(s1,h1,' 1')
text(s2,h2,' 2')
plot([s2 s3],[h2 h3],'color','k','linewidth',2)
plot([s3 s4],[h3 h4],'color','k','linewidth',2)
text(s3,h3,' 3')
text(s4,h4,' 4')
plot([s4 s1],[h4 h1],'color','k','linewidth',2)
for i=1:length(a)
    plot(XSteam('sL_T',a(i)),XSteam('hL_T',a(i)),'.','color','r')
    plot(XSteam('sV_T',a(i)),XSteam('hV_T',a(i)),'.','color','r')
end
title('H-S diagram')
xlabel('Entropy (KJ/KgK)')
ylabel('Enthalpy (KJ/kg)')

%Output
fprintf('                                       RESULTS\n')
fprintf('At state point 1:                                                    At state point 3:\n')
fprintf('%s %.2f','P1 is : ',P1,' Bar')
fprintf('%s %.2f','                                                  P3 is : ',P3,' Bar')
fprintf('\n')
fprintf('%s %.2f','T1 is : ',T1,' Deg celcius')
fprintf('%s %.2f','                                         T3 is : ',T3,' Deg celcius')
fprintf('\n')
fprintf('%s %.2f','H1 is : ',h1,' KJ/kg')
fprintf('%s %.2f','                                              H3 is : ',h3,' KJ/kg')
fprintf('\n')
fprintf('%s %.2f','S1 is : ',s1,' KJ/KgK')
fprintf('%s %.2f','                                                S3 is : ',s3,' KJ/KgK')
fprintf('\n\n')
fprintf('At state point 2:                                                    At state point 4:\n')
fprintf('%s %.2f','P2 is : ',P2,' Bar')
fprintf('%s %.2f','                                                   P4 is : ',P4,' Bar')
fprintf('\n')
fprintf('%s %.2f','T2 is : ',T2,' Deg celcius')
fprintf('%s %.2f','                                          T4 is : ',T4,' Deg celcius')
fprintf('\n')
fprintf('%s %.2f','H2 is : ',h2,' KJ/kg')
fprintf('%s %.2f','                                              H4 is : ',h4,' KJ/kg')
fprintf('\n')
fprintf('%s %.2f','S2 is : ',s2,' KJ/KgK')
fprintf('%s %.2f','                                                S4 is : ',s4,' KJ/KgK')
fprintf('\n\n')
fprintf('%s %.2f','Wt is     : ',W_t,' KJ/kg')
fprintf('\n')
fprintf('%s %.2f','Wp is     : ',W_p,' KJ/kg')
fprintf('\n')
fprintf('%s %.2f','Wnet is   : ',W_net,' KJ/kg')
fprintf('\n')
fprintf('%s %.2f','Ntherm is : ',efficiency,' Percent')
fprintf('\n')
fprintf('%s %.2f','S.S.C is  : ',SSC,' KJ/KWh')
fprintf('\n')

Code explanation:

  • Initially, the different process in a rankine cycle is displayed.
  • The input parameters are obtained from the user.
  • The different parameters at the turbine inlet condition is derived. The various constant values are obtained from the steam table.
  • Here XSteam library is used for obtaining the steam table values.
  • Then, the different parameters at turbine outlet condition is derived.
  • In condenser outlet condition, different parameters are derived with the help of XSteam library.
  • The various values at the pump outlet condition are also calculated.
  • Once the different values at different conditions are obtained, we can proceed further for calculating the main resultant values.
  • The work done, input and output heat and the efficiency of the rankine cycle is calculated.
  • The back work ratio is also calculated.
  • From all the values obtained, the h-s plot and the t-s plot were drawn
  • All the values calculated are shown under result.

Input values:

  • Turbine Inlet temperature = 400° C
  • Turbine Inlet Pressure = 30 bars
  • Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure.

Output:

Result values:

The various result values calculated for the given input is shown below,

Result plots:

h-s plot:

t-s plot:

Reference:

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

Textbook:Engineering Thermodynamics (Third edition) by R.K.Rajput

Conclusion:

Thus the rankine cycle simulator was made using MATLAB. The result values for the input parameters and the plots are shown.

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.