Project 2 - Rankine cycle Simulator
AIM : To create a Rankine Cycle Simulator using MATLAB.
OBJECTIVE :
- To calculate the state points of the Rankine Cycle based on user inputs.
- To plot the corresponding T-s and h-s plots for the given set of inputs.
THEORY :-
RANKINE CYCLE : THE IDEAL CYCLE FOR VAPOR POWER CYCLES
The Rankine cycle, which is the ideal cycle for vapor power plants. The ideal Rankine cycle does not involve any internal irreversibilities and consists of the following four processes:
1-2 Isentropic compression in a pump
2-3 Constant-pressure heat addition in a boiler
3-4 Isentropic expansion in a turbine
4-1 Constant-pressure heat rejection in a condenser
Water enters the pump at state 1 as saturated liquid and is compressed isentropically to the operating pressure of the boiler. The water temperature increases somewhat during this 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 leaves as a superheated vapor at state 3. The boiler is basically a large heat exchanger where the heat originating from combustion gases, nuclear reactors, or other sources is transferred to the water essentially at constant pressure. The boiler, together with the section where the steam is superheated (the super-heater), is often called the steam generator.
The superheated vapor at state 3 enters the turbine, where it expands isentropically and produces work by rotating the shaft connected to an electric generator. The pressure and the temperature of steam drop during this process to the values at state 4, where steam enters the condenser. At this state, steam is usually a saturated liquid–vapor mixture with a high quality. Steam is condensed at constant pressure in the condenser, which is basically a large heat exchanger, by rejecting heat to a cooling medium such as a lake, a river, or the atmosphere. Steam leaves the condenser as saturated liquid and enters the pump, completing the cycle. 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 to the water in the boiler and the area under the process curve 4-1 represents the heat rejected in the condenser. The difference between these two (the area enclosed by the cycle curve) is the net-work produced during the cycle.
Energy Analysis of the Ideal Rankine Cycle
All four components associated with the Rankine cycle (the pump, boiler, turbine, and condenser) are steady-flow devices, and thus all four processes that make up the Rankine cycle can be analyzed as steady-flow processes.
The kinetic and potential energy changes of the steam are usually small relative to the work and heat transfer terms and are therefore usually neglected. Then the steady-flow energy equation per unit mass of steam reduces to
The boiler and the condenser do not involve any work, and the pump and the turbine are assumed to be isentropic. Then the conservation of energy relation for each device can be expressed as follows:
The thermal efficiency of the Rankine cycle is determined from:-
SOLUTION STEPS :-
- To Get different state variables, all the process parameters should be Expressed such as all four processes occurs and input parameters as state 1.
- From the standard Xsteam library to get the steam table data for water, most of the points in between state variables are calculated. AND their corresponding parameters such as enthalpy, entropy, specific heat, saturation temperature, etc.
- ALL the state points are used to find out net work done, work done by turbine, thermal efficiency, back work ratio, etc according to their thermodynamic relations and necessary formulas.
- To plot the property diagram of water, i.e., saturation liquid and vapour line , an array is created using linspace command from 0 to value of T1 with 5000 evenly spaced points in between them and suitable state variables are iterated using for loop.
- To plot T-s and h-s diagram, all the required points are plotted and marked using text command.
INPUT PARAMETERS
Turbine Inlet temperature = 400° C
Turbine Inlet Pressure = 30 bars
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
clear all
close all
clc
% Printing Introduction
fprintf(\'RANKINE CYCLE SIMULATOR \\n\')
fprintf(\'\\n1-2 is isentropic expansion in the Turbine \\n\')
fprintf(\'2-3 is Constant Pressure Heat Rejection by the Condenser \\n\')
fprintf(\'3-4 is isentropic Compression in pump \\n\')
fprintf(\'4-1 is Constant Pressure Heat Addition by the Boiler \\n\')
% User Inputs
P1 = input(\'\\nEnter the Pressure at the Turbine Inlet (in bar): \');
T1 = input(\'Enter the Temprature at the Turbine Inlet (in Degree Celcius): \');
P2 = input(\'Enter the Pressure at the Turbine Outlet (in bar): \');
% State point 1
H1 = XSteam(\'h_pt\',P1,T1); %Enthalpy
S1 = XSteam(\'s_pt\',P1,T1); %Entropy
Hf1 = XSteam(\'hL_p\',P1); %Enthalpy of saturated liquid
Hg1 = XSteam(\'hV_p\',P1); %Enthaply of saturated vapour
Ts1 = XSteam(\'Tsat_p\',P1); %Saturation Temprature
Sf1 = XSteam(\'sL_p\',P1); %Entropy of saturated liquid
Sg1 = XSteam(\'sV_p\',P1); %Entropy of saturated vapour
% State point 2
S2 = S1;
Sf2 = XSteam(\'sL_p\',P2);
Sg2 = XSteam(\'sV_p\',P2);
x = (S2-Sf2)/(Sg2-Sf2); % Dryness fraction
Hf2 = XSteam(\'hL_p\',P2);
Hg2 = XSteam(\'hV_p\',P2);
H2 = Hf2 + x*(Hg2-Hf2);
T2 = XSteam(\'T_ph\',P2,H2);
Ts2 = XSteam(\'Tsat_p\',P2);
% State point 3
H3 = Hf2;
S3 = Sf2;
T3 = T2;
P3 = P2;
% State point 4
P4 = P1;
S4 = S3;
H4 = XSteam(\'h_ps\',P4,S4);
T4 = XSteam(\'T_ps\',P4,S4);
t = linspace(0,374,500); % temp space for plotting saturation cutves
%Plot T-S Diagram
figure(1)
hold on
% Plot Saturation Curve
for i = 1 : length(t)
plot(XSteam(\'sL_T\',t(i)),t(i),\'.\',\'color\',\'b\')
plot(XSteam(\'sV_T\',t(i)),t(i),\'.\',\'color\',\'b\')
end
% Plot Cycle
plot([S1 S2],[T1 T2],\'linewidth\',2,\'color\',\'r\')
if x>1
T3 = Ts2;
plot([S2 Sg2 S3 S4],[T2 Ts2 T3 T4],\'linewidth\',2,\'color\',\'r\')
T2 = Ts2;
else
plot([S2 S3 S4],[T2 T3 T4],\'linewidth\',2,\'color\',\'r\')
end
l = linspace(T1,T2,1000);
for i = 1 : length(l)
plot(XSteam(\'s_pT\',P1,l(i)),l(i),\'.\',\'color\',\'r\')
end
plot([Sf1 Sg1],[Ts1 Ts1],\'linewidth\',2,\'color\',\'r\')
xlabel(\'Entropy[KJ/Kg-K]\')
ylabel(\'Temprature[K]\')
title(\'T-S Diagram\')
% Plot H-S Diagram
figure(2)
hold on
% Plot Saturation Curve
for i = 1 : length(t)
plot(XSteam(\'sL_T\',t(i)),XSteam(\'hL_T\',t(i)),\'.\',\'color\',\'b\')
plot(XSteam(\'sV_T\',t(i)),XSteam(\'hV_T\',t(i)),\'.\',\'color\',\'b\')
end
% Plot Cycle
plot([S1 S2 S3 S4 S1],[H1 H2 H3 H4 H1],\'linewidth\',2,\'color\',\'r\')
xlabel(\'Entropy[KJ/Kg-K]\')
ylabel(\'Enthalpy[KJ/Kg]\')
title(\'H-S Diagram\')
% calculations
% Turbine Work
Wt = H1-H2;
% Pump Work
Wp = H4-H3;
% Heat Addition
Qin = H1-H4;
% Heat Rejection
Qout = H2-H3;
% Net Work
Wnet = Wt-Wp;
% Efficiency
Ntherm = (Wnet/Qin)*100;
% Specific steam consumption
SSC = 3600/Wnet;
% Back Work Ratio
BWR = Wp/Wt;
% Print Results
fprintf(\'\\n\\nResults\\n\')
fprintf(\'At State Point 1:\\n\')
fprintf(\'P1 is : %.2f bar\\n\',P1)
fprintf(\'T1 is : %.2f Deg Celcius\\n\',T1)
fprintf(\'H1 is : %.2f KJ/Kg\\n\',H1)
fprintf(\'S1 is : %.2f KJ/Kg-K\\n\',S1)
fprintf(\'\\nAt State Point 2:\\n\')
fprintf(\'P2 is : %.2f bar\\n\',P2)
fprintf(\'T2 is : %.2f Deg Celcius\\n\',T2)
fprintf(\'H2 is : %.2f KJ/Kg\\n\',H2)
fprintf(\'S2 is : %.2f KJ/Kg-K\\n\',S2)
fprintf(\'\\nAt State Point 3:\\n\')
fprintf(\'P3 is : %.2f bar\\n\',P3)
fprintf(\'T3 is : %.2f Deg Celcius\\n\',T3)
fprintf(\'H3 is : %.2f KJ/Kg\\n\',H3)
fprintf(\'S3 is : %.2f KJ/Kg-K\\n\',S3)
fprintf(\'\\nAt State Point 4:\\n\')
fprintf(\'P4 is : %.2f bar\\n\',P4)
fprintf(\'T4 is : %.2f Deg Celcius\\n\',T4)
fprintf(\'H4 is : %.2f KJ/Kg\\n\',H4)
fprintf(\'S4 is : %.2f KJ/Kg-K\\n\',S4)
fprintf(\'\\nWt is : %.2f KJ/Kg\\n\',Wt)
fprintf(\'Wp is : %.2f KJ/Kg\\n\',Wp)
fprintf(\'Wnet is : %.2f KJ/Kg\\n\',Wnet)
fprintf(\'Thermal Efficiency is : %.2f percent\\n\',Ntherm)
fprintf(\'S.S.C. is : %.2f Kg/KWh\\n\',SSC)
fprintf(\'Back Work Ratio is : %.3f \\n\',BWR)
1) Start the program with \'clear all\',\'close all\', and \'clc\' command.
2) As our task is to take user input, to facilitate users to continue or end the program, we have introduced a while statement at the start of the script. While statement, the first step is to make provision for MatLab to accept user input. \'input()\' is used to provide the user input. The user input includes temperature and pressure before entry to the turbine and pressure after exiting to the turbine.
3) Now based on user inputs parameters at 4 state points are calculated. Thermodynamic parameters include enthalpy H, entropy S, temperature T, pressure P, and dryness factor X at state point 2. For calculating these parameters XSteam() i.e. steam table MatLab program is used. This program consists of functions for all thermodynamic properties. After calling these functions in the main script gives us thermodynamic properties based on other properties like temperature and pressure.
4) After calculating all parameters, the next objective is to calculate pump work, turbine work, net work output, back ratio, and thermal efficiency.
5) Now, we need to display all these results in the command window which is done by using command \'fprintf()\'.
6) The next objective is to plot the graph for H-S and T-S. The first step in plotting this graph is to plot the saturation curve which is calculated using \'for\' loop. Under \'for\' loop, values for entropy and enthalpy are calculated over a temperature range. Plotting these calculated values, the plot of a saturation curve can is obtained. Other processes are plotted by plotting respective values of H, S, T.
7) Now, when the program is run it asks the user to input Turbine Inlet temperature, Turbine Inlet Pressure, Turbine Outlet Pressure which is Condenser Inlet Pressure.
8) After the input parameters are given, all the results are displayed in the command window.
Results:
- First, the user has to input the given input parameters in the command window.
-
Turbine Inlet temperature = 400° C
-
Turbine Inlet Pressure = 30 bars
-
Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
-
References :
https://www.sciencedirect.com/topics/earth-and-planetary-sciences/rankine-cycle