Challenge

Project 2 - Rankine cycle Simulator

Aim:

Create a Rankine Cycle Simulator using MATLAB.

Objective:

  • Calculate the state points of the Rankine Cycle (any type of your choice) based on user inputs.
  • Plot the corresponding T-s and h-s plots for the given set of inputs.
  • To get output in Command Window for all state points.

Theory:

Rankine Cycle:

Rankine Cycle is the Thermodynamic Cycle which describes processes like a Heat engine, steam Turbine, and Steam Engine, it will extract mechanical energy from some heat source and gives some Useful Work. In Steam Turbine The Rankine cycle principle is used.

Fig. Rankine Cycle:- Steam Turbine

In Above Fig. we can see that the Steam Turbine Working on Rankine Cycle.

Components of Steam Turbine

  1. Turbine
  2. Condensor
  3. Pump
  4. Boiler

Working :

In steam Turbine liquid(mostly Water) is used for Boiling in Boiler, Boiler boils water (Qin) until it gets converted into Steam, here heat addition will be done, in that time Pressure will be constant, then this water convert into high-pressure Steam. this steam is supplied to Turbine while this process Pressure will vary. that steam is used to convert this energy to mechanical energy(Wt). then after the Turbine rotates steam will be sent to the condenser to make a Vapour into water(Qout) here heat rejection will be done. then it will be converted into water then water again sent to the Pump to increase the Pressure here Pump required some energy (Wp).

Rankine cycle Process:

There are Four Processes in Rankine Cycle:

1) Process 1-2 : Isentropic Expansion in Turbine

Dry Saturated Vapour expands in Turbine, generating power. The shaft is connected to the generator, this results in the production of electricity mean the Conversion of Mechanical energy to Electrical energy.

2) Process 2-3 : Constant Pressure Heat Rejection in Condensor

The expanded vapor passed through Condensor, where it gets condensed and converted into Liquid again. this liquid was again pumped into the boiler.

3) Process 3-4 : Isentropic Compression by Pump

In this process water comes into the Pump in a saturated state then the liquid is compressed isentropically until get boiler pressure.

4) Process 4-1 : Constant Pressure Heat Addition in Boiler

In this process water enters into Boiler it converts into high-pressure steam in this process pressure will be constant. in which the Liquid phase changed into Vapour.

Required Inputs:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

The following formulas were used:
Matlab Code:
close all
clear all
clc
% Program for Rankine Cycle Simulator
disp(' RANKINE CYCLE ');
disp('1-2 is isentropic expansion in turbine;');
disp('2-3 is constant pressure heat removal');
disp('3-4 is isentropic compression in pump');
disp('4-1 is constant pressure heat addition in boiler');
% Inputs
p1=input('Enter the pressure at turbine inlet(bar):');
T1=input('Enter the temperature at turbine inlet(degree C):');
p2=input('Enter the pressure at condenser inlet(bar):');
% Calculating dryness fraction at point 1
h1=XSteam('h_pT', p1, T1);
s1=XSteam('s_pT',p1 ,T1);
% At state 2
s2=s1; % Isentropic expansion
sf2=XSteam('sL_p' , p2);
sg2=XSteam('sV_p', p2);
sfg2=sg2-sf2;
x2=(s2-sf2)/(sg2-sf2);
hf2=XSteam('hL_p', p2);
hg2=XSteam('hV_p', p2);
hfg2=hg2-hf2;
h2=hf2+(x2*hfg2);
% At state point 3
p3=p2;
s3=XSteam('sL_p',p3);
h3=XSteam('hL_p',p3);
% At state point 4
s4=s3;
p4=p1;
% Work done by the turbine
wt=h1-h2;
% Work done to run a pump
v3=XSteam('vL_p',p3);
wp=v3*(p4-p3)*100;
h4=h3+wp;
% Net work
Wnet=wt-wp;
%Heat into the system
Qin = h1 - h4;
%Heat out of the system
Qout = h2 - h3;
%Thermal efficiency
Thermal_eff = (Wnet/Qin)*100;
%Specific Steam Consumption
%SSC = mass flow rate/power
SSC =(3600/Wnet);
% Back work ratio
BW = (wp/wt)
%Calculating temperatures at the state points
T3 = XSteam ('Tsat_p', p3 );
T2 = T3;
Cp4 = XSteam ('Cp_ps', p4, s4);
Cv4 = XSteam ('Cv_ps', p4, s4);
k = Cp4/Cv4;
T4 = T3/((p3/p4)^((k-1)/k));
%Calculating temperature, entropy, and enthalpy at the vapor and liquid
%line for plotting
T6 = XSteam ('Tsat_p',p1);
s5 = XSteam ('sL_p',p1);
s6 = XSteam ('sV_p',p1);
h5 = XSteam ('hL_p',p1);
h6 = XSteam ('hV_p',p1);
T5 = T6;
%Plotting the saturation curve
T =linspace(1,375,1000);
for i =1:length(T)
sf(i) = XSteam ('sL_T', T(i));
sg(i) = XSteam ('sV_T', T(i));
hf (i) = XSteam ('hL_T', T(i));
hg (i) = XSteam ('hV_T', T(i));
end
%Plotting T-s diagram
figure(1)
hold on
plot(sf,T,'r','LineWidth',1)
plot(sg, T, 'r','linewidth',1)
plot([s1 s2],[T1 T2],'b','LineWidth',2)
plot([s2 s3], [T2 T3] ,'b', 'linewidth', 2)
plot([s3 s4], [T3 T4], 'b', 'linewidth', 2)
plot([s4 s5],[T4 T5],'b','linewidth',2)
plot([s5 s6], [T5 T6], 'b', 'linewidth', 2)
sc1 = linspace (s6, s1, 1000);
for l = 1:length(sc1);
Tcl (l) = XSteam ('T_ps', p1, sc1(l));
end
plot(sc1, Tcl, 'k', 'linewidth', 2)
text(s1+0.1,T1,'1')
text(s2+0.1,T2,'2')
text (s3,T3-20,'3')
text (s4,T4+20,'4' )
title ('Temp vs Entropy plot');
xlabel ('Entropy (Kj/kgk) ')
ylabel ('Temperature (degree C) ');
legend ('Saturation curve');
%Plotting h-s diagram
figure(2)
hold on
plot(sf,hf,'k','linewidth',1)
plot(sg, hg,'k','linewidth',1)
plot([s1 s2],[h1 h2],'r','lineWidth',2)
plot([s2 s3],[h2 h3],'r','lineWidth',2)
plot([s3 s4],[h3 h4],'r','lineWidth',2)
hc= linspace (h4, h5, 100);
for k =1:length(hc)
sch(k)=XSteam('s_ph',p1,hc(k));
end
plot(sch,hc,'r','lineWidth',2)
plot([s5 s6],[h5 h6],'r','LineWidth',2)
title ('Enthalpy vs Entropy plot')
xlabel ('Entropy , S (KJ/kgk) ')
ylabel ('Enthalpy , H (KJ/kg)')
legend('Saturation Curve','location','northwest')
%Results
disp('At stage point l');
nl = sprintf('P1 lS %.3f bar' ,p1);
disp(nl);
n2 = sprintf('Tl is %.3f C',T1);
disp(n2);
n3 = sprintf('hl is %.3f kJ/kg',h1);
disp (n3);
n4 = sprintf('sl is %.3f kJ/kgK',s1);
disp (n4);
disp ('At stage point 2');
nll = sprintf('P2 lS %.3f bar' ,p2);
disp(nll);
n21 = sprintf('T2 is %.3f C',T2);
disp (n21);
n31 = sprintf('h2 is %.3f kJ/kg',h2);
disp (n31);
n41 = sprintf('s2 is %.3f kJ/kgK',s2);
disp(n41);
disp('At stage point 3');
nl2 = sprintf('P3 is %.3f bar',p3 );
disp(nl2);
n22 = sprintf('T3 is %.3f C',T3);
n32 = sprintf('h3 is %.3f kJ/kg',h3);
disp (n32);
n42 = sprintf('s3 lS %.3f kJ/kgK',s3);
disp(n42);
disp ('At state point 4') ;
n13 = sprintf('P4 is %.3f bar',p4);
disp (n13);
n23 = sprintf('T4 lS %.3f C',T4);
disp (n23);
n33 = sprintf('h4 is %.3f kJ/kg',h4);
disp (n33);
n43 = sprintf('s4 lS %.3f kJ/kgK',s4);
disp(n43);
n14 = sprintf('Wt is %.3f kJ/kg',wt);
disp (n14);
n15 = sprintf('Wp is %.3f kJ/kg',wp);
disp (n15);
n16 = sprintf('Wnet is %.3f kJ/kg',Wnet);
disp (n16);
n17 = sprintf('Thermal_efficiency is %.2f percent',Thermal_eff)
disp (n17);
n18 = sprintf('SSC is %.2f kg/kWh',SSC);
disp (n18);
n19 = sprintf('Back WorkRatio is %.3f',BW)
Matlab Command window output:
Matlab Code Explanation:
  • Initially, we start with clear all, close all, and clc to clear all the previous data in the workspace.
  • XSteam data is used to extract the steam and water properties of entropy and enthalpy and specific pressure and temperature for saturated liquid and saturated vapor conditions.
  • Now we have to start with inputting the input pressure at state point 1, Temperature at state point 1, and condenser inlet temperature at state point 2.
  • Then all the state points are calculated with the help of XSteam data file and the inputs provided.
  • Xsteam data works as,h1=XSteam('h_pt',p1, T1) which returns the enthalpy of water at given pressure and temperature in bar and degree C respectively.
  • With the help of thermodynamic relation, we find further state points and extract the data from Xsteam data file.
  • f stands for saturated liquid and g stands for saturated vapor.
  • Now we calculate the efficiency and Specific steam consumption of the Rankine cycle from the thermodynamic relations.
  • T, s, and h are extracted at vapor and liquid lines for plotting after the 4th point for the variation in the plot.
  • The saturation curve is plotted in red for saturated liquid and saturated gas in T-S and in H-S it is black.
  • The plot for temperature vs entropy and enthalpy vs entropy is plotted with all the points obtained in the program.
  • Results of the program are displayed in the command window using sprintf command.
Output Plots:

Result:

  • Thus with the help of Matlab Rankine cycle simulator is obtained where the values are extracted from 'XSteam' data file and the result is obtained from the given values of input.
  • Net work done is 1117.852 KJ/KG.
  • Thermal efficiency is 36.17%.
  • The back work ratio is 0.003.
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.