Levenberg–marquardt based ANN solution for MHD nanofluid flow and heat transportation over a thin needle with thermophoresis effects Authors: Haider Ali, Aaqib Majeed, Taoufik Saidani, Parvez Ali Published: 2026 ABSTRACT AbstractArtificial neural network (ANN) techniques have emerged as powerful data-driven tools for their effectiveness in analysis, modeling, and simulation. These supervised learning approaches are designed to reduce the error between predicted and observed data, providing accurate approximations of complex physical systems. To improve training performance, the Levenberg–Marquardt algorithm (LMA) is widely adopted due to its fast convergence and suitability for nonlinear problems. The objective of this study is to develop an ANN-based computational framework using the LMA to accurately predict the flow and heat transfer characteristics of an MHD nanofluid over a thin needle based on Buongiorno’s model. The novelty of the present work lies in applying an ANN-based predictive framework to the Buongiorno nanofluid model over a moving thin needle, which has received limited attention in the existing literature. The impacts of transverse magnetic field, Brownian motion, and thermophoresis are contained in the mathematical model. The governing equations for fluid flow are converted to ordinary differential equations (ODEs) and numerically solved. The results are also predicted by using Artificial Neural Networks (ANNs) techniques. The effect of physical parameters like magnetic parameter (M), Prandtl number (Pr), thermophoresis parameter (Nt), Brownian motion parameter (Nb), and Schmidt number (Sc) on velocity, temperature and concentration profiles are explored. The outcomes indicate that the velocity of the fluid decreases with the upsurge of the magnetic parameter while the temperature increases. Higher values of Pr and Sc reduce the temperature and concentration profiles, correspondingly. The Brownian motion parameter boosts the temperature but lowers the concentration, while the thermophoresis parameter rises both temperature and concentration. It is also observed that the magnetic field increases the skin friction coefficient but decreases the heat and mass transfer rates. The ANN results are very close to the numerical results, showing that ANN is an accurate and reliable method for predicting complex nanofluid flow problems.Keywords: Thin needle, Buongiorno model, Nanofluid, ANN, Brownian motion, Mathematical modeling Introduction Nanofluids have received great attention because they improve the heat transfer ability of ordinary fluids. A nanofluid is made by mixing very small particles, called nanoparticles, into ordinary base fluids such as water, oil, and ethylene glycol. These nanoparticles increase the thermal conductivity of the fluid and make it more useful in several engineering and industrial applications like cooling systems, solar energy devices, electronic equipment, biomedical engineering, and manufacturing industries [1–5]. A number of research groups have examined the use of various kinds of nanoparticles to enhance the performance of fluids, such as copper, titanium oxide, aluminium oxide and carbon nanotubes [6–9]. Magnetohydrodynamic (MHD) nanofluid flow is an important research field in the recent years as it is possible to control the motion of the electrically conducting fluids by magnetic fields, which also control their heat transfer behavior [10–12]. Hence, the synergistic action of nanoparticles and magnetic field has now proved very beneficial in recent thermal engineering applications. The flow across a thin needle is crucial due to its use in the polymer industries, geothermal systems, hot-wire anemometers, and wire cooling. Thin needles are beneficial as they have a smaller drag force and better heat transfer performance. The earlier studies have primarily taken into account ordinary fluid flowing over the thin needles while the recent studies are concerned with the nanofluids and hybrid nanofluids under various physical conditions [13–15]. The MHD nano fluid flow past a porous thin needle with nonlinear radiation impacts was examined by Khan et al. [16]. Ali et al. [17] examined flow of nanoliquid over a moving slender needle under the influence of magnetic field. Reddy et al. [18] conducted an analysis of the entropy generation and Stefan blowing effects on the hybrid nanofluid flow through a moving thin needle. Shah et al. [19] umerically investigated the thermally enhanced electromagnetohydrodynamic (EMHD) flow of a CuO–ethylene glycol/water micropolar nanofluid.. Tlili et al. [20] investigated radiative MHD nanofluid flow over a moving thin needle in a porous medium with Hall current, dust particles, and entropy generation. In thin needle problems, the effects of chemical reactions, viscous dissipation, velocity slip, porous media and non-Newtonian fluids were also included by other researchers [21–24]. The aforementioned studies revealed that fluid velocity, temperature and concentration of fluid are highly influenced by magnetic field and nanoparticles. But few studies have been conducted on the flow of thin needles with the model of Buongiorno nanofluid. The Buongiorno model is one of the widespread models to examine nanofluids that consider the movement of the nanoparticles inside the fluid. In this model, the two major effects taken into account are thermophoresis and Brownian motion. The Brownian motion is the arbitrary movement of nanoparticles and the thermophoresis is the movement of particles by differences in temperature [25]. The Buongiorno model provides more realistic results in problems of heat and mass transfer compared to simple nanofluid models [26, 27]. Buongiorno model was used to investigate the flow of electrically conducting nanofluid by Chu et al. [28] and improvement in the heat transfer was observed. Krishna and Chamkha [29, 30] investigated the Hall and slip effects on the flow of an MHD nanofluid in a rotating tube in the presence of the Buongiorno model. Ali et al. [30] studied the hybrid nanofluid flow using the modified Buongiorno model and obtained a better thermal performance. Yasmin [31] studied the MHD hybrid nanofluid flow of microorganisms of the gyrotactic type with the impact of Brownian motion and thermophoretic diffusion. Choudhary et al. [32] examined MHD Williamson flow of hybrid nanoliquid over stretching and shrinking cylinders employing modified Buongiorno model. The results of these studies showed the temperature and the concentration of nanoparticles are strongly affected by these phenomena, namely Brownian motion and thermophoresis. However, very few studies have been conducted on the Buongiorno nanofluid flow over thin needles. ANNs are current computational tools that are extensively used in the answer to complicated engineering and scientific issues. ANN methods are able to learn the nonlinear relationships between different physical parameters, and make accurate predictions with lower computational amounts [33]. Due to these merits, ANNs are now commonly applied in fluid mechanics [34] and heat transfer problems, also in the case of nanofluid flow and MHD systems [34]. Artificial intelligence (AI) techniques were employed to examine the MHD nanofluid flow over a mobile thin needle by Ismail et al. [35] who obtained accurate prediction results. Siddique et al. [36] used ANN analysis to model the MHD hybrid nanofluid flow past a thin needle considering nonlinear radiation and heat generation effect. Imran et al. [37] have implemented the ANN techniques for thermal analysis of MHD hybrid nanofluid flow in porous media and concluded that machine learning technique can be efficiently used to predict complex fluid flow behavior. From these studies it can be concluded that the ANN methods are gaining more and more importance in the latest developments of modern fluid dynamics research. Several recent studies have investigated the flow and heat transfer behavior of different non-Newtonian nanofluids under various physical conditions. The effects of viscosity ratio and unsteady stretching velocity on ternary nanofluid flow have been analyzed in [38], while the influence of rheological properties on tetra-Bingham nanofluids has also been reported [39]. Moreover, Darcy–Brinkman porous media, Navier slip, and Biot boundary conditions have been shown to significantly affect fluid flow and heat transfer characteristics [40]. The combined effects of thermal radiation, Stefan blowing, Brownian motion, thermophoresis, and entropy generation have also been investigated to improve the understanding of advanced heat transfer systems [41, 42]. These studies provide a strong foundation for developing more generalized mathematical models for non-Newtonian nanofluid flows. The combined influence of bioconvection, Darcy–Forchheimer resistance, and Buongiorno’s model has been reported to significantly affect the flow, heat, and mass transfer characteristics [43]. Similarly, entropy generation and magnetohydrodynamic effects have been widely investigated to improve the understanding of thermal transport in ferrofluids and Bingham fluids [44, 45]. Moreover, the effects of velocity slip, Darcy–Brinkman porous media, and mass transpiration have been shown to play an important role in controlling the thermal and concentration boundary layers of ternary nanofluids [46, 47]. In addition, chemically reactive micropolar hybrid nanofluid flow over a porous surface has highlighted the combined effects of an inclined magnetic field, radiation, and entropy generation on transport phenomena [48]. These studies provide a strong basis for developing more generalized mathematical models for complex non-Newtonian nanofluid flows. The coupling of analytical or numerical solvers with ANN has been successfully used to predict the behavior of micropolar and tetrahybrid nanofluids with high accuracy while reducing computational effort [49, 50]. In addition, MHD stagnation-point flows, entropy generation, and hybrid nanofluids have been extensively investigated to understand the effects of magnetic fields and thermal transport under different physical conditions [51, 52]. Furthermore, hybrid nanofluid flows with convective slip and mixed convection have demonstrated the importance of surface conditions and variable thermophysical properties in enhancing heat transfer performance [53, 54]. These studies highlight the growing role of artificial intelligence as an efficient predictive tool for advanced fluid flow and heat transfer analyses. Recent studies have used both numerical methods and artificial intelligence to study complex nanofluid flow and heat transfer problems. ANNs have been successfully used to predict the flow behavior of nanofluids with high accuracy and less computational time [55, 56]. Moreover, the effects of porous media, thermal radiation, magnetic field, and entropy generation on heat and mass transfer have been widely investigated under different flow conditions [57, 58]. Recent studies have also examined the stability of hybrid nanofluid flow and the thermal behavior of nanomaterials over a moving thin needle, showing that these physical effects play an important role in controlling fluid flow and heat transfer [59, 60]. These studies show that combining numerical methods with ANN provides an efficient and reliable approach for solving complex nanofluid flow problems. Upreti et al. [61] and Upreti et al. [62] reported that Cattaneo–Christov heat flux, Darcy–Forchheimer porous media, and nanoparticle shape significantly influence the thermal and flow characteristics of nanofluids. Bartwal et al. [63] and Bartwal et al. [64] further showed that entropy generation and machine learning techniques, such as MLP, can accurately predict heat and mass transfer performance. Moreover, Upreti et al. [65] and Upreti et al. [66] successfully applied regression models, ANFIS–PSO, and ANFIS–GA to improve the prediction of complex fluid flow problems. In addition, Upreti and Bartwal [67] and Pandey et al. [68] highlighted the growing importance of nanofluids in thermal management and energy-efficient engineering systems. These studies demonstrate that combining numerical methods with artificial intelligence provides an accurate and efficient approach for predicting complex nanofluid flow and heat transfer problems. These studies encouraged the present work which investigates the flow of MHD nanofluid across a thin needle with consideration of the Buongiorno model. The mathematical model incorporates the inspiration of Brownian motion, thermophoresis, and magnetic field on the flow of the fluid, heat energy, and the concentration of nanoparticles. Unlike many previous studies that used simple nanofluid models, the present work uses the Buongiorno model to study both temperature and concentration distributions in detail. The interaction between magnetic forces and nanoparticle movement is also analyzed under suitable boundary conditions. According to the authors’ knowledge, very limited work has been reported on MHD nanofluid flow over a thin needle using the Buongiorno model. Therefore, the present study will help researchers better understand nanoparticle transport and heat transfer behavior in electrically conducting nanofluids. Presented a computational strategy that may be useful for future applications in advanced cooling technologies, microfluidic systems, and thermal transport engineering. Novelty of the present study Developed a hybrid computational framework combining Artificial Neural Networks (ANNs) with the Levenberg–Marquardt Algorithm (LMA) for accurate prediction of nonlinear MHD nanofluid flow behavior. Developed a hybrid computational framework combining Artificial Neural Networks (ANNs) with the Levenberg–Marquardt Algorithm (LMA) for accurate prediction of nonlinear MHD nanofluid flow behavior. Investigated magnetohydrodynamic (MHD) nanofluid flow over a thin needle using the Buongiorno nanofluid model, which simultaneously incorporates Brownian diffusion and thermophoretic transport mechanisms. Investigated magnetohydrodynamic (MHD) nanofluid flow over a thin needle using the Buongiorno nanofluid model, which simultaneously incorporates Brownian diffusion and thermophoretic transport mechanisms. Applied the Levenberg–Marquardt optimization scheme to enhance ANN training efficiency, convergence speed, and prediction accuracy for complex transport phenomena. Applied the Levenberg–Marquardt optimization scheme to enhance ANN training efficiency, convergence speed, and prediction accuracy for complex transport phenomena. Compared ANN predictions with numerical ODE solutions, demonstrating the reliability and robustness of ANN methodologies for nanofluid dynamics. Compared ANN predictions with numerical ODE solutions, demonstrating the reliability and robustness of ANN methodologies for nanofluid dynamics. Examined the combined effects of magnetic field, Brownian motion, thermophoresis, Prandtl number, and Schmidt number on velocity, temperature, and concentration distributions. Examined the combined effects of magnetic field, Brownian motion, thermophoresis, Prandtl number, and Schmidt number on velocity, temperature, and concentration distributions. Provided a detailed analysis of engineering quantities including skin friction coefficient, heat transfer rate, and mass transfer rate under varying physical parameters. Provided a detailed analysis of engineering quantities including skin friction coefficient, heat transfer rate, and mass transfer rate under varying physical parameters. Demonstrated that ANN techniques can serve as an efficient alternative to conventional numerical approaches for solving highly nonlinear boundary layer flow problems. Demonstrated that ANN techniques can serve as an efficient alternative to conventional numerical approaches for solving highly nonlinear boundary layer flow problems. Established the effectiveness of data-driven intelligence methods for thermal engineering and nanofluid transport simulations involving coupled momentum, heat, and mass transfer processes. Established the effectiveness of data-driven intelligence methods for thermal engineering and nanofluid transport simulations involving coupled momentum, heat, and mass transfer processes. Problem formulation The current study examines a steady, laminar, and axisymmetric MHD nanofluid flow over a thin needle. The mathematical formulation is developed employing the Buongiorno nanofluid model, which accounts for the effects of Brownian motion and thermophoresis [1]. Physical configuration of the study is displayed in Fig. 1 where (x, r) are the cylindrical coordinates in axial and radial directions. A uniform transverse magnetic field is implemented normal to the flow direction, while the induced magnetic field is ignored because of the small magnetic Reynolds number. The base fluid and nanoparticles are considered to be in thermal equilibrium, and viscous dissipation and pressure gradient effects are ignored. Heat and mass transfer take place because of temperature and concentration differences among the needle surface and the ambient fluid. The present model is formulated by following the base framework reported by Ahmad et al. [69, 70]. a Coordinate system and physical configuration. b Flow chart of bvp4c With boundary conditions At needle surface u=U∞, v=0, T=Tw,DB∂C∂r+DTT∞∂T∂r=0, and u→U∞, T→T∞, C→C∞ as r→∞. The boundary conditions represent a moving heated thin needle immersed in an unbounded nanofluid. At the needle surface, the temperature is kept constant, and the zero nanoparticle mass flux condition follows Buongiorno’s nanofluid model. Far from the needle, the fluid reaches the ambient velocity, temperature, and concentration, representing the undisturbed free-stream conditions. The similarity transformations are [69] The transformed system of ODEs is Subject to the boundary conditions where the Brownian motion-Nb=τDBC∞v, magnetic parameter-M=σB02ρU∞,Prandtl number-Pr=vα, parameter, thermophoresis parameter-Nt=τDT(Tw−T∞)vT∞, and Schmidt number-Sc=vDB, Lewis number-Le=ScPr and respectively. Methodology Numerical solution The given system of nonlinear differential equations is solved numerically employing the bvp4c solver in MATLAB. To enable its implementation, the higher-order equations are first converted to a system of first-order ordinary differential equations by inserting new variables: y1=f,y2=f′,y3=f′′,y4=θ,y5=θ′,y6=ϕ,andy7=ϕ′. Using these substitutions, the original system is rewritten in first-order form. Furthermore, as the problem is defined over a semi-infinite domain, the interval is truncated to [0,ηmax], where ηmax is chosen sufficiently large to ensure accurate approximation of the boundary conditions at infinity. The numerical procedure involves defining an ODE function corresponding to the transformed first-order system and a boundary condition function that incorporates the prescribed conditions at η=0 and η→∞. An initial mesh and an appropriate initial guess for all variables are generated using bvpinit to facilitate convergence. This is followed by the solution of the problem by bvp4c (Fig. 2) solver which is a collocation solver that uses adaptive mesh refinement. The results of calculating the velocity, temperature and concentration profiles are then extracted and examined and the accuracy of the results checked by mesh refinement and convergence tests. Architecture of the proposed ANN model ANN modeling To enhance predictive performance and minimize computational expenses, numerical outputs of the MATLAB bvp4c solver were used to provide a training set to an ANN with the help of the nftool (Neural Fitting Tool). The data produced by the numerical simulations, consisting of the sampling of the governing parameters, together with their physical responses (skin friction coefficient, temperature, and concentration) was arranged as input-output pairs. The parameters were taken as the dimensionless input and the target outputs were the numbers that were solved. One of the adopted neural network was feedforward with numerous hidden layers because it proved to be very efficient and converged very fast in problems of nonlinear regression [70–72]. The Levenberg–Marquardt (LM) backpropagation algorithm [72, 73] was employed to train the neural network because it was proven to be very efficient and converged very fast in nonlinear regression problems (Fig. 2). Mathematically, the training process would focus on reducing the mean squared error (MSE) of the ANN forecasts and the numerical values, which is expressed as During optimization, the LM algorithm iteratively updates the network weights according to where J represents the Jacobian matrix of errors, e is the error vector, and μ is a damping parameter governing convergence [71, 72]. These primary relations govern the learning tool employed within nftool. In MATLAB, the dataset that was available was automatically divided into the training, validation and testing subsets in order to develop reliable models. Regression plots (R-values) and mean squared error curves as well as error histograms were used as a measure of the performance of the trained network and they, collectively, give an insight into the accuracy and generalization capability. Lastly, the predictions made by ANN were compared with the numerical outcomes of bvp4c using both tabular data and graphical representation. The high correlation between the two sets of findings, with very negligible error values, proves the reliability and success of the suggested hybrid numerical-ANN framework. Table 1. Table 1Performance analysis and convergence statistics of the proposed ANN model during training, validation, and testing processesParameter / DatasetInitial ValueStopped ValueTarget ValueObservationsMSEREpoch081000———Elapsed Time—00:00:00————Performance0.09549.11e-170———Gradient0.3053.21e-091e-07———Mu0.0011e-111e + 10———Validation Checks026———Training———179.6068e-071.0000Validation———41.9679e-051.0000Test———49.6467e-050.9999 Performance analysis and convergence statistics of the proposed ANN model during training, validation, and testing processes Results and discussion The numerical results given in Tables 2–5 show the effects of M, Pr, Nb, Nt, and Sc on the skin friction coefficient (Cfx), Nusselt number (Nux), and Sherwood number (Shx). It is found that the greater the value of M, the bigger the value of Cfx, which in turn means that the smaller the values of Nux and Shx. This is because the magnetic field produces a resistance to the flow of the fluid. Consequently, the heat transfer rate and mass transfer rate will decrease. The Nux is increased by the positive effect of Pr. With the increase of Pr, the Nux also increases, implying greater heat transfer rate. The change is however rather small for the Shx and very small for the Cfx. Nb decreases the Nux and increases the Shx. The higher value of Nb, the more random the movement of the nanoparticles will be within the fluid. This decreases the surface temperature gradient and decreases heat transfer, but increases mass transfer. Nt decreases both the Nux and Shx. An increase in Nt will cause the nanoparticles to be pushed farther away from the heated surface and thus lower the heat and mass transfer rates. In the same way, the value of Cfx continues to be nearly constant. Sc has a strong effect upon the Shx. With an increase in Sc, the Shx value increases significantly, thus intensifying the mass transfer rate. The Nux also rises slightly and there is very little change in Cfx. To validate the present model, M=0 was set. Under this condition, the governing equations become the same as those reported in [69]. The obtained numerical results show excellent agreement with [69], which confirms the accuracy and reliability of the present model. Table 4Comparison of numerical and predicted values of NuxParametersNuxMPrNbNtScNumericalPredicted (ANN)Absolute Error1.110.50.520.2728320.2731425116245570.113810561.210.50.520.2658400.2660560687752950.081277751.310.50.520.2593660.2590855571596960.108126291.410.50.520.2533700.2534930449565480.048563351.510.50.520.2478090.2481987282406120.1572696110.50.50.520.2451130.2462474400791250.462823310.70.50.520.2604080.2611012973315660.26623504110.50.520.2803850.2821126712150520.6161781911.30.50.520.2971250.2973048236871110.0605212211.50.50.520.3067220.3064141381640930.10037162110.20.520.3287090.3288249001096350.03525918110.30.520.3121130.3122921756887080.05740731110.40.520.2960000.2961221453208500.04126531110.50.520.2803850.2821126712150520.61617819110.60.520.2652790.2659855771190370.26635245110.50.120.3465470.3468369781663410.08367643110.50.220.3294700.3297579517103970.08739846110.50.320.3127310.3148122404349410.665505110.50.420.2963610.2966044190470540.08213599110.50.520.2803850.2821126712150520.61617819110.50.510.2782050.2784844952493930.10046378110.50.520.2803850.2821126712150520.61617819110.50.530.2849880.2852166422494210.08022873110.50.540.2895390.2886434658350230.30929656110.50.550.2935970.2936978908222440.03436371 Comparison of numerical and predicted values of Nux Table 2Numerical outcomes for M=Pr=1,Nb=Nt=0.5,Sc=2MPrNbNtScCfxNuxShx1.110.50.52−0.7538100.2728320.5859161.210.50.52−0.7946200.2658400.5815431.310.50.52−0.8328430.2593660.5776911.410.50.52−0.8688060.2533700.5742911.510.50.52−0.9027930.2478090.57128110.50.50.52−0.7100330.2451130.62269310.70.50.52−0.7100330.2604080.608564110.50.52−0.7100330.2803850.59088111.30.50.52−0.7100330.2971250.57679811.50.50.52−0.7100330.3067220.569044110.20.52−0.7100330.3287090.383281110.30.52−0.7100330.3121130.499283110.40.52−0.7100330.2960000.556786110.50.52−0.7100330.2803850.590881110.60.52−0.7100330.2652790.613266110.50.12−0.7100330.3465470.641615110.50.22−0.7100330.3294700.621478110.50.32−0.7100330.3127310.606369110.50.42−0.7100330.2963610.596193110.50.52−0.7100330.2803850.590881110.50.51−0.7100330.2782050.374812110.50.52−0.7100330.2803850.590881110.50.53−0.7100330.2849880.767448110.50.54−0.7100330.2895390.918933110.50.55−0.7100330.2935971.053309 Numerical outcomes for M=Pr=1,Nb=Nt=0.5,Sc=2 Table 5Comparison of numerical and predicted values of ShxParametersShxMPrNbNtScNumericalPredicted (ANN)Absolute Error1.110.50.520.5859160.5864182831471940.085726141.210.50.520.5815430.5821864791101980.110650311.310.50.520.5776910.5805577758437420.496247271.410.50.520.5742910.5762305553909410.337730421.510.50.520.5712810.5738539131724480.4503761110.50.50.520.6226930.6204642601537660.3579195310.70.50.520.6085640.6073971880138480.19173201110.50.520.5908810.5822347460374201.4632817711.30.50.520.5767980.5805305532314200.6471161911.50.50.520.5690440.6005198080522905.53134873110.20.520.3832810.3835067908004810.05890999110.30.520.4992830.4997124869252030.08602074110.40.520.5567860.5576027941139750.14669803110.50.520.5908810.5822347460374201.46328177110.60.520.6132660.6150477511543360.2905348110.50.120.6416150.6414988348080790.01810512110.50.220.6214780.6215152403204170.00599222110.50.320.6063690.6136384506084791.19884932110.50.420.5961930.5973604720014090.19582115110.50.520.5908810.5822347460374201.46328177110.50.510.3748120.3772378985032290.64723075110.50.520.5908810.5822347460374201.46328177110.50.530.7674480.7678228542390950.04884425110.50.540.9189330.9143296157887910.50094884110.50.551.0533091.053091734408320.02062696 Comparison of numerical and predicted values of Shx The numerical results are matched with the results predicted by the ANN model in Tables 3 to 5. The errors in all cases are very small and the predicted values are very close to the numerical values. This indicates that the ANN model is capable to forecast the current flow problem accurately and reliably. The velocity and temperature profiles of the nanofluid flow past thin needle due to the effect of M are presented in Figs. 3 and 4, respectively. The velocity is seen to be decreasing as the M increases. This is because of the fact that the magnetic field generates a resistance to fluid flow. The opposite trend is true, however, with increasing values of M, the temperature profile increases. If the fluid motion slows down, more heat is generated within the fluid, thus increasing the fluid temperature. The impact of key parameters on the temperature profile is displayed in Figs. 5–9. The Prandtl number is varied to represent different engineering fluids with different thermal diffusivities and to investigate its influence on the heat transfer characteristics of the nanofluid. An increment in values of Pr corresponds to a decrease in temperature. This indicates that the higher the Pr the slower the spread of heat in the fluid. However, the temperature profile increases with enhancing Nb and Nt. The greater the Brownian motion, the better the fluid will move the nanoparticles and the better the fluid will distribute heat. Similarly, the thicker the thermal boundary layer, the greater the temperature will be, which can be achieved by increasing the value of Nt for moving nanoparticles away from the heated surface. Contrarily, the temperature profile is lowered by increasing the Sc. Table 3Comparison of numerical and predicted values of CfxParametersCfxMPrNbNtScNumericalPredicted (ANN)Absolute Error1.110.50.52−0.753810−0.7536220894789610.0249281011.210.50.52−0.794620−0.7943109955218000.0388870751.310.50.52−0.832843−0.8312343160287690.1931557291.410.50.52−0.868806−0.8678929767588440.1050894261.510.50.52−0.902793−0.9016153486917220.1304453310.50.50.52−0.710033−0.7104330229344560.0563386410.70.50.52−0.710033−0.7101032149076360.009888964110.50.52−0.710033−0.7103176307658720.04008697711.30.50.52−0.710033−0.7097100557123140.04548299711.50.50.52−0.710033−0.7105394407689260.071326371110.20.52−0.710033−0.7101796576431690.020655046110.30.52−0.710033−0.7101390412811060.014934698110.40.52−0.710033−0.7097177770741600.044395532110.50.52−0.710033−0.7103176307658720.040086977110.60.52−0.710033−0.7101485247462830.016270335110.50.12−0.710033−0.7101177929631560.011942116110.50.22−0.710033−0.7100095363210890.00330459110.50.32−0.710033−0.7088836915259180.16186691110.50.42−0.710033−0.7097939584942540.033666253110.50.52−0.710033−0.7103176307658720.040086977110.50.51−0.710033−0.7096723519659920.050793137110.50.52−0.710033−0.7103176307658720.040086977110.50.53−0.710033−0.7096808350177930.049598396110.50.54−0.710033−0.7099667167736470.009335232110.50.55−0.710033−0.7098424997512110.026829774 Comparison of numerical and predicted values of Cfx Effect of variations of 𝑀 on velocity field Effect of variations of M on temperature field Effect of variations of Pr on temperature field Impact of certain values of Nt on temperature field Impact of various values of Pr on concentration field Effect of variations of Nb on temperature field Effect of variations of Nb on concentration field Overall, these results show that the temperature of the nanofluid depends on the combined effects of the magnetic field, heat diffusion, and nanoparticle motion. By changing the values of M, Pr, Nb, Nt, and Sc, the temperature distribution inside the fluid can be controlled. This may be useful in designing engineering systems where better heat transfer and temperature control are needed. The concentration profiles obtained for the various parameters are illustrated in Figs. 10–13 respectively. It is found that the concentration profile increases with the increase of Pr slightly. But the concentration is lower with higher Nb. This is because of the concentration boundary layer thickness is reduced by stronger random motion of nanoparticles. Increasing Nt will involve higher concentration profile as more number of nanoparticles will be moved from the hot surface to the cooler fluid region. Last, the concentration profile becomes sharply decreasing with growing Sc as the larger the value of Sc the smaller the mass diffusion inside the fluid. Impact of certain values of Nt on concentration profile a Isothermal lines for variations of M. b Isothermal lines for variations of Nb. c Isothermal lines for variations of Nt. d Isothermal lines for variations of Pr. e Isothermal lines for variations of Sc. Effect of variations of Sc on temperature field Effect of variations of Sc on concentration field The increase in M raises the Cfx because the magnetic field creates more resistance to the fluid flow, which increases the force acting on the needle surface. However, it reduces Nux and Shx because the heat and mass transfer from the surface become weaker. On the other hand, increasing Pr improves the heat transfer rate by reducing the thermal boundary layer, while increasing Sc improves the mass transfer rate by reducing mass diffusion and increasing the concentration gradient near the surface. Different physical parameters are shown as contours of temperature (isothermal lines) in fig. 13(a-e). These contour lines show how temperature changes inside the fluid flow region. It can be seen that the temperature is highest near the needle surface and gradually decreases away from the surface. The contour lines are closer near the surface, which shows that the temperature changes rapidly in that region. Figure 13(a) shows the effect of 𝑀. It is noted that the temperature increases when the magnetic parameter increases. This happens because the magnetic field slows down the fluid motion and produces more heat inside the fluid. As a result, the thermal boundary layer becomes thicker. Figures 13(b, c) show the effects of 𝑁𝑏 and 𝑁𝑡. In both cases, the temperature inside the fluid increases when the parameter values increase. Stronger Brownian motion increases the random movement of nanoparticles, while thermophoresis moves nanoparticles from the hot surface toward the cooler fluid region. Both effects improve heat distribution inside the fluid. Figure 13(d) presents the effect of 𝑃𝑟. It is noticed that the temperature decreases when 𝑃𝑟 increases. This means that heat spreads more slowly in the fluid at higher values of 𝑃𝑟. Therefore, the thermal boundary layer becomes thinner. Figure 13(e) shows the effect of 𝑆𝑐. It can be observed that the temperature decreases slightly with increasing 𝑆𝑐. Larger values of 𝑆𝑐 reduce mass diffusion, which weakens the movement of nanoparticles and slightly lowers the temperature inside the fluid. Overall, the contour plots clearly show how heat spreads inside the fluid for different parameter values. Wider temperature contours indicate that heat spreads over a larger region, while closer contours indicate that the temperature changes more quickly near the needle surface. These results help explain how the governing parameters control the heat transfer in the fluid. Figures 14a–g show the performance of ANN model utilized in this study. These figures explain howaccurately the ANN model learns the data and predicts the required results. Figure 14(a) shows the trainingprocess of the ANN model. It is observed that the gradient value becomes very small at epoch 8, whichmeans the network training is completed successfully. The value of 𝜇 also decreases during the training process, which shows that the model becomes more stable and accurate. The validation checks also showthat the ANN model works properly without instability. Figure 14(b) presents the validation performanceof the ANN model. The graph displays that the error becomes very small during training. The bestperformance is achieved at epoch 6. The training, validation, and testing curves remain close to each other, which means the ANN model gives reliable and accurate predictions. Figure 14(c) shows the regressionplots for training, validation, testing, and overall data. The values of the correlation coefficient (𝑅) are veryclose to 1 in all cases. This means that the predicted values are almost the same as the actual values.Therefore, the ANN model predicts the results very accurately. Figure 14(d) shows the error histogram ofthe ANN model. Most of the error values are close to zero. This means that the difference between theactual results and predicted results is very small. Hence, the ANN model is highly accurate and reliable. Figures 14e–g compare the actual numerical results with the ANN predicted values for the 𝐶𝑓𝑥 , 𝑁𝑢𝑥, and 𝑆ℎ𝑥, respectively. It can be observed that the predicted lines are almost the same as the actuallines. This close agreement endorses that the ANN model can effectively forecast the flow, heat transfer,and mass transfer performance of the current nanofluid problem. a Training of ANN model. b Performance curve. c Regression curve. d Error Histogram. e Comparison of 𝐶𝑓𝑥 values. f Comparison of Nux values. g Comparison of Sh𝑥 values The present results may help in designing biomedical needles, where good control of fluid flow and temperature is needed. They may also be useful in MEMS devices, electronic cooling, and wire cooling systems by improving heat transfer and temperature control. These findings can also be applied to other engineering systems that use nanofluids for better thermal performance. Conclusions In the current study, the MHD nanofluid flow over a thin needle was examined employing the Buongiorno nanofluid model. The influences of certain pertinent parameters on fluid velocity, temperature, concentration, heat transfer, and mass transfer were considered. ANN systems were also used to forecast the results. The key conclusions of the study are given below: The velocity profile decreases with increasing M. The velocity profile decreases with increasing M. The temperature profile increases with increasing M, Nb, and Nt, but decreases with increasing Pr and Sc. The temperature profile increases with increasing M, Nb, and Nt, but decreases with increasing Pr and Sc. The concentration profile increases with increasing Nt, but decreases with increasing Nb and Sc. The concentration profile increases with increasing Nt, but decreases with increasing Nb and Sc. Increasing M increases Cfx but decreases the heat and mass transfer rates. Increasing M increases Cfx but decreases the heat and mass transfer rates. The heat transfer rate increases with increasing Pr, while the mass transfer rate increases with increasing Sc. The heat transfer rate increases with increasing Pr, while the mass transfer rate increases with increasing Sc. The ANN results are very close to the numerical results, with very small prediction errors. The ANN model accurately predicts Cfx, Nux, and Shx. The ANN results are very close to the numerical results, with very small prediction errors. The ANN model accurately predicts Cfx, Nux, and Shx. Future work may consider more advanced fluid models, additional physical effects, and improved machine learning methods to further increase the accuracy and practical use of the proposed model. Future work may consider more advanced fluid models, additional physical effects, and improved machine learning methods to further increase the accuracy and practical use of the proposed model. Acknowledgements The authors extend their appreciation to Northern Border University, Saudi Arabia, for supporting this work through project number (NBU-FFR-2026-2225-05). Nomenclature Coordinate along the needle surface (m) Radial coordinate normal to the needle surface (m) Axial velocity component (ms−1) Radial velocity component (ms−1) Free stream velocity far from the needle (ms−1) Fluid temperature (K) Temperature at the needle surface (K) Ambient temperature (K) Nanoparticles concentration (kgm−3) Nanoparticles concentration at the needle surface (kgm−3) Ambient concentration (kgm−3) Similarity independent variable (Dimensionless) Stream function (Dimensionless) Axial velocity (Dimensionless) Temperature (Dimensionless) Nanoparticle concentration (Dimensionless) Kinematic viscosity of the base fluid m2s−1 Thermal diffusivity of the base fluid m2s−1 Brownian diffusion coefficient m2s−1 Thermophoretic diffusion coefficient m2s−1 Density of base fluid (kgm−3) Electrical conductivity of the fluid (Sm−1) Applied magnetic field strength (T) Magnetic parameter (Dimensionless) Prandtl number (Dimensionless) Brownian motion parameter (Dimensionless) Thermophoresis parameter (Dimensionless) Schmidt number (Dimensionless) Lewis number (Dimensionless) Local skin friction coefficient (Dimensionless) Local Nusselt number (Dimensionless) Local Sherwood number (Dimensionless) Numerical value of output i (Dimensionless) ANN predicted value of output i (Dimensionless) Mean squared error (Dimensionless) Total number of data samples (Dimensionless) Weight matrix at iteration k (Dimensionless) Damping parameter (Dimensionless) Jacobian matrix of errors (Dimensionless) Error vector (Dimensionless) Identity matrix (Dimensionless) Author contributions H. Ali: Writing – review & editing, Writing – original draft, Visualization, Validation, Supervision, Software, Resources, Project administration, Methodology, Investigation, Formal analysis, Conceptualization. A. Majeed: Writing – review & editing, Writing – original draft, Validation, Supervision, Data analysis. S. Taoufik: Writing – review & editing, Methodology, Writing – original draft, Supervision, Software, Resources. P. Ali: Formal analysis, Physical interpretation of results, Investigation, Methodology. Data availability The datasets used and/or analysed during the current study available from the corresponding author on reasonable request. Declarations 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. Contributor Information Aaqib Majeed, Email: aaqibmajeed.math@tuf.edu.pk. Taoufik Saidani, Email: Taoufik.Saidan@nbu.edu.sa. References Associated Data Data Availability Statement The datasets used and/or analysed during the current study available from the corresponding author on reasonable request.