Rankine Cycle Simulator
AIM: Create a Rankine Cycle Simulator
OBJECTIVE:
- Calculate each state points of the Rankine Cycle based on inputs.
- Plot the corresponding T-s and h-s plots for the given set of inputs.
- Calculate Efficiency.
The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing a phase change. It is an idealized cycle in which friction losses in each of the four components are neglected. The heat is supplied externally to a closed loop, which usually uses water as the working fluid.
- Four components of the Rankine cycle:
- Pump
- Boiler
- Turbine
- Condenser
- Four processes of the Rankine cycle:
1 2: Isentropic Expansion
Turbine (1-2): Superheated steam enters into the Turbine and expands isentropically resulting in the production of work. The shaft of the turbine is connected to the generator. This results in the production of electricity i.e Mechanical energy gets converted into electric energy. Work produced by the turbine,
`W_T = m(h_1 -h_2) K`
2-3: Constant Pressure Heat Rejection
Condenser (2-3): The expanded vapour is then passed through a condenser, where it gets condensed and converts into liquid again. This liquid is again pumped to the boiler.
`Q_r = m(h_2 - h_3) K`
3-4: Isentropic Compression by the Pump
Pump (3-4): The water enters into the pump in a saturated state. Then the liquid is compressed isentropically until it meets the boiler pressure. Work done by the pump is,
`W_P = m(h_3 -h_4) K`
4-1: Constant Pressure Heat Addition
Boiler (4-1): The water enters into the boiler as compressed and leaves as superheated from the boiler. Thus the phase changes from liquid to vapour. The heat supplied by the boiler is
`Q_b = m(h_1 - h_4) K`
Here we take mass flow rate m = 1 for this code.
Required Inputs:
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
Program:
clear all;
close all;
clc;
%Printing the discription of Rankine cycle process
fprintf(\' *Rankine Cycle Simulation* \');
fprintf(\'1-2 Reversible adiabatic expansion in the Turbine\');
fprintf(\'2-3 Constant pressure Transfer of heat into the Condenser\');
fprintf(\'3-2 Reversible adiabatic pumping process in the feed pump\');
fprintf(\'4-1 Constant pressure heat transfer into the boiler\');
%Providing the Basic input data
P1=30;
T1=400;
P2=0.05;
%Finding the specific pressure of the Cp value at Pressure(P1) and (P2) for the saturated liquid and vapour
Cp1_V=XSteam(\'CpV_p\',P1);
Cp1_L=XSteam(\'CpL_p\',P1);
Cp2_V=XSteam(\'CpV_p\',P2);
Cp2_L=XSteam(\'CpL_p\',P2);
%Finding the Saturation Temperature at Pressure(P1)&(P2)
Tsat_P1=XSteam(\'Tsat_p\',P1);
Tsat_P2=XSteam(\'Tsat_p\',P2);
%Calculating the Enthapy (KJ/Kg) and Entropy (KJ\\Kg.K) at Saturation Points
%Finding Saturated Vapour enthalpy(Hg) & entropy(Sg) at State-1(boiler out)
Hg_1=XSteam(\'hV_p\',P1);
Sg_1=XSteam(\'sV_p\',P1);
%Finding Saturated Vapour enthalpy(Hg) & entropy(Sg) at State-2 (Turb out)
Hg_2=XSteam(\'hV_p\',P2);
Sg_2=XSteam(\'sV_p\',P2);
%Finding Saturated Liquid enthalpy(Hg)& entropy(Sg) at State-3(Cond out)
Hf_2=XSteam(\'hL_p\',P2);
Sf_2=XSteam(\'sL_p\',P2);
%Finding Saturated Liquid enthalpy(Hg)& entropy(Sg) at State-4(Pump out)
Hf_1=XSteam(\'hL_p\',P1);
Sf_1=XSteam(\'sL_p\',P1);
%Calculating State Properties at state-1
fprintf(\'At state point-1 \\n\');
fprintf(\'P1 is : %f bar \\n\',P1);
fprintf(\'T1 is : %f degC \\n\',T1);
H1=XSteam(\'h_pT\',P1,T1); %enthalpy of superheated water vapour at the exit of the boiler
fprintf(\'H1 is : %f KJ/Kg \\n\',H1);
S1=XSteam(\'s_pT\',P1,T1);
fprintf(\'S1 is : %f KJ/Kg.K \\n\\n\',S1);
%Calculating the State properties at state-2
fprintf(\'At state point-2 \\n\');
fprintf(\'P2 is : %f bar \\n\',P2);
S2=S1; %since entropy at state-1 and state-2 do not change
fprintf(\'S2 is : %f KJ/Kg.K \\n\',S2);
%Calculating the Dryness Frsction(X).
%Dryness Fraction at state-2
if (S2<=Sg_2)
X2=(S2-Sf_2)/(Sg_2-Sf_2);
else
X2=1;
end
fprintf(\'X2 is : %f \\n\',X2);
%finding the value of T2 at Dryness fraction X2
if X2<1
T2=Tsat_P2; %since Temperature drops inside the Turbine
else
%S2=Sg_2+Cp_2_v*(log(T2/Tsat_P2)
T2=(Tsat_P2+273.15)*exp((S2-Sg_2)/Cp2_V);
T2=T2-273.15; %converting to DegC
end
fprintf(\'T2 is : %f degC \\n\',T2);
%Finding the value of Enthalpy(H2) at state-2 using X2
if (X2<1)
H2=Hf_2+X2*(Hg_2-Hf_2); %enthalpy of wet steam at the turbine exit, i.e. at the condenser inlet
else
H2=XSteam(\'h_pT\',P2,T2);
end
fprintf(\'H2 is : %f KJ/Kg \\n\\n\',H2);
%Finding the state variables at state-3
fprintf(\'At State point-3 \\n\');
P3=P2; %Pressure of fluid is same at Turbine out let and condenser out
fprintf(\'P3 is : %f bar \\n\',P3);
T3=Tsat_P2; %since no subcooling is expected
fprintf(\'T3 is : %f degC \\n\',T3);
V3=XSteam(\'vL_p\',P3);
H3=Hf_2; %enthalpy of water at the condenser outlet
fprintf(\'H3 is : %f KJ/Kg \\n\',H3);
S3=Sf_2; %phase transition vapour to liquid
fprintf(\'S3 is : %f KJ/Kg.K \\n\\n\',S3);
%Finding the state variables at state-4
fprintf(\'At state point-4 \\n\');
P4=P1;
fprintf(\'P4 is : %f bar \\n\',P4);
S4=S3; %since the entropy of liquid do not change while pumping
fprintf(\'S4 is : %f KJ/Kg.K \\n\',S4);
%Work done by pump is Wp
Wp=V3*(P4-P3)*100;
H4=Wp+H3; %enthalpy of water at the boiler inlet, i.e. at the pump outlet
fprintf(\'H4 is : %f KJ/Kg \\n\',H4);
T4=(Tsat_P1+273.15)/(exp((Sf_1-S4)/Cp1_L));
T4=T4-273.15; %converting from kelvin to degC
fprintf(\'T4 is : %f degC \\n\\n\',T4);
%calculating the Plotting points for Saturation Liquid and Vapour line
Temp=linspace(1,T1,1000);
for i=1:length(Temp)
H_L(i)=XSteam(\'hL_T\',Temp(i));
H_V(i)=XSteam(\'hV_T\',Temp(i));
S_L(i)=XSteam(\'sL_T\',Temp(i));
S_V(i)=XSteam(\'sV_T\',Temp(i));
end
%Plotting T-S & H-S Diagrams
%Plotting the T-S Diagram.
figure(1)
hold on
plot([S1 S2],[T1 T2],\'r\',\'linewidth\',2)
text(S1,T1,\'1\')
text(S2,T2,\'2\')
%plot([S2 Sg_2],[T2 Tsat_P2],\'r\',\'linewidth\',2)
%text(Sg_2,Tsat_P2,\'2S\')
plot([S2 S3],[T2 T3],\'r\',\'linewidth\',2)
text(S3,T3,\'3\')
plot([S3 S4],[T3 T4],\'r\',\'linewidth\',2)
text(S4,T4,\'4\')
plot([S4 Sf_1],[T4 Tsat_P1],\'r\',\'linewidth\',2)
text(Sf_1,Tsat_P1,\'4S\')
plot([Sf_1 Sg_1],[Tsat_P1 Tsat_P1],\'r\',\'linewidth\',2)
text(Sg_1,Tsat_P1,\'1S\');
plot([Sg_1 S1],[Tsat_P1 T1],\'r\',\'linewidth\',2)
plot(S_L,Temp,\'b\',\'linestyle\',\'--\',\'linewidth\',1)
plot(S_V,Temp,\'b\',\'linestyle\',\'--\',\'linewidth\',1)
title(\'T-S Diagram of Ideal Rankine Cycle\')
xlabel(\'Temperature (deg C)\')
ylabel(\'Specific Entropy(KJ/Kg.K)\')
%Plotting the H-S Diagram
figure(2)
hold on
plot([S1 S2],[H1 H2],\'r\',\'linewidth\',2)
text(S1,H1,\'1\')
text(S2,H2,\'2\')
%plot([S2 Sg_2],[H2 Hg_2],\'r\',\'linewidth\',2)
%text(Sg_2,Hg_2,\'2S\')
plot([S2 S3],[H2 H3],\'r\',\'linewidth\',2)
text(S3,H3,\'3\')
plot([S3 S4],[H3 H4],\'r\',\'linewidth\',2)
text(S4,H4,\'4\')
plot([S4 Sf_1],[H4 Hf_1],\'r\',\'linewidth\',2)
text(Sf_1,Hf_1,\'4S\')
plot([Sf_1 S1],[Hf_1 H1],\'r\',\'linewidth\',2)
%text(Sg_1,Hg_1,\'1S\')
%plot([Sg_1 S1],[Hg_1 H1],\'g\',\'linewidth\',2)
plot(S_L,H_L,\'b\',\'linestyle\',\'--\',\'linewidth\',1.5)
plot(S_V,H_V,\'b\',\'linestyle\',\'--\',\'linewidth\',1.5)
title(\'H-S Diagram of Ideal Rankine Cycle\')
ylabel(\'Specific Enthalpy (KJ/Kg)\')
xlabel(\'Specific Entropy (KJ/Kg.K)\')
%Calculating the Workdone,Heatinput,Specific Steam Consumption(SSC)& Efficiency
%Workdone by the Turbine=Wt
Wt=H1-H2;
fprintf(\'Workdone by the Turbine is : %f KJ/Kg \\n\',Wt);
fprintf(\'Workdone by the Pump is : %f KJ/Kg \\n\',Wp);
%Net workdone=Wnet
Wnet=Wt-Wp;
fprintf(\'Networkdone is : %f \\n\',Wnet);
%Heat of the fluid after saturation is Qin
Qin=H1-H4;
fprintf(\'Heat of the Fluid Before Expansion is : %f KJ \\n\',Qin);
%Thermal Efficiency of the Rankine cycle is Eff_thermal
Eff_thermal=(Wnet/Qin)*100;
fprintf(\'Thermal Efficiency of the cycle is : %f \',Eff_thermal); disp(\'%\');
%Rankine cycle Efficiency is Eff_rankine
Eff_rankine=((H1-H2)/(H1-Hf_2))*100;
fprintf(\'Rankine Efficiency is : %f \',Eff_rankine); disp(\'%\');
%Specific steam consumption of the Turbine is SSC
SSC=3600/Wt;
fprintf(\'Specific steam consumption is : %f Kg/KWh \\n\',SSC);
%Back Work Ratio is BWR
BWR=Wnet/Wt;
fprintf(\'Back work ratio is : %f \\n\',BWR);
Explanation:
-
Giving layout to simulator by providing information that displays
-
Giving input command
-
Using XSteam function taken all thermodynamic values Find all required value of pressure, temperature, entropy and enthalpy for all points
-
Find entropy and enthalpy at liquid and vapour phase to draw saturation curve
-
Using formula calculated all required data as a output of program
6. Plotted T-S and H-S diagram using plot command
Output: