Control of Three-Dimensional Natural Convection of Graphene–Water Nanofluids Using Symmetrical Tree-Shaped Obstacle and External Magnetic Field

: This numerical investigation explores the enhanced control of the 3D natural convection (NC) within a cubic cavity filled with graphene–water nanofluids, utilizing a bottom-center-located tree-shaped obstacle and a horizontal magnetic field (MF). The analysis includes the effects of the Rayleigh number (Ra), the solid volume fraction of graphene ( φ ), the Hartmann number (Ha), and the fins’ length (W). The results show complex flow patterns and thermal behavior within the cavity, indicating the interactive effects of nanofluid properties, the tree-shaped obstacle, and magnetic field effects. The MHD effects reduce the convection, while the addition of graphene improves the thermal conductivity of the fluid, which enhances the heat transfer observed with increasing Rayleigh numbers. The increase in the fins’ length on the heat transfer efficiency is found to be slightly negative, which is attributed to the complex interplay between the enhanced heat transfer surface area and fluid flow disruption. This study presents an original combination of non-destructive methods (magnetic field) and a destructive method (tree-shaped obstacle) for the control of the fluid flow and heat transfer characteristics in a 3D cavity filled with graphene–water nanofluids. In addition, it provides valuable information for optimizing heat transfer control strategies, with applications in electronic cooling, renewable energy systems, and advanced thermal management solutions. The application of a magnetic field was found to reduce the maximum velocity and total entropy generation by about 82% and 76%, respectively. The addition of graphene nanoparticles was found to reduce the maximum velocity by about 5.5% without the magnetic field and to increase it by 1.12% for Ha = 100. Varying the obstacles’ length from W = 0.2 to W = 0.8 led to a reduction in velocity by about 23.6%.


Introduction
The heat transfer and fluid flow destructive and non-destructive control techniques have drawn the attention of researchers and engineers with the principal goal to optimize the energy systems.These techniques involve mixing nanoparticles (NPs) with conventional base fluids, the use of fins and obstacles, and the application of magnetic fields.Liu et al. [1] explored the impacts of NP concentration, MF intensity and direction, and cylindrical grooves on nanofluid convective flow 2D cavities.The results show that stepped grooves and specific magnetic configurations considerably improve heat transfer.Tayebi et al. [2] performed a study on the convective nanofluid flow and irreversibility production in an annular enclosure under the application of a MF and using fins having different lengths.They examined the heat transfer and entropy production, with an economic analysis on the use of the nanofluid, to balance between performance improvement and cost.Saha et al. [3] conducted the study of the MHD convective flow of an Al 2 O 3 -H 2 O nanoliquid within an enclosure having a corrugated top wall and a hot fin located at the bottom wall.It was revealed that blade-shaped nanoparticles improve the thermal transport by 7.65%, compared to 2.86% for spherical nanoparticles.Iftikhar et al. [4] explored the influences of hot fins and radiation on the NC flow of Ag and Cu nanoparticles dispersed in ethylene glycol.The study demonstrates an improvement of the buoyancy-driven flow with an increase in fin dimensions and NP concentration; the enhancement reached a 42% increase in fluid velocity and 57% of the heat transfer rate.Nayak et al. [5] studied the unsteady nanofluid MHD-NC flow in a hexagonal cavity incorporating a cold diamondshaped obstacle.The findings show an important improvement in heat transfer efficiency: a 76.16% improvement in the Nu av as the Ra increases, and the optimal obstacle position significantly enhances the heat transfer.Islam et al. [6] investigated the hybrid nanoliquid MHD NC in a prismatic cavity.The study highlighted an improvement of the thermal performance with an increase in the Ra and nanoparticle concentrations, while magnetic influence shows opposite effects.In the investigation of Vinodhini and Prasad [7], the MHD NC of nanofluids in a differentially heated 2D cavity was investigated.The heat generation/absorption and an oblique magnetic field were considered, with a focus on the effects of Brownian motion and thermophoresis.Al-Farhany et al. [8] presented a study focusing on the effect of fin lengths and location on the nanofluid MHD free convective flow in a porous cavity.The findings showed an improved heat transfer with increasing fin length, fin spacing, and modified Rayleigh number, while an increase in the Ha decreases the heat transfer.Cheng et al. [9] analyzed water/copper nanofluid convective flow in a confined cavity.The study finds that the magnetic forces reduce the velocity and temperature gradients, decreasing entropy generation, while varying the magnetic field angle and baffle dimensions significantly impacts the generation of entropy.Abderrahmane et al. [10] numerically explored the MHD 3D free convection in an undulated cubic cavity.
The results indicate the sensitivity of entropy generation to Darcy and Rayleigh numbers, the Hartmann number, and the undulation number.Acharya et al. [11] performed a study on the MHD flow of a hybrid nanofluid flow in a discreetly heated, fin-equipped circular cavity.The study reveals that increasing Rayleigh numbers accelerate velocity, while magnetic fields and higher concentrations of nanoparticles tend to slow the flow.Waqas et al. [12] studied the impact of the fin number, NP fraction, and Ra on laminar and steady NC flow in a horizontal ring.It was found that the insertion of fins and the NPs improve the heat transfer efficiency, especially at higher Ra values.Armaghani et al. [13] considered a two-phase model to investigate the Al 2 O 3 -nanofluid convective flow in an E-shaped cavity.A novel correlation was used to get accurate values of the thermal conductivity and it was found that the entropy generation was reduced by adding nanoparticles.Khan et al. [14] conducted a computational analysis on the 2D nanoliquid NC in a closed cavity having partially active walls.They demonstrated that the addition of nanoparticles and the increase in the Ra enhance velocity and heat transfer performance.The ternary nanofluid convective in a tilted porous cavity under various conditions was investigated by Thirumalaisamy et al. [15].It was found that the specific combination of the different kinds of nanoparticles can lead to an optimized heat transfer.The conjugated MHD nanofluid free convection and irreversibility production considering heat-generating blocks was studied by Tasnim et al. [16].The authors mentioned that higher heat transfer occurs with pure water than with nanofluids and that the position of the heat-generating blocks and the enclosure's tilt angle play a significant role on the thermal performance.The MHD-NC flow of a micropolar nanoliquid in a semi-annular cavity has been considered by Seyyedi et al. [17].The heat transfer efficiency was found to decline with the increase in Ha, and it was improved at a higher Ra and by adding nanoparticles.The effect of using a porous fin nanofluid natural convective flow was examined by Siavashi et al. [18].The heat transfer was improved at high Darcy number values, while lower values reduced it.Additionally, low concentrations of nanoparticles enhanced the heat transfer more effectively compared to higher concentrations.Çiçek et al. [19] numerically analyzed a hybrid nanofluid natural convective flow, considering the migration and deposition nanoparticles phenomena.They found that adding nanoparticles and increasing Ra led to an improved heat transfer.Acharya [20] studied the hydrothermal effects of laminar NC of a hybrid nanofluid in a circular cavity equipped with I-shaped fins.The study reveals that fin length significantly influences thermal control and flow behavior, and variations in Ra, Ha, and nanoparticle concentration affect the temperature field and flow dynamics.Ali et al. [21] explored the MHD NC of a non-Newtonian nanofluid in a U-shaped enclosure, focusing on the impacts of Ra, Ha, NP volume fraction, ratio appearance of the deflectors, the angle of inclination, and the power index.They noted a notable impact of the power index on heat transfer at higher Ra.Qi et al. [22] studied the effects of rotation angles, metal foam, and adjustable magnetic fields on the nanoliquids convective heat transfer.Their study reveals that the optimal nanoparticle mass fraction for maximum heat transfer is 0.3% and that vertical magnetic fields improve thermal performance, particularly at a 90 • cavity rotation angle.Liao and Li [23] performed a study on the heat transfer performance of nanoliquids under an inclined MF.The authors mentioned that there are three distinct heat transfer structures based on the magnetic field magnitude and analyzed the critical Hartmann numbers, allowing the transitions between these structures.In addition, the authors proposed an empirical expression, allowing the prediction of the critical Ha based on the magnetic field orientation.Vahedi et al. [24] presented a study on the thermal performance of a hybrid nanofluid under MHD effects.Based on sensitivity analysis and optimization, the authors mentioned that although the increase in the number of fins led to an enhancement of the heat transfer by about 30%, longer fins led to similar results even with fewer fins, reducing the viscous entropy generation.The hybrid nanoliquid MHD hydrothermal behavior and entropy production in an octagonal enclosure has been explored by Acharya [25], with a special focus on the effect of fin lengths.The authors concluded that the fin length and the addition of nanoparticles have a significant influence on the irreversibilities and heat transfer.Cao et al. [26] discussed the 2D MHD NC of a nanoliquid.It was mentioned that the magnetic fields and NPs have an important effect on the heat transfer, the NPs transport area, and on the temperature field.Selimefendigil et al. [27] evaluated the influences of a non-uniform MF on the mixed convection in a 3D vented enclosure filled with encapsulated PCM through which a nanoliquid flows.They concluded that the phase change is accelerated with higher values of Re and concentration of nanoparticles.Alazzam et al. [28] explored the heat transfer dynamics of nano-encapsulated PCMs in a cubic corrugated enclosure under a MF.They found that the Ra and Ha significantly influence heat transfer, where a higher Ra is improving and a higher Ha is decreasing the average Nusselt number.Additional investigations into the influence of combining nanofluids with magnetic fields and fins in complex cavity designs on heat transfer characteristics can be found in the references [29,30].Based on the above-mentioned literature survey, it is evident that there is a lack of investigations on the three-dimensional aspect of nanofluids' flows in confined spaces.In fact, most of the studies dealing with the effects of nanofluids and magnetic fields focused on two-dimensional configurations.Researchers generally avoid the consideration of 3D MHD flows due to the complexity of the governing equation and the need to resolve the current density and electrical potential equation.In addition, two-dimensional studies often do not give accurate results, compared to the real convective phenomena; this is mainly due to the neglection of the transversal flow.Thus, more research is necessary to explore the more in-depth MHD convective flows, especially in the presence of internal obstacles.Our research aims to address this gap through a computational study focused on the enhanced control of the 3D NC in a cubic cavity filled with graphene-water nanofluid by means of a uniform MF and a tree-shaped obstacle, which can potentially contribute to the development of more effective and energy-efficient cooling solutions, ensuring the reliable and sustained operation of advanced electronic devices under high thermal loads.

Problem Statement and Mathematical Modeling
The schematic view depicted in Figure 1 involves a cubic cavity filled with graphenewater nanofluid, where natural convection is controlled using an external magnetic field and a tree-shaped obstacle positioned at the bottom center, with the associate coordinate system.The left and right walls are considered as hot(T h ) and cold(T c ), respectively, while all the remaining lateral walls are thermally insulated.
obstacles.Our research aims to address this gap through a computational study focused on the enhanced control of the 3D NC in a cubic cavity filled with graphene-water nanofluid by means of a uniform MF and a tree-shaped obstacle, which can potentially contribute to the development of more effective and energy-efficient cooling solutions, ensuring the reliable and sustained operation of advanced electronic devices under high thermal loads.

Problem Statement and Mathematical Modeling
The schematic view depicted in Figure 1 involves a cubic cavity filled with graphenewater nanofluid, where natural convection is controlled using an external magnetic field and a tree-shaped obstacle positioned at the bottom center, with the associate coordinate system.The left and right walls are considered as hot(Th) and cold(Tc), respectively, while all the remaining lateral walls are thermally insulated.Based on the aforementioned assumptions and the Boussinesq approximation for the buoyancy force, the governing equations are presented as follows [31]: Based on the aforementioned assumptions and the Boussinesq approximation for the buoyancy force, the governing equations are presented as follows [31]: Symmetry 2024, 16, 692 The selection of dimensionless variables is as follows: Therefore, the governing equations are as follows: ∂T ∂t with: Boundary conditions are defined as: = 0 at y = 0, z = 0 and z = 1 Taking into account the magnetohydrodynamic effects, the generation of entropy is described as follows [31]: Based on the previously mentioned dimensionless variable, the locally generated entropy can be expressed as follows: T 0 is the irreversibility coefficient.
I s is fixed at 10 −4 in this study.
Symmetry 2024, 16, 692 The total generated entropy is: The local and average Nusselt numbers are expressed as: and The density, specific heat, and electrical conductivity of the nanofluid are evaluated using the following expressions: It should be noted that achieving the uniformity of NP dispersion in the base fluid is essential to enhance the thermal conductivity and heat transfer.But practically, this uniform dispersion can hardly be achieved.Sedimentation, aggregation, clogging, etc., can become the common problems that would deteriorate the efficiency of nanofluid-based systems.Furthermore, it is often assumed that the properties of NPs and the base fluid are constant.But their properties depend on the conditions of the system, such as temperature, pressure, NP concentration, etc.Hence, the performance of the system can be impacted in practice.The properties of water and graphene are presented in Table 1.
Table 1.Properties of water and graphene at 30 • C.

Water CNT
In the present study, the thermal conductivity and dynamic viscosity of the nanofluid are measured using a KD2-Pro thermal properties analyzer and a Malvern Kinexus pro rheometer, respectively.More details on the measurement procedure can be found in Ref. [32].Based on these measurements, the following expressions are established.The power law regression model has been used for the thermal conductivity and the enhanced power law regression model, with the added interaction and polynomial terms, for the dynamic viscosity.
It is to be mentioned that the thermal conductivity and dynamic viscosity are taken at an average temperature of 30 • C for all the performed numerical simulations.
The finite element method, utilizing Galerkin's weighted residual technique, is applied for the resolution of the system of Equations ( 6)- (10).The Lagrange polynomials are represented as: H: value of the variable at the nodes of the elements.• The time-dependent components are handled using the backward differentiation formula.
The convergence criterion is: Model Verification and grid dependency test.
The present model's verification (Table 2) is based on a comparison with the results of Ozoe and Okada [33].The analysis demonstrates a notable correspondence between the results obtained, affirming the accuracy of the current model.A grid sensitivity check was performed with four different grid sizes (G1, G2, G3, G4) for Ra = 10 5 , φ = 0.02, W = 0.6, and Ha = 25, as Table 3.The Nu av is calculated for each grid size, and the results show that as the mesh gets finer, the Nu av also increases.The percentage increase in the Nu av is highest when moving from G1 to G2 and then starts to decrease with subsequent refinements, which is a sign that the solution is approaching grid independence.The incremental increase reduces for finer grids, with an incremental increase of about 0.6% when moving from G3 to G4.Compared to G4, the G3 mesh provides accurate results with less computational cost.It is important to select a grid size that balances precision with computational time.Thus, G3 is chosen over G4 for all numerical executions to save computation time while still providing accurate results.

Results and Discussion
In this section, the effect of the governing parameters on the control of three-dimensional natural convection of graphene-water nanofluids, through the use of a symmetrical treeshaped obstacle and an external magnetic field, are presented.The goal is to understand how these control methods influence the thermal and velocity fields and to optimize the heat transfer and entropy generation.
Figure 2 shows the effects of a MF and the addition of NPs on the velocity magnitude along particle trajectories for Ra = 10 5 and fin's length W = 0.2.The particle trajectories in pure water without a MF show a complex flow with high velocity magnitudes, indicating intense convection, especially near the hot surfaces.The addition of NPs to the fluid enhances the thermal conductivity and alters the flow characteristics.The particle trajectories still show a 3D complex flow pattern similar to the pure water case, but the velocity magnitudes are slightly more intense due to enhanced heat transfer and, therefore, increased buoyancy forces, leading to more vigorous convection.Introducing a MF (Ha = 50) to pure water significantly changes the flow structure.The particle trajectories are more organized and less chaotic, indicating that the Lorentz force is damping the fluid motion.Accordingly, the velocity magnitudes are reduced, which can be attributed to the fact that the MF has a stabilizing effect on the convective flow.When a MF is applied, the particle trajectories show that the fluid's velocity magnitudes are higher than in the pure water case with a MF, but still less chaotic than without a MF.When the MF is applied at Ha = 50, a 50% reduction in the maximum velocity magnitude, indicated by the shift in color scales, is noticed.Due to the viscous effect, the use of nanoparticles slightly decreases the maximum velocity by around 16.7%.

Results and Discussions
In this section, the effect of the governing parameters on the control of three-dimensional natural convection of graphene-water nanofluids, through the use of a symmetrical tree-shaped obstacle and an external magnetic field, are presented.The goal is to understand how these control methods influence the thermal and velocity fields and to optimize the heat transfer and entropy generation.Figure 2 shows the effects of a MF and the addition of NPs on the velocity magnitude along particle trajectories for Ra = 10 5 and fin's length W = 0.2.The particle trajectories in pure water without a MF show a complex flow with high velocity magnitudes, indicating intense convection, especially near the hot surfaces.The addition of NPs to the fluid enhances the thermal conductivity and alters the flow characteristics.The particle trajectories still show a 3D complex flow pattern similar to the pure water case, but the velocity magnitudes are slightly more intense due to enhanced heat transfer and, therefore, increased buoyancy forces, leading to more vigorous convection.Introducing a MF (Ha = 50) to pure water significantly changes the flow structure.The particle trajectories are more organized and less chaotic, indicating that the Lorentz force is damping the fluid motion.Accordingly, the velocity magnitudes are reduced, which can be attributed to the fact that the MF has a stabilizing effect on the convective flow.When a MF is applied, the particle trajectories show that the fluid's velocity magnitudes are higher than in the pure water case with a MF, but still less chaotic than without a MF.When the MF is applied at Ha = 50, a 50% reduction in the maximum velocity magnitude, indicated by the shift in color scales, is noticed.Due to the viscous effect, the use of nanoparticles slightly decreases the maximum velocity by around 16.7%.The iso-surfaces of temperature are plotted in Figure 3, comparing the effects of a MF on the thermal field with and without graphene nanoparticles.In the absence of a MF, the iso-surfaces for both cases are curved, showing the dynamic nature of the convective flow.The complexity of the surfaces is due to the presence of the conduction and convection regimes, with the dominance of the convection for high Ra values.The presence of NPs in the nanofluid enhances the thermal conductivity and affects the flow behavior compared to pure water by enhancing the convective heat transfer.The tree obstacle induces flow disruptions, visible by the deformation of the iso-surfaces around it.Applying a MF, the gray iso-surfaces for pure water become more stretched with a horizontal stratification and become similar to a conductive regime due to the Lorentz force.The Lorentz forces The iso-surfaces of temperature are plotted in Figure 3, comparing the effects of a MF on the thermal field with and without graphene nanoparticles.In the absence of a MF, the iso-surfaces for both cases are curved, showing the dynamic nature of the convective flow.The complexity of the surfaces is due to the presence of the conduction and convection regimes, with the dominance of the convection for high Ra values.The presence of NPs in Symmetry 2024, 16, 692 9 of 22 the nanofluid enhances the thermal conductivity and affects the flow behavior compared to pure water by enhancing the convective heat transfer.The tree obstacle induces flow disruptions, visible by the deformation of the iso-surfaces around it.Applying a MF, the gray iso-surfaces for pure water become more stretched with a horizontal stratification and become similar to a conductive regime due to the Lorentz force.The Lorentz forces arising from the interaction between the MF and the moving conductive fluid act to dampen the flow intensity, which reduces the convection.The nanofluid iso-surfaces under the influence of a MF show that the field's damping effect is also present but to a lesser degree than in pure water.The enhanced thermal conductivity of the nanofluid counteracts some of the magnetic damping, maintaining a higher degree of thermal mixing and convective activity than in the pure water case.It is also to be mentioned that the application of the MF leads to a vertical symmetry of the flow structure.
and nanofluid with and without magnetic field.
The iso-surfaces of temperature are plotted in Figure 3, comparing the effects of a MF on the thermal field with and without graphene nanoparticles.In the absence of a MF, the iso-surfaces for both cases are curved, showing the dynamic nature of the convective flow.The complexity of the surfaces is due to the presence of the conduction and convection regimes, with the dominance of the convection for high Ra values.The presence of NPs in the nanofluid enhances the thermal conductivity and affects the flow behavior compared to pure water by enhancing the convective heat transfer.The tree obstacle induces flow disruptions, visible by the deformation of the iso-surfaces around it.Applying a MF, the gray iso-surfaces for pure water become more stretched with a horizontal stratification and become similar to a conductive regime due to the Lorentz force.The Lorentz forces arising from the interaction between the MF and the moving conductive fluid act to dampen the flow intensity, which reduces the convection.The nanofluid iso-surfaces under the influence of a MF show that the field's damping effect is also present but to a lesser degree than in pure water.The enhanced thermal conductivity of the nanofluid counteracts some of the magnetic damping, maintaining a higher degree of thermal mixing and convective activity than in the pure water case.It is also to be mentioned that the application of the MF leads to a vertical symmetry of the flow structure.The mid-plane velocity vector projections and thermal field are illustrated in Figure 4 for Ra = 10 5 , W = 0.4 with and without graphene nanoparticles.In a non-magnetic environment, the pure water flow structure shows a classic convective pattern with strong recirculation zones indicated by the closed-loop velocity vectors.The tree obstacle has an important effect on the flow structure by creating a local vortex between the tree branches, especially for Ha = 0.When nanoparticles are added, the flow becomes more intense due to the increased thermal conductivity that favorizes the convective heat transfer.The temperature field for pure water is distorted at the top region due to the dominance of the convection and is quasi-vertical in the bottom region due to the presence of the obstacle that opposes the flow.For pure water under magnetic influence, the flow structure is noticeably more organized and symmetric, with reduced recirculation zones.This is an indication of the damping effect of the Lorentz forces that opposes the buoyancy force.The graphene-water nanofluid's flow still exhibits greater motion compared to pure water under the same magnetic conditions.With a magnetic field, the temperature field in pure water is more uniform due to the reduction in the convective flow, leading to a more conduction-like heat transfer regime.When adding nanoparticles, even with the magnetic field, the compressed isotherms near the hot wall remain but are more stretched, showing that the nanofluid retains higher heat transfer rates than pure water but is also affected by the magnetic field.It can be observed that a rise in magnetic field strength from Ha = 0 to Ha = 100, in the case of both pure water and nanofluid, resulted in an important decrease in the maximum velocity values by about 82%.This implies that the magnetic field has a very strong damping effect on fluid flow intensity.The presence of nanoparticles has different effects on the fluid's maximum velocity at different magnetic field conditions.With no magnetic field, the maximum velocity in the presence of nanoparticles is 5.45% less than for the pure water case.On the other hand, with a strong magnetic field, nanoparticles increase fluid maximum velocity by 1.12%, meaning a complex interaction between the magnetic field and adding nanoparticles.), the flow structure exhibits a modest amount of convection with weak velocity vectors intensity.The isotherms are symmetric, parallel, and equidistant due to the dominance of the thermal conduction over convection, and the flow field is relatively stable and organized.Increasing the Rayleigh number to 10 4 enhances the buoyancy forces, leading to a more pronounced convective pattern in the flow structure.The velocity vectors are stronger, and the presence of multiple convection cells can be observed.The isotherms become more distorted, particularly close to the active walls, indicating stronger convection, which improves the heat transfer.At Ra = 10 5 , the flow is dominated by the convection and has a complex structure due to the intense flow.The isotherms are highly distorted on the heated side due to the intense thermal convection.The influence of the tree obstacle on the flow structure and temperature field is more pronounced at this level.The Ra causes a strong increase in maximum velocity values as it increases.In fact, when the Ra is increased from 10 3 to 10 4 , the increase in velocity is very large and is about 900%.Similarly, when the Ra is increased from 10 4 to 10 5 , the increase is about 500%, illustrating the dominance of the convective heat transfer mode.Figure 7 displays the total entropy generation for Ra = 10 5 and fin's length W = 0.2 within the central plane of the differentially heated cavity with and without graphene nanoparticles.Without a magnetic field and without the addition of nanoparticles, there are high levels of entropy generation near the heated and cooled walls, where temperature gradients, and thus thermal irreversibilities, are greatest.The addition of NPs enhances the thermal conductivity, and thus improves the heat transfer.However, the entropy generation remains high close to the active walls but with different distributions.The application of a MF has a noticeable effect on the entropy generation.The patterns are altered, and we observe a localized decrease in the entropy generation where magnetic damping of the flow is strongest.The entropy generation levels are lower due to the considerable suppression of the NC.Moreover, the MF reduces the entropy generation in the nanofluid; Figure 6 showcases the mid-plane velocity vectors projection and the thermal field for graphene-water nanofluid under a magnetic field (Ha = 25).Various fins' lengths are presented, ranging from W = 0.2 to W = 0.8, while keeping the Ra constant at Ra = 10 5 , which indicates that the flow is considerably influenced by buoyancy-driven convection.The fins' lengths are a crucial aspect of the heat transfer enhancement in the cavity, and their effects on the thermal and flow fields are markedly significant.With shorter fins (W = 0.2), the velocity vectors show a well-defined large central convective roll, which is indicative of strong buoyancy forces.The thermal field shows a relatively smooth gradient with evenly spaced isotherms in the middle portion.Increasing the fin length to W = 0.4, we observe the development of more complex flow patterns, with the large central vortex being disrupted by secondary circulations.The thermal field shows tighter isotherms on the heated side, indicating enhanced heat transfer.Further increasing the fins' length, the flow becomes more intense, as seen by the increased number and complexity of circulation patterns.The thermal field reflects this with more distorted isotherms, especially around the obstacle, indicating that the mixing effect of the flow is intensifying with the longer fins.The reduction in velocity is about 23.61% as the W increases from 0.2 to 0.8.In fact, when the fins become longer, they create more resistance to the flow, which slows down the velocity.however, the reduction is not as pronounced as in pure water.The addition of nanoparticles, which enhance thermal properties, leads to a resistance against the magnetic stabilizing effect.Nevertheless, the distribution of entropy generation magnitudes is lower compared to the case of absence of a MF.Due to the increased viscous effects, the use of nanoparticles increases the entropy generation by 74.44% and 108.86%, for Ha = 0 and 50, respectively.Due to the magnetic damping effect, the increase of the Ha from 0 to 50 leads to a decrease in the total entropy generation by 76.24% and 71.55% for φ = 0 and φ = 0.02, respectively.Figure 7 displays the total entropy generation for Ra = 10 5 and fin's length W = 0.2 within the central plane of the differentially heated cavity with and without graphene nanoparticles.Without a magnetic field and without the addition of nanoparticles, there are high levels of entropy generation near the heated and cooled walls, where temperature gradients, and thus thermal irreversibilities, are greatest.The addition of NPs enhances the thermal conductivity, and thus improves the heat transfer.However, the entropy generation remains high close to the active walls but with different distributions.The application of a MF has a noticeable effect on the entropy generation.The patterns are altered, and we observe a localized decrease in the entropy generation where magnetic damping of the flow is strongest.The entropy generation levels are lower due to the considerable suppression of the NC.Moreover, the MF reduces the entropy generation in the nanofluid; however, the reduction is not as pronounced as in pure water.The addition of nanoparticles, which enhance thermal properties, leads to a resistance against the magnetic stabilizing effect.Nevertheless, the distribution of entropy generation magnitudes is lower compared to the case of absence of a MF.Due to the increased viscous effects, the use of nanoparticles increases the entropy generation by 74.44% and 108.86%, for Ha = 0 and 50, respectively.Due to the magnetic damping effect, the increase of the Ha from 0 to 50 leads to a decrease in the total entropy generation by 76.24% and 71.55% for φ = 0 and φ = 0.02, respectively.The variation of the Nuav as a function of the Ha and nanoparticle concentration for shorter fins (W = 0.2) and longer fins (W = 0.8) is illustrated in Figure 8 for Ra = 10 5 .For W = 0.2, as the Ha increases, there is a general decrease in the Nuav, indicating that the MF has a damping effect on the convective heat transfer due to the Lorentz force suppressing the convection and therefore reducing the efficiency of convective heat transfer.For a given Ha, increasing φ increases the Nuav, which is attributed to the enhanced thermal The variation of the Nu av as a function of the Ha and nanoparticle concentration for shorter fins (W = 0.2) and longer fins (W = 0.8) is illustrated in Figure 8 for Ra = 10 5 .For W = 0.2, as the Ha increases, there is a general decrease in the Nu av , indicating that the MF has a damping effect on the convective heat transfer due to the Lorentz force suppressing the convection and therefore reducing the efficiency of convective heat transfer.For a given Ha, increasing φ increases the Nu av , which is attributed to the enhanced thermal properties with adding graphene nanoparticles that improve the efficiency of convective heat transfer despite magnetic damping.Similarly for W = 0.8, an increase in the Ha generally leads to a reduction in the Nu av .This effect appears to be more pronounced for larger fins' length, indicating an even stronger damping effect of the MF on convection.As with the shorter fins, increasing φ for a given Ha enhances the Nu av ; however, the overall Nusselt numbers appear to be slightly lower than for W = 0.2.While the nanoparticles improve heat transfer, the larger fins could create more flow disturbance and resistance, somewhat counteracting the benefits of the enhanced thermal conductivity.9 presents the surface plot showing the change in the Nu av against the Ra and fins' length for Ha = 50 and φ = 0.02.As the Ra increases, the buoyancy forces become more significant, and the convection becomes more efficient, which is reflected in an increase in the Nu av .The steeper slope of the surface at a lower W indicates that the Nu av is more sensitive to changes in the Ra when the fins are shorter.The plot shows that as the W increases, there is a very slight decrease in the Nu av , which is attributed to the fact that wider fins impede fluid flow.In addition, it is clear that the increase in the Ra increases the Nu av for all the values of W. The effect of the W on the Nu av is less pronounced than that of Ra, but there is a general trend of decreasing Nu av with increasing W, especially at higher Ra values.An increase in the Ha results in increased Smag but also opposes the flow, which potentially reduces thermal and frictional entropy generation.The stabilization becomes more effective so that the overall system becomes more ordered, thus reducing Smag.The addition of NPs enhances the thermal conductivity and leads to stronger temperature gradients and higher thermal entropy generation (Sth).For Ra = 10 5 , the temperature gradients are more important, and higher Sth occurs.The frictional entropy (Sfr) is generated due to fluid viscosity and flow resistance.The flow around the tree obstacle creates frictional losses, and the fluid's viscosity is increased by the addition of nanoparticles.Thus, Sfr is considerably affected by the increase in φ.The Stot is the sum of all forms of entropy generations.The figure shows a decrease in the Stot with the increase in the MF magnitude and an increase with the increase in the NPs volume fraction.Figure 10 illustrates how the different types of entropy generation, thermal (S th ), frictional (S fr ), magnetic (S mag ), and total (S tot ), vary with the Ha and φ at Ra = 10 5 and W = 0.4.An increase in the Ha results in increased S mag but also opposes the flow, which potentially reduces thermal and frictional entropy generation.The stabilization becomes more effective so that the overall system becomes more ordered, thus reducing S mag .The addition of NPs enhances the thermal conductivity and leads to stronger temperature gradients and higher thermal entropy generation (S th ).For Ra = 10 5 , the temperature gradients are more important, and higher S th occurs.The frictional entropy (S fr ) is generated due to fluid viscosity and flow resistance.The flow around the tree obstacle creates frictional losses, and the fluid's viscosity is increased by the addition of nanoparticles.Thus, S fr is considerably affected by the increase in φ.The S tot is the sum of all forms of entropy generations.The figure shows a decrease in the S tot with the increase in the MF magnitude and an increase with the increase in the NPs volume fraction.shows that as the Ra increases, indicating stronger convective flows due to higher temperature differences, Sth increases.This is because larger temperature gradients, which are more prevalent at a higher Ra, lead to greater thermal irreversibility.Similarly, varying the W may show that longer fins initially increase Sth due to greater surface area affecting heat transfer but could potentially lead to a decrease in Sth at some point where the flow becomes too disrupted by the fins, leading to less efficient heat exchange.Sfr generally arises from viscous dissipation in the fluid flow.As the Ra increases, the flow becomes more intense, which increases frictional losses, thus increasing Sfr.However, the increase in the fin length W could show a more complex trend, as it introduces more surface for friction but also changes the flow pattern, which could either increase or decrease Sfr.With a consistent Ha of 50, Smag is influenced primarily by the flow velocity and electrical properties of the fluid, both affected by φ.The plot for Smag shows a less pronounced variation with Ra, which indicates that the magnetic field effectively dampens the convection, leading to a more orderly flow despite the increase in buoyancy forces.However, the increase in the fin's length for higher Rayleigh numbers reduces Smag because as the W increases, the flow becomes more obstructed in such a way that it has less interaction with the magnetic field, which decreases the magnetic entropy generation.Overall, at a higher Ra and decreasing W, the Stot shows an increase due to the combined effects of thermal, frictional, Figure 11 represents a series of surface plots showing the variations of thermal (S th ), frictional (S fr ), magnetic (S mag ), and total (S tot ) entropy generation as functions of the Ra and the fin length for Ha = 50 and a NPs volume fraction φ = 0.02.The variation of S th shows that as the Ra increases, indicating stronger convective flows due to higher temperature differences, S th increases.This is because larger temperature gradients, which are more prevalent at a higher Ra, lead to greater thermal irreversibility.Similarly, varying the W may show that longer fins initially increase S th due to greater surface area affecting heat transfer but could potentially lead to a decrease in S th at some point where the flow becomes too disrupted by the fins, leading to less efficient heat exchange.S fr generally arises from viscous dissipation in the fluid flow.As the Ra increases, the flow becomes more intense, which increases frictional losses, thus increasing S fr .However, the increase in the fin length W could show a more complex trend, as it introduces more surface for friction but also changes the flow pattern, which could either increase or decrease S fr .With a consistent Ha of 50, S mag is influenced primarily by the flow velocity and electrical properties of the fluid, both affected by φ.The plot for S mag shows a less pronounced variation with Ra, which indicates that the magnetic field effectively dampens the convection, leading to a more orderly flow despite the increase in buoyancy forces.However, the increase in the fin's length for higher Rayleigh numbers reduces S mag because as the W increases, the flow becomes more obstructed in such a way that it has less interaction with the magnetic field, which decreases the magnetic entropy generation.Overall, at a higher Ra and decreasing W, the S tot shows an increase due to the combined effects of thermal, frictional, and magnetic entropy generations, indicating that there is an optimal fin's length where the S tot is minimized for a more efficient system design.

Flow
Symmetry 2024, 16, x FOR PEER REVIEW 18 of 23 and magnetic entropy generations, indicating that there is an optimal fin's length where the Stot is minimized for a more efficient system design.

Regression analysis:
The aim of this section is to establish correlations allowing the direct calculation of the Nuav and the Stot.Due to a number of parameters and their mutual interactive effects, the Lasso regression model is chosen to reach a high accuracy of predictivity.The use of the Lasso regression model with interaction terms and squared variables allows for simultaneous feature selection and regularization.In fact, Lasso regression helps in reducing the complexity of the model by penalizing the absolute size of the regression coefficients.It also allows for the shrinking of some coefficients to zero and effectively selects a simple model to avoid overfitting.
The Lasso regression model can be expressed as minimizing the following objective function: where: • n is the number of observations, • yi is the observed value of the dependent variable for the i th observation, • Xij is the value of the j th predictor for the i th observation,

Regression analysis:
The aim of this section is to establish correlations allowing the direct calculation of the Nu av and the S tot .Due to a number of parameters and their mutual interactive effects, the Lasso regression model is chosen to reach a high accuracy of predictivity.The use of the Lasso regression model with interaction terms and squared variables allows for simultaneous feature selection and regularization.In fact, Lasso regression helps in reducing the complexity of the model by penalizing the absolute size of the regression coefficients.It also allows for the shrinking of some coefficients to zero and effectively selects a simple model to avoid overfitting.
The Lasso regression model can be expressed as minimizing the following objective function: where: • n is the number of observations, • y i is the observed value of the dependent variable for the ith observation, • X ij is the value of the jth predictor for the ith observation, • β j are the coefficients (including the intercept β 0 and those for all predictors and their interactions), • p is the total number of predictors (including interaction terms), • λ is the regularization parameter that controls the strength of the penalty (the higher the value, the more significant the amount of shrinkage).
The first term represents the residual sum of squares (RSS), and the second term is the Lasso penalty.
As a result of the Lasso regression model, the following expressions are obtained for the Nu av and the St ot :  Equations ( 22) and ( 23) allow the prediction of the Nu av and the S tot as functions of the variables Ra, Ha, W, φ, and their significant interactions and squared terms.ϵ represents the model error term (deviations of the predictions from the actual values).
For the Nu av and the St ot , the Lasso model has effectively captured the complexity of the relationships while also applying regularization to prevent overfitting.In fact, the R-squared values of 0.970 and 0.959 mean that approximately 97% of the variance in the Nu av and 95.9% of the variance in the S tot are explained by the models, which means the models fit the data well.The MSE values are relatively low, indicating that the model's predictions are, on average, close to the actual values.The values of λ are obtained using a cross-validation process between fitting the data well and keeping the model complexity under control.
Figure 12 presents the plots of residuals versus predicted values for the Nu av and the St ot .The plot of residuals allows the assessment of the homoscedasticity of the residuals and the identification of non-linearities or outliers that can affect the models.From the plots of residuals versus predicted values, it is clear that the residuals are scattered around the horizontal line at zero, corresponding to a well-fitting model.The residuals are distributed across the range of the predicted Nu av and S tot values.Thus, it can be mentioned that the obtained expressions predict the functions with accuracy and without obvious biases or non-linearities.The variance of the residuals is consistent across the range of predicted values, which indicates the homoscedasticity of the model.This property is desirable because it indicates that the model is stable.Finally, it can be concluded that the absence of clear patterns or systematic bias in these plots suggests that the Lasso regression model is performing well.
• The incorporation of the tree-shaped obstacle allows a considerable control of the flow and affect of the temperature field.In fact, a reduction in the maximum velocity by about 23.61% occurs when the fins' length is varied from W = 0.2 to W = 0.8.• The increase in the length of the branches considerably reduces the heat transfer, especially at higher Ra values.• The use of nanoparticles increases the entropy generation by 74.44% and 108.86% for Ha = 0 and 50, respectively.
Overall, the present study focuses on the potential of using the combination of a nondestructive technique (magnetic field) and a destructive technique (tree-shaped obstacle) on the fluid flow, heat transfer, and entropy production during graphene-water nanofluid 3D natural convection.The study can find its applications in thermal management by enhancing the operational efficiency of electronic cooling systems and other applications requiring precise thermal control.

Figure 1 .
Figure 1.Studied configuration; (a) schematic view of 3D cubic cavity fitted with horizontal fins and coordinate system; (b) central plan.(c) used mesh.

Figure 1 .
Figure 1.Studied configuration; (a) schematic view of 3D cubic cavity fitted with horizontal fins and coordinate system; (b) central plan.(c) used mesh.

Figure 2 .
Figure 2. Particle trajectories (colored via velocity magnitude) for Ra = 10 5 and W = 0.2 for pure water and nanofluid with and without magnetic field.

Figure 2 .
Figure 2. Particle trajectories (colored via velocity magnitude) for Ra = 10 5 and W = 0.2 for pure water and nanofluid with and without magnetic field.

Figure 6
Figure6showcases the mid-plane velocity vectors projection and the thermal field for graphene-water nanofluid under a magnetic field (Ha = 25).Various fins' lengths are presented, ranging from W = 0.2 to W = 0.8, while keeping the Ra constant at Ra = 10 5 , which indicates that the flow is considerably influenced by buoyancy-driven convection.The fins' lengths are a crucial aspect of the heat transfer enhancement in the cavity, and their effects on the thermal and flow fields are markedly significant.With shorter fins (W = 0.2), the velocity vectors show a well-defined large central convective roll, which is indicative of strong buoyancy forces.The thermal field shows a relatively smooth gradient

Figure 5
Figure 5 displays the effects of the Rayleigh number on the mid-plane velocity vectors projection and the thermal field for fin's length W = 0.6, φ = 0.02, and Ha = 50.At a relatively low Rayleigh number (Ra = 10 3 ), the flow structure exhibits a modest amount

Figure 7 .
Figure 7.Total entropy generation contours at the central plan for Ra = 10 5 , W = 0.2 with and without nanoparticles.

Figure 7 .
Figure 7.Total entropy generation contours at the central plan for Ra = 10 5 , W = 0.2 with and without nanoparticles.

Figure 9
Figure 9 presents the surface plot showing the change in the Nuav against the Ra and fins' length for Ha = 50 and φ = 0.02.As the Ra increases, the buoyancy forces become more significant, and the convection becomes more efficient, which is reflected in an increase in the Nuav.The steeper slope of the surface at a lower W indicates that the Nuav is more sensitive to changes in the Ra when the fins are shorter.The plot shows that as the

Figure
Figure9presents the surface plot showing the change in the Nu av against the Ra and fins' length for Ha = 50 and φ = 0.02.As the Ra increases, the buoyancy forces become more significant, and the convection becomes more efficient, which is reflected in an increase in the Nu av .The steeper slope of the surface at a lower W indicates that the Nu av is more sensitive to changes in the Ra when the fins are shorter.The plot shows that as the W increases, there is a very slight decrease in the Nu av , which is attributed to the fact that wider fins impede fluid flow.In addition, it is clear that the increase in the Ra increases the Nu av for all the values of W. The effect of the W on the Nu av is less pronounced than that of Ra, but there is a general trend of decreasing Nu av with increasing W, especially at higher Ra values.

Figure 10
Figure 10 illustrates how the different types of entropy generation, thermal (Sth), frictional (Sfr), magnetic (Smag), and total (Stot), vary with the Ha and φ at Ra = 10 5 and W = 0.4.An increase in the Ha results in increased Smag but also opposes the flow, which potentially reduces thermal and frictional entropy generation.The stabilization becomes more effective so that the overall system becomes more ordered, thus reducing Smag.The addition of NPs enhances the thermal conductivity and leads to stronger temperature gradients and higher thermal entropy generation (Sth).For Ra = 10 5 , the temperature gradients are more important, and higher Sth occurs.The frictional entropy (Sfr) is generated due to fluid viscosity and flow resistance.The flow around the tree obstacle creates frictional losses, and the fluid's viscosity is increased by the addition of nanoparticles.Thus, Sfr is considerably affected by the increase in φ.The Stot is the sum of all forms of entropy generations.The figure shows a decrease in the Stot with the increase in the MF magnitude and an increase with the increase in the NPs volume fraction.

Figure 9 .
Figure 9. Variation of Nu av versus Ra and W for Ha = 50 and φ = 0.02.

Figure 11
Figure11represents a series of surface plots showing the variations of thermal (Sth), frictional (Sfr), magnetic (Smag), and total (Stot) entropy generation as functions of the Ra and the fin length for Ha = 50 and a NPs volume fraction φ = 0.02.The variation of Sth shows that as the Ra increases, indicating stronger convective flows due to higher temperature differences, Sth increases.This is because larger temperature gradients, which are more prevalent at a higher Ra, lead to greater thermal irreversibility.Similarly, varying the W may show that longer fins initially increase Sth due to greater surface area affecting heat transfer but could potentially lead to a decrease in Sth at some point where the flow becomes too disrupted by the fins, leading to less efficient heat exchange.Sfr generally arises from viscous dissipation in the fluid flow.As the Ra increases, the flow becomes more intense, which increases frictional losses, thus increasing Sfr.However, the increase in the fin length W could show a more complex trend, as it introduces more surface for friction but also changes the flow pattern, which could either increase or decrease Sfr.With a consistent Ha of 50, Smag is influenced primarily by the flow velocity and electrical properties of the fluid, both affected by φ.The plot for Smag shows a less pronounced variation with Ra, which indicates that the magnetic field effectively dampens the convection, leading to a more orderly flow despite the increase in buoyancy forces.However, the increase in the fin's length for higher Rayleigh numbers reduces Smag because as the W increases, the flow becomes more obstructed in such a way that it has less interaction with the magnetic field, which decreases the magnetic entropy generation.Overall, at a higher Ra and decreasing W, the Stot shows an increase due to the combined effects of thermal, frictional,

Figure 11 .
Figure 11.Variation of thermal (S th ), frictional (S fr ), magnetic (S mag ), and total entropy generation (S tot ) as functions of Ra and W, for Ha = 50 and φ = 0.02.