Project 2 - Rankine cycle Simulator
To simulate the Rankine Cycle and plot the corresponding T-S and H-S plots using MATLAB.
Objective:
- Calculate the state points of the Rankine Cycle based on given inputs.
- Plot the corresponding T-S and H-S plots for the given set of inputs.
Given:
- Turbine Inlet temperature = 400° C
- Turbine Inlet Pressure = 30 bars
- Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure
Required Output Values:
- Net work output
- Back work ratio
"Note: The standard Xsteam library is used to get the steam table data for water is given, which is used to calculate the points in between the state variables."
Introduction:
Rankine cycle converts thermal energy to mechanical energy.
On-road vehicles, which convert around one-third of the fuel energy into useful mechanical energy for propulsion, are moving energy conversion systems that generate considerable waste heat.
It is found from prior research that the Rankine Cycle has great potential in automobile waste heat harvesting applications which can, in turn, be connected to the combustion engine which will result in
better-wasted heat consumption and increasing the performance of the vehicle and helping theenvironment.
Rankine cycle is the most basic thermodynamic cycle for any steam powerplant. It starts with the heating of water in the boiler at constant pressure to produce steam. The steam produced is then isentropically expanded in the turbine to produce work. After the turbine, the steam goes into the condenser where it is cooled and converted into the water at constant pressure. The water is then again pumped back to the boiler by a pump and the cycle continues.
The ideal Rankine cycle consists of the following four processes:
i. 1-2: Isentropic compression in a pump
ii. 2-3: Constant pressure heat addition in a boiler
iii. 3-4: Isentropic expansion in a turbine
iv. 4-1: Constant pressure heat rejection in a condenser
Procedure:
1. First, it was pointed out to quantify all the necessary variables and parameters.
2. Then, all the parameters were sorted out using the 'XSteam' library function.
3. The usual calculations and plotting of the graphs were then done according to the theory of
Thermal thermodynamics.
Rankine cycle in Matlab:
% Rankine Cycle Simulator
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)
Steps:
1) begin the program with 'clear all','near all', and 'clc' command.
2) As our challenge is to take person enter, to facilitate users to continue or stop this system, we've delivered a while assertion on the begin of the script. whilst announcement, step one is to make provision for MatLab to simply accept person enter. 'enter()' is used to offer the consumer enter. The consumer input consists of temperature and pressure earlier than access to the turbine and stress after exiting to the turbine.
3) Now based totally on consumer inputs parameters at four state points are calculated. Thermodynamic parameters consist of enthalpy H, entropy S, temperature T, stress P, and dryness issue X at country point 2. For calculating those parameters XSteam() i.e. steam table MatLab application is used. This program consists of functions for all thermodynamic houses. After calling these capabilities within the important script offers us thermodynamic homes based totally on other properties like temperature and stress.
4) After calculating all parameters, the following objective is to calculate pump paintings, turbine paintings, net paintings output, again ratio, and thermal efficiency.
5) Now, we need to display a majority of these consequences inside the command window that's done by means of the use of command 'fprintf()'.
6) the next goal is to plan the graph for H-S and T-S. the first step in plotting this graph is to plot the saturation curve that is calculated the use of 'for' loop. below 'for' loop, values for entropy and enthalpy are calculated over a temperature variety. Plotting those calculated values, the plot of a saturation curve can is obtained. other methods are plotted by way of plotting respective values of H, S, T.
7) Now, while the program is run it asks the user to input Turbine Inlet temperature, Turbine Inlet strain, Turbine Outlet pressure that's Condenser Inlet pressure.
8) After the input parameters are given, all of the results are displayed inside 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
Command Window:
T-S plots:
H-S plots:
Workspace Valves :
Errors:
No perplexed errors occurred while running the MATLAB program.
Conclusion:
Rankine cycle is the basic cycle for understanding about the steam turbine systems in
thermodynamics.
The required output values are obtained for the given input parameters:
Net work output = 1117.87 KJ/Kg
Back work ratio = 0.003
Thus, the Rankine cycle is successsfully simulated using MATLAB.