Project 2 - Rankine cycle Simulator
RANKINE CYCLE SIMULATOR
INTRODUCTION:
Rankine cycle is the operational method in steam power plants. Comparing to the Carnot cycle for the same temperature limits Rankine cycle produces higher specific work output. Rankine cycle produces work conversation using high-pressure water which converted into steam in constant pressure. The detailed process discussed below.
RANKINE CYCLE PROCESS:
Process 1-2: Reversible adiabatic expansion in the turbine.
Process 2-3: Constant pressure heat transfer in a condenser.
Process 3-4: Reversible adiabatic pumping.
Process 4-1: Constant pressure transfer of heat in the boiler.
In process 1-2 high-pressure steam expand in the turbine and converted into work. This will lose heat as work. Then the Liquid-Vapour mixture sent to the condenser to convert into fluid under constant temperature. In process 3-4 liquid sent to high-pressure pump to increase the pressure of water. This pressurized water then sent to the boiler for converting into steam.
PROGRAM:
clear all
close all
clc
%Inputs
Input1=input('Enter temperature (Deg C) at turbine inlet:');
Input2=input('Enter pressure (bar) at turbine inlet:');
Input3=input('Enter pressure (bar) at turbine outlet:');
%Turbine Inlet
T1=Input1; %Temperature at stage 1
P1=Input2; %Pressure at stage 1
H1=XSteam('h_pT',P1,T1); %Enthalpy at Stage 1 from steam table for pressure and temperature
S1=XSteam('s_pT',P1,T1); %Entropy at stage 1 from steam table for pressure and temperature
%Turbine outlet or condenser inlet
S2=S1; %Isentropic expansion (Entropy is equal)
P2=Input3; %Pressure at stage 2
S_F2=XSteam('sL_p',P2); %Entropy liquid at pressure
S_G2=XSteam('sV_p',P2); %Entropy vapour at pressure
x=((S2-S_F2)/(S_G2-S_F2)); %Determine dryness factor
H_F2=XSteam('hL_p',P2); %Enthalpy liquid at pressure
H_G2=XSteam('hV_p',P2); %Enthalpy vapouer at pressure
H_FG2=H_G2-H_F2; %Determine Enthalpy of liquid and vapour mixture
H2=H_F2+(x*H_FG2); %Determine Enthalpy at state 2
T2=XSteam('Tsat_P',P2); %Temperature at state 2
V2=XSteam('vL_T',T2); %Specific volume at state 2
%Work done by turbine
WTurbine=H1-H2;
%Pump input
T3=T2;
P3=XSteam('psat_T',T3);
H3=XSteam('hL_p',P3);
S3=XSteam('sL_p',P3);
%Work done by pump
Wpump=V2*(P1-P2)*100;
%Boiler input
S4=S3;
H4=Wpump+H3;
P4=P1;
T4=XSteam('T_ph',P4,H4);
%heat added by boiler
Q1=H1-H4;
%Work net
Wnet=WTurbine-Wpump;
%Efficiency
Eff=(Wnet/Q1)*100;
%Data for plotting saturated vapour and liqiud curve
temp=373.9460; %Critical temperature
T=linspace(1,temp,200); %Values of temperature from 1 to critical temperature
for i=1:length(T) %For loop 200
%Entropy for concurrent temperature
S(i)=XSteam('sV_T',T(i)); %For Vapour
s(i)=XSteam('sL_T',T(i)); %For Liquid
%Enthalpy for concurrent temperature
H(i)=XSteam('hV_t',T(i)); %For Vapour
h(i)=XSteam('hL_t',T(i)); %For Liquid
end
%Graph from point 4 to point 1
T_4_1=linspace(T4,T1,100); %values between T4 and T1
for j=1:length(T_4_1)
S_4_1(j)=XSteam('s_pt',P4,T_4_1(j)); %Entropy for concurrent temperature
end
%T-S diagram for saturated liquid and vapour
plot(S,T,s,T,'linewidth',1.5)
hold on
%Plot State points and connect them
plot([S1 S2],[T1 T2],[S2 S3],[T2 T3],[S3 S4],[T3 T4],'marker','o','color','b')
Di=plot(S_4_1,T_4_1,'color','b');
%Labels,Legend and Title
xlabel('Entropy [(kJ/kgK)]');
ylabel('Temperature [K]');
legend('T-S Curve for saturated Vapour','T-S Curve for saturated Liquid','Rankine cycle')
title('T-S Diagram')
%H-S diagram for saturated liquid and vapour
figure(2)
plot(S,H,'linewidth',2)
hold on
Dig=plot(s,h)
plot([S1 S2],[H1 H2],[S2 S3],[H2 H3],[S3 S4],[H3 H4],[S4 S1],[H4 H1],'marker','*','linewidth',2,'color','r')
%Labels,Legend and Title
xlabel('Entropy [(kJ/kgK)]');
ylabel('Enthalpy [(kJ/kg)]');
legend('H-S Curve for saturated Vapour','H-S Curve for saturated Liquid','Rankine cycle')
title('H-S Diagram')
%Merge state point values as array
Pressure=[P1 P2 P3 P4];
Temperature=[T1 T2 T3 T4];
Enthalpy=[H1 H2 H3 H4];
Entropy=[S1 S2 S3 S4];
%Create new folder
Folder_Name='Rankine Output';
mkdir(Folder_Name);
%Save T-s and H-s plots in folder
saveas(Di,[pwd sprintf('/%s/T-S Dig.jpeg',Folder_Name )])
saveas(Dig,[pwd sprintf('/%s/H-S Dig.jpeg',Folder_Name )])
%Create Document
doc=fopen([pwd sprintf('/%s/Rankine.txt',Folder_Name)],'w');
fprintf(doc,'\t\tRANKINE CYCLE SIMULATOR\n');
fprintf(doc,'1-2:Isentropic expansion in a turbine\n2-3:Constant pressure heat rejection in a condenser\n3-4:Isentropic compression in a pump\n4-1:Constant pressure heat addition in a boiler\n');
%Print State points in file
for i=1:4
X=sprintf('\nState point %d:\nP%d \t:%6.3f Bar\nT%d \t:%6.3f Deg C\nH%d \t:%6.3f KJ/Kg\nS%d \t:%6.3f KJ/KgK\n',i,i,Pressure(i),i,Temperature(i),i,Enthalpy(i),i,Entropy(i));
fprintf(doc,X)
end
Y=sprintf('Work done by Turbine:%fkJ/kg\nWork done by Pump:%fkJ/kg\nWork net:%f\nEfficency of rankine cycle:%f',WTurbine,Wpump,Wnet,Eff);
fprintf(doc,Y)
fclose(doc)
PLOTS:
Temperature and Entropy plot:
Enthalpy and Entropy plot:
RESULT:
The results are saved in a separate folder "Rankine output".