Challenge

Project 2 - Rankine cycle Simulator

AIM - Rankine cycle Simulator

Theory:

Rankine cycle: The Rankine cycle or Rankine Vapor Cycle is the process widely used by power plant such as coal fired engine or nucular powered engine. In this mechanism, a fuel is used to produce heat within a boiler, converting water into steam which then expands through a turbine producing useful work. This process was developed in 1859 by Scottish engineer William J.M. Rankine. This is a thermodynamic cycle which converts heat into mechanical work—which usually gets transformed into electricity by .

The steps in the Rankine Cycle:

Pump: Compression of the fluid to high pressures using a pump. here fluid was compressed in a isoentropic process.

Boiler: The compressed fluid is heated to the final temperature, here heat was added in a constant pressure process .

Turbine: Expansion of the vapor in the turbine. here we get work output in a isoentropic process .

Condenser: Condensation of the vapor in the condenser, here costand tempreture cooling take place .

'XSteam' function :

Syntax of function 'Out=XSteam(fun,In1,In2)'
XSteam take 2 or 3 arguments. The first argument must always be the steam table function you want to use.
The other arguments are the inputs to that function.
Example: XSteam('h_pt',1,20) Returns the enthalpy of water at 1 bar and 20 degC
Example: XSteam('TSat_p',1) Returns the saturation temperature of water at 1 bar.
Matlab code for Rankin cycle :
clear all
close all
clc

%state 1 inlet of turbine
%pressure in bar
%tempreture in degc
%Enthalpy    (kJ/kg)
%Specific entropy (kJ/kg-K)
%state 1
p1=30
t1=400
h1=XSteam('h_pT',30,400)
s1=XSteam('s_pT',30,400)
%state 2 outlet of turbine
p2=0.05
s2=s1
t2=XSteam('T_ps',0.05,s2)
x=XSteam('x_ps',0.05,s2)
h2=XSteam('h_px',0.05,x)
%state 3
p3=0.05
t3=t2
h3=XSteam('hL_T',t3)
s3=XSteam('sL_T',t3)
%state 4
p4=30
s4=s3
t4=XSteam('T_ps',30,s4)
h4=XSteam('h_pT',30,t4)
%state 5
p5=30
t5=XSteam('Tsat_p',30)
s5=XSteam('sL_T',t5)
h5=XSteam('hL_T',t5)
%state 6
p6=30
t6=t5
h6=XSteam('hV_p',p5)
s6=XSteam('sV_p',p5)
%calculate the Net work output
%Net work output=Turbine work output(w1)-pump ouput(w2)
w1=h1-h2
w2=h3-h4
w=w1-w2
% Back work ratio
Back_work_ratio = (h4-h3)/(h1-h2);
%creat the tampreture array
T = linspace(0,400,1000);
%plot the saturated line
for i=1:length(T)
    sf(i)=XSteam('sL_T',T(i));
    sg(i)=XSteam('sV_T',T(i));
    hf(i)=XSteam('hL_T',T(i));
    hg(i)=XSteam('hV_T',T(i));
end
%plot of rankine 
figure(1)
plot(sf,T)
hold on
plot(sg,T)
plot(s1,t1,'*')
plot(s2,t2,'*')
plot(s3,t3,'*')
plot(s4,t4,'*')
plot(s5,t5,'*')
plot(s6,t6,'*')
plot([s1,s2],[t1,t2],'color','r')
plot([s2,s3],[t2,t3],'color','g')
plot([s3,s4],[t3,t4],'color','r')
plot([s4,s5],[t4,t5],'color','g')
plot([s5,s6],[t5,t6],'color','r')
plot([s6,s1],[t6,t1],'color','g')
%plot h-s digram
figure(2)
plot(sf,hf,'Color','r')
hold on
plot(sg,hg,'Color','r')
plot(s1,h1,'*')
plot(s2,h2,'*')
plot(s3,h3,'*')
plot(s4,h4,'*')
plot(s5,h5,'*')
plot(s6,h6,'*')
plot([s1,s2],[h1,h2],'color','r')
plot([s2,s3],[h2,h3],'color','g')
plot([s3,s4],[h3,h4],'color','r')
plot([s4,s5],[h4,h5],'color','g')
plot([s5,s6],[h5,h6],'color','r')
plot([s6,s1],[h6,h1],'color','g')
% Displaying Results
fprintf('        RESULTS\n\n')
fprintf('State point 1:\n')
fprintf('P1 = %f\n',p1)
fprintf('T1 = %f\n',t1)
fprintf('H1 = %f\n',h1)
fprintf('S1 = %f\n\n',s1)

fprintf('State point 2:\n')
fprintf('P2 = %f\n',p2)
fprintf('T2 = %f\n',t2)
fprintf('H2 = %f\n',h2)
fprintf('S2 = %f\n',s2)
fprintf('x= %f\n\n',x)

fprintf('State point 3:\n')
fprintf('P3 = %f\n',p3)
fprintf('T3 = %f\n',t3)
fprintf('H3 = %f\n',h3)
fprintf('S3 = %f\n\n',s3)

fprintf('State point 4:\n')
fprintf('P4 = %f\n',p4)
fprintf('T4 = %f\n',t4)
fprintf('H4 = %f\n',h4)
fprintf('S4 = %f\n\n',s4)

fprintf('Work done by Turbine = %f\n',w1)
fprintf('Work done by Pump = %f\n',w2)
fprintf('Net Work done = %f\n',w)
fprintf('Back_work_ratio = %f\n',Back_work_ratio)

Metlab code explanation :

'clear all' Is to clear the command window.
'close all' Is to clear all the fig .
'clc'clear all outputs .
'p1=input('Turbine inlet pressure, p1 = ');' Use input function to input the value of turbine inlate pressure ,then input the outlet pressure of turbine and inlate tempreture of the turbine .
'h1=XSteam('h_pT',p1,t1)','s1=XSteam('s_pT',p1,t1)' here we call the XSteam function to find the value of enthlpy and entropy .
'w1=h1-h2' Work doen by the turbine is 'enthalpy at turbine inlet-enthalpt at turbine out'
'w2=h3-h4' Is work given to the pump .
'Back_work_ratio = (h4-h3)/(h1-h2);' Is the ratio of pump work input to turbine work output.
'T = linspace(0,400,1000);' Is use to create a array of temperature .
'sf(i)=XSteam('sL_T',T(i))' To call the function entropy at saturated liqued and in this way we calculate saturated entropy and saturated enthalpy at 0 to 400 tempreture range .
'plot(sf,T)' Is use to plot the saturated liquide line .
'plot(sg,T)'Is use to plot the saturated gas line.
'plot(s1,t1,'*')' plot the point steat 1 of TS digram .In this way we plot all the points .
'plot([s1,s2],[t1,t2],'color','r')' plot line between steat point 1 and 2 .
'fprintf('State point 1:\n')'print the message 'state point' .
'fprintf('P1 = %f\n',p1)' Prient p1 and the value of p1 , In this way print all the steat points and print p,t,h,s for all the state point .
Output of metlab code:
Inputs are

Turbine Inlet temperature = 400° C

Turbine Inlet Pressure = 30 bars

Turbine Outlet Pressure = 0.05 bars = Condenser Inlet Pressure

TS Digram
HS Digram
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.