Challenge

Project 2 - Rankine cycle Simulator

Rankine Cycle:

Rankine cycle is the simplest and an ideal cycle for vapor power cycles. Rankine cycle consists of four components and four thermodynamic procedures. Therefore each one of the procedure occurs in each constituent. The four constituents are shown in figure as follows.

The four procedures occur in rankine cycle are as follows:

• The procedure 1-2 is isentropic expansion in the turbine,
• The procedure 2-3 is isobaric reversible heat refusal in the condenser,
• The procedure 3-4 is a reversible adiabatic compression takes place in pump, and
• The procedure 4-1 is an isobaric heat addition procedure in the boiler.

To analyze and determine the effectiveness of rankine cycle by taking functioning fluid as water (1 kg) flowing via all the components of rankine cycle system. By noticing the rankine cycle in P-V, T-S and H-S diagrams as shown in figure (b) above for computing the efficiency of the rankine cycle.

The heat supplied = Q1 = (h1 – h3) – Wp
Here Wp = (h4 – h3) is termed as pump work per kg steam.
The heat discarded into the condenser = Q2 = (h2 – h3)
Total work done per kg of steam W = Q1 – Q2 = WT – Wp = (h1 – h3) – Wp
Here WT = turbine work

Whenever pump work is negligible, the Rankine cycle efficiency will be,

The expression of thermal efficiency can as well be build up by introducing thermodynamic mean temperature of heat adding together. Thermodynamic mean temperature of heat addition,

When pump work is neglected then,

For Calculations all governing equations are:

MATLAB Code:

%Programme for simulating Rankine Cycle

%Clear Workspace,command window and close all plots
clear all
close all
clc

%Print the Rankine cycle process discription
fprintf('    #RANKINE CYCLE SIMULATOR# \n \n \n');
fprintf('The procedure 1-2 is ISENTROPIC EXPANSION in the turbine \n');
fprintf('The procedure 2-3 is ISOBARIC REVERSIBLE HEAT REFUSAL in the condenser \n');
fprintf('The procedure 3-4 is a REVERSIBLE ADIABETIC COMPRESSION takes place in pump \n');
fprintf('The procedure 4-1 is an ISOBARIC HEAT ADDITION procedure in the boiler \n');

%Providing all the given inputs data
p1 = input('Enter the fluid pressure at the Turbine inlet(in bar): \n');
t1 = input('Enter the fluid temperature at the Turbine inlet(in Degree Celsius): \n');
p2 = input('Enter the fluid pressure at the Condenser inlet(in bar): \n');
fprintf('\n    Results   \n');

%Calculating the required inputs from the Data given
%Finding the cp value at p1 and p2 for saturated liquid and vapour
cp1_v = XSteam('CpV_p',p1);
cp2_v = XSteam('CpV_p',p2);
cp1_l = XSteam('CpL_p',p1);
cp2_l = XSteam('CpL_p',p2);
%Finding Saturation Temperature at Pressure p1 and p2
Tsat_p1 = XSteam('Tsat_p',p1);
Tsat_p2 = XSteam('Tsat_p',p2);

%Calculating the Enthalpy(KJ/kg) and Entropy(KJ/kgK) at Saturation point
%Find Saturated vapour enthalpy(Hg) and entropy(Sg) at state-1(Boiler Out)
Hg_1 = XSteam('hV_p',p1);
Sg_1 = XSteam('sV_p',p1);
%Find Saturated vapour enthalpy(Hg) and entropy(Sg) at state-2(Turbine Out)
Hg_2 = XSteam('hV_p',p2);
Sg_2 = XSteam('sV_p',p2);
%Find Saturated Liquid enthalpy(Hg) and entropy(Sg) at state-3(Condenser Out)
Hf_2 = XSteam('hL_p',p2);
Sf_2 = XSteam('sL_p',p2);
%Find Saturated Liquid enthalpy(Hg) and entropy(Sg) at state-4(Pump Out)
Hf_1 = XSteam('hL_p',p1);
Sf_1 = XSteam('sL_p',p1);

%Calculate the 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);
%Enthalpy of superheated water vapour at the exit of the boiler
h1 = XSteam('h_pT',p1,t1);
fprintf('h1 is : %f KJ/kg  \n',h1);
%Entropy of superheated water vapour at the exit of the boiler
s1 = XSteam('s_pT',p1,t1);
fprintf('s1 is : %f KJ/kg.K  \n\n',s1);

%Calculate the State Properties at state-2
fprintf('At state point-2  \n');
fprintf('p2 is : %f bar  \n',p2);
%Since entropy at state-1 and state-2 do not change
s2 = s1;
fprintf('s2 is : %f KJ/kg.K  \n',s2);

%calculate the Dryness Fraction(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
%finding the value of Enthalpy(h2) at state-2 using X2
if X2 < 1
    %since Temperature drops inside the Turbine
    t2 = Tsat_p2;
    %enthalpy of wet steamat the turbine exit, i.e. at the condenser inlet
    h2 = Hf_2+X2*(Hg_2-Hf_2);
else
    %s2 = Sg_2+cp2_v*(log(t2/Tsat_p2)
    t2 = (Tsat_p2+273.15)*exp((s2-Sg_2)/cp2_v);
    %converting to degC
    t2 = t2-273.15;
    h2 = XSteam('h_pT',p2,t2);
end
fprintf('t2 is : %f degC  \n',t2);
fprintf('h2 is : %f KJ/kg  \n\n',h2);

%Finding the state variables at state-3
fprintf('At State point-3  \n');
%Pressure of fluid is same at Turbine outlet and condeser out
p3 = p2;
fprintf('p3 is : %f bar  \n',p3);
%since no subcooling is expected
t3 = Tsat_p2;
fprintf('t3 is : %f degC  \n',t3);
v3 = XSteam('vL_p',p3);
%Enthalpy of water at the condenser outlet
h3 = Hf_2;
fprintf('h3 is : %f KJ/kg  \n',h3);
%phase transition vapour to liquid
s3 = Sf_2;
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);
%since the entropy pf liquid do not change while pumping
s4 = s3;
fprintf('s4 is : %f KJ/kg.K  \n',s4);
%Workdone by pump is wp
wp = v3*(p4-p3)*100;
%Enthalpy of water at the boiler inlet, i.e. at the pump outlet
h4 = wp+h3;
fprintf('h4 is : %f KJ/kg  \n',h4);
t4 = (Tsat_p1+273.15)/(exp((Sf_1-s4)/cp1_l));
%converting from kelvin to degC
t4 = t4-273.15;
fprintf('t4 is : %f degC  \n\n',t4);

%Calculate the plot 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],'color','r','linewidth',2)
text(s1,t1,'1')
text(s2,t2,'2')
%plot([s2 Sg_2],[t2 Tsat_p2],'color','r','linewidth',2)
%text(Sg_2,Tsat_p2,'2s')
plot([s2 s3],[t2 t3],'color','m','linewidth',2)
text(s3,t3,'3')
plot([s3 s4],[t3 t4],'color','k','linewidth',2)
text(s4,t4,'4')
plot([s4 Sf_1],[t4 Tsat_p1],'color','g','linewidth',2)
text(Sf_1,Tsat_p1,'4s')
plot([Sf_1 Sg_1],[Tsat_p1 Tsat_p1],'color','g','linewidth',2)
text(Sg_1,Tsat_p1,'1s')
plot([Sg_1 s1],[Tsat_p1 t1],'color','g','linewidth',2)
plot(s_l,temp,'color','b','linestyle','--','linewidth',1)
plot(s_v,temp,'color','y','linestyle','--','linewidth',1)
title('T-S Diagram of Ideal Rankine Cycle')
legend('ISENTROPIC EXPANSION','ISOBARIC REVERSIBLE HEAT REFUSAL','REVERSIBLE ADIABETIC COMPRESSION','ISOBARIC HEAT ADDITION','location','southeast');
xlabel('Temperature (deg C)')
ylabel('Specific Entropy(KJ/kg.K)')

%Plotting the H-S Diagram
figure(2)
hold on
plot([s1 s2],[h1 h2],'color','r','linewidth',2)
text(s1,h1,'1')
text(s2,h2,'2')
%plot([s2 Sg_2],[h2 Hg_2],'color','r','linewidth',2)
%text(Sg_2,Hg_2,'2s')
plot([s2 s3],[h2 h3],'color','m','linewidth',2)
text(s3,h3,'3')
plot([s3 s4],[h3 h4],'color','k','linewidth',2)
text(s4,h4,'4')
plot([s4 Sf_1],[h4 Hf_1],'color','g','linewidth',2)
text(Sf_1,Hf_1,'4s')
plot([Sf_1 Sg_1],[Hf_1 Hg_1],'color','g','linewidth',2)
text(Sg_1,Hg_1,'1s')
plot([Sg_1 s1],[Hg_1 h1],'color','g','linewidth',2)
plot(s_l,h_l,'color','b','linestyle','--','linewidth',1.5)
plot(s_v,h_v,'color','y','linestyle','--','linewidth',1.5)
title('H-S Diagram of Ideal Rankine Cycle')
legend('ISENTROPIC EXPANSION','ISOBARIC REVERSIBLE HEAT REFUSAL','REVERSIBLE ADIABETIC COMPRESSION','ISOBARIC HEAT ADDITION','location','southeast');
xlabel('Specific Enthalpy (KJ/kg)')
ylabel('Specific Entropy(KJ/kg.K)')

%Calculate 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 KJ/kg  \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/wnet;
fprintf('Specific Steam Consumption is : %f kg/KWh  \n',SSC);
%Back Work Ratio is BWR
BWR = wp/wt;
fprintf('Back Work Ratio is : %f  \n',BWR);

For writing this programme using XSteam.m which is basically steam table.

Start with clearing workspace , closing all plots and clear command window. after that using fprintf command printing the description of all process for Rankine cycle in command window.

next using input() command ask for inputs which includes temperature and pressure before entry to turbine and pressure after exit to turbine.

for all four state point we need to find the value of enthalpy,entropy,temperature and pressure which is obtained from XSteam() command. also finding the value for dryness fraction at state point 2.

now for this all four state point plotting the values for H-S and T-S diagrame and given title, legends and axis lables.

after that calculations for pump work, turbine work, net work output, back ratio, thermal efficiency etc.

and printing the all results in the command window for the all outputs.

Command Window Output:

Plots for Rankine Cycle

T-S Diagram:

H-S Diagram:

Conclusion:

For Given Input

Net Work Output = 1117.85 KJ/kg

Back Work Ratio = 0.00268

References:

https://energyeducation.ca/encyclopedia/Rankine_cycle

http://www.ecourses.ou.edu/cgi-bin/ebook.cgi?topic=th&chap_sec=10.1&page=theory

https://www.slideshare.net/Lahiru_Dilshan/thermodynamic-assignment-2

http://www.expertsmind.com/topic/vapor-power-cycles/rankine-cycle-97680.aspx

https://en.wikipedia.org/wiki/Rankine_cycle

Errors facing during making programme:

error getting when going to plot saturation lines for vapour and liquid due to the for loop is not proper done, after some research and trying many times solving the error and getting the right output.

also some typo errors during making code. example use Xsteam insted of XSteam.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.