Challenge

Project 2 - Rankine cycle Simulator

Aim :- Write a Program to Calculate the Work Done and Thermal efficiency of the Rankine cycle simulator .

Objective :-

  • Create a Rankine Cycle simulator using matlab .
  • The code runs on the state points of the Rankine cycle based on given temperature , pressure.
  • Then plot the corresponding T-s and H-s on inputs .
  • Title and axis label are label with Entropy and Enthapy.

Introduction :-

  • The rankine cycle is the process widely used by power plant such as coal fired power plant or nuclear reactors.In this cycle a fuel is used to produced heat with the boiler,Converting water into steam which then expands through a turnbine producing useful work.this process was developed in 1859 by scottish engineer william J.M Rankine.This is a thermodynamic cycle which converts mechanical energy which usually gets transformed into electrical energy.

The Steps in the Rankine Cycle :

  1. Pump :- Comperssion of the fluid to high pressure using a pump.
  2. Boiler :- The Compressed fluid is heated to the final temperature . Therefore,a phase changes occurs from liquid to vapour.
  3. Turbine :- Expansion of the vapour in the turbine.
  4. Condenser :- Condensation of the vapour in the condenser [where the used heat goes to final heat sink].

Steps followed in T-S diagram :-

  • Process 1-2 : Isentropic compression in pump . Here the working fluid is pumped from low to high pressure.
  • Process 2-3 : Constant pressure heat addition in the boiler.In this process,the high-pressure liquid is added to the boiler and is heated at constant pressure to become a dry saturated vapour .
  • Process 3-4 : Isentropic expansion in a turbine,the dry saturated vapour expands through the turnbine resulting in the generation of power.
  • Process 4-1 : Constant pressure heat rejection in a condenser.Wet vapour is conddensed at a constant pressure to beacome a saturated liquid.

Main Program :-

close all 
clear all
clc

% Display rankine cycle simulator and its process
disp("         Rankine cycle simulator")
fprintf('\n 1-2  is the  isentropic expansion process')
fprintf('\n 2-3  is the constant pressure heat rejection process')
fprintf('\n 3-4  is the isentropic compression process')
fprintf('\n 4-1  is the constant pressure heat addition process')



% Variables At Stage 1 
p1 = 30;
t1 = 400;
h1 = XSteam('h_pT',30,400);
s1 = XSteam('s_ph',30,h1);
fprintf('\n\n           Results')
fprintf('\n\n At state point 1')
fprintf('\n P1 is:%f bar',p1)
fprintf('\n T1 is:%f deg celcius',t1)
fprintf('\n H1 is:%f KJ/Kg',h1)
fprintf('\n S1 is:%f KJ/KgK',s1)


% Variables At Stage 2
p2 = 0.5;
s2 = s1;
t2 = XSteam('T_ps',0.5,6.1858);
sf2 = XSteam('sL_p',p2);
sg2 = XSteam('sV_p',p2);
hf2 = XSteam('hL_p',p2);
hg2 = XSteam('hV_p',p2);
x = ((s2 - sf2)/(sg2 - sf2));
h2 = hf2 + (x*(hg2 - hf2));
v2 = XSteam('v_ph',p2,h2);
fprintf('\n\n At state point 2')
fprintf('\n P2 is:%f bar',p2)
fprintf('\n T2 is:%f deg celcius',t2)
fprintf('\n H2 is:%f KJ/Kg',h2)
fprintf('\n S2 is:%f KJ/KgK',s2)

% Variables At Stage 3 
t3 = t2;
p3 = p2;
s3 = XSteam('sL_p',p3);
h3 = XSteam('hL_T',32.875);
v3 = XSteam('v_ph',p3,h3);
fprintf('\n\n At state point 3')
fprintf('\n P3 is:%f bar',p3)
fprintf('\n T3 is:%f deg celcius',t3)
fprintf('\n H3 is:%f KJ/Kg',h3)
fprintf('\n S3 is:%f KJ/KgK',s3)

% Variables At Stage 4 
s4 = s3;
v4 = v3;
p4 = p1;
h4 = XSteam('h_ps',p4,s4);
t4 = XSteam('T_hs',h4,s4);
fprintf('\n\n At state point 4')
fprintf('\n P4 is:%f bar',p4)
fprintf('\n T4 is:%f deg celcius',t4)
fprintf('\n H4 is:%f KJ/Kg',h4)
fprintf('\n S4 is:%f KJ/KgK',s4)


% Variables At Stage 5 
p5 = p4;
t5 = XSteam('Tsat_p',p5);
h5 = XSteam('hL_T',t5);
s5 = XSteam('sL_p',p5);
fprintf('\n\n At state point 5')
fprintf('\n P5 is:%f bar',p5)
fprintf('\n T5 is:%f deg celcius',t5)
fprintf('\n H5 is:%f KJ/Kg',h5)
fprintf('\n S5 is:%f KJ/KgK',s5)


% Variables At Stage 6 
t6 = t5;
p6 = XSteam('psat_T',t5);
s6 = XSteam('sV_T',t6);
h6 = XSteam('hV_T',t6);
fprintf('\n\n At state point 6')
fprintf('\n P6 is:%f bar',p6)
fprintf('\n T6 is:%f deg celcius',t6)
fprintf('\n H6 is:%f KJ/Kg',h6)
fprintf('\n S6 is:%f KJ/KgK',s6)

v3 = XSteam('vL_p', p3);

Wp = v3 * (p4 - p3) * 100;
h4 = Wp + h3;
fprintf('h4 is : %f kJ/kg\n'), h4

% loop to find variables on saturation lines
t = linspace(0,400,1000);
for i=1:length(t)
s_line1(i)=XSteam('sL_T',t(i));
end

for j=1:length(t)
s_line2(j)=XSteam('sV_T',t(j));
end

for i=1:length(t)
h_line1(i)=XSteam('hL_T',t(i));
end

for j=1:length(t)
h_line2(j)=XSteam('hV_T',t(j));
end

%Calculating Work and Efficiency
Wt = h1 - h2;
fprintf('Work by turbine is : %f kJ/kg\n', Wt)
fprintf('Work by compressor is : %f kJ/kg\n', Wp)
Wnet = Wt - Wp;
fprintf('Net Wok done is : %f kJ/kg\n', Wnet)
Qin = h1 - h4;
eff_thermal = Wnet / Qin ;    % Effieciency
fprintf('Thermal efficiency is : %f', eff_thermal); disp('%')
SSC = 3600 / Wt;    % Specific steam consuption
fprintf('S.S.C is : %f kg/kWh ', SSC)



%plotting T-s graph
figure(1)
hold on
plot([s_line1 s_line2],[t t])
plot([s1 s2 s3 s4 s5 s6 s1],[t1 t2 t3 t4 t5 t6 t1])
text(s1,t1,'1')
text(s2,t2,'2')
text(s3,t3,'3')
text(s4,t4,'4')
text(s5,t5,'5')
text(s6,t6,'6')
title("Rankine cycle T-S Diagram")
xlabel('Entropy(KJ/KgK)')
ylabel('Temperature(K)')
axis([0,8,0,450])



%plotting h-s graph
figure(2)
hold on
plot([s_line1 s_line2],[h_line1 h_line2])
plot([s1 s2 s3 s4 s5 s6 s1],[h1 h2 h3 h4 h5 h6 h1])
text(s1,h1,'1')
text(s2,h2,'2')
text(s3,h3,'3')
text(s4,h4,'4')
text(s5,h5,'5')
text(s6,h6,'6')
title("Rankine cycle H-S Diagram")
xlabel('Entropy(KJ/KgK)')
ylabel('Enthalpy(KJ/Kg)')
axis([0,8,0,3500])

Command Window Output :-

Plots :-

Conclusion :-

  • This states that points of the rankine cycle are calculated by using Saturated steam table data for water from standard MATLAB Xsteam Data file .
  • From the help of programmig matlab plot the T-S ,H-S of the rankine cycle and also gives the work and efficiency of it.
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.