Project 2 - Rankine cycle Simulator
The Rankine cycle or Rankine Vapor Cycle is the process widely used by power plants such as coal fired powder or nuclear reactors .In this mechanism, a fuel is used to produce heat `within a boiler, converting water into steam which then expands through a turbine producing useful work. This process was developed in 1859 by Scottish engineer William J.M. Rankine This is a thermodynamic cycle which converts heat into mechanical energy—which usually gets transformed into electricity by electrical generation.
Fig 2- The pressure volume diagram of the Rankine cycle. This illustrates the changes in pressure and volume the working fluid (water) undergoes to produce work.
The steps in the Rankine Cycle as shown in( Figure 1) and the corresponding steps in the pressure volume diagram(fig 2) are outlined below:
- Pump: Compression of the fluid to high pressure using a pump (this takes work) (Figure 2: Steps 3 to 4)
- Boiler: The compressed fluid is heated to the final temperature (which is at boiling point), therefore, a phase change occurs—from liquid to vapor. (Figure 2: Steps 4 to 1)
- Turbine: Expansion of the vapor in the turbine. (Figure 2:Steps 1 to 2)
- Condenser: Condensation of the vapor in the condenser (where the water heat goes to the final heat sink (the atmosphere or a large body of water (ex. lake or river). (Figure 2: Steps 2 to 3)
The efficiency of the Rankine cycle is limited by the high heat of vaporization by the fluid. The fluid must be cycled through and reused constantly, therefore, water is the most practical fluid for this cycle. This is not why many power plants are located near a body of water that's for the waste heat.
As the water condenses in the condenser, waster heat is given off in the form of water vapour which can be seen billowing from a plant's cooling towers. This waste heat is necessary in any thermodynamic cycle. Due to this condensation step, the pressure at the turbine outlet is lowered. This means the pump requires less work to compress the water resulting in higher overall efficiencies.
Fig 1- A simple schematic with components for the Rankine Cycle.
Fig 2- The pressure volume diagram of the Rankine cycle
Steps Involved during Coding:
- Printing the different stages in the rankine cycle using fprintf
- Getting the Pressure and temperature at the turbine inlet , pressure at the condenser from the user using input
- Extracting Cp and Cv values for liquid and vapour phases with the help of XSteam file provided.
- Using the data P1,T1,H1,S1 we got from the Xsteam we are displaying the Pressure , temperature, enthalpy and entropy at all the state points namely 1,2,3,4.
- At state point 2 , S2=S1 because of the isentropic process.
- In the next step ,if the S2 < entropy of the steam then we should find the dryness fraction.
- At the state point 2, finding T2 for superheat in such away that if the dryness fraction is less than 1 then T2 =T2s or else T2 is calculated for superheated region and also enthalpy is also calculated.
- At state point 3 , assuming no subcooling we will have the same temperature T3 =T2s .
- Again at state point 4, because of isentropic process S4 =S3, entropy is constant.
- Now calculating the Work done by the Pump
Wp =
So Wp = V8 Change in Pressure
- The work done by the turbine is given by
-dw =dh
So -w = h2 -h1
W=h1-h2=Wp
- Now calculating the net work which is
Wnet = Wt -Wp;
Where Wt is always greater than Wp because the amount of work which is given to the pump should be minimum to get the maximum efficiency.
- Finally to calculate the efficiency = Outout/input
Here output is the Wnet and input is given by the heat supplied (Qin)
So Efficiency = Wnet/Qin
For the following inputs , output T-S and H-S diagram are obtained
Turbine Inlet temperature = 400C
Turbine inlet pressure = 30 bar
Turbine Outlet Pressure = 0.05bars = Condensor inlet pressure
clear all
close all
clc
fprintf('SIMULATOR OF RANKINE CYCLE \n')
fprintf('1-2 Isentropic Expansion in the Turbine \n')
fprintf('2-3 Constant Pressure Heat Rejection by the Condenser \n')
fprintf('3-2 Isentropic Compression in the Pump\n')
fprintf('4-1 Constant Pressure Heat Addition by the Boiler\n')
%inputs
P1 = input('Enter the Pressure at the Inlet (Turbine Inlet) (in bar):');
T1 = input('Enter the Temperature at the Turbine inlet (in Degree celsius): ');
P2 = input('Enter the Pressure at the Condenser (in bar): ');
disp('RESULTS')
%getting Cp and cv values from Xsteam
%Cp and Cv assumed to not change with temperature to make problem simple
% for vapur
cpV_high= XSteam('CpV_p', P1);
cpV_low=XSteam('CpV_p', P2);
cvV_high=XSteam('CvV_p', P1);
cvV_low=XSteam('CvV_p', P2);
% for liquid
cpL_high= XSteam('CpL_p', P1);
cpL_low=XSteam('CpL_p', P2);
cvL_high=XSteam('CvL_p', P1);
cvL_low=XSteam('CvL_p', P2);
%Getting important parameters from Xsteam
%for high pressure
T1s = XSteam('Tsat_p', P1);
S1g = XSteam('sV_p', P1);
S1f = XSteam('SL_p', P1);
S1fg = S1g - S1f;
H1f = XSteam('hL_p', P1);
H1g = XSteam('hV_p', P1);
H1fg = H1g - H1f;
%for low pressure
S2g = XSteam('sV_p', P2);
S2f = XSteam('SL_p', P2);
S2fg = S2g - S2f;
T2s = XSteam('Tsat_p', P2);
H2f = XSteam('hL_p', P2);
H2g = XSteam('hV_p', P2);
H2fg = H2g - H2f;
temp = linspace(1, 373, 300);
for i = 1 : length(temp)
H_Liq(i) = XSteam('hL_T', temp(i));
H_Vap(i) = XSteam('hV_T', temp(i));
S_Liq(i) = XSteam('sL_T', temp(i));
S_Vap(i) = XSteam('sV_T', temp(i));
end
% State point 1
disp('At state point 1:')
fprintf('P1 is : %f Bar\n ', P1)
fprintf('T1 is : %f Deg celsius\n', T1)
H1 = XSteam('h_pt', P1, T1);
fprintf('H1 is : %f kJ/kg\n', H1)
S1 = XSteam('s_pt', P1, T1);
fprintf('S1 is : %f kJ/kgK\n', S1)
% State point 2
disp('At state point 2:')
fprintf('P2 is : %f Bar\n', P2) %P2 input already taken
S2 = S1; %isentropic Process , so entropy is constant
fprintf('S2 is : %f kJ/kgK\n', S2)
%predicting location of point 2 in T-s
if(S2<=S2g)
X2 = (S2 - S2f) / (S2fg); % Dryness Fraction at state point 2
else
X2=1;
end
fprintf('X2 is :%f \n', X2)
%calculating T2 for superheat or wet or dry wherever it lies
if(X2<1)
T2=T2s;
else
%t2 cal by s2=s2g+low_cpV*(log(T2/T2s))
T2=(T2s+273)*exp((S2-S2g)/cpV_low) ; %2 in superheated region
T2=T2-273.15;
end
fprintf('T2 is : %f Deg celsius \n', T2)
if(X2<1)
H2 = H2f + X2 * H2fg;
else
H2=H2g+ cpV_low*(T2-T2s);
end
fprintf('H2 is : %f kJ/kg\n', H2)
% State point 3
%Assuming no subcooling in condensor
disp('At state point 3:')
P3 = P2;
fprintf('P3 is : %f Bar\n', P3)
V3 = XSteam('vL_p', P3);
T3 = T2s; %no subcooling assumed
fprintf('T3 is : %f Deg celsius\n', T3)
H3 =H2f;
fprintf('H3 is : %f kJ/kg\n', H3)
S3 =S2f;
fprintf('S3 is : %f kJ/kgKn\n', S3)
% State point 4
disp('At state point 4:')
P4 = P1;
fprintf('P4 is : %f Bar\n', P4)
S4 = S3;
fprintf('S4 is : %f kJ/kgK\n', S4)
Wp = V3 * (P4 - P3) * 100; %Wp = ?v dp
H4 = Wp + H3;
fprintf('H4 is : %f kJ/kg\n', H4)
% to cal T4 s4=s3=sf1-high_cpL*ln(t1s/t4)
term=exp((S1f-S4)/cpL_high); %Use exp instead of Exp to take input as double
T4= T1s/term;
fprintf('T4 is : %f Deg celsius n\n', T4)
% Work done, heat, SSC and efficiency calculations
Wtur = H1 - H2;
fprintf('Work given by turbine is : %f kJ/kg\n', Wtur)
fprintf('Work given by compressor is : %f kJ/kg\n', Wp)
Wnet = Wtur - Wp;
fprintf('Net Work done is : %f kJ/kg\n', Wnet)
Qin = H1 - H4;
eff_thermal = Wnet / Qin ; % Effieciency
fprintf('Thermal efficiency is : %f \n', eff_thermal); disp('%')
SSC = 3600 / Wtur; % Specific steam consuption
fprintf('S.S.C is : %f kg/kWh \n ', SSC)
%T-s diagram
figure(1) % T-S
hold on
plot([S1 S2], [T1 T2], 'r', 'linewidth', 1)
text(S1,T1,' 1')
text(S2,T2,' 2')
plot([S2 S2g], [T2 T2s], 'r', 'linewidth', 1)
text(S2g,T2s,' 2s')
plot([S2g S3], [T2s T3], 'r', 'linewidth', 1)
text(S3,T3,' 3')
plot([S3 S4], [T3 T4], 'r', 'linewidth', 1)
text(S4,T4,' 4')
plot([S4 S1f], [T4 T1s], 'r', 'linewidth', 1)
text(S1f,T1s,' 4s')
plot([S1f S1g], [T1s T1s], 'r', 'linewidth', 1)
text(S1g,T1s,' 1s')
plot([S1g S1], [T1s T1], 'r', 'linewidth', 1)
plot(S_Liq, temp, 'b', 'linestyle','--','linewidth', 1)
plot(S_Vap, temp, 'b', 'linestyle','--','linewidth', 1)
%marking direction
text(S1,(T1+T2)/2,'vee','HorizontalAlignment','center','color','r')
text((S2g+S2f)/2,T3,'langle','color','r')
text(S3,(T3+T4)/2,'wedge','HorizontalAlignment','center','color','r')
text((S1f+S1g)/2,T1s,'rangle','color','r')
title('T-S Diagram ')
ylabel('Temprature (Celcius)')
xlabel('Specific Entropy (kJ/kgK)')
figure(2) % H-S
hold on
plot([S1 S2], [H1 H2], 'r', 'linewidth', 1);
text(S1,H1,' 1')
plot([S2 S3], [H2 H3], 'r', 'linewidth', 1);
text(S2,H2,' 2')
plot([S3 S4], [H3 H4], 'r', 'linewidth', 1);
text(S3,H3,' 3')
plot([S4 S1], [H4 H1], 'r', 'linewidth', 1);
text(S4,H4,' 4')
plot(S_Liq, H_Liq, 'b','linestyle','--', 'linewidth', 1.5)
plot(S_Vap, H_Vap, 'b','linestyle','--', 'linewidth', 1.5)
title('H-S Diagram')
ylabel('Specific Enthalpy (kJ/kg)')
xlabel('Specific Entropy (kJ/kgK)')
References: