Introduction

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 Choi1, 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 exchangers2, solar collectors3, material engineering4, energy storage systems5, engine oil6, Bio-technology7 and Water Cleaning Process8.

Over the past two decades, several studies have been published on nanofluids and their flow and heat transfer behaviors. Rashmi9 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 Al2O3 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 Al2O3water-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 applications15,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 185620. 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. Bahiraei32 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 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 others35,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-Fe3O4/ H2O). Several parameters are studied such as Ra \(\left({10}^{3}\le \mathrm{Ra}\le {10}^{6}\right).\) Ha \((0\le \mathrm{Ha}\le 100)\), and Da \(\left({10}^{-5}\le \mathrm{Da}\le 0.15\right)\). 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.

Figure 1
figure 1

Schematic illustration of corrugated enclosure and sample mesh.

Table 1 Thermo physical properties of water and nanoparticles50.

The wavy walls equations obey.

$$x = - A\sin (\frac{N\pi x}{H})$$
(1)

The thermophysical properties of water and Multi-Walled Carbon Nanotube-Iron oxide (MWCNT-Fe3O4) are defined in Table 1.

Mathematical formulation

The porous cavity is filled with Fe3O4/MWCNT-water hybrid nanoliquid. The Forchheimer-Brinkman-extended51 Darcy model is adopted together with the Boussinesq approximation:

$$\frac{\partial u}{{\partial x}} + \frac{\partial v}{{\partial y}} = 0$$
(2)
$$\frac{{\rho_{hnf} }}{{\varepsilon^{2} }}\left( {u\frac{\partial u}{{\partial x}} + v\frac{\partial u}{{\partial y}}} \right) = - \frac{\partial P}{{\partial x}} + \frac{{\mu_{hnf} }}{\varepsilon }\left( {\frac{{\partial^{2} u}}{{\partial x^{2} }} + \frac{{\partial^{2} u}}{{\partial y^{2} }}} \right) - \left( {\frac{{\mu_{hnf} }}{K}u - \frac{1.75}{{\sqrt {150} \left( \varepsilon \right)^{\frac{3}{2}} }}\frac{{\mu_{hnf} u\left| u \right|}}{\sqrt K }} \right)$$
(3)
$$\frac{{\rho_{hnf} }}{{\varepsilon^{2} }}\left( {u\frac{\partial v}{{\partial x}} + v\frac{\partial v}{{\partial y}}} \right) = - \frac{\partial p}{{\partial y}} + \frac{{\mu_{hnf} }}{\varepsilon }\left( {\frac{{\partial^{2} v}}{{\partial x^{2} }} + \frac{{\partial^{2} v}}{{\partial y^{2} }}} \right) - \left( {\frac{{\mu_{hnf} }}{K}u - \frac{1.75}{{\sqrt {150} \left( \varepsilon \right)^{\frac{3}{2}} }}\frac{{\mu_{nf} u\left| u \right|}}{\sqrt K }} \right) + \left( {\rho \beta } \right)_{hnf} g(T_{h} - T_{c} ) - \sigma_{hnf} B_{0} v^{2}$$
(4)
$$u_{hnf} \frac{{\partial T_{nhf} }}{\partial x} + v_{hnf} \frac{{\partial T_{hnf} }}{\partial y} = \alpha_{hnf} \left( {\frac{{\partial^{2} T_{hnf} }}{{\partial x^{2} }} + \frac{{\partial^{2} T_{hnf} }}{{\partial y^{2} }}} \right)$$
(5)

The volume fraction of nanoparticle types used are formulated as follows:

$$\varphi = \varphi ({\text{MWCNT}}) \, + \varphi \left( {{\text{Fe}}_{{3}} {\text{O}}_{{4}} } \right)$$
(6)

The following nanofluid thermophysical properties are utilized51,52,53,54,55,56,57:

$$\left\{ \begin{gathered} \rho_{hnf} = (1 - \phi )\rho_{f} + \phi \rho_{p} \hfill \\ (\rho \beta )_{hnf} = (1 - \phi )(\rho \beta )_{f} + \phi (\rho \beta )_{p} \hfill \\ \end{gathered} \right.$$
(7)
$$\left\{ \begin{gathered} (\rho C_{p} )_{hnf} = (1 - \phi )(\rho C_{p} )_{f} + \phi (\rho C_{p} )_{p} \hfill \\ \alpha_{hnf} = \frac{{k_{hnf} }}{{(\rho C_{p} )_{hnf} }} \hfill \\ \end{gathered} \right.$$
(8)
$$\frac{{k_{hnf} }}{{k_{f} }} = \frac{{k_{np} + \left( {n - 1} \right)k_{f} - \left( {n - 1} \right)\left( {k_{f} - k_{np} } \right)\varphi }}{{k_{np} + \left( {n - 1} \right)k_{f} + \left( {k_{f} - k_{np} } \right)\varphi }}$$
(9)
$$\mu_{hnf} = \frac{{\mu_{{_{bf} }} }}{{\left( {1 - \varphi } \right)^{2.5} }}$$
(10)

The following dimensionless variables are utilized:

$$X = \frac{x}{L},Y = \frac{y}{L}$$
(11)
$$U = \frac{uL}{{\alpha_{f} }},V = \frac{vL}{{\alpha_{f} }}$$
(12)
$$\theta_{nf} = \frac{{T_{nf} - T_{c} }}{{T_{h} - T_{c} }}, \quad \theta_{s} = \frac{{T_{s} - T_{c} }}{{T_{h} - T_{c} }}, \quad \Pr = \frac{{\nu_{f} }}{{\alpha_{f} }}$$
(13)
$$Ra = \frac{{g\beta_{f} (T_{h} - T_{c} )L^{3} }}{{\nu_{f} \alpha_{f} }},{\text{ P = }}\frac{{pL^{2} }}{{\rho_{f} \alpha_{f}^{2} }},{\text{ k}}_{eff} = \varepsilon k_{nf} + (1 - \varepsilon )k_{m} ,{\text{ C}}_{F} = \frac{1.75}{{\sqrt {150} }}$$
$$Da = \frac{\lambda }{{L^{2} }}, \quad \Pr = \frac{{v_{fl} }}{{\alpha_{fl} }}$$
$$Ha = LB_{{}} \sqrt {\frac{{\sigma_{nf} }}{{\mu_{nf} }}}.$$
(14)

As a result, we have

$$\frac{\partial U}{{\partial X}} + \frac{\partial V}{{\partial Y}} = 0$$
(15)
$$\begin{gathered} \frac{1}{{\varepsilon^{2} }}\left( {U\frac{\partial U}{{\partial X}} + V\frac{\partial U}{{\partial Y}}} \right) = - \frac{\partial P}{{\partial X}} + \frac{{\rho_{f} }}{{\rho_{hnf} }}\frac{{\mu_{hnf} }}{{\mu_{f} }}\frac{\Pr }{\varepsilon }\left( {\frac{{\partial^{2} U}}{{\partial X^{2} }} + \frac{{\partial^{2} U}}{{\partial Y^{2} }}} \right) \hfill \\ \quad - \frac{{\rho_{f} }}{{\rho_{hnf} }}\frac{{\mu_{hnf} }}{{\mu_{f} }}\frac{\Pr }{{Da}}U - \frac{{C_{F} \sqrt {U^{2} + V^{2} } }}{{\sqrt {Da} }}\frac{U}{{\varepsilon^{3/2} }} \hfill \\ \end{gathered}$$
(16)
$$\begin{gathered} \left( {U\frac{\partial V}{{\partial X}} + V\frac{\partial V}{{\partial Y}}} \right) = - \frac{\partial P}{{\partial X}} + \frac{{\rho_{f} }}{{\rho_{hnf} }}\frac{{\mu_{hnf} }}{{\mu_{f} }}\frac{\Pr }{\varepsilon }\left( {\frac{{\partial^{2} V}}{{\partial X^{2} }} + \frac{{\partial^{2} V}}{{\partial Y^{2} }}} \right) - \frac{{\rho_{f} }}{{\rho_{nf} }}\frac{{\mu_{nf} }}{{\mu_{f} }}\frac{\Pr }{{Da}}V - \frac{{C_{F} \sqrt {U^{2} + V^{2} } }}{{\sqrt {Da} }}\frac{V}{{\varepsilon^{3/2} }} \hfill \\ \quad + \frac{{(\rho \beta )_{hnf} }}{{\rho_{hnf} \beta_{f} }}Ra\Pr \theta - Ha^{2} \Pr \frac{{\sigma_{hnf} }}{{\sigma_{f} }}\frac{{\rho_{f} }}{{\rho_{hnf} }}V \hfill \\ \end{gathered}$$
(17)
$$U\frac{\partial \theta }{{\partial X}} + V\frac{\partial \theta }{{\partial Y}} = \alpha_{hnf} \left( {\frac{{\partial^{2} \theta }}{{\partial X^{2} }} + \frac{{\partial^{2} \theta }}{{\partial Y^{2} }}} \right)$$
(18)

Boundary conditions

The boundary conditions now become.

For top wall

$$U = V = 0, \quad \frac{{\partial \theta_{nf} }}{\partial Y} = 0$$
(19)

Heated part of inner wall

$${\text{U = V = 0, }} \quad \theta_{nf} = 1, \,$$

For outer wall

$${\text{U = V = 0, }} \quad \theta_{nf} = 0, \,$$

The average numbers are defined as

$$Nu_{avg} = \frac{{k_{nf} }}{{k_{f} }}\frac{\partial \theta }{{\partial n}}$$
(20)

Entropy production analysis

The entropy production relation is given by47,48:

$${S}_{T}=\frac{{k}_{nf}}{{T}_{0}^{2}}\left[{\left(\frac{\partial T}{\partial x}\right)}^{2}+{\left(\frac{\partial T}{\partial y}\right)}^{2}\right]+\frac{{\mu }_{nf}}{{T}_{0}}\left[2{\left(\frac{\partial u}{\partial x}\right)}^{2}+2{\left(\frac{\partial v}{\partial y}\right)}^{2}+{\left(\frac{\partial u}{\partial x}+\frac{\partial v}{\partial x}\right)}^{2}\right]+\frac{{\sigma }_{nf}{B}_{0}^{2}}{{T}_{0}}\left({u}^{2}+{v}^{2}\right).$$
(21)

In dimensionless form can be expressed as:

$${S}_{T}=\frac{{k}_{nf}}{{k}_{f}}\left[{\left(\frac{\partial \theta }{\partial X}\right)}^{2}+{\left(\frac{\partial \theta }{\partial Y}\right)}^{2}\right]+\frac{{\mu }_{nf}}{{\mu }_{f}}\upchi \left\{2\left[{\left(\frac{\partial U}{\partial X}\right)}^{2}+2{\left(\frac{\partial V}{\partial Y}\right)}^{2}\right]+{\left(\frac{\partial U}{\partial Y}+\frac{\partial V}{\partial X}\right)}^{2}+\upchi {\mathrm{Ha}}^{2}\frac{{\sigma }_{nf}}{{\sigma }_{f}}({U}^{2}+{V}^{2})\right\}.$$
(22)

where,

$$\upchi =\frac{{\mu }_{f}{T}_{0}}{{k}_{f}}{\left(\frac{{u}_{w}}{{T}_{h}-{T}_{c}}\right)}^{2},$$
(23)

is the irreversibility distribution ratio and The terms of Eq. (27) can be separated into the following form:

$${S}_{T}={S}_{HT}+{S}_{FF}+{S}_{MF},$$
(24)

where \({S}_{HT}\) , SFF and SMF are the entropy production due to heat transfer irreversibility (HTI), fluid friction irreversibility (FFI) and magnetic field (MF) respectively.

$${S}_{HT}=\frac{{k}_{nf}}{{k}_{f}}\left[{\left(\frac{\partial \theta }{\partial X}\right)}^{2}+{\left(\frac{\partial \theta }{\partial Y}\right)}^{2}\right]$$
(25)
$${S}_{FF}=\frac{{\mu }_{nf}}{{\mu }_{f}}\upchi \left\{2\left[{\left(\frac{\partial U}{\partial X}\right)}^{2}+2{\left(\frac{\partial V}{\partial Y}\right)}^{2}\right]+{\left(\frac{\partial U}{\partial Y}+\frac{\partial V}{\partial X}\right)}^{2}\right\}.$$
(26)
$${S}_{MF}=\upchi {\mathrm{Ha}}^{2}\frac{{\sigma }_{nf}}{{\sigma }_{f}}({U}^{2}+{V}^{2})$$
(27)

Bejan number is defined as:

$${B}_{e}=\frac{\int {S}_{HT}\mathrm{dXdY}}{\int {S}_{T}\mathrm{dXdY}}=\frac{{S}_{HT}}{{S}_{T}}$$
(28)

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.

Table 2 Grid sensitivity check (Ha = 0, φ = 0.04, Da = 10–2, Ra = 105).
Figure 2
figure 2

Validation of numerical code with Calcagni et al.53 at Ra = 105.

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 \(\varphi\)=0.04, gravity effects due to temperature differences inside the porous cavity were varied using a wide range of Ra (103 \(\le Ra\le\) 106). Also, the magnetic field impact was considered with (0 \(\le Ha\le\) 100), besides the Darcy number influence was taken into account using (10–5 \(\le Da\le\) 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 (Th-Tc) 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 = 103), convection streams are very weak (\(\psi_{\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.

Figure 3
figure 3

The impact of Ra on (ψ) Streamlines, (θ) Isotherms, and (S) Entropy for Da = 10–2, Ha = 0.

In this case, low entropy generation (4.5 \(\le\) S \(\le\) 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 = 106. 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 (\(\psi_{\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 × 103 \(\le\) S \(\le\) 1.29 × 105).

Hartman number effect

The influence of the electromagnetic forces exerted by the magnetic field on the nanofluid under investigation was examined through the Hartman number in a range of (0 \(\le\) Ha \(\le\) 100), with (Ra = 106, Da = 10–2, and AR = 0.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 (\(\psi_{\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, \(\psi_{\max }\) = 12, for Ha = 50, \(\psi_{\max }\) = 11.2, and for Ha = 100, \(\psi_{\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, Smax = 124.7 × 103 and for Ha = 100, Smax = 83.3 × 103). Therefore, we can say that the magnetic field is used to confine the convection, therefore the thermal losses in the concerned system become lower.

Figure 4
figure 4

The impact of Ha on (ψ) Streamlines, (θ) Isotherms, and (S) Entropy for Da = 10–2, Ra = 106.

Darcy number effect

Permeability of the porous media is considered using various values of Darcy number (10–5 \(\le\) Da \(\le\) 10–2) for (Ra = 106; Ha = 0 and AR = 0.5). Figure 5 shows the Darcy number effects on current lines, 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, \(\psi_{\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, \(\psi_{\max }\) = 0.32), furthermore, the convection rollers tend to tighten. The isotherms are stratified and reappear in uniform way within the cavity.

Figure 5
figure 5

The impact of Da on (ψ) Streamlines, (θ) Isotherms, and (S) Entropy for Ha = 0, Ra = 106.

Heated-wall length effect

In this part, effects of the geometrical shape of the cavity were presented using (0.5 \(\le\) AR \(\le\) 0.75) for (Ra = 106, 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 (\(\psi_{\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 (\(\psi_{\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.

Figure 6
figure 6

The impact of AR on (ψ) Streamlines, (θ) Isotherms, and (S) Entropy for Ha = 0, Ra = 106.

Heat transfer performance of odd-shaped enclosure

For the characterization of heat transfer inside the porous cavity, Nuavg 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,D,E), when AR reduces the Nusselt number reaches higher values.

Figure 7
figure 7

The variation of average Nu in various parameters.

Characterization of entropy production

To understand and characterize the energy losses within the cavity, Bejan number evolutions have been presented according to the control parameters. Combined effects of (Ra, Da); (Ra, Ha); (Ra, AR), and (Da, Ha) on Be number have be shown respectively in Fig. 8A–D. A cylindrical stratification variation was observed on the Bejan number behavior when Ra and Da are varied simultaneously (see 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.

Figure 8
figure 8

The variation Bejan number with various parameters.

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.