Application of Metaheuristic Algorithms for Optimizing Longitudinal Square Porous Fins

The objectives of this study involve the optimization of longitudinal porous fins of square cross-section using metaheuristic algorithms. A generalized nonlinear ordinary differential equation is derived using Darcy and Fourier’s laws in the energy balance around a control volume and is solved numerically using RFK 45 method. The temperature of the base surface is higher than the fin surface, and the fin tip is kept adiabatic or cooled by convection heat transfer. The other pertinent parameters include Rayleigh number (100 ≤ Ra ≤ 10), Darcy number, (10 ≤Da ≤ 10), relative thermal conductivity ratio of solid phase to fluid (1000 ≤ kr ≤ 8000), Nusselt number (10 ≤ Nu ≤ 100), porosity (0.1 ≤ φ ≤ 0.9). The impacts of these parameters on the entropy generation rate are investigated and optimized using metaheuristic algorithms. In computer science, metaheuristic algorithms are one of the most widely used techniques for optimization problems. In this research, three metaheuristic algorithms, including the firefly algorithm (FFA), particle swarm algorithm (PSO), and hybrid algorithm (FFAPSO) are employed to examine the performance of square fins. It is demonstrated that FFA-PSO takes fewer iterations and less computational time to converge compared to other algorithms.


Introduction
The heat transfer rate from a solid surface can be enhanced with the help of the fins of different shapes. They are employed in numerous appliances such as microelectronics and heat exchangers. The geometry of the fin plays a key role in improving the overall performance that needs to enhance the efficiency of the fin. Several researchers, including [1][2][3][4][5] have examined several fins shapes for the longitudinal and annular fins and optimized the thermal performance of these fins. Porous fins have been widely used as a viable thermal candidate for effective cooling. The research on the performance and efficiency of porous fins is a new dimension of research in the field of heat transfer. Porous fins enhance the heat transfer rate by increasing the surface area by convection through the pores in addition to reducing the weight of the assembly. The thermal performance of the Porous fins is excellent compared with the thermal performance of conventional equal weight solids, where many studies have examined the thermal performance of the porous fins [6][7][8][9].
In 2001, Kiwan et al. [10] proposed a new method that enhances the heat transfer from a given surface by using porous fins. They found that the performance of the porous fin leads to much more improvement in the heat transfer coefficient compared to the performance of the conventional fin. Ghasemi et al. [11] solved the nonlinear temperature distribution equation in solid and porous longitudinal fin with temperature using differential transformation method (DTM). Their results reveal that the technique is highly effective and convenient. Kundu et al. [12] studied the thermal performance of porous fin of various shapes working in a convection environment. They investigated the Straight fins (rectangular, convex parabolic and two exponential types). Kiwan [13] proposed a new method to study the performance of porous fins in a natural convection environment. He found that the rate of heat transfer from the porous fin could exceed the rate of the solid fin. Kiwan [14] studied the problem of laminar natural convection heat transfer from a porous fin attached to a vertical surface. Gorla et al. [15] examined the effects of heat transfer and convection in rectangular porous media. Kundu et al. [16] proposed a computational model to determine the best performance and optimal dimensions of porous fins. They also studied the effects of all parameters on performance and conditions for improvement. Hatami et al. [17] found that the thermal performance of rectangular profiles was better compared to convex and triangular shapes.
The primary purpose of any optimization algorithm is to detect the optimal value of system parameters under various conditions. An optimization algorithm is desired to be robust, has a low computational cost, is able to rapidly reach the globally optimal values of a problem, has very few control parameters, and easy to implement in different problem paradigms [18]. In the last two decades, nature-inspired metaheuristic algorithms have become very popular because of their ability to solve several real-world optimization problems in artificial intelligence (AI), optimization, engineering applications, computational intelligence, data mining, and machine learning. These metaheuristic algorithms are now one of the most widely used techniques for optimization. They are incredibly diverse and include Particle Swarm Optimization (PSO), Firefly Algorithm (FFA), Simulated Annealing, Differential Evolution, Genetic Algorithms, Harmony Search, Ant and Bee algorithm, and others.
Hatami et al. [19] used the Least Square Method and fourth-order Runge-Kutta method to predict the temperature distribution in circular convective-radiative porous fins. Hatami et al. [20] used three analytical methods for predicting the temperature distribution in a rectangular porous fin with temperature-dependent internal heat generation. The methods are the Differential Transformation Method, Collocation Method, and Least Square Method. Das et al. [21] used a simulated annealing method to choose parameters of a rectangular porous fin, which can meet the desired temperature distribution. Deshamukhya et al. [22] used FFA to optimize the important parameters of rectangular porous fins with the reflective boundary condition. They have used three metaheuristic optimization algorithms, namely FFA, PSO, and Gravitational Search Algorithm (GSA). They optimized the parameters responsible for transferring heat from the porous fin subjected to convective tip conditions and insulated end condition.
The above literature review reveals that there is no single study that investigates the modeling and optimization of a longitudinal square fin using metaheuristic algorithms. To fill this gap, mathematical models are developed for the heat transfer and optimization of a longitudinal square fin. For optimization, PSO, FFA, and their hybrid algorithms were employed to obtain the optimum values of the governing parameters for the minimum average entropy generation rate.

Problem Statement
Consider a longitudinal porous fin of square cross-section, which is attached to a base plate, as shown in Fig. 1. The side of the square fin is s, and the length is L, and the fluid (air) is flowing axially along the fin length. Two different materials (Aluminum and copper) are used for the porous fin. The fin surface transfers heat to ambient by convection through fin pores and solid surface. The fluid flow rate is assumed to be _ m, the ambient temperature is T 1 , and the heat transfer coefficient is h. The fin tip is considered to be either adiabatic or convectively cooled. This analysis is based on the following assumptions: 1. The porous fin is homogeneous, isotropic, and saturated with the single-phase ambient fluid. 2. The thermophysical properties are constant, 3. The entire system is in local thermodynamic equilibrium, 4. The heat conduction occurs only in the axial direction, and 5. The fluid velocity is modeled by Darcy's law.
We get the following dimensionless equation for a longitudinal fin of arbitrary profile with uniform cross-section: where & p and & c are the porous and convective parameters respectively and can be written as: The porous parameter & p shows the effect of the permeability of the porous medium, while the convective parameter & c shows the effect of convection heat transfer from the fin surface and É ¼ s=L is the dimensionless geometry parameter. The dimensionless temperature and the efficiency of the fin are plotted in terms of these two parameters. Eq. (2) is subjected to the following dimensionless boundary conditions: The second-order differential Eq. (2) with boundary conditions (4) can be solved numerically by the finite difference method or analytically by the homotopy perturbation method. Thus, the dimensionless distribution within the porous square fin up to first order for adiabatic tip boundary condition can be written as: Similarly, the dimensionless distribution within the porous square fin up to first order for convective tip boundary condition can be written as: e Àf c ðX À2Þ À e 2f c ðX þ1Þ Á e Àf c ðX À6Þ À e À2f c ðX À3Þ À e À2f c ðX À2Þ þ e f c ðX þ4Þ These temperature distributions depend upon the porous and convective parameters. They can be used to determine the heat transfer rate from the porous fins and the efficiency that will be defined in the next section.

Fin Efficiency
Following [23], the actual heat transfer rate, maximum heat transfer rate, and the heat transfer rate of the un-finned surface can be written as: The efficiency of the porous fin is defined as the ratio of the actual rate of heat transfer of the fin to the maximum heat transfer rate and can be written as: Using dimensionless variables, Eq. (8), and simplifying, we get Thus, the efficiency of the porous fin depends on the porosity, as well as Rayleigh, Darcy, and Nusselt numbers. The selection of these dimensionless numbers is very vital in improving the efficiency of porous fins.

Entropy Generation Model
Following [24], the entropy generation rate for steady flow can be obtained from entropy balance across the control volume ( Fig. 1) and can be written as: Assuming uniform pressure across the control volume, and following [25], the change in entropy can be written as: Considering the limiting case, Dx ! 0 and using Eqs. (11) and (12) gives: Using Darcy' law, the mass flow rate through the porous fin can be written as: Using Fourier's law of conduction and Eq. (13), the entropy generation rate can be written as: Thus, the entropy generation rate per unit volume of the longitudinal porous fin of the arbitrary crosssection can be written as: In dimensionless form, the total entropy generation rate can be written as: Ns pm (17) where Ns h and Ns pm are the dimensionless entropy generation rates due to heat and porous medium, k r and Tr are the dimensionless ratios and defined as: while the characteristic length ', cross-sectional area A c and the perimeter P of the square fin are defined as: The average entropy generation rate in the longitudinal fin can be determined from: The irreversibility ratio also known as Bejan number [26] is defined as: Concerning the entropy generation analysis of convective heat transfer problems, Bejan presented the expression of irreversibility distribution ratio as follows [26]: It is noteworthy to underline that when È > 1, the porous medium irreversibility Ns pm is the major source, whereas if 0 < È < 1 the heat transfer irreversibility Ns h is dominant when È ¼ 1; the irreversibility due to heat transfer (Ns h ) and due to porous medium (Ns pm ) have the same share.

Optimization
The optimization algorithms, searching for optimal solutions, are based on the information they collect through several iterations [27]. To avoid local search, three metaheuristic algorithms, including firefly algorithm (FFA), particle swarm optimization (PSO), and hybrid PSO-FFA algorithms are used for global optimization. The general optimization procedure and the essential aspects of each algorithm will be presented in the coming sections.

Optimization Procedure
In this study, the dimensionless average entropy generation rate Ns avg is the objective function (fitness function) that is to be minimized subject to the following constraints. So, the mathematical model for the optimization of Ns avg can be written as: Minimize f ðxÞ ¼ Ns avg (23) Subject to 10 Ra 50; 0 < Da < 1; 0:5 f 0:9; 10 Nu L 50; 100 k s 500 We focus on finding the optimal values of the above parameters through the selected algorithms. The other fixed parameters are given in Tab. 1.

Firefly Algorithm
Based on the behavior of fireflies, Yang [28] presented the FFA as a very effective algorithm. The FFA is flexible to both continuous and clustering problems because of its several characteristics [29,30]. The key advantages of FFA arise in two main parts: The ability to deal with the automatic subdivision and multimodality. Therefore, the population of FFA is automatically divided into groups, with each group trying to achieve the optimal local position.
The main idea of the FFA relies on the attraction of fireflies to each other depending on the strength of brightness, aware that sceneries will determine the strength of the brightness of an objective function. According to that, the fireflies are going to move to the brighter ones, whereas a firefly will have a random movement if there are no brighter fireflies. According to Yang [28], the new position of a firefly i in reference to a brighter firefly j is given by: where x i ðtÞ represents the position of the firefly x i at time t (i = 1, 2, …, N), where N is the number of fireflies. b 0 represents the attractiveness at a distance of r ¼ 0 and if b 0 ¼ 0, then the firefly x i has a random walk, cÃ represents the brightness absorption parameter, α represents a random vector over the interval [0,1], a t and 2 t i represent random parameter and vector, respectively, at time t [31]. FFA techniques and practical steps are briefly summarized in the following.
1. The FFA starts with N initial solutions (N fireflies) that are generated randomly. Note that initial solutions provide the initial values of the optimal variables Ra; Da; f; NuL; s; and ks: These initial solutions will develop over time to create a new generation. Furthermore, the random vector α and the brightness absorption parameter cÃ are assigned fixed parameters. Here, the parameter cÃ defines the convergence speed between the fireflies and contributes to how the FFA behaves.
2. The optimization process starts by generating initial populations. In every iteration, the attractiveness (β) and the distance (r) values of the fireflies are computed from the best firefly. 3. The value of light intensity IðrÞ changes with the firefly movements. This means that the positions of the fireflies are affected depending on their performance given the attractiveness and distance values I i ðrÞ > I j ðrÞ; then the firefly i will move towards the firefly j; otherwise, the firefly i will move randomly. 4. Announce the optimal solution (optimal value of Ns). Fig. 2 illustrates the structure of the FFA algorithm.

Particle Swarm Optimization Algorithm
The working principle of the PSO algorithm was inspired by the birds flock's social behavior and the fish's shoaling behavior [32,33]. The solutions generated by the PSO algorithm have the name particles. Note that particles of this work are the values of Ra, Da, f, Nul, s, and Ks. Using the Eqs. (26) and (27), each particle flies according to the change in its velocity vector v and its position x [32,34]: v ik ðt þ 1Þ ¼ v ik ðtÞ þ c 1 Ã r 1k ðtÞðy ik ðtÞ À x ik ðtÞÞ þ c 2 Ã r 2k ðtÞðŷ ik ðtÞ À x ik ðtÞÞ (26) Kennedy and Eberhart suggested c 1 ¼ c 2 ¼ 1:49 in his calculations [35]. Note that, when the best particle, i.e., the solution with the best performance (optimal value of Ns avg ), is determined, the other particles will follow it. Additionally, each particle will retain the best position it achieved before.

Hybrid FFA-PSO Algorithm
The purpose of using of PSO-FFA is improving the overall performance of FFA and PSO algorithm in a research field by combining the two algorithms together so that the weaknesses of one algorithm are compensated by the strengths of other algorithm [36]. The new position vectors of the FFA-PSO is generated randomly by using the following equations [36].
ij ðx ik ðtÞ À x i;p best ðtÞÞ þ c 2 e ÀcÃr 2 2 ij ðx ik ðtÞ À x i;g best ðtÞÞ þ aðc Ã À1Þ (29) where r 1 is the Cartesian distance between x ik ðtÞ and x i;p best ðtÞ. r 1 is the Cartesian distance between x ik ðtÞ and x i;g best ðtÞ.

Results and Discussion
This study demonstrates the mathematical modeling and optimization of longitudinal porous fins of square cross-section. For the modeling, the first and second laws of thermodynamics together with Darcy and Fourier's laws, are employed, whereas three metaheuristic algorithms are utilized to minimize the entropy generation rate. The dimensionless nonlinear differential equations are solved analytically using Homotopy Perturbation Method (HPM) for the two selected fin tip boundary conditions. The effects of dimensionless numbers, including Rayleigh, Darcy, Nusselt numbers on the dimensionless temperature, fin efficiency, total entropy generation rate, and Bejan number, are investigated theoretically. In each case, it is assumed that f ¼ 0:8; k s ¼ 200; Nu ' ¼ 20; s ¼ 0:01.

Theoretical Results
Figs. 3(a) and 3(b) display the effects of Rayleigh and Darcy numbers on the dimensionless temperature along the fin surface for the adiabatic and convective tip conditions. The Rayleigh number plays the same role in free convection, as Reynolds number plays in the forced convection. The dimensionless temperature is found to be maximum at the base surface and decreases along the fin surface. As the Rayleigh number increases, the dimensionless temperature decreases in each case. For convective fin tip condition, the Rayleigh number enables a better heat transfer rate at higher values of Nu ' . The Darcy number signifies the comparative impact of the permeability of the porous medium. It is observed that the dimensionless temperature decreases with an increase in the Darcy number, see Figs. 3(a) and 3(b). The variation of fin efficiency with both Ra and Da along the fin surface is depicted in Figs. 4(a) and 4(b) for both boundary conditions, respectively. Like temperature, the fin efficiency is maximum at the base surface and decreases along the fin surface. Both Ra and Da tend to reduce the efficiency of the fin. As Da increases, the ideal heat transfer rate increases, which reduces the fin efficiency.
The total dimensionless entropy generation rate N st includes the entropy generation due to heat transfer Ns h and porous medium Ns pm . In the porous medium, the entropy generation rate depends upon Ra and Da. The total dimensionless entropy generation rate is plotted versus the fin length in Figs. 5(a) and 5(b) for both tip boundary conditions. In each case, the effects of Ra and Da on Ns t are displayed for the same fixed parameters. As expected, the total dimensionless entropy generation rate is maximum at the base surface and decreases along the fin length. As the Rayleigh number increases, the total dimensionless entropy generation rate decreases due to the decrease in temperature gradients. As the Darcy number decreases, the permeability of the porous medium decreases, and as a result, the entropy generation rate also decreases. The Bejan number is plotted versus fin length in Figs. 6(a) and 6(b) for both boundary conditions. The effect of Ra and Da on the Bejan number are displayed. It is shown that the Bejan number decreases with an increase in the Ra, but increases with Da. In fact, Bejan number shows the relative measure of irreversibility due to heat transfer over irreversibility due to porous medium. In both cases, the Bejan number is close to unity which indicates the dominance of irreversibility due to heat transfer, see Fig. 6.

Simulation Results
In this study, a longitudinal square cross-section porous fin is modeled and optimized using three robust metaheuristic algorithms, namely, PSO, FFA, and hybrid PSO-FFA, for the two selected boundary conditions. The personal and global best values of Ns avg are plotted in Fig. 7(a) adiabatic tip and Fig. 7 (b) convective tip conditions using the PSO algorithm. During the optimization process, the position of each particle will be automatically adjusted in the direction based on the best position founded by itself (personal best), and the other is the best position in the whole swarm (Global best) [32]. In each iteration, the algorithms memorized the personal best value of the fitness function (the lowest value of Ns avg founded by that iteration). Moreover, each iteration memorized the Global best value of the fitness function (the lowest value of Ns avg found so far). These curves show a decreasing trend from first iteration until a point that has no more improvement, and then there is convergence in the algorithms. For the adiabatic tip condition, the global best value of Ns avg ¼ 0:83 is found after 8 iterations, whereas for the convective tip condition, the global best value of Ns avg ¼ 0:84 is found after 38 iterations. Figs. 8 and 9 display the convergence of Ns avg using PSO for both fin tip conditions, respectively. The constriction factors (c 1 and c 2 ) were introduced into PSO to improve its search performance, where c 1 ¼ c 2 ¼ 1:49 has been suggested by Zeng et al. [35]. The constriction factors represent jumping steps that affect finding the best solutions. In order to find appropriate values for the constriction factors (PSO algorithm parameters), we examined different values for c 1 and c 2 find the optimum value of Ns avg : As a result, we found that the best values for the parameters for both boundary conditions are c 1 ¼ c 2 ¼ 1:9; as shown in Fig. 8(a) adiabatic tip and Fig. 8(b) convective tip conditions. The initial population that we have used is 80, and the number of iterations is 100. As a result, the best values of PSO algorithm parameters are c 1 ¼ c 2 ¼ 1:9: PSO algorithm parameters represent jumping steps that affect finding the minimum possible value.  In addition to the PSO algorithm, we also made an effort to improve the objective function Ns avg of longitudinal porous fins by calculating optimal values using FFA and hybrid PSO-FFA. The initial population starts by 80, and the number of iterations is determined by 100, while c 1 ¼ c 2 ¼ 1:9; a¼ 2; and c ¼ 0:05: In the first experiment (adiabatic tip condition), the optimal value of Ns avg is 0.8261, and the corresponding value of g is 0.91. Fig. 9(a) adiabatic tip and Fig. 9(b) convective tip conditions demonstrate the convergence of the fitness functions Ns avg for both fin tip conditions using three selected MAs. The best results or the minimum entropy generation rate obtained after all the runs have been shown in both figures. MAs examine the whole domain for improved combinations of design variables, which would give the minimum value of Ns avg is observed that hybrid PSO-FFA converges after 5 iterations, then PSO converges after 16 iterations, and FFA converges after 80 iterations for the adiabatic fin tip condition. Therefore, PSO-FFA has performed better than FFA and PSO in terms of convergence speed and computational effort. However, for the convective fin tip condition, the convergence rate is found slow. Note that the three algorithms determine the same optimal value. As a result, the best values of the parameters for adiabatic tip conditions are Ra ¼ 10; Da ¼ 0:0010; f ¼ 0:5; Nu ' ¼ 10; ks ¼ 100 and s ¼ 0:008 ( Fig. 9(a)).
On the other hand, the optimal value of Ns avg for the convective tip condition is 0.8425, as shown in Fig. 9(b). This figure shows that the optimum value obtained is the same value that was determined using the three algorithms. In addition, the best values of the parameters are Ra ¼ 10; Da ¼ 0:0010; f ¼ 0:5; Nu ' ¼ 10; ks ¼ 100, and s ¼ 0:008.

Conclusion
Metaheuristic algorithms have been used to optimize the thermal performance of longitudinal porous fins with a square cross-section using the entropy generation model. The information of the local and global best positions is exploited to update the particle's velocity in each iteration. The effects of two different tip boundary conditions on the performance of fins are examined. The following important conclusions are drawn from this study: Rayleigh and Darcy's numbers reduce the dimensionless temperature and fin efficiency along the fin surface.
The convective tip condition provides higher efficiency than the adiabatic tip condition. The Rayleigh number reduces the total entropy generation rate, whereas the Darcy number increases the entropy generation rate. The optimum value obtained is the same value that was determined using the three algorithms The hybrid PSO-FFA is found to be more efficient than PSO or FFA algorithms in terms of convergence speed and computational efforts.