All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM : To write code in MATLAB that can solve a Rankine cycle and make plots for it. OBJECTIVE : To calculate the state points of the Rankine Cycle based on user inputs. To plot the corresponding T-s and h-s plots for the given set of inputs. THEORY : The Rankine cycle is a model used to predict the performance of steam…
Shaik Faraz
updated on 24 Oct 2022
AIM :
To write code in MATLAB that can solve a Rankine cycle and make plots for it.
OBJECTIVE :
THEORY :
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.
The Rankine cycle closely describes the process by which steam-operated heat engines commonly found in thermal power generation plants generate power. Power depends on the temperature difference between a heat source and a cold source. The higher the difference, the more mechanical power can be efficiently extracted out of heat energy, as per Carnot's theorem. The heat sources used in these power plants are usually nuclear fission or the combustion of fossil fuels such as coal, natural gas, and oil, or concentrated solar power. The higher the temperature, the better.
Figure 1. Classical Carnot Heat Engine
The efficiency of the Rankine cycle is limited by the high heat of vaporization of the working fluid. Also, unless the pressure and temperature reach super critical levels in the steam boiler, the temperature range the cycle can operate over is quite small: steam turbine entry temperatures are typically around 565 °C and steam condenser temperatures are around 30 °C. This gives a theoretical maximum Carnot efficiency for the steam turbine alone of about 63.8% compared with an actual overall thermal efficiency of up to 42% for a modern coal-fired power station. This low steam turbine entry temperature (compared to a gas turbine) is why the Rankine (steam) cycle is often used as a bottoming cycle to recover otherwise rejected heat in combined-cycle gas turbine power stations.
Figure 2. Rankine Cycle Layout [1 – Pump, 2 – Boiler, 3 – Turbine, 4 – Compressor]
The cold source (the colder the better) used in these power plants are usually cooling towers and a large water body (river or sea). The efficiency of the Rankine cycle is limited on the cold side by the lower practical temperature of the working fluid. The working fluid in a Rankine cycle follows a closed loop and is reused constantly. The water vapor with condensed droplets often seen billowing from power stations is created by the cooling systems (not directly from the closed-loop Rankine power cycle). This 'exhaust' heat is represented by the "Qout" flowing out of the lower side of the cycle shown in the T–s diagram below. Cooling towers operate as large heat exchangers by absorbing the latent heat of vaporization of the working fluid and simultaneously evaporating cooling water to the atmosphere.
While many substances could be used as the working fluid in the Rankine cycle, water is usually the fluid of choice due to its favorable properties, such as its non-toxic and unreactive chemistry, abundance, and low cost, as well as its thermodynamic properties. By condensing the working steam vapor to a liquid the pressure at the turbine outlet is lowered and the energy required by the feed pump consumes only 1% to 3% of the turbine output power and these factors contribute to a higher efficiency for the cycle. The benefit of this is offset by the low temperatures of steam admitted to the turbine(s). Gas turbines, for instance, have turbine entry temperatures approaching 1500 °C. However, the thermal efficiency of actual large steam power stations and large modern gas turbine stations are similar.
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. In other words Process 1-2 is called an Isentropic compression.
Figure 3. T–s diagram of a typical Rankine cycle operating between pressures of 0.06 bar and 50 bar. Left from the bell-shaped curve is liquid, right from it is gas, and under it is saturated liquid–vapor equilibrium.
The high-pressure liquid enters a boiler, where it is heated at constant pressure by an external heat source to become a dry saturated vapor. 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. In other words, Process 2-3 is called Constant pressure heat addition in boiler.
The dry saturated vapor expands through a turbine, generating power. This decreases the temperature and pressure of the vapor, and some condensation may occur. The output in this process can be easily calculated using the chart or tables noted above. In other words, Process 3-4 is called an Isentropic expansion.
The wet vapour then enters a condenser, where it is condensed at a constant pressure to become a saturated liquid. In other words, Process 4-1 is called Constant pressure heat rejection in condenser.
In an ideal Rankine cycle the pump and turbine would be isentropic, i.e., the pump and turbine would generate no entropy and hence maximize the net-work output. Processes 1–2 and 3–4 would be represented by vertical lines on the T–s diagram and more closely resemble that of the Carnot cycle. The Rankine cycle shown here prevents the state of the working fluid from ending up in the superheated vapor region after the expansion in the turbine, which reduces the energy removed by the condensers.
The actual vapor power cycle differs from the ideal Rankine cycle because of irreversibilities in the inherent components caused by fluid friction and heat loss to the surroundings; fluid friction causes pressure drops in the boiler, the condenser, and the piping between the components, and as a result the steam leaves the boiler at a lower pressure; heat loss reduces the net-work output, thus heat addition to the steam in the boiler is required to maintain the same level of net-work output.
Water enters the pump at state 1 as saturated liquid and is compressed isentropically to the operating pressure of the boiler. The water temperature increases somewhat during this isentropic compression process due to a slight decrease in the specific volume of water.
Water enters the boiler as a compressed liquid at state 2 and leaves as a superheated vapor at state 3. The boiler is basically a large heat exchanger where the heat originating from combustion gases, nuclear reactors, or other sources is transferred to the water essentially at constant pressure. The boiler, together with the section where the steam is superheated (the superheater), is often called the steam generator.
The superheated vapor at state 3 enters the turbine, where it expands isentropically and produces work by rotating the shaft connected to an electric generator. The pressure and the temperature of steam drop during this process to the values at state 4, where steam enters the condenser. At this state, steam is usually a saturated liquid–vapor mixture with a high quality.
Steam is condensed at constant pressure in the condenser, which is basically a large heat exchanger, by rejecting heat to a cooling medium such as a lake, a river, or the atmosphere. Steam leaves the condenser as saturated liquid and enters the pump, completing the cycle. In areas where water is precious, the power plants are cooled by air instead of water. This method of cooling, which is also used in car engines, is called dry cooling.
During a Rankine cycle, work is done on the fluid by the pumps between states 1 and 2 (isentropic compression). Work is done by the fluid in the turbine between stages 3 and 4 (isentropic expansion). The difference between the work done by the fluid and the work done on the fluid is the net work produced by the cycle and it corresponds to the area enclosed by the cycle curve (in pV diagram). The working fluid in a Rankine cycle follows a closed loop and is reused constantly.
As can be seen, it is convenient to use enthalpy and the first law in terms of enthalpy in analysis of this thermodynamic cycle. This form of the law simplifies the description of energy transfer. At constant pressure, the enthalpy change equals the energy transferred from the environment through heating:
Isobaric process (Vdp = 0):
dH = dQ → Q = H2 – H1
At constant entropy, i.e. in isentropic process, the enthalpy change equals the flow process work done on or by the system:
Isentropic process (dQ = 0):
dH = Vdp → W = H2 – H1
GOVERNING EQUATIONS :
BODY OF THE CONTENT :
Solution Steps :
MATLAB CODE :
% A program for simulating Rankine cycle and plot required graphs.
close all
clear all
clc
% Subscript for different state points
% 1 = Turbine inlet or Boiler outlet, 2 = Condenser inlet or Turbine outlet,
% 3 = Pump inlet or Condenser outlet, 4 = Boiler inlet or Pump outlet
% Input parameters -
% p1 = Turbine inlet pressure (bar),
% T1 = Temperature at turbine inlet(deg C),
% p2 = Turbine outlet pressure (bar),
% Description about four process,
fprintf('Process (1-2) - Isentropic Expansion in the Turbine\n');
fprintf('Process (2-3) - Isobaric Heat Rejection by the Condenser\n')
fprintf('Process (3-2) - Isentropic Compression in the Pump\n')
fprintf('Process (4-1) - Isobaric Heat Addition by the Boiler\n')
% For Inputting state variables at point 1,
p1 = input('Enter the Pressure at the Turbine Inlet (in bar): ');
T1 = input('Enter the Temperature at the Turbine inlet (in Degree celsius): ');
p2 = input('Enter the Pressure at the Turbine Outlet (in bar): ');
% Calculating state variables at all points from given datafile,
% At point 1
hg_1=XSteam('hV_p',p1);
sg_1=XSteam('sV_p',p1);
Tsat_P1=XSteam('Tsat_p',p1);
Cp1_L=XSteam('CpL_p',p1);
% At point 2
hg_2=XSteam('hV_p',p2);
sg_2=XSteam('sV_p',p2);
Tsat_P2=XSteam('Tsat_p',p2);
Cp2_V=XSteam('CpV_p',p2);
% At point 3
hf_3=XSteam('hL_p',p2);
sf_3=XSteam('sL_p',p2);
% At point 4
hf_4=XSteam('hL_p',p1);
sf_4=XSteam('sL_p',p1);
% state variables at point 1,
fprintf('At State 1\n');
fprintf('p1 is :%f bar\n',p1);
fprintf('T1 is :%f degrees C\n',T1);
h1=XSteam('h_pT',p1,T1);
fprintf('h1 is :%f kJ/kg\n',h1);
s1=XSteam('s_pT',p1,T1);
fprintf('s1 is :%f kJ/kgK\n',s1);
% state variables at point 2,
fprintf('At State 2\n');
fprintf('p2 is : %f bar\n', p2);
% entropy remains the same through turbine ( ideal )
s2 = s1;
fprintf('s2 is : %f kJ/kgK\n', s2);
% Calculating value of x(dryness fraction)
if(s2 <= sg_2)
x2 = (s2 - sf_3) / (sg_2-sf_3);
else
x2=1;
end
fprintf('x2 is :%f \n', x2);
% For calculating value of T2,
if(x2<1)
T2 = Tsat_P2;
else
% s2 = sg_2 + Cp2_V*(log(T2/Tsat_P2))-formula for calculating entropy in
% superheated region
T2 = (Tsat_P2+273.15)*exp((s2-sg_2)/Cp2_V);
T2 = T2 - 273.15;
end
fprintf('T2 is : %f degrees C\n', T2)
% For calculating value of h2,
if(x2<1)
h2 = hf_3 + x2 * (hg_2-hf_3);
else
h2 = XSteam('h_pT',p2,T2);
end
fprintf('h2 is : %f kJ/kg\n', h2)
% state variables at point 3,
fprintf('At state 3\n')
p3 = p2;
fprintf('p3 is : %f bar\n', p3)
V3 = XSteam('vL_p', p3);
T3 = Tsat_P2;
fprintf('T3 is : %f degrees C\n', T3)
h3 = hf_3;
fprintf('h3 is : %f kJ/kg\n', h3)
s3 = sf_3;
fprintf('s3 is : %f kJ/kgK\n', s3)
% Calculating state variables at point 4,
fprintf('At state 4\n')
p4 = p1;
fprintf('p4 is : %f bar\n', p4)
% Isentropic pumping process
s4 = s3;
fprintf('s4 is : %f kJ/kgK\n', s4)
T4 = XSteam('T_ps' ,p4,s4);
fprintf('T4 is : %f degrees C\n', T4)
W_p = V3 * (p4 - p3) * 100; % work done by pump(W_p = h4-h3)
h4 = W_p + h3;
fprintf('h4 is : %f kJ/kg\n', h4)
% Calculation of net work output,net heat,back work ratio and thermal
% efficiency and other parameters
% Work done by turbine
W_T = h1 - h2;
fprintf('Work by turbine is : %f kJ/kg\n', W_T)
fprintf('Work by pump is : %f kJ/kg\n', W_p)
% Net work done
Wnet = W_T - W_p;
fprintf('Net Wok done is : %f kJ/kg\n', Wnet)
% Net heat supplied
Qin = h1 - h4;
% Thermal Effieciency
eff_thermal = Wnet/Qin ;
fprintf('Thermal efficiency is : %f\n', eff_thermal);
% Back work ratio
b_w_r = (W_p/W_T);
fprintf('Back work ratio is : %f \n ', b_w_r)
% Work ratio
w_r = (Wnet/W_T);
fprintf('Work ratio is : %f \n ', w_r)
% summation of b_w_r and w_r should be 1
fprintf('Back work ratio + Work ratio is : %f \n ', (b_w_r+w_r))
% Heat rate and specific steam consumption
H_R = (1/eff_thermal);
fprintf('Heat Rate is : %f kJ/kWs\n ', H_R)
ssc = (1/Wnet);
fprintf('Specific steam consumption is : %f kg/kWs\n ', ssc)
% Iterating saturation Liquid and Vapour lines from 0 to value of T1 for plotting
% property diagram of water
temperature = linspace(0, T1, 5000);
for i = 1 : length(temperature)
H_l(i) = XSteam('hL_T', temperature(i));
H_v(i) = XSteam('hV_T', temperature(i));
S_l(i) = XSteam('sL_T', temperature(i));
S_v(i) = XSteam('sV_T', temperature(i));
end
% Plotting T-s Diagram
figure(1)
hold on
plot([s1 s2], [T1 T2],'color','blue', 'linewidth', 3)
plot([s2 sg_2], [T2 Tsat_P2],'color','green', 'linewidth', 3)
plot([sg_2 s3], [Tsat_P2 T3],'color','green', 'linewidth', 3)
plot([s3 s4], [T3 T4],'color','blue', 'linewidth', 3)
plot([s4 sf_4], [T4 Tsat_P1],'color','blue', 'linewidth', 3)
plot([sf_4 sg_1], [Tsat_P1 Tsat_P1],'color','green', 'linewidth', 3)
plot([sg_1 s1], [Tsat_P1 T1],'color','green', 'linewidth', 3)
text(s1,T1,' 1','FontSize',15)
text(s2,T2,' 2','FontSize',15)
text(s3,T3,' 3','FontSize',15)
text(sf_4,Tsat_P1,' 4','FontSize',15)
plot(S_l, temperature, 'black', 'linestyle','--','linewidth', 1)
plot(S_v, temperature, 'black', 'linestyle','--','linewidth', 1)
axis([0 10 0 500])
title('T-s Diagram of Ideal Rankine Cycle')
ylabel('Temprature (degrees C)')
xlabel('Specific Entropy (kJ/kgK)')
grid on
% Plotting h-s Diagram
figure(2)
hold on
plot([s1 s2], [h1 h2],'color','green', 'linewidth', 3)
plot([s2 sg_2], [h2 hg_2],'color', 'red', 'linewidth', 3)
plot([sg_2 s3], [hg_2 h3],'color', 'red', 'linewidth', 3)
plot([s3 s4], [h3 h4],'color', 'green', 'linewidth', 3)
plot([s4 sf_4], [h4 hf_4],'color', 'green', 'linewidth', 3)
plot([sf_4 sg_1], [hf_4 hg_1],'color', 'red', 'linewidth', 3)
plot([sg_1 s1], [hg_1 h1],'color', 'red', 'linewidth', 3)
text(s1,h1,' 1','FontSize',15)
text(s2,h2,' 2','FontSize',15)
text(s3,h3,' 3','FontSize',15)
text(sf_4,hf_4,' 4','FontSize',15)
plot(S_l, H_l,'color','black','linestyle','--', 'linewidth', 1)
plot(S_v, H_v,'color', 'black','linestyle','--', 'linewidth', 1)
title('h-s Diagram of Ideal Rankine Cycle')
ylabel('Specific Enthalpy (kJ/kg)')
xlabel('Specific Entropy (kJ/kgK)')
grid on
ERRORS AND REMEDIES : There were no major errors encountered except one formula mistake which was rectified.
RESULTS : The following are the output of the above code -
CONCLUSION :
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 1 : CFD Meshing for Tesla Cyber Truck
Aim: Performing topological cleanup and surface mesh on tesla cyber truck and on a wind tunnel based on selected target length values of its different components using element type as Tria, as well as appropriate selection of the volume that contains the vehicle and its surroundings with the wind tunnel for volumetric…
15 Nov 2022 04:17 AM IST
Week 5 Challenge : Surface wrap on Automotive Assembly
Aim: Perforform Topo cleanup and delete unwanted surfaces for Surface wrap. After Topo cleanup, Merge all 3 models and perform surface wrap. Target length for Wrap = 3 mm 1. Engine: 2. Gear box: 3. Transmission: Procedure: 1. Topo Cleanup : (Engine, Transmission & Gear Box)…
10 Nov 2022 08:22 AM IST
Week 4 Challenge : CFD Meshing for BMW car
Aim: To perform topological clean-up, and carry out the surface meshing of a BMW M6 car model and create a wind tunnel surrounding the same. Objectives: For the given model, check and solve all geometrical errors on half portion and Assign appropriate PIDs. Perform meshing with the given Target length and element Quality…
07 Nov 2022 11:33 AM IST
Week 3 Challenge : CFD meshing on Turbocharger
Aim: Performing CFD meshing on Turbocharger using ANSA Objective: For the given model, check for the geometrical errors to make appropriate volumes. Create and assign PIDs as shown in the video. Perform surface mesh with the given target lengths as per PIDs. Blade stage-1 = 1 mm Blade stage-2 = 1 mm Impeller = 2 mm…
03 Nov 2022 08:06 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.