MHD darcy-forchheimer nanofluid flow and entropy optimization in an odd-shaped enclosure filled with a (MWCNT-Fe3O4/water) using galerkin finite element analysis

MHD nanoliquid convective flow in an odd-shaped cavity filled with a multi-walled carbon nanotube-iron (II, III) oxide (MWCNT-Fe3O4) hybrid nanofluid is reported. The side walls are adiabatic, and the internal and external borders of the cavity are isothermally kept at high and low temperatures of Th and Tc, respectively. The governing equations obtained with the Boussinesq approximation are solved using Galerkin Finite Element Method (GFEM). Impact of Darcy number (Da), Hartmann number (Ha), Rayleigh number (Ra), solid volume fraction (ϕ), and Heated-wall length effect are presented. Outputs are illustrated in forms of streamlines, isotherms, and Nusselt number. The impact of multiple parameters namely Rayleigh number, Darcy number, on entropy generation rate was analyzed and discussed in post-processing under laminar and turbulent flow regimes.

At the end of the twentieth century, a new class of fluid emerged owing to the work done by a team of researchers led by professor Choi 1 , who named it nanofluid. This new engineered fluid exhibited exceptional heat transfer characteristics and offered the great benefit of enhancing any thermal system performance without any modifications to its components. Nowadays we can find nanofluids in a plethora of energy, bioengineering, and industrial applications thanks to the work done by many researchers on nanofluid to expand their utility for example in heat exchangers 2 , solar collectors 3 , material engineering 4 , energy storage systems 5 , engine oil 6 , Bio-technology 7 and Water Cleaning Process 8 .
Over the past two decades, several studies have been published on nanofluids and their flow and heat transfer behaviors. Rashmi 9 found gains of 6.3% and 18.45% in the second law of efficiency and heat transfer rate, respectively when he tested a ternary hybrid nanoliquid as a radiator coolant. He also noted that the performance of this hybrid nanofluid was dependent on the volume concentration and the shape of the solid particles. Choi et al. 10 discussed enhancing the performance of a radiator used to cool a 100 kW high power system by employing an EG/water-based Al 2 O 3 nanoliquid they found that the nanofluid enhanced the heat transfer rate inside the radiator by 6.9%. Moreover, they demonstrated the nanofluid they used, could be mass-produced and that its long-term suspension stability was well maintained during the study period. Ahmadi et al. 11 studied the influence of employing nanoliquid in a shell and tube heat exchanger cooling an EGR system of a diesel engine. Desouky et al. 12 examined numerically the MHD thermal behavior inside a T-shaped enclosure filled with nanofluid and under the influence of Lorentz force and the motion of the upper and lower parallel walls Merino et al. 13 provided an insight into how the method of nanofluid preparation affects its thermal performance and stability. Fadodun et al. 14 examined the heat transport rate of an Al 2 O 3 water-based nanofluid as it circulated inside a converging pipe. Suspending nanoparticles in a base fluid has been proven to be an effective technique in augmenting the thermal performance in various thermal applications [15][16][17][18][19] .
The analysis of nanofluid flow through porous media has been receiving tremendous attentiveness from many researchers and the most common model used in this type of study is the Darcy model developed by Henry Darcy in 1856 20 . Taking into consideration the 1 and 2 laws of thermodynamics, Shahsavar et al. 21 evaluate the hydrothermal performance of a heat sink filled with metal foam and saturated by an eco-friendly water-silver nanofluid. They stated that although the presence of porous medium diminished the entropy production rate, it improved the overall thermal performance of the heat sink. Alihosseini et al. 22 observed that the thermal performance of nanofluid when flowing through a cylinder fully saturated with a porous medium was better when compared to its performance in an empty cylinder. Th. Benos et al. 23 researched the hydrothermal characteristics of nanofluid inside a rectangular porous enclosure subjected to an external uniform magnetic field and an internal heating source. Baïri et al. 24 discussed the enhancement of the performance of a spherical thermal management system for a spherical electronic device, using permeable media filled with a nanofluid. Liu et al. 25 simulated the hydrothermal behavior of water-based Cu nanoliquid saturating an annulus filled with porous media. Tahmasbi et al. 26 analyzed the Mixed convection of nanofluid inside a square enclosure filled with optimized permeable media and equipped with two rotating cylinders. Using the non-equilibrium technique, Shafee et al. 27 scrutinized the impact of a magnetic field on the heat transfer of a nanoliquid within a cavity filled with porous media. They found that the Lorentz forces suppressed convective flow. Salari et al. 28 studied experimentally the influence of using nanofluids to enhance a heat exchanger partially filled with a permeable medium. The outcomes show that using both the nanofluid and the partial porous medium contributed to the improvement of the thermal performance rate in the heat exchanger. Aminian et al. 29 directed a numerical investigation on MHD forced convective heat transport of a nanofluid flowing through a cylinder saturated with a porous medium. In addition, they defined a performance evaluation criterion (PEC) to compare the thermal and hydrodynamic performance of the different configurations of the investigated system. According to their results, the Hartmann and Darcy number have an undeniable positive impact on the enhancement of the PEC and heat transfer rate.
Furthermore, several scientists reported on the entropy production of nanofluid in various cavities and under various conditions for example inside a square cavity and under a magnetic field Kefayati et al. 30 , an enclosure with wavy side walls filled with a ferrofluid Afsana et al. 31 . Bahiraei 32 studied the heat transportation performance of a hybrid eco-friendly nanoliquid flowing inside tubes equipped with rotary twisted tape. They found that employing the twisted tape at relatively high rotation speeds, (around 900 rpm) greatly diminished the total entropy production and total exergy destruction of the hybrid nanolquid. In another study by Bahiraei et al. 33 inspected the entropy production for the flow of a hybrid nanoliquid through a microchannel heat sink outfitted with secondary channels and ribs. Ma et al. 34 numerically studied the first and second law performance of a branching microchannels heatsink employing ecofriendly Ag-water based nanofluid, using a two-phase mixture www.nature.com/scientificreports/ model. They also discussed the impact of various fin arrangements. In addition to the previously mentioned literature review, it should be mentioned that other authors have given an extensive reviews and they investigated both forced and natural convection where the nanofluid was utilized for conventional and rarefied flows under different physical and geometrical effects for different applications. These include but not limited to MHD, porous media, fins, internal heat generation and many others [35][36][37][38][39][40][41][42][43][44][45][46][47][48][49] . The present work investigates MHD natural convection response within an Odd-Shaped enclosure Filled with a (MWCNT-Fe 3 O 4 / H 2 O). Several parameters are studied such as Ra 10 3 ≤ Ra ≤ 10 6 . Ha (0 ≤ Ha ≤ 100) , and Da 10 −5 ≤ Da ≤ 0.15 . 2D numerical simulation is performed on this geometry using the finite element method and directed to identify the optimum conditions for obtaining the best heat transfer possible through this configuration.
Physical model. As mentioned in the current text, the problem description is based on magnetic force's influence on the nanoparticle treatment process within the medium, taking into account the impact of permeability. More specifically, the objective is to see how to change the flow condition parameters, such as the radiation parameter, Ra and Ha numbers, the nanoparticle content, and the number of corrugations, with a view to controlling heat transfer and entropy generation in the domain. Here, the physical model (see Fig. 1) is a trapezoidal cavity cooled by the sides (Tc) and heated by a corrugated bottom (Th). The upper wall of the cavity is considered adiabatic. Table 1 exhibits characteristics of hybrid nanofluid.
The wavy walls equations obey.
The thermophysical properties of water and Multi-Walled Carbon Nanotube-Iron oxide (MWCNT-Fe 3 O 4 ) are defined in Table 1.

Mathematical formulation
The porous cavity is filled with Fe 3 O 4 /MWCNT-water hybrid nanoliquid. The Forchheimer-Brinkman-extended 51 Darcy model is adopted together with the Boussinesq approximation:  www.nature.com/scientificreports/ The volume fraction of nanoparticle types used are formulated as follows: The following nanofluid thermophysical properties are utilized 51-57 : The following dimensionless variables are utilized: As a result, we have For outer wall.
The average numbers are defined as Entropy production analysis. The entropy production relation is given by 47,48 : In dimensionless form can be expressed as: where, is the irreversibility distribution ratio and The terms of Eq. (27) can be separated into the following form: where S HT , S FF and S MF are the entropy production due to heat transfer irreversibility (HTI), fluid friction irreversibility (FFI) and magnetic field (MF) respectively.
Bejan number is defined as:

Method of solution
Validation and grid independence. Galerkin weighted residual finite element method was used for the solution of the governing equations along with the boundary conditions. several grids are tested. As indicated in Table 2, The obtained results lead us to consider the extra-fine grid with 40,600 triangular elements to be used in the current study. To assure the accuracy of the numerical method of the adopted code, the isothermal contours are represented and then compared with published results obtained by Calcagni et al. 58 as showed in Fig. 2.

Results and discussion
In this part, we discuss in detail the results obtained from the numerical simulations carried out in this work.
The results have been given in terms of streamline, isotherms, and Isentropic contours within the odd-shaped cavity in question. Also, we presented the average Nusselt number variation a Bejan number evolution as a function of control parameters at the hot wall. In this work, the effects of a wide range of parameters on flow structure, temperature distribution, and induced entropy generation have been examined. The volume fraction of nanoparticles within the fluid domain was set at ϕ=0.04, gravity effects due to temperature differences inside the porous cavity were varied using a wide range of Ra (10 3 ≤ Ra ≤ 10 6 ). Also, the magnetic field impact was considered with (0 ≤ Ha ≤ 100), besides the Darcy number influence was taken into account using (10 -5 ≤ Da ≤ 10 -2 ). The geometrical shape of the cavity was examined by considering different lengths of the heated wall.
Flow field, temperature distribution, and entropy generation. Rayleigh number effect. Without magnetic force (Ha = 0) and under (Da = 10 -2 ), we investigated Rayleigh number effects on streamlines, isotherms, and entropy production. The results of this examination can be seen in Fig. 3. In such structures, the flow force within the cavity occurs by virtue of thermal thrust caused by the temperature gradient (T h -T c ) between the convex wall and the lateral walls of the cavity. The symmetrical boundary conditions imposed on the odd-shaped cavity walls create a symmetrical flow structure with respect to the vertical axis passing through the cavity center (X = 0.5). Indeed, a bi-cellular flow pattern prevails with an upward movement at the center of the cavity. Under slow flow regimes (Ra = 10 3 ), convection streams are very weak ( ψ max = 0.04), and uniform temperature distribution occupies the whole domain. In this case thermal conduction governs both flow and temperature distribution structures. Isothermal line values increase gradually from the hot wall to the cold wall. This topology, called thermal stratification, is one of the characteristics of slow flows whose heat transfer occurs mainly by thermal diffusion. In this case, low entropy generation (4.5 ≤ S ≤ 175.3) is observed at the cones of the convex hot wall of the cavity, due to the weak condensation of isotherms near this region. Increased Rayleigh numbers are accompanied by higher buoyancy forces Ra = 10 6 . Therefore, a more important fluid circulation is required. The structure remains bi-cellular except that the shape of cells changes and they take an oval shape, indicating an increase in the induced flow. In this case, convection takes over and is accompanied by distortion of the isotherms which appear as thermal plumes. The latter is a sign of more intense convection currents ( ψ max = 12.3), which promotes the convection mechanism over that of conduction. The cold walls and the warm convex wall exhibit greater thermal gradients, creating active regions for local entropy generation. So, we notice that the produced entropy is more important in the case of high Rayleigh numbers with (3.3 × 10 3 ≤ S ≤ 1.29 × 10 5 ).    Figure 4 depicts the current lines, isotherms, and entropy production as a function of the Hartman number. Without a magnetic field (Ha = 0), the flow occurs as a two-cell structure under oval shape with a circulation velocity ( ψ max = 12.3). For this case, isotherms appear as a thermal plume characterized by a distortion of the temperature profiles. When the flow is subjected to a constant magnetic field characterized by a Hartman number (Ha ≠ 0), both thermal and hydrodynamic fields in the enclosure show that the magnetic field causes a decrease in the flow force intensity. In other words, it appears that the magnetic field has the ability to slow down and attenuate convection currents. Knowing that as Ha increases, the streamlines become narrower and have a lower flow intensity, (e.g., for Ha = 25, ψ max = 12, for Ha = 50, ψ max = 11.2, and for Ha = 100, ψ max = 9.4). This indicates that the magnetic field has a retarding effect on convection development. In its turn the isentropic profiles reveal that the entropy production in the enclosure declines with growing Hartman number, (e.g., for Ha = 25, S max = 124.7 × 10 3 and for Ha = 100, S max = 83.3 × 10 3 ). Therefore, we can say that the magnetic field is used to confine the convection, therefore the thermal losses in the concerned system become lower.
Darcy number effect. Permeability of the porous media is considered using various values of Darcy number (10 -5 ≤ Da ≤ 10 -2 ) for (Ra = 10 6 ; Ha = 0 and AR = 0.5). Figure 5 shows the Darcy number effects on current lines, www.nature.com/scientificreports/ temperature distribution, and isentropic lines in the odd-shaped cavity. High values of Da denote high permeability of the porous media, reflected by higher fluid velocities (e.g., for Da = 10 -2 , ψ max = 12.32). In this case, the isotherms have a deformed shape with a thermal plume at the heated wall and a uniform temperature zone in the center of the cavity. Therefore, the entropy generation in this case is more important. As Da decreases, the ability of the porous medium to allow the fluid to pass through decreases, therefore the fluid slows down (for Da = 10 -5 , ψ max = 0.32), furthermore, the convection rollers tend to tighten. The isotherms are stratified and reappear in uniform way within the cavity.
Heated-wall length effect. In this part, effects of the geometrical shape of the cavity were presented using (0.5 ≤ AR ≤ 0.75) for (Ra = 10 6 , Ha = 0, and Da = 10 -2 ). The results have been presented in Fig. 6, from this figure it was found that this parameter can play an important role on temperature repartition and streaming pattern as well as entropy production. Indeed, for AR = 0.25, the fluid flow area becomes larger, which induces bigger convection rollers and higher flow velocities ( ψ max = 16.2). As a result, the uniform temperature zone becomes larger, and a low entropy generation was observed. Concerning the situation of AR = 0.5, findings have been already commented on in the previous sections. The increasing value of AR = 0.75 narrows the surface area of the fluid. This induces convective cells with thin widths, consequently, the fluid velocity weakens ( ψ max = 9.2). As a result, the isotherms cluster on both sides of the cavity. In this case, the induced entropy has low values compared to the other two cases. For the characterization of heat transfer inside the porous cavity, Nu avg has been reported as a function of previously defined control parameters. The results were given as 3-D curves, where the mean Nu is given versus two parameters in the same curve (see Fig. 7). A growing change of the Nusselt number has been recorded in accordance to the rising of Rayleigh number independently of the other parameters' values (see Fig. 7A,B,F). This is obvious given that the convection regime dominates heat transfer as Ra becomes higher. As introduced in the previous sections, increasing the number of Hartman's delays the fluid flow. Consequently, the rate of heat transfer in the cavity is translated by the decreasing evolution of the mean Nusselt number versus the Ha number (see Fig. 7A,C,E). From these three curves, it can be noted that the decrease of Nusselt number vs. Ha, is more remarkable for higher Rayleigh numbers, as well as higher Darcy numbers (see Fig. 7A,C). Also, it is interesting to note that Darcy's number has a positive effect on the change of Nu number. Indeed, the "increase in Da leads to an improvement of the heat transfer rate. Reducing the heating length has also a positive impact on mean Nusselt, or, as demonstrated in (Fig. 7B, Fig. 8A). From this figure, it can be seen that the Bejan number is highest at low Ra and regardless of Da. In this situation, entropy occurs mainly by thermal irreversibility. This scenario has also been observed when Ra reaches its maximum with a combination with lower Da. For higher values of Ra and Da together, irreversibility's due to the friction forces are predominant. Concerning the effects of combination (Ra, Ha) on Be, it turned out that Be's number moved per vertical segment according to Ha as a function of Rayleigh number (see Fig. 8B). As Ra becomes higher, Be tends to become lower, whatever the magnetic field intensity is considered (Ha). In other words, an almost constant evolution of Be as a function of the Ha number. But Ha's effects on Be are more remarkable for small values of Da (see Fig. 8D), meaning that as Ha increases, energy degradation in a cavity is mainly due to temperature gradient effects. On another side, the effects of Ar parameter combined with the Rayleigh number (Fig. 8C), demonstrate that the geometric parameter Ar has little effect on Bejan number variations.

Conclusion
We have presented empirical parametric research on natural convection and entropy formation inside a cavity filled with a nanofluid exposed to a magnetic field under the presence of a porous medium. It is possible to summarize the most relevant points arising from this work as follows: • The heat transfer in the cavity is affected by flow regime (Ra), magnetic field strength Ha; medium porosity Da and heating length characterized by Ar. Note that the effects level of each parameter mentioned differs from the other. • Reducing the Da number leads to a drop in flow intensity.
• The thermal exchange rate within the oddly shaped cavity improves with increasing Ra.
• The reduction in Nusselt numbers relative to Ha is more noticeable for higher Rayleigh numbers, as well as for higher Darcy numbers. • Entropy generation within the cavity increases with increased Ra and diminishes at higher Ha values.
• Hartman number effects on Bejan number are most noticeable for small quantities of Darcy's number.

Data availability
The results of this study are available only within the paper to support the data.  License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.