Challenge

Project 2 - Rankine cycle Simulator

Aim : To create a Basic program that state for the Ranking cylce simulator using the Matlab.

Objective :

  • To develop basic program that calculate state point
  • to adddthe thermodynamic relation to get the point in between state variables
  • To plot ranking cycle on Ts and Hs curve

Theory :

A Rankine cycle power system is a heat engine converting thermal energy into work. Similar to the vapor compression heat pump, it comprises four main components: a boiler (sometimes called evaporator), a turbine, a condenser and a pump. The working fluid in a low-pressure slightly subcooled liquid state is brought to high pressure by the pump. The pump consumes power. The high-pressure liquid enters the boiler, where it is heated-up, vaporized and potentially heated again to leave the boiler in superheated vapor state. Thermal power must be supplied to the boiler by an external heat source. At the outlet of the boiler, the high-pressure vapor enters the turbine where it is expanded down to the low pressure. The turbine delivers mechanical power. As a function of the nature of the working fluid and turbine inlet state, the fluid at the end of the expansion can be in superheated vapor state or in two-phase state. At the outlet of the turbine, the fluid enters the condenser where it is condensed to liquid state and, then, slightly subcooled. Thermal power rejected at the condenser is dumped into a heat sink. The low-pressure subcooled liquid enters the pump again. The net power delivered by the Rankine cycle system is the power delivered by the turbine minus that consumed by the pump (and, potentially, auxiliaries such as the condenser fan).

The Rankine cycle power system is the technology employed in steam power plants for the electricity production. These conventional steam Rankine cycle power systems use water as the working fluid. Other working fluids than water can be used. The term Organic Rankine Cycle (ORC) is used when the working fluid contains carbon, but the definition is generally extended to include ammonia.

The Rankine cycle is an ideal cycle if water passes through the four components without irreversibilities and pressure drops. The ideal Rankine cycle consists of the following four processes, as shown on the T-s diagram on the left:

  • 1-2: Isentropic compression in a pump
  • 2-3: Constant pressure heat addition in a boiler
  • 3-4: Isentropic expansion in a turbine
  • 4-1: Constant pressure heat rejection in a condenser.

Matlab program code

%Rankine Cycle Simulator
close all
clear all
clc

disp('RANKINE CYCLE SIMULATOR')
disp('1-2 is isentropic expansion in turbine')
disp('2-3 is constant pressure heat rejection in condenser')
disp('3-4 is isentropic compression in pump')
disp('4-1 is constant pressure heat addition in boiler')

p1=input('enter the pressure at the inlet of turbine (in bar)= ');
t1=input('enter the temp at the inlet of turbine (in degree C)= ');
p2=input('enter the pressure at the inlet of condenser (in bar)= ');

%steam condition at the inlet of turbine.
h1=XSteam('h_pt',p1,t1);
s1=XSteam('s_pt',p1,t1);

%steam condition at the outlet of turbine
sg2=XSteam('sV_p',p2);
sf2=XSteam('sL_p',p2);
sfg2 = sg2-sf2;
x2 = (s1-sf2)/sfg2;
s2 = sf2+x2*sfg2;

hf2= XSteam('hL_p',p2);
hg2= XSteam('hV_p',p2);
hfg2=hg2-hf2;
h2=hf2+x2*hfg2;

t2=XSteam('Tsat_p',p2);

%workdone by the turbine
W_t=h1-h2;

%steam condition at the outlet of condenser
p3=p2;
t3=XSteam('Tsat_p',p2);
h3=XSteam('hL_p',p2);
s3=XSteam('sL_p',p2);
vf=XSteam('vL_p',p2);
t22=t3;

% calculation of pump work
W_p=vf*(p1-p2)*100;

%steam Condition at state 4
p4=p1;

h4=W_p+h3;
s4=s3;
t4=XSteam('T_ph',p4,h4);

%work net
W_net=W_t-W_p;

%heat supplied
Q_s=h1-h4;
%heat rejected
Q_r=h2-h3;

%eficiency
efficiency=(W_net/Q_s);

%specific steam consumption
SSC=3600/W_net;
tf_sat=XSteam('Tsat_p',p1);
sf_sat=XSteam('sL_p',p1);
hf_sat=XSteam ('hL_p',p1);
sg_sat=XSteam('sV_p',p1);
hg_sat=XSteam('hV_p',p1);

%plotting T-S diagram
hold on

%for plottin saturation curve
tsat1=linspace(0,374,1000);

for i=1:length(tsat1)
ss1(i)=XSteam('sL_T',tsat1(i));
end

for j=1:length(tsat1)
ss2(j)=XSteam('sV_T',tsat1(j));
end

plot (ss1,tsat1,'b')

plot(ss2,tsat1,'r')

%for saturation temp at pl
temp=XSteam('Tsat_p',p1);
t=linspace(t4,temp,30);
for i=1:length(t)
S(i)=XSteam('s_pt',p1,t(i));
hold on

end

t0=linspace(temp,t1,300);
for i=1:length(t0)
S0(i)=XSteam('s_pt',p1,t0(i));
end

%for plotting turbine work
plot([s1 s2],[t1 t2],'g')
%for heat rejection in condenser
plot([s2 s3],[t2 t3],'r')
%for pump work
plot([s3 s4],[t3 t4],'g')

%plotting curved line(constant pressure line in wet region) from outlet of
%the pump to the point from where phase change starts
plot(S,t,'y')

%plotting the phase change region
plot([sf_sat sg_sat],[tf_sat tf_sat], 'b')

%plotting the curved constant pressure line from where the phase change
%ends to the superheated point
plot(S0,t0,'g')

legend ('Saturation Curve L', 'Saturation Curve V', 'Turbine', 'condenser", "pump', 'boiler', 'location','northwest')
title('T-S Diagram 687')
xlabel('Entropy')
ylabel('Temperature')

%plotting H-S diagram
figure (2)
hold on


%for plotting the saturation curve
tsat1=linspace(0, 374, 1000);

for i=1:length(tsat1)
hh1(i)=XSteam('hL_T', tsat1(i));
end

for j=1:length(tsat1)
hh2(j)=XSteam('hV_T',tsat1(j));
end
plot(ss1,hh1, 'b')
plot(ss2, hh2, 'r')

%for plotting tubine
plot([s1 s2], [h1 h2],'g')

%for condenser
plot([s2 s3], [h2 h3], 'r')

%for plotting pump
plot([s3 s4], [h3 h4], 'r')
s=linspace(s3, s1, 1000);
for i=1:length(s)
h(i)=XSteam('h_ps', p1,s(i));
end
%for plotting boiler
% plot([s4 s1], [h4 h1], 'g')
plot(s,h, 'b')
legend('Saturation Curve L', 'Saturation Curve V', 'Turbine', 'condenser', 'pump', 'boiler', 'location','northwest')
title('Hs Diagram687')
xlabel('Entropy')
ylabel('Enthalpy')

%outputs
%at state 1
fprintf('At State Point 1:\r\n')
fprintf('P1 is : %f Bar\r\n',p1)
fprintf('T1 is: %f Deg Celcius\r\n',t1)
fprintf('H1 is: %f KJ/Kg\r\n',h1)
fprintf('S1 is: %f KJ/KgK\r\n',s1)

% at state 2
fprintf('At State Point 2: \r\n')
fprintf('P2 is: %f Bar\r\n',p2)
fprintf('T2 is: %f Deg Celcius \r\n',t2)
fprintf('H2 is: %f KJ/Kg\r\n', h2)
fprintf('S2 is: %f KJ/KgK\r\n',s2)
fprintf('X is: %f \r\n',x2)

%at state 3
fprintf('At State Point 3: \r\n')
fprintf('P3 is %f Bar\r\n',p3)
fprintf('T3 is %f Deg Celcius\r\n',t3)
fprintf('H3 is: %f KJ/Kg\r\n', h3)
fprintf('S3 is: %f KJ/KgK\r\n',s3)

%state 4
fprintf('At State Point 4:\r\n')
fprintf('P4 is: %f Bar\r\n',p4)
fprintf('T4 is: %f Deg Celcius \r\n', t4)
fprintf('H4 is: %f KJ/Kg\r\n', h4)
fprintf('54 is: %F KJ/KgK\r\n',s4)

%culations
fprintf('Work Done By Turbine: %f kJ/kg\r\n',W_t)
fprintf('Work Done By Pump: %f kJ/kg\r\n',W_p)
fprintf('Heat Added in The Boiler: %f KJ/kg\r\n',Q_s)
fprintf('Heat Rejected in The Condenser: %f kJ/kg\r\n',Q_r)
fprintf('Thermal Efficiency is: %f %%\r\n', efficiency*100)
fprintf('Specific Steam Consumption : %F KJ/kWh\r\n',SSC)

screen shot of matlab program code

program code explanation.

  1. Xsteam data is used to extract steam and water properties of enthaly, entropy at specific pressure and temperatures for sat liquid,

sat vapour conditions etc.

ii. The program requires the input of Pressure (in bar) at state point 1 ( turbine inlet). Temperature at same point (deg celcius) and Temp

at condenser inlet (point 2).

iii. With the help of these inlets & from Xsteam data, the program calculates all the state points of the Rankine cycle.

iv. The xsteam data works as,

v. h1 = XSteam('h_pT, p1, T1): (Returns the enthalpy of water at given pressure and temperature in bar and degC resp.)

vi. As we extract the data, we use thermodynamic relation to further find state points and extract their data from XSteam.

vii. Sf and sg, hf and hg, where f and g stands for saturated liquid and saturated vapour respectively.

viii. The net work, work done by turbine, work done to run the pump. Heat in and heat out are calculated using standard thermodynamic relation

ix. Efficiency and Specific steam consumption (s.s.c) of the Rankine cycle is calculated.

x. T. s and h are extracted at vapour and liquid line for plotting purpose, after 4th point for the variation you observe in the plot.

xi. Saturation curve is plotted in red for saturated liquid and saturated gas.

xii. Plot of Tvs s and h vs s is created from all the points obtained from the program

xiii. The plot changes as the user input changes for the above mentioned inputs.

xiv. Results are displayed in the command window

Results:

RANKINE CYCLE SIMULATOR
1-2 is isentropic expansion in turbine
2-3 is constant pressure heat rejection in condenser
3-4 is isentropic compression in pump
4-1 is constant pressure heat addition in boiler


enter the pressure at the inlet of turbine (in bar)= 30
enter the temp at the inlet of turbine (in degree C)= 400
enter the pressure at the inlet of condenser (in bar)= 0.05

note in challenge given inputs:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure


At State Point 1:

P1 is : 30.000000 Bar

T1 is: 400.000000 Deg Celcius

H1 is: 3231.571027 KJ/Kg

S1 is: 6.923259 KJ/KgK

At State Point 2:

P2 is: 0.050000 Bar

T2 is: 32.875490 Deg Celcius

H2 is: 2110.708212 KJ/Kg

S2 is: 6.923259 KJ/KgK

X is: 0.814256

At State Point 3:

P3 is 0.050000 Bar

T3 is 32.875490 Deg Celcius

H3 is: 137.765119 KJ/Kg

S3 is: 0.476254 KJ/KgK

At State Point 4:

P4 is: 30.000000 Bar

T4 is: 32.963884 Deg Celcius

H4 is: 140.776056 KJ/Kg

54 is: Work Done By Turbine: 1120.862815 kJ/kg

Work Done By Pump: 3.010937 kJ/kg

Heat Added in The Boiler: 3090.794971 KJ/kg

Heat Rejected in The Condenser: 1972.943093 kJ/kg

Thermal Efficiency is: 36.167131 %

Specific Steam Consumption : >> 3.22

Ranking cycle on Ts and Hs curve

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.