Challenge

Project 2 - Rankine cycle Simulator

PROJECT 2 - RANKINE CYCLE SIMULATOR

AIM: Creation of rankine cycle simulator from given inputband reading the data from standard thermodynamic library of steam table.

OBJECTIVE:

1.To create a rankine cycle simulator in matlab.

2.To calculate the state point using function xsteam.

3.To plot the t-s and h-s curve for given input in rankine cycle.

4.To get output in the command window for each state point in cycle.


DESCRIPTION:

* The rankie cycle is one of the vapor powered cycle. This cycle is somewhat different than gas powered cycle in which working fluid remained gas throughout the entire cycle.

* In vapor powered cycle the working fluid is steam because of its many desirable characteristics such as low cost production,availability and high enthalpy of vaporization.

* There are many impracticalities associated with carnot cycle which can be elimimated by superheating thr steam and condense in condenser which makes it best for nuclear power plants and other steam related power generation sources.


THE PROCESS IN RANKINE CYCLE ARE GIVEN AS:

* Isentropic compression in pump.

* Constant pressure heat addition in boiler.

* Isentropic expansion in a turbine.

* Constant pressure heat rejection in condenser.

* Water enters the pump at state 1 as saturated liquid and is compressed isentropic compression process due to a slight decrease in the specific volume of water.The vertical distance between states 1 and 2 on the t-s diagram is greatly exaggerated for clarity.

* Water enters the boiler as a compressed liquid at state 2 and leave as a superheated vapor at state 3. The boiler is basically a large heat origination from combustion gases,nuclear reactors,or other sources is transferred to the water essentially at constant pressure.

* The superheated vapour at state 3 enters the turbine ,where it expands isentripically and produces work by rotating the shaft connected to on electric generator.

* The pressure and the temperature of steam drop during this process to the values at state4,where steam enters the condenser.At this
state,steam enters the condenser.At this state,steam is usually a saturated liquid-vapor mixturevwith a high quality.

* In areas where water is precious,the power plants are cooled by air instead of water. This method of cooling,which is also used in car engines,is called dry cooling.

* Remembering that the area under the process curve on a T-S diagram represents the heat transfer for internally reversible processes,we see that the area under process curve 2-3 represents the heat transferred tobthe water in the boiler and the area under the process curve 4-1 represent the heat rejected in the condenser.The difference between these two is the net work produced durning the cycle.

* All the four components of rankie cycle are steady flow devices hence the process regarding this devices can be evaluated as steady state process.The steady state flow energy equation per unit mass of steam reduces to:

(Qin-Qout)+(Win-Wout) = hc-hi

* The boiler and condenser are not involved in any mechanical work whereas pump and turine are assumed to isentropic in nature while
working throughtout the cycle,then conservation of energy relation for each device can be expressed as:

Wpump = h2-h1

where,

h1 = hj at p1 and v1 = vf at p1

The heat added in boiler can be given as:

qin = h3-h2

The work which can be taken out of cycle from turbine is given as:

Wout = h3-h2
The heat removed from the condenser is given as:

qout = h4-h1
The thermal efficiency of rankie cycle is given as:

nth = Wnet/qin = 1-qout/qin

where,

Wnet = qin - qout = Wturb-Wpump

CODE EXPLANATION:

1.The creation of rankie cycle simulator starts with some input value which are required to calculate the other state point in cycle eventually.

2.The rankie cycle process is displayed in the command window and then inputs are entered which are inlet pressure for turbine,temperature at turbine inlet and pressure at condenser.

3.Then we are using xsteam function file for reading state point.First,we get the value of entholpy and entropy at state point 1 from the xsteam function file.

4.As process from 1-2 is isentropic compression the entropy at point 1 is equal to point 2.The team '(s_pt,p1,t1)'refers to entropy at pressure and temperature point 1.

5.The term 'sg'and 'sf' are referred to saturated liquid and saturated vapor entropy respectively . This value is used to calculated
other function according to mathematical relations.

6.Similarly,other point are taken from xsteam function file which are necessary to calculate other parameters.After that work done in turbine and pump are calculated for further getting the net work done rankie cycle.

7.After calculation the net work done the efficiency of the rankie cycle is calculated along with is steam consumed by a locomotive cyclinder per unit of output of work done.

8.Then plotting is done respectively for T-S and H-S graph in rankie cycle and each state point value has been put in command window.

THE CODE FOR RANKINE CYCLE SIMULATOR IS GIVEN AS:

clear all
close all
clc
% Ranking cycle simulator
fprintf('Rankine cyclen')
fprintf('1-2 is isentropic expansion in turbien')
fprintf('2-3 is constant pressure heat removaln ')
fprintf('3-4 is isentropic compression in pump n')
fprintf('4-1 constant pressure heat addition in boilern')
% Entering the input data for calculation of state points
% pressure at turbine inlet
p1 = 50;
% temperature at turbine inlet
t1 = 500;
% pressure at condenser
p2 = 5;
% taking data from xstream file for state point 1
h1 = XSteam('h_pt',p1,t1);
s1 = XSteam('s_pt',p1,t1);
% taking data from xsteam file for state point 2
s2 = s1;
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));
% taking data from xsteam file for state point 3
p3 = p2;
s3 = XSteam('sl_p',p3);
h3 = XSteam('hl_p',p3);
% taking data from xstem file for state point 4
s4 = s3;
p4 = p1;
% work done in turbine for the ranking cycle
w_t = h1-h2;
% work done required for pump
v3 = XSteam('vl_p',p3);
w_p = v3*(p4-p3)*100;
h4 = h3-w_p;
% net work done for rankine cycle
w_net = w_t - w_p;
% heat rejection from system
q_in = h1-h4;
% heat rejection from system
q_out = h2-h3;
% thermal efficiency of ranking cycle
t_eff = (w_net/q_in)*100;
%specific steam consumption = (mass flow rate /net work done)
sp_s = (3600/w_net);
% calculation of temperature at all point 2,3 and 4
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));
% caculation of other constant for saturated liquid and vapour
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 for saturation line
t = linspace (1,560,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 for rankine cycle
figure(i)
hold on
plot(sf,t,'color','b','linewidth',2)
plot(sg,t,'Color','b','linewidth',2)
plot([s1 s2],[t1 t2],'Color','r','LineWidth',3)
plot([s2 s3],[t2 t3],'Color','r','LineWidth',3)
plot([s3 s4],[t3 t4],'Color','r','LineWidth',3)
plot([s4 s5],[t4 t5],'Color','r','LineWidth',3)
plot([s5 s6],[t5 t6],'Color','r','LineWidth',3)
s_1 = linspace(s6,s1,1000);
for j = 1 : length(s_1)
tc(j) = XSteam('t_ps',p1,s_1(j));
end
plot(s_1,tc,'Color','r','LineWidth',3)
text(s1+0.1,t1,'1')
text(s1+0.1,t2,'2')
text(s3,t3-20,'3')
text(s4,t4+20,'4')
title('temperature vs entropy')
xlabel('entropy(kj/kg-k)')
ylabel('temperature(deg.celcius)')
legend('saturation curve')
% plotting h-s daigram for ranking cycle
figure(2)
hold on
plot(sf,hf,'Color','b','linewidth',2)
plot(sg,hg,'Color','b','LineWidth',2)
plot([s1 s2],[h1 h2],'Color','r','linewidth',3)
plot([s2 s3],[h2 h3],'Color','r','linewidth',3)
plot([s3 s4],[h3 h4],'Color','r','LineWidth',3)
hc = linspace(h4,h5,1000);
for k = 1:length(hc)
s_c(k) = XSteam('s_ph',p1,hc(k));
end
plot(s_c,hc,'Color','r','LineWidth',3)
plot([s5 s6],[h5 h6],'Color','r','LineWidth',3)
for l = 1:length(s_1)
h_c(l) = XSteam('h_ps',p1,s_1(l));
end
plot(s_1,h_c,'Color','r','LineWidth',3)
text(s1+0.1,h1,'1')
text(s2+0.1,h2,'2')
text(s3,h3-100,'3')
text(s4,h4+200,'4')
title('enthalpy vs entropy')
xlabel('entropy(kj/kg-k)')
ylabel('enthalpy(kj/kg)')
legend('saturation curve')
% displaying result in command window
disp('results of rankine cycle');
fprintf('at state point 1ttttt');
fprintf('at state point 2n');
fprintf('p1 = %10f in barrtttt',p1);
fprintf('p2 = %10f in barn',p2);
fprintf('t1 = %11f in deg.celciustt',t1);
fprintf('t2 = %11f in deg.celciusn',t2);
fprintf('h1 = %12f in kj/kgttt',h1);
fprintf('h2 = %12f in kj/kgn',h2);
fprintf('s1 = %9f in kj/kg-kttt',s1);
fprintf('s2 = %9f in kj/kg-kn',s2);
fprintf('n');
fprintf('at state point 3ttttt');
fprintf('at state point 4n');
fprintf('p3 = %10f in barn',p3);
fprintf('p4 = %11f in barn',p4);
fprintf('t3 = %11f in deg.celciustt',t3);
fprintf('t4 = %11f in deg.celciustt',t4);
fprintf('h3 = %12f in kj/kgttt',h3);
fprintf('h4 = %12f in kj/kgn',h4);
fprintf('s3 = %9f in kj/kg-kttt',s3);
fprintf('s4 = %9f in kj/kg-kn',s4);
fprintf('n');
fprintf('turbine work done = %14f in kj/kgn',w_t)
fprintf('pump work done = %15f in kj/kgn',w_p)
fprintf('net work done = %17f in kj/kgn',w_net)
fprintf('thermal efficiency = %13f in percentn',t_eff)
fprintf('sp.steam consumption = %f in kj/kwn',sp_s)
INFERENCE OF PLOT:
To make the graph more deliberate we are changing some value in the inputs by increasing the inlet pressure and temperature along with condenser pressure also which results in following graphs.
* From the above diagram as we see along the saturation curve point 1 start with turbine from which heat rejection is started which heat rejection is started which is again isentropic process.
* The steam is get cooled in condenser and in form of saturated liduid as it under the curve.Then it was pumped to enter in boiler where its temperature is increased to change it from saturated liquid to saturated vapor form.
* As we can see from above plot the steam entropy change during the process with respect to enthalpy.As the heat added in the system the entropy has been increased and similarly as the heat removed from the system the entropy drops with similar rates.
FOR THE GIVEN IN THE CHALLENGE THE GRAPH WILL LOOK LIKE THIS:

The value for the state point in command windows are given as:

For inlet pressure in turbine as = 500 bar

Inlet temperature in turbine = 500 deg.cel

pressure in condenser = 5 bar

For input given in challenge:

For inlet pressure in turbine as = 30 bar

Inlet pressure in turbine = 400 deg.cel

Pressure in condenser = 0.05 bar

COMMAND WINDOW:

Rankine cyclen1-2 is isentropic expansion in turbien2-3 is constant pressure heat removaln 3-4 is isentropic compression in pump n4-1 constant pressure heat addition in boilern
t5 =

263.9429

results of rankine cycle
at state point 1tttttat state point 2np1 = 50.000000 in barrttttp2 = 5.000000 in barnt1 = 500.000000 in deg.celciusttt2 = 151.836244 in deg.celciusnh1 = 3434.476097 in kj/kgttth2 = 2814.925098 in kj/kgns1 = 6.977804 in kj/kg-kttts2 = 6.977804 in kj/kg-knnat state point 3tttttat state point 4np3 = 5.000000 in barnp4 = 50.000000 in barnt3 = 151.836244 in deg.celciusttt4 = 231.746236 in deg.celciustth3 = 640.185335 in kj/kgttth4 = 635.268830 in kj/kgns3 = 1.860599 in kj/kg-kttts4 = 1.860599 in kj/kg-knnturbine work done = 619.550998 in kj/kgnpump work done = 4.916505 in kj/kgnnet work done = 614.634493 in kj/kgnthermal efficiency = 21.957448 in percentnsp.steam consumption = 5.857140 in kj/kwn>> plot(time,pressure)

From the two different input value it is seen that increasing the pressure and temperature in turbine result in lowering the efficiency of rankie cycle.

ERRORS:

* This error is mostly coming because of entering wrong keywords for saturated entropy and enthalpy from xsteam function file.

CONCLUSION:

So,we have created the rankine cycle simulator the given input ,in which we have taken the data from xsteam function file.

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.