Project 2 - Rankine cycle Simulator
$ AIM:
*To develop a basic programe that calculate the state points
*To add the thermodynamics relation to get the points inbetween the state varaibles
*To plot rankine cycle on T-S and H-S curve
# THEORY:
*The rankine cycle is the fundemental operating cycle in all power plants , where an operating fluid is countinusely evaporated and condensed
*The selection of operating fluid depands mainly on the available temperature range
*1-2 isentropic expansion:
*The vapour is expanded in the turbine . the producing work which may be converted into the electricity. the expansion is limited by the temperature of the cooling medium and by erosion of the turbine blade by the liquid entertainmet in the vapour steam as the process movies further into the two phase region. the exit vapour qualities should be the greater then 90% to increase the turbine blade
*2-3 constant pressure heat rejection:
*The condenser (2-3): the expanded vapour is then passed through a condenser, where it gets condensed and converts into the liquid again , the liquid is pupmped to the boiler
*3-4 isentropic copression by the pump:
*Pump (3-4) the water into the pump in satureted state. then the liquid is compressed isentropicaly until it meets the boiler pressure. work done by the pump
*4-1 constant pressure heat addiction:
*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
* applying the steady flow flow energy equation (SFEE) to all the process . neglelating the friction process and change in kinetic % potential energy
*Q1=h1-h4 @ boiler
*W1=h1-h2 @ turbine
*Q2=h2-h3 @ condenser
*Wp=h4-h3 @ pump
*the capacity of steam plant is often expressed interms of steam rate(SR) or specific steam consumpation(SSC)
* INPUTS:
* Turbine inlet temperature = 400c
*Turbine inlet pressure = 30bars
*Turbine outlet pressure = 0.05 bar = condenser inlet pressure
* MATLAP MAIN CODE
close all
clear all
clc
disp('RANKINE CYCLE');
disp('1-2 is isentropic expension in the turbine');
disp('2-3 is constant pressure heat rejection by the condenser');
disp('3-4 is isentropic expension in the pump');
disp('4-1 is constant pressure heat addition to the boiler');
%inputs
disp('inputs');
P1 = 30;
P2 = 0.05;
T1 = 400;
%calculating enthalphy (h) and entropy (s) at the point 1;
h1 = XSteam('h_pT',P1,T1);
s1 = XSteam('s_pT',P1,T1);
%calculating enthalphy (h) and entropy (s) at the point 2;
s2 = s1;
%for isentropic expension, (T2/T1)=(P2/P1)^(1-(1/g))
g=1.4;
power= 1-(1/g);
T2=T1*((P2/P1)^power);
h2=XSteam('h_pT',P2,T2);
%calculating pressure, enthalpy and entropy at point 2
%since constant pressure heat removel
P3=P2;
T3=T2
h3=XSteam('hL_T',T3);
s3=XSteam('sL_T',T3);
%calculating pressure, enthalpy and entropy at point 4
%since isentropic compression
s4=s3;
%since constant pressure process
P4=P1;
T4=XSteam('T_ps',P4,s4);
h4=XSteam('h_pT',P4,T4);
h41=XSteam('hL_p',P4);
s41=XSteam('sL_p',P4);
s42=XSteam('sV_p',P4);
h42=XSteam('hV_p',P4);
T41=XSteam('T_hs',h41,s41);
T42=XSteam('T_hs',h42,s42);
%calculating entropy and enthalpy at the satration curve
Temp=linspace(0,500,100);
for i= 1:length(Temp)
sv(i)=XSteam('sV_T',Temp(i));
sl(i)=XSteam('sL_T',Temp(i));
hv(i)=XSteam('hV_T',Temp(i));
hl(i)=XSteam('hL_T',Temp(i));
end
%calculting the net work output (W_net)
W_t=h1-h2;
W_p=h4-h3;
W_net=W_t-W_p;
%Calculating the back work ratio
Bw_ratio = W_p/W_t;
%calculating the thermal efficiency
Q_1 =h1-h4;
eff_thermal = (W_net/Q_1)*100;
%calculating specific steam consumation, lJ=3600 kg/s
ssc=3600/W_net;
%ploting the graph
figure(1)
plot([s1 s2],[T1 T2],[s2 s3],[T2 T3],[s3 s4],[T3 T4],[s4 s41],[T4 T41],[s41 s42],[T41 T42],[s42 s1],[T42 T1],'marker','*','color','r')
hold on
plot (sv,Temp)
plot (sl,Temp)
xlabel('entropy-s(kJ/kgK)');
ylabel('Temperature-T(K)');
text(s1,T2,{'1',''})
text(s2,T2,'2')
text(s3,T3,{'','3'})
text(s4,T4,{'4',''})
text(s41,T41,'4-1')
text(s42,T42,'4-2')
figure(2)
plot([s1 s2],[h1 h2],[s2 s3],[h2 h3],[s3 s4],[h3 h4],[s4 s1],[h4 h1],'marker','*','color','g')
hold on
plot (sv,hv)
plot(s1,h1)
xlabel('Entropy-s(kJ/kgK)');
ylabel('Enthalpy-h(kJ/K)');
text(s1,h1,'1')
text(s2,h2,'2')
text(s3,h3,{'','3'})
text(s4,h4,{'4',''})
text(s41,h41,'4-1')
text(s42,h42,'4-2')
%displaying results in the command window
disp('results');
disp('At stage point 1');
n1=sprintf('P1 is %.3f bar',P1);
disp(n1);
n2=sprintf('T1 is %.3f C',T1);
disp(n2);
n3=sprintf('h1 is %.3f kJ/kg',h1);
disp(n3);
n4=sprintf('s1 is %.3f kJ/kgK',s1);
disp(n4);
disp('At the stage point 2');
m1=sprintf('P2 is %.3f bar',P2);
disp(m1);
m2=sprintf('T2 is %.3f C',T2);
disp(m2);
m3=sprintf('h2 is %.3f kJ/kg',h2);
disp(m3);
m4=sprintf('s2 is %.3f kJ/kgk',s2);
disp(m4);
disp('At the stage point 3');
l1=sprintf('P3 is %.3f bar',P3);
disp(l1);
l2=sprintf('T3 is %.3f C',T3);
disp(l2)
l3=sprintf('h3 is %.3f kJ/kg',h3);
disp(l3)
l4=sprintf('s3 is %.3f kJ/kgk',s3);
disp(l4);
disp('At the stage point 4');
k1=sprintf('P4 is %.3f bar',P4);
disp(k1);
k2=sprintf('T4 is 5.3f C',T4);
disp(k2);
k3=sprintf('h4 is %.3f kJ/kg',h4);
disp(k3);
k4=sprintf('s4 is %.3f kJ/kgk',s4);
disp(k4);
n5=sprintf('W_t is %.3f kJ/kg',W_t);
disp(n5);
n6=sprintf('W_p is %.3f kJ/kg',W_p);
disp(n6);
n7=sprintf('W_net is %.3f kJ/kg',W_net);
disp(n7);
n8=sprintf('Eff_Thermal is %2f percent',eff_thermal);
disp(n8);
n9=sprintf('ssc is %.2f kg/kWh',ssc);
disp(n9);
* RESULTS:
* The rankine cycle plot was generated and calculated the state points the efficiency and the output is printed in the command window and i summit my outputs and results,
* EXPLANATION
* To start with close all ,clear all and clc commend to clear the dates in matlap
*Inputs varaibles (p1,T1,p2) are given by input command whose values are entered in the command window while executing the programme
*State - 1: values for enthalpy and entropy are extrated as a function pf pressure @ temperature
*h_pT, s_pT, sV_p etc are the default varaibles whose values is strored in XSteam file
*Similarly all the varaibles for the all states are extrated by using suitable format
*Pressure , Temperature , Enthalpy , Entropy for all the state varaibles are extreted of function of the depandsentant varaibles from the XSteam file
*State - 2: Is a condenser inlet where the high-pressure is converted into the low-pressure water and hence dryness fraction, enthalpy @ entropy for the saturated vapour and water are considered to calculate the specific enthalpy
*State - 3: The water is condensed back to its saturation temperature and feb into the pump this temperature of water at the exit of the condenser and entry of pump is the same
*State - 4: This is the constant pressure heat addition and hence pressure is equal to the p1, but the temperature is increses on heating at the condtant pressure and constant volume as our entropy remains same and hence cp/cv=gamma is considering to find temeprature T4
*Define the two more points 5 and 6 to plot the cycle with deatils
*Then we calculated the work done and heat evolved and SSC are calulated by the using the basic forumla
*To plot the saturation curve a temperature range is defined using linspace command and for overall length of this temperature values of enthalpy and entropy are calulated at every temperature points the break in the saturation curve seperates the liquid phase and vapour phase
*Now we found out the all data then we need to plot the T-S and H-S curevs using the plot command and annotation are assigned by using the text command
*Finally the results of ranline cycle simulation is dipalyed over he command window using the fprintf command