Project

RANKINE CYCLE SIMULATOR

RANKINE CYCLE SIMULATOR

The Rankine cycle is a model used to predict the performance of steam turbine systems. It was also used to study the performance of reciprocating steam engines. The Rankine cycle is an idealized thermodynamic cycle of a heat engine that converts heat into mechanical work while undergoing phase change.

Basic Rankine Cycle

Different phases of a basic rankine cycle [1-2-3-4-1]

  1. 1-2 is Isentrophic Expansion in the Turbine
  2. 2-3 is Constant Pressure Heat Rejection by the Condensor
  3. 3-4 is Isentrophic Compression in the Pump
  4. 4-1 is Constant Pressure Heat Addition by the Boiler
  • In the code it first takes the pressure at the Turbine Inlet (in bar), the Temperature at the Turbine Inlet (Deg celcius) and the pressure at the Condenser (in bar). It then calculates all the temperature , pressure ,entrophy and the enthalphy. To find these parameters it takes the input XSteam file which contains all the thermodynamic properties of water and steam from 0 - 1000 bar and from 0 - 2000 deg C according to the standard IAPWS IF-97.
  • It then calculates all the efficiency , work and heat transfer taking in the cycle.
  • Taking a range of saturated temperature it finds all the points in the liquid and the vapour line .
  • At last it plots the results in T-S and H-S diagram.

Code

%%
close all
clear all
clc
% RANKINE CYCLE SIMULATOR
fprintf('\t\t\t\t\t\t\t RANKINE CYCLE SIMULATOR \n')
%describes the processes of a rankine cycle 1-2-3-4-1
fprintf('\t\t 1-2 is Isentrophic Expansion in the Turbine \n')
fprintf('\t\t 2-3 is Constant Pressure Heat Rejection by the Condensor \n')
fprintf('\t\t 3-4 is Isentrophic Compression in the Pump \n')
fprintf('\t\t 4-1 is Constant Pressure Heat Addition by the Boiler \n')
fprintf('\n') %next line

%these are the questions that are asked as an input to the program 
Ques1 = '  Enter the pressure at the Turbine Inlet (in bar)=';
P1 = input(Ques1) ; 
Ques2 = '  Enter the Temperature at the Turbine Inlet (in Degree Celcius)=';
T1 = input(Ques2) ;
Ques3 = '  Enter the pressure at the Condenser (in bar)=';
P2 = input(Ques3) ;
%% 
%saturation temperature is found for pressure at inlet of turbine
Tsat= XSteam('Tsat_p',P1);
%checking wheather temperature is saturated or super_heated
if T1>Tsat
s1 = XSteam('s_pT',P1, T1);
h1 = XSteam('h_pT',P1, T1);
Tsup=T1; %super_heated temperature
else
    if T1==Tsat
s1 = XSteam('sV_T', T1);
h1 = XSteam('hV_T', T1);
    else
   %in case  the temperature is below the saturation temperature
    fprintf('Input temperature is not saturated')
    end
end
s2 = s1; %isentropic expansion

sf1=XSteam('sL_p',P1); %entrophy at liquid state
sg1=XSteam('sV_p',P1); %entrophy at gaseous state
sf2=XSteam('sL_p',P2);
sg2=XSteam('sV_p',P2);
hf2=XSteam('hL_p',P2); %enthalpy at liquid state
hg2=XSteam('hV_p',P2); %enthalpy at gaseous state

x2=((s2-sf2)/(sg2-sf2)); %dryness fraction factor
h2=hf2+(x2*(hg2-hf2));
%work done in the turbine
Wt=h1-h2;
%Constant Pressure Heat rejection by the Boiler
P3 = P2;
%Constant Pressure Heat Addition by the Boiler
P4 = P1;
% point3 is on the curve, thus takes value from the liquid line
h3=hf2;
s3=sf2;
v3=XSteam('vL_p', P3); 
%work done in the pump
Wp = v3*(P4-P3)*100;
h4=Wp+h3;
s4=s3;
T3 = XSteam('T_hs', h3,s3);
T2= T3;

cp4= XSteam('Cp_ps', P4,s4);
cv4= XSteam('Cv_ps', P4,s4);
gamma=cp4/cv4;
T4=T3*(P4/P3)^((gamma-1)/gamma);
%Net work done in the system
Wnet=Wt-Wp;
%heat addition
Qin=h1-h4;
%heat rejection
Qout=h2-h3;
%overall efficiency
overall_n = (Wt - Wp)*100/Qin;
%thermal efficiency
ntherm=Wnet*100/Qin;
%specific fuel consumption
ssc=3600/Wnet;


%% printing the results at different points[T, P, s and h]
fprintf('\n\t\t\t\t\t\t\t\t RESULTS  \n\n')
fprintf('\t\t At State point 1: \t\t\t\t\t\t')
fprintf('At State point 2:\n')
fprintf('\t\t T1=%f Deg celcius\t\t\t\t', T1)
fprintf('T2=%f Deg celcius\n', T2)
fprintf('\t\t P1=%f Bar\t\t\t\t\t\t', P1)
fprintf('P2=%f Bar\n', P2)
fprintf('\t\t h1=%s kJ/Kg \t\t\t\t\t', h1)
fprintf('h2=%s kJ/Kg\n', h2)
fprintf('\t\t s1=%s kJ/Kg\t\t\t\t\t', s1)
fprintf('s2=%s kJ/Kg\n', s2)
fprintf('\t\t\t\t\t\t\t\t\t\t\t\t')
fprintf('x2=%f\n', x2)
fprintf('\n')

fprintf('\t\t At State point 3: \t\t\t\t\t\t')
fprintf('At State point 4: \n')
fprintf('\t\t T3=%f Deg celcius\t\t\t\t\t', T3)
fprintf('T4=%f Deg celcius\n', T4)
fprintf('\t\t P3=%f Bar\t\t\t\t\t\t', P3)
fprintf('P4=%f Bar\n', P4)
fprintf('\t\t h3=%s kJ/Kg\t\t\t\t\t', h3)
fprintf('h4=%s kJ/Kg\n', h4)
fprintf('\t\t s3=%s kJ/Kg\t\t\t\t\t', s3)
fprintf('s4=%s kJ/Kg\n', s4)
fprintf('\n')
%print work done and efficiences
fprintf('\t\t Compressor work : %s kJ/Kg\n', Wp)
fprintf('\t\t Boiler heat added: %s kJ/Kg\n', Qin)
fprintf('\t\t Condenser heat rejected: %s kJ/Kg\n', Qout)
fprintf('\t\t Turbine work : %s kJ/Kg\n', Wt)
fprintf('\t\t Overall efficiency is %1.0f percent\n', overall_n)
fprintf('\t\t thermal efficiency is %1.0f percent\n', ntherm)
fprintf('\t\t Specific fuel consumption is %1.5f Kg/kWh\n', (ssc))


%% to create the liquid and the vapour lines 
%saturation temperature range is specified
tsat=linspace(1,400,400);
%for temperature range specified the point values are found
for i=1:length(tsat)
   sl(i)=XSteam('sL_t',tsat(i)); 
   sv(i)=XSteam('sV_t',tsat(i)); 
   hl(i)=XSteam('hL_t',tsat(i)); 
   hv(i)=XSteam('hV_t',tsat(i)); 
end
%plotting hte results
figure(1) % T-S diagram
hold on
plot([sl,sv],[tsat,tsat])
plot([s1,s2,s3,s4,sf1,sg1,s1],[T1,T2,T3,T4,Tsat,Tsat,T1],'marker','o','markersize',5,'markerfacecolor','r')
text(s1,T1+25,'1')
text(s2,T2-25,'2')
text(s3,T3-25,'3')
text(s4,T4+25,'4')
title('T-S Diagram')
xlabel('Entropy')
ylabel('Temperature')

figure(2) %H-S diagram
hold on
plot([sl,sv],[hl,hv])
plot([s1,s2,s3,s4,s1],[h1,h2,h3,h4,h1],'marker','o','markersize',5,'markerfacecolor','r')
text(s1,h1+100,'1')
text(s2,h2-100,'2')
text(s3,h3-100,'3')
text(s4,h4+100,'4')
title('H-S Diagram')
xlabel('Entropy')
ylabel('Enthalphy')

Above program runs as shown below

The results of the state points as per the inputs given are plotted in the T-S and the H-S diagrams and are represented in the two figures respectively

Reference

  • Google
  • Matlab help
  • projects.skill-lync
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.