Project 2 - Rankine cycle Simulator
AIM:
To create a Rankine Cycle Simulator using MATLAB program.
OBJECTIVE:
1.Calculate each state points of the Rankine Cycle base on user inputs.
2.Plot the corresponding T-S and H-S plots for the given set of inputs.
3.Calculate the efficiency.
THEORY:
The Rankine cycle is an idealzed thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing a phase change. It is an ideallized cycle in which friction losses in each of the four components are reglected. The heat is supplied externally to a closed loop,which usually uses water as the working fluid.

FOUR COMPONENTS OF THE RANKINE CYCLE:
1.Pump- The pump's job is to deliver liquid to the boiler.
2.Boiler- The boiler's job is to heat the liquid and turn it to vapor.
3.Turbine- A turbine is a turbomachine with at least one moving part called a rotor assembly, which is a shaft or drum with blades attached.
4.Condenser- The outdoor portion of an air conditioner or heat pump that either releases or collects heat.
FOUR PROCESS OF THE RANKINE CYCLE:
ISENTROPIC EXPANSION(1-2):
Turbine(1-2):
Super heated 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 convered into electric energy.Work produced by the turbine.
WT = m(h1-h2)K
CONSTANT PRESSURE HEAT REJECTON(2-3):
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.
QT = m(h2-h3)K
ISENTROPIC COMPRESSION BY THE PUMP(3-4):
PUMP(3-4):
The water enters into the pump in a saturated state. Then the liquid is compressed isentropically unit it meets the boiler pressure. Work done by the pump is.
WP = m(h3-h4)K
CONSTANT PRESSURE HEAT ADDITON:
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 is supplied by the boiler is
QB = m(h1-h4)K
The efficiency of the Steam Cycle is given by,
`eta` = Wn/Q1 = WT-WP/Q1
Applying the Steady Flow Energy Equation(SPEE) to all the process neglecting the friction losses and changes in Kinetic and Potential Energy.
Q1 = h1-h4 @Boiler
Wt = h1-h2 @Turbine
Q2 = h2-h3 @Condenser
Wp = h4-h3 @Pump
The capacity of the steam plant is often expressed in terms of Steam Rate(SR) or SPecific Steam Consumption(SSC)
SSC = 3600/Wn (kg/kWh).
REQUIRED INPUTS:
Turbine Inlet Temperature =400°C
Turbine Inlet Pressure = 30bars
Turbine Outlet Pressure = 0.05bars = Condenser Inlet Pressure
PROGRAM:
clear all
close all
clc
disp('RANKINE CYCLE SIMULATOR')
disp('1-2 = isentrpic expansion in the turbine');
disp('2-3 = constant pressure heat rejection by the condensor');
disp('3-4 = isentropic compression in the pump');
disp('4-1 = constant pressure heat addition by the boiler');
t1 = input('Enter the temperature at the turbine inlet(in degree celsius):');
p1 = input('Enter the pressure at the turbine inlet(in bar):');
p2 = input('Enter the pressure at condensor(in bar):');
fprintf('rRESULTSrn')
%stage 1 turbine inlet
s1 = XSteam('s_pT',p1,t1);
h1 = XSteam('h_pT',p1,t1);
%stage 2 condensor heat
sf2 = XSteam('sL_p',p2);
sg2 = XSteam('sV_p',p2);
hf2 = XSteam('hL_p',p2);
hg2 = XSteam('hL_p',p2);
s2 = s1;
t2 = XSteam('Tsat_p',p2);
%spliting the formula
x2 = ((s2-sf2)/(sg2-sf2));
h2 = hf2+(x2*(hg2-hf2));
%stage 3 pump inlet
p3 = p2;
t3 = XSteam('Tsat_p',p2);
s3 = XSteam('sL_p',p3);
h3 = XSteam('hL_p',p3);
cp4 = XSteam('cpL_p',p3);
cv4 = XSteam('cvL_p',p3);
gamma = (cp4/cv4);
g = (gamma-1)/gamma;
%stage 4 boiler inlet
p4 = p1;
s4 = s3;
h4 = XSteam('h_ps',p4,s4);
t4 = t3*((p4/p3)^g);
%turbine work
wt = h1-h2;
%pump work
wp = h4-h3;
%ntework
w_net = wt-wp;
%heat of in and out of the system
q_in = h1-h4;
q_out = h2-h3;
q_in = h1-h4;
q_out = h2-h3;
n = w_net/q_in;
np = n*100;
SSC = 3600/w_net;
tf_sat = XSteam('Tsat_p',p1);
sf_sat = XSteam('sL_p',p1);
hf_sat = XSteam('hL_p',p1);
sg_sat = XSteam('sV_p',p1);
hg_sat = XSteam('hV_p',p1);
%ploting
figure(1)
hold on
temp = linspace(0,400,1000);
for i = 1:length(temp)
aa(i) = XSteam('sL_T',temp(i));
end
for j = 1:length(temp)
bb(j) = XSteam('sV_T',temp(j));
end
plot(aa,temp,'color','b')
plot(bb,temp,'color','b')
temp = (XSteam('Tsat_p',p1));
t0 = linspace(temp,t1,300);
for i = 1:length(t0)
cc(i) = XSteam('s_pt',p1,t0(i));
end
t5 = XSteam('Tsat_p',p4);
s5 = XSteam('sL_T',t5);
plot([s1 s2],[t1 t2],'color','r')
plot([s2 s3],[t2 t3],'color','r')
plot([s3 s4],[t3 t4],'color','r')
plot([s4 s5],[t4 t5],'color','r')
plot([sf_sat sg_sat],[tf_sat tf_sat],'color','r')
plot(cc,t0,'color','r')
title('T-S DIAGRAM')
xlabel('ENTROPY(KJ/kgK)')
ylabel('TEMPERATURE(K)')
text(s1,t1,'1');
text(s2,t2,'2');
text(s3,t3,'3');
text(s4,t4,'4');
text(s5,t5,'4s');
text(sg_sat,tf_sat,'1s');
%ploting
figure(2)
hold on
temp1 = linspace(0,400,1000);
for i = 1:length(temp1)
cc(i) = XSteam('hL_T',temp1(i));
end
for j = 1:length(temp1)
dd(j) = XSteam('hV_T',temp1(j));
end
plot(aa,cc,'color','b')
plot(bb,dd,'Color','b')
plot([s1 s2],[h1 h2],'Color','r')
plot([s2 s3],[h2 h3],'Color','r')
plot([s3 s4],[h3 h4],'Color','r')
plot([s4 s1],[h4 h1],'Color','r')
title('H-S DIAGRAM')
xlabel('ENTROPY(KJ/KgK)')
ylabel('ENTHALPY(KJ/Kg)')
text(s1,h1,'1');
text(s2,h2,'2');
text(s3,h3,'3');
text(s4,h4,'4');
%printing the output
disp('at stage point 1:')
fprintf('P1 is : %f barn',p1)
fprintf('T1 is : %f deg celcius',t1)
fprintf('H1 is : %f KJ/kgn',h1)
fprintf('S1 is : %f KJ/KgKbn',s1)
disp('at stage point 2:n')
fprintf('P2 is : %f barn',p2)
fprintf('T2 is : %f deg celcius',t2)
fprintf('H2 is : %f KJ/kgn',h2)
fprintf('S2 is : %f KJ/KgKbn',s2)
fprintf('X is : %f rn',x2)
disp('at stage point 3:n')
fprintf('P3 is : %f barn',p3)
fprintf('T3 is : %f deg celcius400',t3)
fprintf('H3 is : %f KJ/kgn',h3)
fprintf('S3 is : %f KJ/KgKbn',s3)
disp('at stage point 4:n')
fprintf('P4 is : %f barn',p4)
fprintf('T4 is : %f deg celcius',t4)
fprintf('H4 is : %f KJ/kgn',h4)
fprintf('S4 is : %f KJ/KgKrn',s4)
fprintf('Wt : %f KJ/Kgn',wt)
fprintf('Wp : %f KJ/Kgn',wp)
fprintf('Wnet : %f KJ/Kgn',w_net)
fprintf('Ntherm : %f %n',n*100)
fprintf('SSC : %f KJ/KWbn',SSC)
EXPLANATIONS:
1.The program begins with clc commands to clean the workspace and plots.
2.Input variables p1,T1,p2 are given by input command whose values are entered in command window while executing the program.
3.In State-1 Values for Enthalpy and Entropy are extracted as function of Pressure and Temperature.
4.h_pT,s_pT,hL_p,sV-p are some of the default variables whose value is stored in XSteam file.
5.All the varialbes for all states are extracted using a suitable format.
6.Pressure,Temperature,Enthalpy,Entropy for all the state variables are extracted as a function of the dependent variable from the XSteam file.
7.In State-2 is a Condenser inlet where the High pressure steam is converted into Low pressure water and hence Dryness Fraction,Enthalpy and Entropy for Saturated Vapour and Saturated Water are considered to Calculate the Specific Enthalpy.
8.In State-3 The water is condensed back to its Saturation Temperature and fed to the pump.This temperature of water at the exit of the Condenser and entry of pump is the same.
9.In State-4 This is Constant Pressure Heat addition,hence pressure is equal to p1,but the temperature increases on heating at Constant Pressure & Constant Volume as our entropy remains ame and hence Cp/Cv = gamma is considered to find the temperature T4.
10.Work done and Heat evolved & SSC are calculated by basic formulae.
11.To plot the Saturation Curve a temperature range is defined using linspace command and for the overall length of this Temperature values of Enthalpy and Entropy are calculated at every temperature point. The break in the Saturation Curve separates the Liquid Phase & Vapour phase.
12.Plotting is done for both the T-S and H-S curves using the plot commands. Annotations are assigned using text command.
13.Results of the Cycle Simulation is displayed over command window using fprintf command.
ERRORS WHILE PROGRAMING:
1.

Declared my variables wrongly. By seeing command window i rrectified my error.
2.

Decleared my variable wrongly. By seeing command window i rectified my error.
3.

Made a typo error. By seeing command window i rectified my errors.
OUTPUT:
PLOTS:
1.T-S DIAGRAM:

2.H-S DIAGRAM:

OUTPUT IN WORKSPACE COMMAND:


OBSERVATION:
T-S and H-S values are ploted and Efficeincy is calculated.
RESULT:
Thus the Rankine Cycle Simulator is programmed using MATLAB program and verified sucessfully.
REFERNCES: