Project

Rankine Cycle Simulator

Aim: -

To create a program to plot HS and TS diagram based upon the iput conditions

Introduction: -

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. It is an idealized cycle in which friction losses in each of the four components are neglected. The heat is supplied externally to a closed loop, which usually uses water as the working fluid.

Processes in Rankine Cycle: -

  • Process 1–2: The working fluid is pumped from low to high pressure. As the fluid is a liquid at this stage, the pump requires little input energy.

  • Process 2–3: The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapour. The input energy required can be easily calculated graphically, using an enthalpy–entropy chart (h–s chart, or Mollier diagram), or numerically, using steam tables.

  • Process 3–4: The dry saturated vapour expands through a turbine, generating power. This decreases the temperature and pressure of the vapour, and some condensation may occur. The output in this process can be easily calculated using the chart or tables noted above.

  • Process 4–1: The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid.

Components of Rankine Cycle: -

The four basic components of Rankine cycle are shown in figur.

  • Pump: The liquid condensate leaving the condenser at the state 1 is pumped to the operating pressure of the boiler. The pump operation is considered isentropic.
  • Boiler: The heat is supplied in the working fluid (feed water) in the boiler and thus vapor is generated. The vapor leaving the boiler is either at saturated at the state 3 or superheated at the state 3, depending upon the amount of heat supplied by the boiler.
  • Turbine: The vapor leaving the boiler enters the turbine, where it expands isentropically to the condenser pressure at the state 4. The work produced by the turbine is rotary (shaft) work and is used to drive an electric generator or machine.
  • Condenser: The condenser is attached at the exit of the turbine. The vapor leaving the turbine is wet vapor and it is condensed completely in the condenser to the state 1, by giving its latest heat to some other cooling fluid like water.

\"Image

Program: -

clear all
close all
clc

disp(\'RANKINE CYCLE SIMULATOR\')
disp(\'1-2 is issentric expansion in the turbine\')
disp(\'2-3 is constant pressure heat rejection by the condensor\')
disp(\'3-4 is issentric compression in the pump\')
disp(\'4-1 is constant pressure heat addition in the pump\')
fprintf(\'\\n\');

%Defining know values
prompt = \'Enter the pressure of the Turbine at Inlet (in bar):\';
P1 = input(prompt);
prompt = \'Enter the temperature of the Turbine at Inlet (in Degree Celcius):\';
T1 = input(prompt);
prompt = \'Enter the pressure of the Condensor at Inlet (in bar):\';
P2 = input(prompt);
fprintf(\'\\n\');

tsat=XSteam(\'Tsat_p\',P1);
sL1=XSteam(\'sL_P\',P1);
sV1=XSteam(\'sV_P\',P1);
if T1>tsat
    tsup = T1;
    H1 = XSteam(\'h_pt\',P1,tsup);
    S1 = XSteam(\'s_pt\',P1,tsup);
else if t1 == tsat;
        H1 = XSteam(\'hL_p\',P1);
        S1 = XSteam(\'sL_p\',P1);
    else
        disp(\'Enter Temp greater than Tsat\')
    end
end
    
%As process 1-2 is Isentropic Expansion, the Entropies are the same
S2 = S1;
sf2 = XSteam(\'sL_p\',P2);
sg2 = XSteam(\'sV_p\',P2);
hf2 = XSteam(\'hL_p\',P2);
hg2 = XSteam(\'hV_p\',P2);
x2 = (S2-sf2)/(sg2-sf2);
H2 = hf2+(x2*(hg2-hf2));

%As the fluid leaving the turbine is neither fully 
%liquid or gas(Saturated state)
T2 = XSteam(\'Tsat_p\',P2);

%As process 3-4 is Constant Pressure and Constant Temperature
P3 = P2;
T3 = T2;
H3 = XSteam(\'hL_p\',P3);
S3 = XSteam(\'sL_p\',P3);

%AS process 4-1 is Constant Pressure Heat Addition
P4 = P1;

%The specific entropy is constant for the isentropic expansion
S4 = S3;

%As it is a Isobaric Process
cp4 = XSteam(\'Cp_ps\',P4,S4);

%As the process is Isochoric
cv4 = XSteam(\'Cv_ps\',P4,S4);
gamma = cp4/cv4;
T4 = T3*(P4/P3)^((gamma-1)/gamma);
vf = XSteam(\'vL_p\',P3);

%Pump Work
Wp = vf*(P1-P2)*100;
H4 = Wp+H3;

%Work output from turbine
Wt = H1-H2;
    
%heat input
Q_in = H1-H4;
    
%heat output
Q_out = H2-H3;
    
%net work
W_net = Wt-Wp;
    
%Heat added in the boiler
Q_in = H1-H4;

%ThermalEfficiency
T_eff = (W_net/Q_in)*100;

%specific fuel consumption
sfc = 3600/W_net;

%plotting saturation lines
temp = linspace(1, 373, 500);

hl = zeros(1,100);
hv = zeros(1,100);
sl = zeros(1,100);
sv = zeros(1,100);

for i = 1 : length(temp)
     hl(i) = XSteam(\'hL_T\', temp(i));
     hv(i) = XSteam(\'hV_T\', temp(i));
     sl(i) = XSteam(\'sL_T\', temp(i));
     sv(i) = XSteam(\'sV_T\', temp(i));
end

%Plotting T vs S
figure(1)
hold on
plot(sl,temp,\'b\',\'linestyle\',\'-\',\'linewidth\',1.5)
plot(sv,temp,\'b\',\'linestyle\',\'-\',\'linewidth\',1.5)
xlabel(\'Specific Entropy (kJ/kgK)\')
ylabel(\'Temprature (degC)\')
title(\'T-S diagram\');
plot([S1 S2 S3 S4 sL1 sV1],[T1 T2 T3 T4 tsat tsat],\'color\',\'r\',\'linewidth\', 1.5)

%Notating the state points
text(S1,T1,\'1\')
text(S2,T2,\'2\')
text(S3,T3-10,\'3\')
text(S4,T4+10,\'4\')

t = linspace(tsat,tsup,1000); 
for j =1:length(t)
    sp(j) = XSteam(\'s_pT\',P1,t(j));
end
plot(sp,t,\'color\',\'r\',\'linewidth\', 1.5);
  
%Plotting H vs S
figure(2)
hold on
title(\'H-S diagram\');
plot(sl, hl, \'b\',\'linestyle\',\'-\', \'linewidth\', 1.5)
plot(sv, hv, \'b\',\'linestyle\',\'-\', \'linewidth\', 1.5)      
plot([S1 S2 S3 S4 S1], [H1 H2 H3 H4 H1], \'color\', \'r\',\'linewidth\', 1.5);
text(S1,H1,\'1\')
text(S2,H2,\'2\')
text(S3,H3-100,\'3\')
text(S4,H4+100,\'4\')
ylabel(\'Specific Enthalpy (kJ/kg)\')
xlabel(\'Specific Entropy (kJ/kgK)\')

%output
%at state 1
fprintf(\'\\n\');
disp(\'RESULTS\');
fprintf(\'\\n\');
disp(\'At State point 1:\');
fprintf(\'P1 is : %.2f Bar\',P1);
fprintf(\'\\n T1 is : %.2f Deg Celcius\',T1);
fprintf(\'\\n H1 is : %.2f kJ/kg\',H1);
fprintf(\'\\n S1 is : %.2f kJ/kgKrn\\n\\n\',S1);

%at state 2
disp(\'At State point 2:\');
fprintf(\'P2 is : %.2f Bar\',P2);
fprintf(\'\\n T2 is : %.2f Deg Celcius\',T2);
fprintf(\'\\n H2 is : %.2f kJ/kg\',H2);
fprintf(\'\\n S2 is : %.2f kJ/kgKrn\\n\\n\',S2);

%at state 3
disp(\' At State point 3:\');
fprintf(\'P3 is : %.2f Bar\',P3);
fprintf(\'\\n T3 is : %.2f Deg Celcius\',T3);
fprintf(\'\\n H3 is : %.2f kJ/kg\',H3);
fprintf(\'\\n S3 is : %.2f kJ/kgKrn\\n\\n\',S3);

%at state 4
disp(\'At State point 4:\');
fprintf(\'P4 is : %.2f Bar\',P4);
fprintf(\'\\n T4 is : %.2f Deg Celcius\',T4);
fprintf(\'\\n H4 is : %.2f kJ/kg\',H4);
fprintf(\'\\n S4 is : %.2f kJ/kgKrn\\n\',S4);

fprintf(\'\\nWork output by the Turbine (Wt) is : %.2f kJ/kg\',Wt);
fprintf(\'\\nWork input by the pump (Wp) is : %.2f kJ/kg\',Wp);
fprintf(\'\\nNet Work is : %.2f kJ/kg\',W_net);
fprintf(\'\\nThermodynamic efficiency is : %.2f Percent\\n\',T_eff);
fprintf(\'%s  Heat input in Boiler:%.2f \\n\',Q_in,\' KJ/kg\');
fprintf(\'%s  Heat rejected in condenser:%.2f\\n \',Q_out,\' KJ/kg\');
fprintf(\'Specific Fuel Consumption is : %.2f kg/kWh\',sfc);

Command Window Output: -

Plots: -

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.