Computational insight to optimize nanofluidic thermal transport management in octagonal enclosure with heat generating element by envisioning novel physical factors Authors: Asad Ullah, Noor Zeb Khan, S Bilal, Muhammad Bilal Riaz Published: 2026 ABSTRACT AbstractThis study investigates the production of entropy and thermal transition phenomena in MHD nanoliquid movement via a porous octagonal enclosure with a central obstacle and establishes an ANN model for predicting the average Nusselt number (Nuavg) based on FEM simulations. The equations governing the flow and thermal transference in steady, incompressible, two-dimensional nanofluid flow were derived using the Darcy–Forchheimer model to include the effect of the porous medium and solved numerically employing the Galerkin finite element method (GFEM). Analysis of grid independence was performed to ensure the accuracy of the computation. Copper nanoparticles mixed with water is used as the working fluid to improve the heat conductivity. To estimate the Nusselt number obtained from the FEM, a feedforward back-propagation ANN employing the Levenberg–Marquardt optimization paradigm was created, trained, and validated using data division for training (70%), validation (15%), and testing (15%). It is found that intensification in thermal transition and thermal conductivity by convection is achieved due to the incorporation of nanoparticles, resulting in a maximum increase of the Nuavg of 7.7% over the pure liquid. Higher Rayleigh numbers strengthen buoyancy effects and render high-velocity and temperature gradients. The ANN model demonstrated high efficiency in forecasting outcomes, resulting in a nearly perfect correlation coefficient (R) of ≈ 1 and mean squared error (MSE) of 5.59 × 10⁻⁸, indicating strong conformity with the FEM results. This analysis provides valuable insights for the design and optimization of advanced thermal management systems, where efficient heat removal from confined geometries is required. Several practical engineering and technological applications are involved in cooling electronic devices, energy systems, and heat exchangers, as well as renewable energy technologies.Keywords: Nanofluid flow, Octagonal enclosure, Darcy–Forchheimer model, Entropy generation, Artificial neural network (ANN) Introduction Nanofluids are the latest type of heat transfer fluids that have the highest thermal behavior efficiency amongst all. They are the prepared colloidal suspensions consisting of tiny solid particles scattered in conventional fluids like ethylene glycol, oil, or water. Induction of nanomaterials gives a huge boost to viscosity, the thermal conductivity, and convective heat transferal properties of liquid which makes it a very promising option in various thermal and energy-related uses. Cooling systems are one the most important areas where nanofluid needed for effective and efficient heat removal. They find their way into the very cooling of microelectronics, automotive radiator, heat exchanger, and refrigeration systems with better heat removal capabilities than what the traditional coolants could provide. In renewable energy systems, nanofluids have been successfully used in solar collectors, photovoltaic-thermal systems, and geothermal applications, where their extraordinary thermal transport results in increased energy conversion efficiency. The concept of nanofluid was first introduced by Choi and Eastman [1]. They proposed suspending nanometer-sized solid particles in conventional fluids. Putra et al. [2] analyzed the natural convection behavior of nanofluids inside a horizontally oriented cylinder heated from one end and cooled from the other. Heat transference and entropy generation scrutinizing in the magnetized nanoliquid flow within a wavy permeable triangular cavity with centrally obstacle by employing FEM integrated with ANN model was communicated by Turabi et al. [3]. Heat transfer enhancement in a two-dimensional enclosure using nanofluid by developing a numerical model that accounts for solid particle dispersion and solving the governing transport equations through a finite-volume approach was explored by Khanafer et al. [4]. Anand and Arora [5] performed a comparative analysis of various nanofluid models for complex nanoparticles by examining natural convection flow in a square cavity with insulated horizontal walls. Thermal transference and natural convection in water based nanoliquid via rectangular cavity heated from bottom was delineated by Hwang et al. [6]. The prediction of thermal behavior in permeable corrugated trapezoidal cavity having hybrid nanofluid inside with implementation of FEM and neural network was deliberated by Farooq et al. [7]. Munir and Turabi [8] performed numerical simulations to examine thermal transition and entropy production in the hybridized nanoliquid flow inside triangular cavity containing cold cylindrical obstacle. Turabi et al. [9] examined natural convection and thermal transference behavior in Casson hybridized nanoliquid flow through a permeable triangular cavity under MHD and thermal radiation effects. Mahmoudi et al. [10] conducted a numerical study on natural convection water based nanoliquid flow with heat generating element positioned horizontally inside the enclosure. Heat and mass transference in the flow of mixed convective hybrid nanofluid flow by accounting Brownian motion and thermophoresis features was inspected by Alsabery et al. [11]. Rashidi et al. [12] presented thermal transition features of Al₂O₃ water-based nanofluid in a square cavity. Numerical investigation for natural convection in a nanofluid-filled cavity containing differently shaped obstacles (circular, square, and diamond) under the influence of a uniform magnetic field and internal heat generation was elucidated by Selimefendigil and Oztop et al. [13]. Saleem et al. [14] numerically investigated heat transmission in Cu–water based nanoliquid inside triangular enclosure with two equal sides, where the base is discretely heated and the lateral walls are cooled by an external air stream. A mathematical model for the exploration of flow attributes of nanofluid and heat transference mechanisms inside a circular cavity containing fractal barriers using the finite volume method was resolved by Mougouei et al. [15]. Shatnawi et al. [16] numerically explored the natural convection flow of a nanofluid within a hexagonal cavity containing an internally heated cylinder, in the absence of porous media and magnetic effects, using the Galerkin weighted residual method based on the finite element formulation. Turabi and Munir [17] numerically examined the combined effects of internal buoyancy forces and applied magnetics force on Casson liquid flow through square cavity by using FEM approach. Entropy generation and MHD analysis in the flow of hybrid nanoliquid in wavy lid-driven domain was carried out by Malik et al. [18]. Roshani et al. [19] elaborated thermophysical performance of a viscous nanoliquid in a two-dimensional triangular cavity containing inverted triangular, square, and rhombus-shaped obstacles under uniform and sinusoidal temperature boundary conditions. The flow and heat transfer characteristics of water-based nanofluid inside a lid-driven square cavity by varying shapes of nanoparticles was deliberated by Rashid et al. [20]. Huda et al. [21] analyzed the transient free convection behavior of nanofluid flow in a square cavity subjected to an inclined periodic magnetic field using a one-component thermally equilibrium homogeneous model, considering distinct thermal boundary conditions. Entropy production is a crucial principle in thermodynamics that measure irreversibility’s occurring inside a system during any real process. In the engineering field, the generation of entropy indicates energy degradation, that is, the loss of useful work potential, both directly and indirectly, through friction, unrestricted expansion, heat transfer across finite temperature differences, and viscous dissipation. Hence, the minimization of entropy generation is an important design goal for improving system efficiency and reducing pollution. Entropy generation in two-dimensional flow in a circular pipe under uniform wall heat flux was analyzed by solving the Navier–Stokes equations in cylindrical coordinates to examine the radial and axial variations of the velocity and temperature fields by Sahin and Massour [22]. A numerical inspection for the naturally convective and entropy generation analysis in Casson fluid inside a wavy triangular enclosure under inclined MHD and thermal energy features was conducted using the finite element method by Turabi et al. [23]. The irreversibility process in steady, laminar fluid flow between two parallel plates of a horizontal channel subjected to a transverse magnetic field was considered by Damseh et al. [24]. Shojaeian and Koşar [25] analytically inspected convective heat transfer and entropy generation in hydrodynamically fluid flows between parallel plates under velocity slip. A numerical inspection for entropy generation and double-diffusive natural convection in Casson hybrid nanofluid flow inside a staggered cavity was presented by Turabi et al. [26]. Coupled thermal and solutal transportation analysis of the flow of non-Newtonian fluids within square enclosures having central circular obstacles was conducted by Ahmed et al. [27]. Entropy minimization in non-Newtonian liquid flow via an inclined parallel-plate channel subjected to a constant pressure gradient was elaborated by Srinivasacharya and Bindu [28]. Entropy generation in MHD flow of non-Newtonian fluids over a wedge, analyzing heat and mass transfer under the combined effects of viscous dissipation, was considered by Abrar and Kosar [29]. Elsiad et al. [30] investigated the effects of Hall current, slip conditions, and thermal relaxation time on magnetohydrodynamic flow and entropy generation over an extended flat plate and cylindrical surface. A mathematical formulation for the thermal transport and entropy generation characteristics of viscous magnetized flow over a radially stretching disk was developed by Naseem et al. [31]. Mirzaei et al. [32] deliberated numerical investigation for natural convection and entropy generation in a trapezoidal cavity using the finite element method. Chamkha et al. [33] performed numerical simulations to examine mixed convective flow of air in a vented cavity having centrally positioned heated square cylinder by utilizing FDM technique. Chamkha [34] presented a numerical solution for the mathematical description of unsteady double-diffusive convection of a binary gas mixture in a rectangular permeable enclosure with a heat source/sink. Neural networks, inspired by the functioning of the human brain, have emerged as one of the most powerful tools in artificial intelligence (AI) for solving complex nonlinear problems. A neural network is composed of processing units (neurons) that are connected in layers and learn the patterns and relationships in the data through training and optimization. During the learning process, neural networks change the connection weights to represent very complex relationships that cannot be achieved using classical analytical or statistical techniques. The use of neural networks in engineering and scientific research has been widespread in areas such as fluid dynamics, image recognition, medical diagnostics, process control, and predictive modeling. Their power is in the capability to generalize from examples so that accurate predictions can be made, even if the analytical models are not available or are very expensive to compute. Specifically, feedforward neural networks trained using backpropagation algorithms have been found to be effective for both regression and classification tasks. Esfe et al. [35] utilized a multilayer perceptron ANN model to analyze the thermal conductivity of multi-walled carbon nanotube (MWCNT)/water nanofluids at different solid volume fractions and temperatures. In another study, Esfe et al. [36] developed a mathematical model for the viscosity of TiO₂–water nanofluids using ANN trained with experimental data, employing a single hidden-layer network with four neurons to predict the dynamic viscosity change with temperature and nanoparticle mass fraction. The use of Levenberg–Marquardt backpropagation algorithm in ANN model to study nanofluid jet impingement heat transfer characteristics in a microchannel heat sink was conducted and reported by Naphon et al. [37]. Toghraie et al. [38] used an ANN model to investigate the viscosity and rheological properties of non-Newtonian nanofluids at different temperatures with the best ANN architecture. Aslam et al. [39] presented a numerical investigation for nonlinear MHD Jeffery–Hamel flow in convergent and divergent channels using ANN integrated with an evolutionary hybrid optimization approach. Pothanna et al. [40] employed ANN model to analyze the thermo-viscous fluid motion between horizontal porous stretched plates within a permeable medium. An ANN model was designed by Haq et al. [41] to forecast mixed convection in the flow of nanofluids induced by curved elongated surfaces. In the previous literature, the integration of numerical and machine learning algorithms to explore nanofluid flow in permeable confined media has not yet been investigated. This study introduces a comprehensive numerical and intelligent hybrid framework that integrates the finite element method (FEM) with an artificial neural network (ANN) model to analyze magnetized nanofluid flow and entropy generation within a permeable octagonal enclosure containing an internal obstacle, with a geometry that has not been previously explored in the existing literature. The proposed model uniquely incorporates the Darcy–Forchheimer porous medium formulation under the impact of a magnetic field, thereby enabling a more realistic representation of the coupled convective, electromagnetic, and porous effects on nanofluid transport phenomena. Unlike conventional studies that focus solely on flow and temperature fields, this work comprehensively evaluates entropy generation, the Bejan number, and the ecological coefficient of performance (ECOP), providing a thermodynamic optimization perspective for nanofluid heat transfer systems. The developed ANN model, trained using FEM-generated datasets, demonstrates exceptional predictive accuracy (R ≈ 1, MSE = 5.59 × 10⁻⁸), offering a computationally efficient model for FEM simulations and proving the feasibility of employing intelligent algorithms for fast and reliable heat transfer predictions. The present study has application relevance to advanced thermal systems in electronic and energy devices, such as cooling of electronic modules and power converters. The inclusion of MHD allows the movement of the liquid to be regulated and thermal transitions to be controlled by adjusting the strength of the magnetic field. The porous structure of the enclosure is commonly used for heat sinks, metal foams, and thermal insulation layers. Mathematical description We have formulated a mathematical model to explore the 2D, steady and incompressible convective nanofluid flow influenced by magnetic field through permeable octagonal enclosure with octagonal obstacle at its center. Water is used as conventional fluid by scattering copper nanomaterials to account nano material effect. The vertical walls along with obstacle are heated with temperature while the horizontal walls kept cold at temperature The inclined walls of the enclosure are adiabatic and no-slip boundary constraints for velocity applied at each boundary (Tables 1, 2). The velocity constituents along axial and vertical directions are highlighted by and denotes the kinematic viscosity of the material. The magnetic field of strength is applied in vertical direction. Physical interpretation of the domain is communicated via Fig. 1. Table 1Physical attributes of base fluid and nanoadditivesPropertyH2OCu997.189540.055.97 × 1072.1 × 10–41.6 × 10–541793830.6400 Physical attributes of base fluid and nanoadditives Table 2Thermo-physical correlation for properties of nanofluidViscosityDensitySpecific heatThermal conductivityElectrical conductivityThermal expansion coefficient Thermo-physical correlation for properties of nanofluid Graphical view of domain Assumption of the study are enlisted as under: Two-dimensional flow Two-dimensional flow Steady and incompressible flow Steady and incompressible flow MHD nanofluid flow MHD nanofluid flow Darcy-model Darcy-model Octagonal enclosure Octagonal enclosure The mathematical modeling of the study is performed by invoking above mentioned assumptions is as under [43, 44]: The boundary constraints of the problem are defined as under: The governing equations and boundary conditions are non-dimensionalized by invoking following parameters [45]: Dimensionless fundamental expressions are as under Non-dimensional boundary constraints are expressed as below: For remaining walls: where indicates outward normal dimensionless length. The non-dimensional physical factors are defined as follows: Entropy generation and here, is irreversibility ratio and fixed at 10–5. Entropy expression is: Here, is the total nanofluid volume. Nusselt number Mathematically, Nusselt number is expressed as below: where, heat flux coefficient is presented as Thermal conductivity at horizontal and vertical walls is attained by After utilizing the aforementioned expressions and simplification following expressions for Nusselt number is attained NuAVG is given as: Numerical procedure The Galerkin Finite Element Method (GFEM) is employed to discretize the fundamental expressions. To ensure mass conservation and accurately determine pressure, mass conservation is expressed in a restricted form, as presented in Eq. (23). Equations (7–10) are resolved by FEM approach and is eliminated by introducing . The condition for maintaining incompressibility is defined in Eq. (7). Consequently, based on the findings of earlier studies [63], the pressure can be represented in the following form: Fundamental mathematical relations for the considered phenomenon is highlighted as under: The foundational set utilized to estimate temperature and velocity is described as below: Conditions to attain non-linear residual expressions for the fundamental equations are and at nodes within the domain which is described as below: Non-linear residual equations expressed in Eqs. (27–29) are tackled with the implementation of Galerkin finite element approach. Gaussian method with three point bi-quadratic basis function is utilized to determine the integration and unidentified variables in non-linear equations. Matrix form of the residuals subjected to thermal and momentum equations expressed as follows: where, and indicates Jacobian matrices of residual, highlights unknown and magnifies known vector. The residual is solved with the help of Newton–Raphson technique (Fig. 2). Steps involved in numerical scheme Grid sensitivity Grid sensitivity is a crucial step in any finite element based numerical study to ensure that the computed solution not rely on mesh size. The objective is to determine the minimum number of elements and degrees of freedom (D.O.F.) required to achieve a numerically stable and accurate solution without excessive computational cost. Grid sensitivity outcomes of the different levels of refinement that were carried out, thereby, indicating alteration in (NuAVG) and (Sitotal) with respect to the increasing mesh resolution are presented in Table 3. The number of elements goes on increasing in a progressive manner from 136 (extremely coarse) to 18,010 (extremely fine), which is related to D.O.F. spanning from 1033 to 99,139. Refining the mesh results in NuAVG and Sitotal, both, gradually drawing closer to their respective asymptotic values. NuAVG is observed to increase from 3.2471 for the very coarse grid to 3.5456 for the very fine grid, with only 0.017% difference in the change between the last two refinement levels (extra fine and extremely fine) which is negligible. In a similar manner, Sitotal drops from 3.844 to 3.5817 steadily, indicating the small variation with the successive refinements. The results presented highlight that changes in the computed quantities are not significant after a particular mesh density. To be precise, the grid of 6,596 elements (extra fine level) provides the results that are accurate enough and at the same time, does not consume too much computational power. Hence, this mesh is used for the following simulations to achieve the desired level of accuracy and at a reasonable computational cost. Table 3Sensitivity analysis at various mesh levelsRefinement levelD.O.FNo. of elementsNuAVGSiTotalExtremely coarse10331363.24713.844Extra coarse13551783.27373.7357Coarser26613723.38233.6586Coarse36235423.39573.6336Normal636110003.43753.6105Fine939315243.46323.601Finer13,60722703.48333.5953Extra fine37,70165963.54623.5815Extremely fine99,13918,0103.54563.5817 Sensitivity analysis at various mesh levels As seen in Fig. 3, the adopted grid system has a spatial distribution that combines rectangular and triangular elements to accommodate the geometric complexity of the computational domain. The fine mesh in the vicinity of the solid–fluid interfaces guarantees precise capturing of the thermal and flow gradients, thus proving the chosen grid to be both numerically stable and physically representative of the transport processes below. Mesh generation at extra fine level Code validation Figure 4 presents a comparison of the isotherm contours obtained from the present numerical model with those reported by Natarajan et al. [30] at and The validation of the computational method used in this research is depicted in the figure. The isotherm patterns of both investigations show very good qualitative correspondence, thereby confirming the dependability and precision of the numerical scheme. Symmetric thermal boundary layers develop along the heated surfaces in both situations, and the overall trends of temperature distribution are in agreement with the benchmark results of Natarajan et al. [30]. The present trials have captured these characteristic features vividly. The close similarity of the two sets of contours indicates that the current model is able to accurately depict the shift from conduction-dominated to convection-dominated regimes. Differences that are small and are seen near the upper corners of the enclosure might be due to slightly different grid resolutions or to the way the boundary conditions were implemented, however, these discrepancies are minor, and do not influence the overall accuracy of the solution. The comparison endorses the computational formulation and numerical accuracy of the present study. Comparison of isotherm contours at and with Natarajan et al. [42] Neural network An ANN model was built in this research to estimate the average Nusselt number from the Finite Element Method (FEM) simulations. The neural network was a predictive model, created to quantify the nonlinear interplay between governing factors and geometric variables with the Nusselt number. To ensure the robustness and generalization ability of the ANN, the data produced by FEM was distributed into three components: training (70%), validation (15%), and testing (15%). The back-propagation algorithm in combination with the Levenberg–Marquardt optimization method, renowned for its fast convergence and strong stability in nonlinear systems, was utilized to iteratively modify weights and biases. A rapid drop in the mean squared error (MSE) during the training phase was a sign of an effective learning process. Figure 5 presents the results drawn from the training of neural network by varying Rayleigh number. Performance indicators such as regression plots, error histograms, and training performance curves were used to evaluate the ANN model in terms of accuracy, reliability, and convergence as they were shown in subfigures (a) to (e). It is seen from the performance curve (Fig. 5a) that there was a very smooth training convergence with the mean squared error (MSE) steadily decreasing and eventually attaining a minimum value of 5.59E-08 at the validation step. This, in turn, suggests that the model was not overfitting. The error histogram plot in Fig. 5b confirms this as it shows that errors are concentrated around the zero mark. The concentration of errors indicated that the predictions made by the ANN were both accurate and not biased with only a few outliers involved. Figure 5e depicts the regression plots where it can be easily seen that the predicted values are indeed responding to the target data in a strong linear manner as most data points fall right onto the best fit line. This also means that the input–output relationship has been captured and the ANN model has done its job effectively. The correlation coefficients (R) found in the training, validation, and testing phases are almost equal to one verifying the high prediction accuracy and low variance. To sum up, Fig. 5 lies the proposed ANN model in a very good accuracy and generalization capability bag. The close interlinking of predicted and actual values, the least error dissemination, the steady training performance, all combined, validate the efficiency and robustness of the ANN architecture for revealing the complex nonlinear relationships. Outcomes of ANN model Results and interpretation This section provides the outcomes of the study by solving the constitutive governing expression with the implementation of Galerkin-based FEM approach. The impact of the pertinent physical factors on streamlines and isotherms patterns along with engineering quantities communicated via graphical and tabular format. The changes of velocity distribution with the Rayleigh number is shown in Fig. 6. Comparison of situations when nanoparticles are present and when they are absent. The presence of nanoparticles and the increase of Rayleigh number, which indicates the level of buoyancy-driven convection, affect the velocity profile. Without nanoparticles, the velocity distribution conforms to the usual natural convection pattern where higher Rayleigh numbers make the buoyancy effect stronger, thus, the fluid movement near the boundary becomes more vigorous and a higher velocity peak in the boundary layer becomes more evident. On the contrary, when the nanoparticles are added, noticeable changes in the velocity distribution occur. Induction of nanomaterials in base fluid magnifies thermal transition and also the buoyancy-driven flow due to the intensified thermal conductivity and viscosity. The result is that the velocity profiles with nanoparticles are lower than those of the pure fluid, indicating that the nanofluids have accelerated the convective transport mechanism. In addition, it is perceived that elevating Rayleigh number from 103 to 105, the pure fluid and the nanofluid both have a rise in velocity magnitude, yet the nanofluids show a more pronounced increase. Variation in velocity distribution versus Rayleigh number with and without nanoparticle The thermal profile is represented by the graph shown in Fig. 7 that is plotted against the Rayleigh number and includes the cases of pure fluid and nanofluid. In the case of pure fluid, the thickness of its thermal boundary layer is depreciated with Rayleigh number from (103 to 105), which implies that heat transport is more efficient as a result of convection being more active. This is a phenomenon that can easily be understood as high Rayleigh numbers mean that buoyancy forces are strong, and they thus cause more vigorous circulation and therefore more heat transfer from the heated surface. The inclusion of nanoadditives in the base fluid results in a significant alteration in the thermal distribution. The nanofluid illustrates a temperature profile within the boundary layer that is lower than that of the pure fluid. Nanoparticles are claimed to boost the thermal conductivity which indicates that the heat will be transferred from the wall to the liquid more effectively hence the layer of hot liquid adjacent to the wall will be thinner and the overall temperature gradients will be higher. Furthermore, the comparison between the cases with nanofluid and with pure fluid indicates that at larger Rayleigh numbers the effect of the nanoparticles becomes more pronounced. Variation in thermal profile versus Rayleigh number with and without nanopaticle Figure 8 elaborates the influence of the Darcy number on the momentum distribution in both a pure fluid and a nanofluid case. As it highlight permeability of medium, with larger values implying less resistance to fluid motion and smaller ones indicating stronger drag effects in the porous material. The pure liquid case indicates that the higher Darcy number not only led to a higher velocity distribution but also was associated with the strongest buoyancy-driven motion. This is because the higher permeability leads to the lesser resistance against the flow of fluids which in turn permits the buoyancy-driven motion to be developed stronger resulting in greater fluid acceleration. While, at lower Darcy numbers, the flow undergoes strong damping since the increased drag exerted by the porous medium results in weaker velocity fields. In case of the base fluid, induction of nanoadditives causes to depreciates velocity distribution in comparison with the pure fluid case. The nanoparticles present get the effective thermal conductivity which in turn makes the buoyancy forces stronger and thus allows faster fluid motion within the porous structure. Nanofluid case also present higher fluid velocity magnitudes regardless of the Darcy number. Additionally, as the difference between nanofluid and pure fluid is more pronounced at high Darcy numbers, the reduced drag enables the thermal effects induced by the nanoparticles to take over the flow dynamics. On the contrary, at lower Darcy numbers, even though the nanoparticle effect is present, the strong resistance of the porous medium curtails the velocity increase making the enhancement relatively less significant. Figure 8 supports the notion that the velocity profile is positively linked with the Darcy number and that the addition of nanoparticles considerably increases the flow driven by buoyancy. This points to the dual role of the porous medium's permeability and the nanofluid's nature in the control of convective motion which, in this case, is beneficial in the cooling and thermal management applications through geothermal energy, filtration, and cooling technologies. Variation in velocity distribution versus Darcy number with and without nanoparticle Darcy number impact on thermal field in the existence and absence of nanoparticles is depicted in Fig. 9. For pure fluid case, higher Darcy number results in increased convective transport and causes to thin thermal boundary layer and reduction of overall temperature gradients. Thus, a more efficient heat dissipation mechanism is applied since the fluid can pass through the porous medium more easily. The case of nanoparticles changes the situation completely. Nanoparticles raised thermal conductivity of the fluid and that is why the heat transfer becomes so strong in the boundary layer. Hence, the thermal profile gets more equal and heat distribution rate goes up. Darcy number is still a major factor in the convection area, but the blending of particles gives a significant leap in thermal transportation efficiency. Therefore, the comparison discloses that nanoparticle addition alters the thermal response of the system towards heat distribution even when the permeability of porous medium varies. Variation in thermal profile versus Darcy number with and without nanopaticle The velocity distribution showed a diminishing pattern with elevation in Hartmann number (see Fig. 10). Without the presence of nanoparticles, the higher Hartmann numbers have a very noticeable effect on the velocity reduction because the Lorentz force that the magnetic field produces is opposing the movement of the liquid. This means that the momentum boundary layer is thinner, and the flow intensity is also lower. Once the nanoparticles are added, the velocity field is even more altered. The nanoparticles in the mixture change the effective viscosity and density of the basic liquid. Therefore, the reduction of velocity is more in the case of the presence of nanoparticles, and the thickness of the velocity boundary layer is further decreased as compared to that of pure fluid. This result confirms the joint damping effect of, on the one hand, the magnetic forces and, on the other, the particle fluid interactions, where the Hartmann number controls electromagnetic resistance mainly, and nanoparticles increase viscous drag, thus resulting in the flow patterns that are more controlled and restrained. Variation in velocity distribution versus Hartmann number with and without nanoparticle Alteration in thermal distribution patterns by varying Hartmann number with and without nanomaterial is manifested in Fig. 11. In the case of pure fluid, by intensifying Hartmann number suppression in of fluid movement is perceived, and consequently, the convective transport becomes weaker. This change in the heat transfer mode causes the heat to be more confined near the surface, and the thermal boundary layer becomes thicker. The implication is that the stronger magnetic fields are restricting the transport of hot and cold matter thus delaying the heat dissipation. On the contrary, the presence of nanoparticles has a very different effect. The nanoparticles improve the effective thermal conductivity of the fluid, and thus, the supplantation of convective transport due to the magnetic field. This means that even though the Lorentz force tends to thicken the thermal boundary layer, the nanoparticle-enhanced conductivity allows for efficient heat transfer. The thermal distribution generated is thus quite uniform and has higher temperature gradients compared to the case of pure fluid. This phenomenon shows that the Hartmann number is the factor controlling the convection suppression, while the nanoparticles are the ones enhancing the conduction, thus collectively influencing the overall thermal response of the system. Variation in thermal profile versus Hartmann number with and without nanopaticle Analysis of different parameter variations for both pure fluid and nanofluid cases is presented in Table 4. It provides a comparison of average Nusselt number (Nuavg), total entropy (Sitotal), Bejan number (Beavg) and ECOP outcomes. The participation of nanoparticles unequivocally results in better heat transfer and thermodynamic performance. In every case, the adoption of nanoparticles resulted in a uniform increase in Nuavg. By way of illustration, the case where is concerned, Nuavg moves from 6.5482 to 6.9574, indicating an increase of approximately 6.24%. Likewise, the case where Ha = 0 is involved shows a rise in Nuavg from 6.9202 to 7.4536, translating into an enhancement of 7.71%. This exerts the inference that nanoparticles are effective in facilitating convective heat transfer to a large extent. In the same vein, total entropy is impacted by the presence of nanoparticles as it also experiences a rise. To put it in a simple way, at the entropy shifts from 8.6714 to 8.8992, which represents a 2.63% increase. At Ha = 0 Sitotal moves from 7.0641 to 7.5982, which amounts to a 7.56% growth. The reason for this is the increased permeability and reduced thermal resistances in the case of nanofluids, hence, the irreversibilities are stronger. Generally, Beavg is superior for nanofluids indicating that the heat transfer irreversibility is more pronounced than the fluid friction irreversibility. At Beavg rises from 0.7607 to 0.7878, signifying a 3.56% increment. Also, at Beavg shows a rise from 0.9030 to 0.9124 (1.04% increase). This is a confirmation that the addition of nanoparticles enhances the thermodynamic efficiency through a relative reduction in viscous losses compared to heat transfer. ECOP has also been observed to increase with nanoparticle incorporation. For example, at there is a 3.53% increase in ECOP from 0.7551 to 0.7818. At ECOP goes from 0.9796 to 0.9809, which is a modest but positive improvement (0.13% increase). The results demonstrate how the addition of nanoparticles aids system performance. The percentage analysis reveals that the nanoparticles have a consistent effect on increasing the Nusselt number and Bejan number while slightly increasing the entropy generation. ECOP shows an upward trend throughout, although with minor percentage increases. All these improvements combined signify that the use of nanofluid not only enhances the heat transfer capability but also the thermodynamic performance, especially at high Rayleigh numbers and Darcy numbers. Table 4Outcomes of average Nusselt number, total entropy, Bejan average number and ECOP by varying different parameters with and without nanoparticleNuavgSitotalBeavgECOPNuavgSitotalBeavgECOP1031010–23.13563.18610.98413.52563.58230.99990.98411043.20723.26380.99730.98263.56493.62550.99840.98321056.54828.67140.76070.75516.95748.89920.78780.781806.92027.06410.98630.97967.45367.59820.98790.980956.81837.60310.90300.89677.31628.07730.91240.9057106.54828.67140.760750.75516.95758.89930.78780.781810−46.54828.63950.76350.75796.95748.87190.79020.784210−36.54828.64240.76320.75766.95748.87440.79000.783910−26.54828.67140.76070.75516.95748.89920.78780.7818 Outcomes of average Nusselt number, total entropy, Bejan average number and ECOP by varying different parameters with and without nanoparticle Concluding remarks This pagination offers a comprehensive analysis of entropy generation in the flow of water based nanofluid through octagonal cavity. The porosity features are added by accounting the Darcy Forchheimer model. The flow also characterizes magnetic field of strength The fundamental equation describing flow phenomenon was designed as PDE’s. The attained PDE’s are resolved numerically with the help of Galerkin finite element approach. An ANN model based on feedforward back propagation was also designed to predict the outcomes of average Nusselt number. The innovative findings of the study are enlisted as under: The induction nanoadditives in base fluid significantly improved the thermal conductivity, leading to elevate heat transference rate throughout enclosure. The induction nanoadditives in base fluid significantly improved the thermal conductivity, leading to elevate heat transference rate throughout enclosure. Both thermal and momentum distribution goes up by intensifying the Rayleigh number. Both thermal and momentum distribution goes up by intensifying the Rayleigh number. Enhancement in Darcy number causes to magnifies the velocity of fluid, while due to presence of nanomaterials also enhanced thermal profile versus Darcy number. Enhancement in Darcy number causes to magnifies the velocity of fluid, while due to presence of nanomaterials also enhanced thermal profile versus Darcy number. Hartmann number exhibited a suppressing effect on momentum distribution due to higher electromagnetic resistance, whereas as thermal profile exhibits a uniform behavior. Hartmann number exhibited a suppressing effect on momentum distribution due to higher electromagnetic resistance, whereas as thermal profile exhibits a uniform behavior. Entropy generation analysis reveals that total entropy elevated slightly with the addition of nanomaterials, while Bejan number indicated dominance of heat transfer irreversibility over viscous losses. Entropy generation analysis reveals that total entropy elevated slightly with the addition of nanomaterials, while Bejan number indicated dominance of heat transfer irreversibility over viscous losses. The Nusselt number was accurately estimated by the ANN model that was trained on the FEM-generated data, and the outstanding regression correlation (R = 1) as well as the small MSE (5.59 × 10−8) indicate high accuracy of model. The Nusselt number was accurately estimated by the ANN model that was trained on the FEM-generated data, and the outstanding regression correlation (R = 1) as well as the small MSE (5.59 × 10−8) indicate high accuracy of model. The conjunction of the FEM-ANN approach turned out to be a computationally inexpensive technique for examining the nanofluid behavior, thus providing forecasting power for intricate thermal systems. The conjunction of the FEM-ANN approach turned out to be a computationally inexpensive technique for examining the nanofluid behavior, thus providing forecasting power for intricate thermal systems. Acknowledgements This article has been produced with the financial support of the European Union under the REFRESH – Research Excellence For Region Sustainability and High-tech Industries project number CZ .10.03.01/00/22_003/0000048 via the Operational Programme Just Transition. Abbreviations Velocity components Kinematic viscosity of nanofluid Thermal expansion coefficient Thermal diffusivity Temperature of liquid Darcy number Hot temperature Prandtl number Electrical conductivity of nanofluid Irreversibility distribution ratio Density of nanofluid Gravitational coefficient Strength of magnetic field Pressure Cold temperature Grashof number Permeability of medium Hartmann number Thermal conductivity Nusselt number Author contributions All authors have equally participated in different sections of manuscript which are described in author contribution section. Asad Ullah: Conceptualization, methodology, software, validation, formal analysis, investigation, data curation, writing-original and revised manuscript draft, writing-review and editing. Noor Zeb Khan: Methodology, formal analysis, investigation, data curation, visualization, writing-original and revised manuscript draft, writing-review and editing. S. Bilal: Conceptualization, Methodology, formal analysis, investigation, data curation, visualization, writing-original and revised manuscript draft, writing-review and editing. Muhammad Bilal Riaz: formal analysis, investigation, funding, data curation, visualization, writing-original and revised manuscript draft, writing-review and editing. Data availability Yes, all data generated or analyzed during this study are included in this published article. Declarations Ethics approval and consent to participate This manuscript is prepared by considering and following all ethical requirement. All authors have equally participated in different sections of manuscript which are described in author contribution section. Consent for publication All authors have consent to publish this article. Competing interests The authors declare no competing interests. Footnotes Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement Yes, all data generated or analyzed during this study are included in this published article.