Introduction

The researchers paid a great attention and efforts in terms of heat transfer augmentation through utilizing different techniques which serve in reduction of fuel consumption, enhancing the thermal performance and economical saving of energy. These techniques were passive and active. This article focuses on the first type that takes much attention by the scientific community as it requires no external power to drive the fluid leading to lower energy consumption. Natural convection is considered as a passive technique that had wide range technological applications in industry. These applications such as solar receiver [1], solar air heater [2], petroleum industry [3], etc. Natural convection in enclosures plays a critical tool to achieve this purposes. In this way, diverse techniques had been included for control of the heat transfer rate such as using of nanofluids, modifying of the enclosures, using the position of the boundary conditions, magnetic field and considering inner bodies immersed within the enclosures [4,5,6]. For full explanation of these shapes, the reader is recommended to read the review articles that summarized the natural convection within the conventional enclosures such as square, rectangular, triangular, trapezoidal, rhombus, wavy, etc. [7, 8]. The studies on natural convection within different shapes of enclosures are in thousands for the last decades, but there are serious limitations on the examination of this physical phenomenon within combined shapes of enclosures such as I-shaped, C-shaped, H-shaped, and F-shaped enclosures. In this way, this motives us to focus on combined shapes of enclosures which is known as H-shaped enclosure as it consists of multi-rectangular shaped enclosure with wavy wall. These shapes are very close to what exists in the reality.

The natural convection within enclosures without inner bodies had been examined a lot. Alhashash and Saleh [9] examined the hybrid nanofluid in wavy enclosure using finite element formulation. The hybrid nanofluid consisted on PCM suspended in the base fluid which was the water. The left wall was corrugated and heated at isothermally, while the right wall was flat and cooled and the rest horizontal walls were thermally insulated. The authors showed the impact of Rayleigh number, fusion temperature, and nanofluid volume fraction in addition to the number of corrugations and their amplitude. The results showed that the wavy surface decreased the heat transfer rate. Shekaramiz et al. [10] used Buongiorno's model to study the natural convection and entropy generation of Fe3O4—water nanofluid within triangular wavy enclosure under the influence of magnetic field. The triangle with equilateral sides where the left wall was wavy and two values of corrugation numbers had been selected (N = 3 and 6). The wavy wall was heated non-uniformly, while the chord was kept at cold temperature. The horizontal wall was insulated. The authors used OpenFOAM and SIMPLE algorithm as well as finite volume scheme for the simulation purposes. The results showed that increasing the number of undulations leads to an obvious reduction in Nusselt number.

Natural convection studies in complex geometries provide insights into how shape affects fluid flow and heat transfer. Non-square enclosures exhibit unique flow physics like formation of multiple vortices, secondary flows, and local hotspots based on the aspect ratio, orientation, curvature, and obstructions. Parameters like Rayleigh number and Prandtl number further influence the convection patterns and Nusselt number correlations. Investigation of such non-standard enclosures is critical for accurate thermal modeling and optimization in applications involving irregular cavities, electronic components with non-rectangular shapes, and complex building geometries. Das et al. [11] introduced the review articles about the studies that focused on natural convection phenomena through non-square shapes. The shapes of enclosure may take different configurations such as triangular enclosures [12], trapezoidal enclosures [13], parallelogramic enclosures [14], rhombic enclosures [15,16,17], and complex enclosures such as I, L, H, V, U, and Y shapes.

Also the inner bodies had been examined natural convection within enclosures as Kim et al. [18] examined the influence of position of inner circular body that it moved vertically in a square enclosure. The inner body was kept at hot conditions, while the enclosure kept at cold temperature. Another related study that had been presented by Hussain and Hussein [19] showed that they used finite volume formulation to study the natural convection between inner body with uniform heat flux through it while the enclosure was cold. Lee et al. [20] examined the influence of heater length attached to the bottom of square enclosure with inner circular cylinder. Dash and Lee [21] examined the natural convection within square enclosure with considering different horizontal and eccentric locations of inner square body. Mokaddes et al. [22] studied the natural convection in wavy enclosure with inner heat generated circular body immersed in Cu-Al2O3/water hybrid nanofluid through the usage of finite element method. The enclosure was partially heated from bottom, while the wavy walls are heated and the top flat wall was adiabatic. The authors had been examined the influence of parameters such of Rayleigh and Hartmann number, in addition to the nanofluid loadings. Additionally, the impact of heater length and the size of the inner circular heater had been tested as well. They found that the addition of 5% of hybrid nanofluid leads to enhanced heat transfer by 86.06% in comparison with the conventional fluid. Tayebi et al. [23] examined double-diffusive square enclosure with inner wavy porous body under the impact of magnetic field. The porous media filled with the wavy body had been modeled utilizing Darcy–Brinkman–Forchheimer approach, while the nanofluid filled the square enclosure considering local thermal non-equilibrium. The authors used for this purpose finite volume formulation. The authors examined the impact of Rayleigh, Hartmann and Lewis numbers in addition to buoyancy ratio, Darcy number and porosity. It had been shown that the heat transfer is affected than the mass transfer by the properties of the porous media. Saha et al. [24] demonstrated the magnetohydrodynamics natural convection in square wavy enclosure filled by nanofluid with fin attached to the bottom flat wall using finite element scheme. The authors examined the impact of fin length under various Rayleigh and Hartmann numbers in addition to the nanofluid volume fraction and their shapes. The enclosure was corrugated from its upper wall and kept at isotherm cold temperature, while the fin was heated and the rest of the enclosure’s walls were isolated. It had been performed that nanoparticles of the blade shape augmented the heat transfer by \(7.65\%.\) Rashid et al. [25] examined heat and mass transfer of Casson fluid flow within crown enclosure with inner circular heater under magnetic field. The authors examined the influence of Lewis, Rayleigh and Hartmann numbers as well as Casson parameter. For this purpose, finite element scheme had been used. The results showed that both of heat and mass transfer reduced with an increment of Hartmann number. The presence of discrete heat sources and inner bodies inside the enclosures introduces complexities to the flow and thermal transport. Common examples include electronic components inside cabinets, heated blocks and cylinders in cavities, and partially active solar collectors.

The physical phenomenon explained of natural convection within enclosures considering multi-inner bodies. In this way, this section addresses the studies related to these thermal cases in full-details. Park et al. [26] used immersed boundary method based on finite volume formulation to study the influence of vertical location of the natural convection between two heated inner cylinders located in a cold square enclosure. Park et al. [27] used immersed boundary method based on finite element formulation to make a comparison between single and two inner heated cylinders located in a square enclosure. The findings revealed that Nusselt number of the case of two inner bodies was better than that of the single cylinder. Yoon et al. [28] studied the natural convection within square enclosure with one hot cylinder and one cold cylinder using finite volume formulation. The authors examined the influence of the size of inner cylinders and Rayleigh numbers. The results indicated that as the inner body increases, the conduction dominates higher than the convection mode. Seo et al. [29] examined the influence of position of four cylinders immersed in a square enclosure using finite volume method.

There are serious limitations of the studies of natural convection considering multi-inner bodies within complex enclosures, for example, the studies in I-shaped enclosure. Mansour et al. [30] examined the natural convection in I-shaped enclosure filled by Cu-water nanofluid using finite difference method. The enclosure was partially heated and cooled from its bottom and top walls, respectively. The researchers studied the influence of the aspect ratio, nanoparticles loadings, Rayleigh number in addition to the heater length. The results showed that narrow I-shaped enclosure enhanced the heat transfer rate. I-shaped enclosure filled by nanofluid under the magnetic field had been examined as well by Malekpour et al. [31]. Multi-inner circular bodies with different thermal arrangements immersed in a nanofluid I-shaped enclosure under the influence of inclined magnetic field had been addressed by Ma et al. [32]. Additionally, Tayebi et al. [33] used finite element formulation to study the natural convection and entropy generation in an inclined I-shaped enclosure filled by nanofluid. Two inner cylinders had been immersed within the enclosure. The enclosure was kept at uniform cold temperature from its top and bottom walls, while the rest of the walls are insulated. The uniform hot temperature had been applied to both of the inner cylinders. The authors examined the influence of Rayleigh number, inclination angle of the enclosure, aspect ratio along with the parameter of vortex viscosity on fluid flow and heat transfer. The results showed that Bejan number reduced with increment of Rayleigh number.

Both experimental and numerical have investigated natural convection phenomena in L-shaped enclosures under laminar flow regimes [34]. The presence of the 90 degree corner leads to the formation of eddies and vortices that enhance convective mixing and heat transfer compared to straight ducts. Parameters such as Rayleigh number, Prandtl number, aspect ratio, boundary conditions, and orientation influence the detailed flow structure and transport processes.

Specific studies include Seyyedi et al. [35] who explained entropy generation in L-shaped enclosures filled with Al2O3-water nanofluid using a control volume-based finite element method to solve the non-dimensional governing equations. Their results showed that increasing the Hartman number from 25 to 75 decreased the entropy optimized number from 15.14 to 8.15%. Other related studies include [36,37,38] who also examined natural convection phenomena through L-shaped enclosures using numerical approaches.

Now, it is the right time after the above comprehensive review on the previous studies we can say that there are serious limitations in the H-shaped enclosures. Rahimi et al. [39] studied the entropy generation and entropy generation in H-shaped enclosure with multi-inner square bodies under different thermal arrangements using lattice Boltzmann method considering heatlines visualization. They developed correlations for thermal conductivity and viscosity. Keramat et al. [40] examined the impact of v-shaped baffles attached within H-shaped enclosure filled by nanofluid using finite volume method. It had been proved that the location of the baffle at the bottom of the enclosure enhanced the heat transfer rate, while it reduced heat transfer rate when located at the top. Eshaghi et al. [41] examined the double-diffusive natural convection within H-shaped enclosure with baffle and corrugation of the enclosure’s wall using finite element scheme. It had been shown that the baffle angle with -60 without corrugation leads to better the heat transfer rate.

In this way, the research questions can be answered. The examination of natural convection within simple shapes had been studied a lot, but there are limitations in the examination of natural convection within complex shapes, especially the H-shaped enclosure. Thus, we will study the natural convection in addition to the entropy generation under the magnetic field and thermal radiation using finite element formulation. It can be seen that there is no single study on examination of the natural convection and entropy generation H-shaped enclosure with two-sided wavy walls considering two inner circular bodies under the magnetic field and thermal radiation. The selected parameters are Rayleigh number \(({10}^{3}\le \text{Ra}\le {10}^{5})\), Hartmann number \(\left(0\le \text{Ha}\le 60\right)\), vertical location of inners bodies \(\left(0.2\le \delta \le 0.8\right)\), distance between inner bodies \(\left(0.3\le E\le 0.9\right)\), height of the enclosure walls \(\left(0.2\le B\le 0.8\right)\) and width of the enclosure wall \(\left(0.1\le A\le 0.9\right)\) in addition to the radiation parameter \(\left(0\le \text{Rd}\le 3\right)\) on fluid flow, heat transfer and entropy generation.

Mathematical model

Problem description

In Fig. 1, a schematic representation of H-shaped enclosure with two-sided wavy walls is illustrated. The mathematical expression of the wavy wall is indicated in Eq. (1)

$$Y=\mp A\left[1-\text{cos}2N\pi y\right]$$
(1)

where A represents the amplitude which is fixed at (A = 0.8), N stands to the number of undulations that also kept unchanged through the entire study at (N = 3).

Fig. 1
figure 1

Schematic diagram of physical computation model

It can be seen that there are two inner cylindrical bodies immersed in the hybrid nanofluid enclosure. The length of the enclosure \(\left(W=1.5\right)\), while the height \(\left(H=1\right)\). The vertical location of the inner is represented by \(\left(0.5\le \delta \le 0.8\right)\), while the distance between them is represented by \(\left(0.3\le E\le 0.9\right)\). There are other geometrical parameters related to the enclosure. These parameters are on the U-section of the H-shaped enclosure which are: \("A"\) stands for horizontal distance, while \("B"\) stands for the vertical distance. The inner bodies are kept at isotherm hot temperature, while the two wavy walls are kept at cold temperature. The rest of the enclosure walls are thermally insulated. Additionally, uniform magnetic field had been imposed in the horizontal direction \("{B}_{\text{o}}"\). The gravity is acting on the downwards direction. Thermal equilibrium had been considered for the tiny metallic nanoparticles (MgO and Ag) and the host fluid (water). Thermophysical properties of each nanoparticles and the water are inserted in Table 1. The reason of using MgO and Ag is that MgO had been utilized in the petrochemical products, catalyst, ceramics and various fields [42]. Additionally, Ag had been introduced in the heat exchangers industry and as drug carrier [43].

Table 1 Thermophysical property of the base fluid and the nanoparticles [44]

The velocity slips had been ignored, and there is joule heating or viscous dissipation. Boussinesq approximations had been considered for modeling the density variation. The non-dimensional form of the governing equations [45,46,47]:

$$\frac{\partial {U}_{\text{hnf}}}{\partial X}+\frac{\partial {V}_{\text{hnf}}}{\partial Y}=0$$
$$\frac{{\rho }_{\text{hnf}}}{{\rho }_{\text{bf}}} \left({U}_{\text{hnf}}\frac{\partial {U}_{\text{hnf}}}{\partial X}+{V}_{\text{hnf}}\frac{\partial {U}_{\text{hnf}}}{\partial Y}\right)=-\frac{\partial P}{\partial X}+\frac{{\mu }_{\text{hnf}}}{{\mu }_{\text{bf}}}\text{Pr}\left(\frac{{\partial }^{2}{U}_{\text{hnf}}}{\partial {X}^{2}}+\frac{{\partial }^{2}{U}_{\text{hnf}}}{\partial {Y}^{2}}\right)$$
$$ \begin{aligned} \frac{{\rho_{{{\text{hnf}}}} }}{{\rho_{{{\text{bf}}}} }} \left( {U_{{{\text{hnf}}}} \frac{{\partial V_{{{\text{hnf}}}} }}{\partial X} + V_{{{\text{hnf}}}} \frac{{\partial V_{{{\text{hnf}}}} }}{\partial Y}} \right) = & - \frac{\partial P}{{\partial Y}} + \frac{{\mu_{{{\text{hnf}}}} }}{{\mu_{{{\text{bf}}}} }}\Pr \left( {\frac{{\partial^{2} V_{{{\text{hnf}}}} }}{{\partial X^{2} }} + \frac{{\partial^{2} V_{{{\text{hnf}}}} }}{{\partial Y^{2} }}} \right) \\ & + \frac{{\sigma_{{{\text{hnf}}}} }}{{\sigma_{{{\text{bf}}}} }}{\text{Ha}}^{2} {\text{Pr}}V + \frac{{\rho_{{{\text{hnf}}}} }}{{\rho_{{{\text{bf}}}} }}\frac{{\beta_{{{\text{hnf}}}} }}{{\beta_{{{\text{bf}}}} }}{\text{RaPr}}\theta \\ \end{aligned} $$
$$\left({U}_{\text{hnf}}\frac{\partial {\theta }_{\text{hnf}}}{\partial X}+{V}_{\text{hnf}}\frac{\partial {\theta }_{\text{hnf}}}{\partial Y}\right)=\left(\frac{4}{3}\text{Rd}+\frac{{\alpha }_{\text{eff},\text{hnf}}}{{\alpha }_{\text{eff},\text{bf}}}\right)\left(\frac{{\partial }^{2}{\theta }_{\text{hnf}}}{\partial {X}^{2}}+\frac{{\partial }^{2}{\theta }_{\text{hnf}}}{\partial {Y}^{2}}\right)$$

The non-dimensional parameters are:

$$ \begin{aligned} X & = \frac{x}{L};Y = \frac{y}{L};U = \frac{uL}{{\alpha_{{{\text{bf}}}} }};V = \frac{vL}{{\alpha_{{{\text{bf}}}} }};P = \frac{{pL^{2} }}{{\rho_{{{\text{hnf}}}} \alpha_{{{\text{bf}}}}^{2} }};\theta = \frac{{T - T_{{\text{c}}} }}{{T_{{\text{h}}} - T_{{\text{c}}} }}; P = \frac{{pL^{2} }}{{\rho_{{{\text{hnf}}}} \alpha_{{{\text{bf}}}}^{2} }}; {\text{Pr}} = \frac{{\nu_{{{\text{bf}}}} }}{{\alpha_{{{\text{bf}}}} }}; \\ {\text{Ra}} & = \frac{{g\beta_{{{\text{bf}}}} \left( {T_{{\text{h}}} - T_{{\text{c}}} } \right)W^{3} }}{{\alpha_{{{\text{bf}}}} \nu_{{{\text{bf}}}} }};{\text{Ha}} = B_{o} L\sqrt {\frac{{\sigma_{{{\text{na}}}} }}{{\rho_{{{\text{na}}}} \nu_{{{\text{na}}}} }}} \\ \end{aligned} $$

Thermophysical properties of hybrid nanofluid are inserted below [47]:

$$ \rho_{{{\text{hnf}}}} = \left( {1 - \phi_{{{\text{hnf}}}} } \right)\rho_{{{\text{bf}}}} + \phi_{{{\text{Ag}}}} \rho_{{{\text{Ag}}}} + \phi_{{{\text{MgO}}}} \rho_{{{\text{MgO}}}} $$
$${\left(\rho {C}_{\text{p}}\right)}_{\text{hnf}}=\left(1-\phi \right){\left(\rho {C}_{\text{p}}\right)}_{\text{bf}}+{\phi }_{\text{Ag}}{\left(\rho {C}_{\text{p}}\right)}_{\text{Ag}}+{\phi }_{\text{MgO}}{\left(\rho {C}_{\text{p}}\right)}_{\text{MgO}}$$
$${\left(\rho \beta \right)}_{\text{hnf}}=\left(1-{\phi }_{\text{hnf}}\right){\left(\rho \beta \right)}_{\text{bf}}+{\phi }_{\text{Ag}}{\left(\rho \beta \right)}_{\text{Ag}}+{\phi }_{\text{MgO}}{\left(\rho \beta \right)}_{\text{MgO}}$$
$${\mu }_{\text{nf}}={\mu }_{\text{bf}}\left(1+32.795{\phi }_{\text{hnf}}-7214{\phi }_{\text{hnf}}^{2}+714600{\phi }_{\text{hnf}}^{3}-0.1941\times {10}^{8}{\phi }_{\text{hnf}}^{4}\right)$$
$${K}_{\text{nf}}={K}_{\text{bf}}\left(\frac{0.1747{\times 10}^{5}+{\phi }_{\text{hnf}}}{0.1747{\times 10}^{5}-0.1498{\times 10}^{6}\times {\phi }_{\text{hnf}}+0.1117\times {10}^{7}{\times \phi }_{\text{hnf}}^{2}+0.1997\times {10}^{8}{\times \phi }_{\text{hnf}}^{3}}\right)$$
$$\frac{{\sigma }_{hnf}}{{\sigma }_{\text{bf}}}=1+\frac{3\left({\phi }_{\text{Ag}}{\sigma }_{\text{Ag}}+{\phi }_{\text{MgO}}{\sigma }_{\text{MgO}}\right)-3{\phi }_{\text{hnf}}}{2+\left\{\frac{{\phi }_{\text{Ag}}{\sigma }_{\text{Ag}}+{\phi }_{\text{MgO}}{\sigma }_{\text{MgO}}}{{\phi }_{\text{hnf}}{\sigma }_{\text{bf}}}\right\}-\left\{\frac{{\phi }_{\text{Ag}}{\sigma }_{\text{Ag}}+{\phi }_{\text{MgO}}{\sigma }_{\text{MgO}}}{{\sigma }_{\text{bf}}}-{\phi }_{\text{hnf}}\right\}}$$

Heat transfer and entropy generation

The heat transfer increasing or reduction is judged by the estimation of Nusselt number that it had been calculated around both of inner heated bodies as indicated below considering the thermal radiation:

$${\text{Nu}}_{\text{avg},\text{i}}=\frac{{K}_{\text{hnf}}}{{K}_{\text{f}}}\left(1+\frac{4}{3}\text{Rd}\frac{{K}_{\text{bf}}}{{K}_{\text{hnf}}}\right)\frac{\partial \theta }{\partial x}$$
$${\text{Nu}}_{\text{avg}}=\sum {\text{Nu}}_{\text{avg},\text{i}}$$

The entropy generation due to fluid flow, heat transfer and magnetic field had been calculated as shown below:

$${\overline{S} }_{\text{gen}}={\overline{S} }_{\text{gen},\text{T}}+{\overline{S} }_{\text{gen},\upmu }+{\overline{S} }_{\text{gen},\text{MHD}}$$
$${\overline{S} }_{\text{gen}}=\frac{{K}_{\text{hnf}}}{{K}_{\text{bf}}}\left[{\left(\frac{\partial \theta }{\partial X}\right)}^{2}+{\left(\frac{\partial \theta }{\partial X}\right)}^{2}\right]+\chi \frac{{\mu }_{\text{hnf}}}{{\mu }_{\text{bf}}}\left[2{\left(\frac{\partial U}{\partial X}\right)}^{2}+2{\left(\frac{\partial V}{\partial Y}\right)}^{2}+{\left(\frac{\partial U}{\partial Y}+\frac{\partial V}{\partial X}\right)}^{2}\right]+\chi \frac{{\sigma }_{\text{hnf}}}{{\sigma }_{\text{bf}}}{\text{Ha}}^{2}{V}^{2}$$

where \(\chi =\frac{{\mu }_{\text{f}}{T}_{0}}{{K}_{\text{f}}}\left(\frac{{\alpha }_{\text{f}}}{L\left({T}_{\text{h}}-{T}_{\text{c}}\right)}\right)\)

The total entropy generation is indicated below

$$ S_{{{\text{gen}},\;{\text{avg}}}} = \int\limits_{v} {\overline{S}_{{{\text{gen}}}} {\text{dv}}} $$

Bejan number had been calculated as below:

$$\text{Be}=\frac{{\overline{S} }_{\text{gen}, T}}{{\overline{S} }_{\text{gen}}}$$
$$ {\text{Be}}_{{{\text{avg}}}} = \frac{{\int_{\text{A}} {\left( {X,Y} \right){\text{dA}}} }}{{\int_{\text{A}} {{\text{dA}}} }} $$

Lastly, the thermal boundary conditions are:

  • The inner circular bodies: \(\theta =1\)

  • The wavy walls: \(\theta =0\)

  • The rest of the enclosure walls: \(\frac{\partial \theta }{\partial X}=\frac{\partial \theta }{\partial Y}\)

Numerical method and validation

In order to solve the complex partial differential equations of mass, momentum and thermal energy, COMSOL 6.0 had been implemented. COMSOL is outstanding CFD software that built in finite element method in simulating numerous heat transfer problem that transforms the complex form of the equations into simple algebraic equations. The H-shaped enclosure discretized into a triangular mesh type had been considered within the H-shaped enclosure as shown in Fig. 2. The iteration process had been continued till the residual error lower than \({10}^{-6}\) as indicated below:

Fig. 2
figure 2

Mesh distribution of the H-shaped with wavy walls enclosure

$$\frac{\sum \left|{\xi }_{\text{i},\text{j}}^{n+1}-{\xi }_{\text{i},\text{j}}^{n}\right|}{\sum \left|{\xi }_{\text{i},\text{j}}^{n+1}\right|}\le {10}^{-6}$$

Additionally, grid dependency had been done to ensure the accuracy of the results as tabulated in Fig. 3.

Fig. 3
figure 3

Mesh dependency test in terms of Nusselt number

The validation had been presented with significant researchers. Figure 4 illustrates the validation with similar study done by Raizah and Aly [48] which studied the natural convection of the H-shaped enclosure filled by porous media and nanofluid using ISPH scheme. The comparison had been presented in terms of isotherms and streamlines. Another validation had been done with Esmaeilpour and Abdollahzadeh [49] which demonstrated the natural convection and entropy generation in wavy enclosure filled by Cu-water nanofluid using finite volume formulation in terms of entropy generation considering different Grashof numbers as indicated in Fig. 5a. Additionally, validation in terms of Nusselt number for Esmaeilpour and Abdollahzadeh [49] is revealed in Fig. 5b to ensure that there is an excellent agreement in terms of Nusselt number as well. Finally, other validations with Khanafer et al. [50] and Sheikholeslami et al. [51] in terms of Nusselt number are tabulated in Table 2. It can be seen that there is good agreement of the present work with the previous studies.

Fig. 4
figure 4

Validation of the present work with Raizah and Aly [48] in terms of isotherms and streamlines

Fig. 5
figure 5

a Validation of the present work with Esmaeilpour and Abdollahzadeh [49] in terms of entropy generation considering different Grashof numbers. b Validation of the present work with Esmaeilpour and Abdollahzadeh [49] in terms of average entropy

Table 2 Validation in terms of Nusselt number of the present work with that obtained by Khanafer et al. [50] and Sheikholeslami et al. [51]

Results and discussion

Figure 6 shows the effect of hot bodies position on the distribution of streamlines, isotherms, and total entropy generation at Ra = 103. At low Rayleigh numbers, the natural convection flows would be weaker since the buoyancy forces driving convection are smaller. The flow patterns and streamlines would be more strongly influenced by conduction heat transfer rather than convection. Changing the vertical position of the inner hot bodies would alter the temperature gradients and thus the density gradients driving natural convection. Placing the bodies symmetrically would likely result in symmetric streamline patterns. Asymmetric placement could create asymmetric flows. Positioning the bodies farther apart vertically could reduce interactions between the convection flows, resulting in less complex streamline shapes. When the two bodies are at an intermediate level of H-enclosure, on each side, hot fluid rises from the heat source along the concave parts of the wall and returns downward along the convex parts, creating a clockwise and counter-clockwise vortex. The proximity of the heat sources may reinforce this effect, creating four distinct vortices—two on each side of the H-enclosure. With the hot bodies placed lower, the upper regions of the enclosure are likely cooler. This reduces the strength of upward convection flows. Less hot fluid rises upwards, so there is less downward flow along the upper convex parts of the wavy walls. This eliminates the upper pair of counter-rotating vortices. The lower position concentrates the heating effect and upward buoyant plume from each heat source. This allows stronger development of the lower pair of vortices. The lower position may alter the temperature gradients such that the lower curvatures of the wavy walls produce the strongest secondary flows and vortices. Positioning the heat sources higher up would concentrate more heating and upward buoyant flow in the upper half of the enclosure. This stronger upward flow would in turn drive increased downward flows along the upper convex parts of the wavy walls. As a result, the upper pair of counter-rotating vortices induced by the wavy geometry would become more distinct and stronger. Isotherms will be densely packed around each heat source, indicating steep temperature gradients. Placing heat sources higher up will skew isotherms upward, with dense clustering in the upper region. Lower placement will shift isotherms down, concentrating them around the lower heat sources. Upper sources yield convex isothermal shapes extending upward from the sources and downward along the walls. Asymmetric placement of the heat sources will yield asymmetrical isotherm patterns. The position of the hot bodies will impact the total entropy generation in the system due to its effects on temperature gradients, flow patterns, and heat transfer mechanisms. Higher entropy generation will occur near the heat sources due to larger temperature gradients and higher heat transfer. Locating sources at upper positions will shift high entropy regions upward. Lower positions shift them downward. Lateral spacing affects interaction between thermal plumes. Closer spacing causes more distortion and overlapping of high entropy zones.

Fig. 6
figure 6

Contours of streamlines, isotherms and total entropy generation considering different positions of inner bodies at low Rayleigh number \(\left(\text{Ra}={10}^{3}\right)\) at \(\text{Ha}=20, A=0.5,B=0.4,E=0.9\)

Increasing the Rayleigh number from 103 to 105 (as shown in Fig. 7) represents a significant enhancement in the natural convection flows. Higher Ra induces stronger buoyancy-driven convection currents, transitioning the flow from a conduction-dominated regime to a convection-dominated one. This transition manifests as increasingly complex flow patterns. At lower Ra, organized vortices predominate due to the balance between viscous and buoyancy forces. As Ra increases, these organized structures give way to more chaotic, swirling flows. This transition occurs because the increased buoyancy overcomes viscous damping, allowing for the development of turbulent-like structures even in laminar flow regimes. Isotherms will become more compressed around heat sources due to steep temperature gradients caused by enhanced convection. Thermal plume interaction will increase, disrupting regular isotherm patterns. Total entropy will increase significantly with more vigorous convective heat transfer. High entropy generation will extend over larger portions near walls/roof due to convection. Conductive heat transfer will be limited to smaller regions, reducing low entropy areas.

Fig. 7
figure 7

Contours of streamlines, isotherms and total entropy generation considering different positions of inner bodies at high Rayleigh number \(\left(\text{Ra}={10}^{5}\right)\) at \(\text{Ha}=20, A=0.5,B=0.4,E=0.9\)

The effect of distance between the inner bodies is depicted in Fig. 8. Closer spacing will increase hydrodynamic interaction between the buoyant plumes and convection currents from each heat source. This will make the streamlines more complex and chaotic. Wider spacing will separate the convection cells, resulting in more defined streamline vortices with less distortion. Smaller separation distance will allow more thermal interaction, disrupting isotherms and causing dense packing between the heat sources. Larger spacing will yield more distinct isotherm groupings around each heat source with less density and distortion. Closer spacing leads to greater disturbance between the thermal plumes, creating more mixing and higher entropy generation between the bodies. Wider spacing reduces interaction, confining high entropy regions around each body separately with lower values in between.

Fig. 8
figure 8

Contours of streamlines, isotherms and total entropy generation considering different distances between the inner bodies at low Rayleigh number \(\left(\text{Ra}={10}^{3}\right)\) at \(\text{Ha}=20, A=0.5,B=0.4\)

At higher Rayleigh numbers around 105 (Fig. 9), the effects of spacing between the hot bodies on the flow physics will be somewhat different compared to lower Rayleigh numbers. the vigorous convection currents will dominate over boundary effects. Spacing will have less influence on flow patterns. Streamlines will show chaotic, swirling flows irrespective of spacing, due to strong buoyancy-driven turbulence. High Ra convection will lead to dense, compressed isotherms around each body even with wider spacing. Isotherm distortion will be present but not as pronounced as lower Ra cases. Wider spacing may still allow slightly more distinct isotherm zones. Intense convective heat transfer will overshadow conductive effects, creating high entropy generation around both bodies and walls despite spacing.

Fig. 9
figure 9

Contours of streamlines, isotherms and total entropy generation considering different distances between the inner bodies at high Rayleigh number \(\left(\text{Ra}={10}^{5}\right)\) at \(\text{Ha}=20, A=0.5,B=0.4\)

The height of the enclosure walls will influence the flow physics and heat transfer characteristics. Here are the expected effects at low (Ra = 103) and high (Ra = 105) Rayleigh numbers. In Figure 10 at low Ra = 103, increasing enclosure height will elongate the vertical convection cells and vortex flow patterns. Taller cavities could allow additional vortices to form if enough vertical space is available. Greater wall height will stretch out the isotherms vertically for both upper and lower heat source positions. Isotherm gradients near the heat sources will remain similar. Taller enclosures will increase the low entropy conductive heat transfer regions away from the main convection flows. Peak entropy near heat sources will not change significantly. In Figure 11 at high Ra = 105, height has little effect as turbulent eddies and chaotic convection dominate the flow, overriding boundary effects. Isotherms will remain densely compressed around heat sources irrespective of height at such high Ra convection. Vigorous convection maintains high entropy generation throughout the enclosure volume regardless of height.

Fig. 10
figure 10

Contours of streamlines, isotherms and total entropy generation considering different heights of the enclosure wall at low Rayleigh number \(\left(\text{Ra}={10}^{3}\right)\) at \(\text{Ha}=20, A=0.5,E=0.9\)

Fig. 11
figure 11

Contours of streamlines, isotherms and total entropy generation considering different heights of the enclosure wall at high Rayleigh number \(\left(\text{Ra}={10}^{5}\right)\) at \(\text{Ha}=20, A=0.5,E=0.9\)

Figures 12 and 13 show the effect of enclosure width for lower and higher value of Rayleigh number, respectively. At low Ra = 103, wider enclosures will allow longer horizontal recirculation flows along the wavy walls, more lateral space enables additional vortices to form in the horizontal direction. Increased width will stretch out isotherms in the horizontal direction. Lateral conduction will increase in wider enclosures. Wider cavities will increase low entropy conduction zones away from heat sources. At high Ra = 105, turbulent eddies and convection will dominate, minimizing effects of width changes. Isotherms will remain compressed around heat sources owing to vigorous convection. Convective heat transfer will lead to high entropy generation irrespective of width.

Fig. 12
figure 12

Contours of streamlines, isotherms and total entropy generation considering different widths of the enclosure wall at low Rayleigh number \(\left(\text{Ra}={10}^{3}\right)\) at \(\text{Ha}=20, B=0.4,E=0.9\)

Fig. 13
figure 13

Contours of streamlines, isotherms and total entropy generation considering different widths of the enclosure wall at high Rayleigh number \(\left(\text{Ra}={10}^{5}\right)\) at \(\text{Ha}=20, B=0.4,E=0.9\)

Figure 14 shows the impact of Hartman number on average Nusselt number for different dimensions of enclosure. The Hartmann number represents the strength of the applied magnetic field. Higher Ha implies stronger magnetic field. The magnetic field suppresses the natural convection flows due to the electromagnetic braking effect on the conductive fluid. This reduction in convection decreases the overall heat transfer rate and thermal transport. Consequently, the average Nusselt number decreases monotonically with increasing Hartmann number. When the hot bodies are placed at the middle position (δ = 0.5), the local Nusselt number reaches the highest values. This is likely because at the center position, the rising plumes from the heat sources and the descending flows along the inclined walls work in tandem to enhance convection and heat transfer. At δ = 0.2, when the heat sources are near the bottom wall, the local Nusselt number is lower than at the middle position. Here, the ascending plumes have less space to develop before reaching the upper wall, reducing their strength and heat transfer. At δ = 0.8, near the upper wall, the local Nusselt number is even lower than the bottom position. In this case, the descending flow along the inclined walls is weakened due to the limited space, reducing the convection.

Fig. 14
figure 14

Nusselt number variation with Hartmann number considering different positions of inner circular bodies at \(\text{Ra}={10}^{5}, \text{Ha}=20, A=0.5,B=0.4,E=0.9\)

The highest Nusselt number is obtained when the spacing between the bodies is E = 0.9. This large spacing minimizes the thermal and hydrodynamic interaction between the natural convection currents generated by each heat source. The ascending plumes can develop and rise with minimal distortion or obstruction from the other side. Similar for the descending flows, this allows the convection to be strongest, enhancing heat transfer and increasing the Nusselt number. At closer spacing of E = 0.3, the Nusselt number decreases compared to E = 0.9. The proximity of the heat sources leads to significant interaction between the convection currents. The plumes and flows from one side can obstruct or limit the flows from the other side due to closeness. This poorer convection causes deterioration in heat transfer rates and lower Nusselt number.

Increasing the height from B = 0.2 to B = 0.8 results in an increase in the Nusselt number. At small spacing of B = 0.2, the proximity of the heat sources limits the vertical development of the thermal plumes. The ascending flows have less space to rise before reaching the upper cavity, causing greater obstruction. Similar limitation occurs for descending flows. This poorer convection at low height reduces heat transfer rates. As the height is increased to B = 0.8, there is greater space for the buoyant plumes to rise and descending flows to circulate. This allows the convection currents to strengthen, enhancing the overall heat transfer coefficient. The improved convection at larger vertical spacing is reflected in the higher Nusselt number obtained. The transition from the ineffective range (B = 0.2 to B = 0.4) to the effective range (B = 0.8) suggests a threshold effect, where a critical vertical spacing is needed to substantially alter the convection patterns and improve heat transfer performance.

At a higher width of A = 0.9, the Nusselt number obtained is lower. The wide enclosure provides more space for the thermal and hydrodynamic boundary layers to develop along the horizontal walls. This increases the conductive thermal resistance in these boundary layers. The increased conduction effects suppress the overall heat transfer coefficient and reduce the Nusselt number. When the width is reduced to A = 0.1, the Nusselt number increases. The narrower enclosure limits the growth of boundary layers along the horizontal walls. This reduces conductive resistance and allows convection to play a greater role. Enhanced convection increases the heat transfer coefficient, increasing the Nusselt number. It can be seen that the behavior of the current results matches the results of Alnaqi et al. [52], who explained the inverse effect of increasing the Hartmann number over the Nusselt number.

Figures 1518 show the relation between Hartman number and Bejan number for different values of enclosure dimensions. Increasing Ha implies a stronger magnetic field which suppresses natural convection flows due to electromagnetic braking action. Weaker convection reduces convective heat transfer rates and makes conduction more dominant. This increases the proportion of irreversible heat conduction across finite temperature gradients. As a result, the Bejan number increases with increasing Hartmann number. At very high Ha, heat transfer may become entirely conduction-based as convection is severely suppressed. This maximizes Be.

Fig. 15
figure 15

Bejan number variation with Hartmann number considering different positions of inner circular bodies for different values of Re at \(\text{Ha}=20, A=0.5,B=0.4,E=0.9\)

Fig. 16
figure 16

Bejan number variation with Hartmann number considering different distances between the two inner circular bodies \(\text{Ra}={10}^{4},\text{Ha}=20, A=0.5,B=0.4\)

Fig. 17
figure 17

Bejan number variation with Hartmann number considering different heights of the enclosure wall of the enclosure at \(\text{Ha}=20, A=0.5,E=0.9\)

Fig. 18
figure 18

Nusselt number variation with Hartmann number considering different widths of the enclosure wall of the enclosure at \(\text{Ra}={10}^{4},\text{Ha}=20,\delta =0.5, B=0.4,E=0.9\)

The effect is less pronounced at higher Rayleigh numbers (105), where strong buoyancy-driven convection is harder to suppress. Lower Ra (103) cases see a steeper rise in Be vs Ha as conduction takes over earlier. From Fig. 15 can be noted the effect of hot bodies vertical distance on Be. Near the upper wall (δ = 0.8), the ascending plumes from the heat sources have a smaller distance to travel before reaching the wall. This weaker and shorter buoyant flow results in poorer convection in the upper region. The limited space also restricts the descending flows along the inclined walls, further reducing convection. The overall weaker convection makes conduction more dominant in the stagnant zones away from the limited plume flows. More conduction irreversibility associated with finite temperature gradients increases the Bejan number. A notable phenomenon occurs when Ha exceeds 40: the Be corresponding to δ = 0.2 becomes greater than that corresponding to δ = 0.5. This behavior can be explained by considering the interplay between magnetic forces, vertical spacing, and the unique geometry of the H-shaped cavity. This crossover behavior at Ha > 40 demonstrates that the effectiveness of magnetic suppression depends not only on the flow structure but also critically on the cavity geometry. The confined, separate flows in the δ = 0.2 case become a source of higher entropy generation under strong magnetic fields, while the more open flow in the δ = 0.5 case is more effectively damped. These factors combine to result in higher entropy generation from both fluid friction and heat transfer irreversibility. The relationship of the Hartmann number with the Bejan number from the current results shows agreement in terms of behavior with the numerical results of Ali et al. [53].

Figure 16 explains the effect of distances between the two inner circular bodies; when the hot bodies are placed closer, their thermal plumes and hydrodynamic flows interact more strongly. This increases mixing between the two sides, enhancing heat transfer by convection. As the lateral spacing increases, the interaction between the flows decreases. Each hot body has a more isolated convection cell with less mutual interference. This reduces the overall convection heat transfer rates within the enclosure. Weaker convection makes conduction through the fluid more significant. Higher conduction irreversibility increases the Bejan number at larger spacing. At close spacing, strong interaction and mixing boosts convection heat transfer, reducing conduction effects and decreasing Be.

Figure 17 shows the effect of the height of the enclosure wall on the Bejan number. At B = 0.2, the small vertical spacing restricts plume development, reducing convection strengths. More heat transfer occurs through conduction in the quiescent regions, increasing irreversible conduction heat transfer. This leads to a higher Bejan number. When height increases to B = 0.8, there is greater space for plume development and circulation. This enhances convection heat transfer and reduces the significance of conduction. Lower irreversible conduction decreases the Bejan number.

Figure 18 shows the variation of Be number for different value of enclosure width. At narrower width (A = 0.2), the growth of thermal and hydrodynamic boundary layers along the side walls is restricted. This allows greater dominance of convective heat transfer over conductive heat transfer. With increasing width to A = 0.9, there is more space for boundary layers to develop along the wider side walls. Thicker boundary layers increase conduction thermal resistance through stagnant fluid. This makes a larger portion of the overall heat transfer occur by irreversible conduction across finite temperature gradients. Hence, the Bejan number increases with enclosure width, as conduction irreversibility becomes more significant. Wider spacing provides more room for boundary layer development which enhances conduction effects and Bejan number, whereas narrow spacing suppresses boundary layers, enhancing convection and reducing Be. Finally, the influence of radiation parameters on Nusselt and Bajan numbers is examined in Fig. 19. It is obvious that its impact of Bejan number is negligible, while its impact on Nusselt number is very strong as increasing its value leads to an obvious bettering in Nusselt number. The current numerical results show that the behavior is consistent with Alizadeh et al.'s [54] previous numerical results in terms of the effect of radiation on the Nusselt number and Bejan number.

Fig. 19
figure 19

Nusselt number and Bejan number versus radiation parameter at \(\text{Ra}={10}^{5},\text{Ha}=20, \delta =0.5,B=0.4,E=0.9\)

Conclusions

Based on our comprehensive investigation of magnetohydrodynamic convection and entropy generation in a hybrid nanofluid within an H-shaped enclosure with wavy walls and inner heat sources, we can draw the following in-depth conclusions:

  1. (1)

    Geometry and flow dynamics: The H-enclosure geometry with wavy walls induces secondary flows and vortices, enhancing heat transfer by up to 15% compared to flat walls. This enhancement is most pronounced at moderate Rayleigh numbers (\(\text{Ra}={10}^{4}\)), where the interplay between geometry-induced flows and buoyancy-driven convection is optimal.

  2. (2)

    Magnetic field effects: Stronger magnetic fields (higher Ha) suppress natural convection flows due to electromagnetic braking effects. At Ha = 60, convection is reduced by approximately 40% compared to Ha = 0, highlighting the significant impact of magnetohydrodynamic forces.

  3. (3)

    Entropy generation: Entropy generation increases with Rayleigh and Hartmann numbers, reflecting intensified heat transfer and thermal gradients. At \(\text{Ra}={10}^{5}\), total entropy generation is 2.5 times higher than at \(\text{Ra}={10}^{3}\), indicating the dominance of convective heat transfer at higher Ra.

  4. (4)

    Vertical location of inner bodies: At \(\text{Ra}={10}^{4}\), increasing the vertical location of inner bodies from δ = 0.2 to δ = 0.8 leads to a 66% increase in Bejan number at Ha = 0. This effect diminishes with increasing Ha, becoming negligible at Ha = 60, suggesting an optimal vertical positioning dependent on magnetic field strength.

  5. (5)

    Internal heat source positioning: The position of internal heat sources significantly influences flow patterns, temperature profiles, and entropy distributions. Optimal positioning (δ = 0.5) balances buoyancy forces and proximity effects, maximizing heat transfer efficiency.

  6. (6)

    Spacing between inner bodies: Increasing the spacing between inner bodies from E = 0.3 to E = 0.9 leads to a 45.31% increase in Bejan number at Ha = 60. An optimal spacing of E≈0.6 was found to maximize heat transfer while minimizing entropy generation.

  7. (7)

    Enclosure dimensions: Enclosure dimension changes have more influence at lower Rayleigh numbers (\(\text{Ra}<{10}^{4}\)) before vigorous convection dominates. A height-to-width ratio of approximately 1.5 was found to be optimal for overall heat transfer performance.

  8. (8)

    Convection enhancement: Parameters that improve convection, such as lower source position or optimal spacing, decrease the Bejan number by reducing conduction irreversibility. The use of hybrid nanofluids enhances heat transfer by up to 20% compared to base fluids, with an optimal nanoparticle concentration of 3% by volume.