Challenge

Project 2 - Rankine cycle Simulator

AIM:

* To develope a basic program that calculates the state points

* To add the thermodynamic relation to get the points inbetween the state variables

* To plot rankine cycle on T-s and H-s curve

THEORY:

* 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

* 1-2 isentropic expansion : The vapour is expanded in the turbine thus producing work which may be convert to electricity in practice the expansion is limited by the tempeature of the cooling medium and by the erosion of the turbine blades by liquid enterainment in the vapour stream as the process move further into two -phase region .exit vapour qualities should be greater than 90% to increase life of the turbine blade.

* 2-3 isobaric heat rejection: The vapour -liquid mixture leaving the turbine(2) is condensed at low pressure usually in a a surface condenser using cooling water .in well designed and mainteined condensers the pressure of the vapoure is well below atmospheric apporacing the saturation pressure of the operating fluid at the cooling water temperature

* 3-4 isentropic compression : The pressure of the condenser is raised in the feed pump .because of the low specfic volume of liquids the pump work is relatively small and often neglected in thermodynimcs calculations.

* 4-1 isobaric heat transfer : High pressure liquid enters the boiler from the feed bump(4) and is heated to the saturation temperature .further addition of energy causes evaporation of the liquid until it os fully converted to saturated steam (1)

heat addition(qa) = h1-h4

heat rejection(qr) = h2-h3

work done by turbine(wt) = h1-h2

work taken by pump(wp) = h4-h3

thermal efficiency = wt-wp/qa

net work output (wn) =wt-wp

back work ratio (BWR) = wp/wt

specfic steam consumption(ssc) = 3600/wn

h1 = enthalpy at turbine inlet

h2 = enthalpy at turbine oulet

h3 = enthalpy at pump inlet

h4 = enthalpy at pump outlet

wt = work done by turbine

wn = work taken by pump

(pi,ti,si,hi) = pressure,temperature,entropy,enthalpy its respectively

Required inputs:

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

RANKINE CYCLE:

The efficiency of power cycle:

CODE:

clear all
close all
clc
% Rankine cycle simulator 

fprintf('Rankine cyclen')
fprintf('1-2 is Isentropic Expansion in Turbine\n')
fprintf('2-3 is constant pressure heat removal\n')
fprintf('3-4 is Isentropic compression in pump\n')
fprintf('4-1 Constant pressure Heat addition in Boiler\n')

% Entering the input data for calculation of state points
p1 = 30;   %Pressure at Turbine Inlet

T1 = 400;  %Temprature at Turbine Inlet 

p2 = 0.05;  %Pressure at Condenser

% Taking data from Xsteam 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; %Because of Isentropic Expansion 
sf2= XSteam('sL_p',p2);
sg2=XSteam('sV_p',p2);  %saturated vapour entropy at pressure 2
x2 =(s2-sf2)/(sg2-sf2); %vapour fraction at state point 2
hf2 =XSteam('hL_p',p2) %saturated liquid Enthalpy at pressure 2
hg2 =XSteam('hV_p',p2) %saturated vapour Enthalpy at pressure 2
h2=hf2 +(x2*(hg2-hf2)); %Enthalpy at state point 2

%Taking data from xsteam file for state point 3

p3 = p2;                 % Constant pressure heat removal process

s3 = XSteam('sL_p', p3);  % Saturated liquid entropy at pressure 3

h3 = XSteam('hL_p',p3);   % Saturated liquid Enthalpy at presssure 


% Taking data from Xsteam file for state point 4

s4=s3;            % Isentropic compression process
p4=p1;            % Constant pressure heat rejection 

% work done in turbine for the rankine cycle 
W_T=h1-h2;

% work done required for pump

v3=XSteam('vL_p' ,p3);     % Saturated Liquid Vapour at pressure 3
W_P=v3*(p4-p3)*100;        % Work done for pump
h4=h3-W_P;                 % Enthalpy at state point 4
% Net work done for Rankine cycle
W_net=W_T-W_P;

% Heat Addition to system
Q_in=h1-h4;
% Heat Rejection from system
Q_out=h2-h3;
% Thermal Efficiency of Rankine cycle 
T_eff=(W_net/Q_in)*100;

%specfic steam consumption =(Mass flow rate / Net work done)
SP_S=(3600/W_net);
% Calculation of Temperature at All state point 2,3 and 4
T3=XSteam('Tsat_P',p3);     % Saturation Temperature at pressure 3
T2=T3;                     % Because Constant Pressure Heat addition
Cp4=XSteam('Cp_Ps',p4,s4); %specfic isobaric heat capacity 
CV4=XSteam('Cv_ps',p4,s4); %specfic isochoric heat capacity
k = Cp4/CV4;
T4=T3/(p3/p4)^((k-1/k));   % Temperature at state point 4

% Calculation of other constant for saturaded liquid and vapour

T6=XSteam('Tsat_p',p1);  % Saturated Temperature at Pressure 1
s5=XSteam('sL_p',p1);   % Saturated Liquid entropy at pressure 1
s6=XSteam('sV_p',p1);    % Saturated vapour entropy at pressure 1
h5=XSteam('hL_p',p1);    % Saturated vapour Enthalpy at pressure 1
h6=XSteam('hV_p',p1);    % Saturated vapour Enthalpy at pressure 1
T5=T6;
% Plotting for Saturation Line

T=linspace (1,560,1000);
for i=1:length(T)
    sf(i) = XSteam('SL_T',T(i)); % Saturated Liquid Entropy 
    sg(i) = XSteam('SV_T',T(i)); % Saturated vapour Entropy 
    hf(i) = XSteam('hL_T',T(i)); % Saturated Liquid Enthalpy
    hg(i) = XSteam('hv_T',T(i));  % Saturated vapour Enthalpy


end 

% plotting T-S Diagram for Rankine cycle 
figure(1)
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(s2+0.1, T2,'2')
text(s3, T3-20,'3')
text(s4, T4+20,'4')
title('Temperature Vs Entropy')
xlabel('Entropy (kj/kg_kg)')
ylabel('Temperature (Deg. Celcius)')
legend('Saturation Curve')

%Plotting H-S Diagram for Rankine cycle
figure(2)
hold on 
grid 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)
plot([s4 s5],[h4 h5],'Color','r','LineWidth',3)
plot([s5 s6],[h5 h6],'Color','r','LineWidth',3)



hc=linspace(h4,h5,100);

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',2)


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 Results in Command window

disp('Result of Ranking cycle')

fprintf('At state point 1\n')

fprintf('At state point 2\n')

fprintf('P1 = %8.3f Bar\n',p1);

fprintf('P2 = %8.3f Bar\n',p2);

fprintf('T1 = %8.3f Deg.Celcius\n',T1);

fprintf('T2 = %8.3f Deg.Celcius\n',T2);
fprintf('H1 = %8.3f kJ/Kg\n',h1);
fprintf('H2 = %8.3f kJ/Kg\n',h2);
fprintf('S1 = %8.3f KJ/Kg-k\n',s1);
fprintf('S2 = %8.3 KJ/Kg-K\n',s2);
fprintf('At state point 3\n')
fprintf('At state point 4\n')
fprintf('P3 = %8.3 Bar\n',p3);
fprintf('P4 = %8.3f Bar\n',p4);
fprintf('T3 = %8.3f Deg.Celcius\n',T3);
fprintf('T4 = %8.3f Deg.Celcius\n',T4);
fprintf('H3 = %8.3f KJ/Kg\n',h3);
fprintf('H4 = %8.3f KJ/Kg\n',h4);
fprintf('S3 = %8.3f KJ/Kg\n',s3);
fprintf('S = %8.3 KJ/Kg\n',s4);
fprintf('Turbine Work Done =%8.3f KJ/Kg\n',W_T)
fprintf('Pump Work Done = %8.3f KJ/Kg\n', W_P)
fprintf('Net Work Done = %8.3f KJ/Kg\n',W_net)
fprintf('Thermal Efficiency =%18.3f percent\n',T_eff)
fprintf('Sp.Steam Consumotion =%8.3 KJ/Kw\n',SP_S)

CODE EXPLANATION:

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

* The rankine 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 condensor .

* Then we are using Xsteam function file for reading state point first we get the value of enthalpy and entropy at state point 1 from the Xsteam function file .

* As process from 1-2 is isentropic compression the entropy at point 1 is equal to point 2 .the term (s_pT,p1,T1) refers to entropy at pressure and temperature point 1.

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

* Similarly other points are taken from Xsteam function file which are necessary to calculate other parameters .after that work done rankine cycle .

* After calculating the net work done the efficiency of the rankine cycle is calculating along with specfic steam consumption which is steam consumed by a locomotive cylinders per unit of output work done .

TEMPERATURE VS ENTROPY:

ENTHALPY VS ENTROPY:

WORKSPACE:

RANKINE CYCLE RESULTS:

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.