Performance and application analysis of ANFIS artificial intelligence for pressure prediction of nanofluid convective flow in a heated pipe

Heat transfer augmentation of the nanofluids is still an attractive concept for researchers due to rising demands for designing efficient heat transfer fluids. However, the pressure loss arisen from the suspension of nanoparticles in liquid is known as a drawback for developing such novel fluids. Therefore, prediction of the nanofluid pressure, especially in internal flows, has been focused on studies. Computational fluid dynamics (CFD) is a commonly used approach for such a prediction of fluid flow. The CFD tools are perfect and precise in prediction of the fluid flow parameters. But they might be time-consuming and expensive, especially for complex models such as 3-dimension modeling and turbulent flow. In addition, the CFD could just predict the pressure, and it is disabled for finding the relationship of such variables. This study is intended to show the performance of the artificial intelligence (AI) algorithm as an auxiliary method for cooperation with the CFD. The turbulent flow of Cu/water nanofluid warming up in a pipe is considered as a sample of a physical phenomenon. The AI algorithm learns the CFD results. Then, the relation between the CFD results is discovered by the AI algorithm. For this purpose, the adaptive network-based fuzzy inference system (ANFIS) is adopted as AI tool. The intelligence condition of the ANFIS is checked by benchmarking the CFD results. The paper outcomes indicated that the ANFIS intelligence is met by employing gauss2mf in the model as the membership function and x, y, and z coordinates, the nanoparticle volume fraction, and the temperature as the inputs. The pressure predicted by the ANFIS at this condition is the same as that predicted by the CFD. The artificial intelligence of ANFIS could find the relation of the nanofluid pressure to the nanoparticle fraction and the temperature. The CFD simulation took much more time (90–110 min) than the total time of the learning and the prediction of the ANFIS (369 s). The CFD modeling was done on a workstation computer, while the ANFIS method was run on a normal desktop.

The improvement of the thermophysical properties of the operating fluids is known as a way for the efficiency augmentation of the heat exchangers being employed in different industrial applications such as oil and gas industry. Using nanofluids (NFs) has been introduced for decades as such an improvement in heat transfer where these fluids have significant applications 1 . The dynamic viscosity and the thermal conductivity of the base fluids are influenced by the suspension of particular nanoparticles with designed shape and size. There are a number of studies have shown the conductivity and viscosity increase of the NFs by the nanoparticle concentrations 2-4 . Mahbubul et al. 3 reviewed the experimental investigations about the nanofluids viscosity. They reported that viscosity is enhanced by the increment of volume concentration and is deteriorated by increasing the temperature. Abulhassan et al. 5 carried out an investigation on the evaluation of the viscosity of Titania nanotubes ethylene glycol/water-based nanofluid. They believe that the nanofluid's thermophysical properties must be assessed based on the nanoparticle concentration and the base fluid temperature. According to the literature pertaining to NFs, although the heat transfer possessed the potential of enhancement by the NFs, the more pressure is lost by the nanoparticles fraction. Moghanlou et al. 6 conducted a systematic experimental-based work on the nanofluid heat transfer in a mini channel. They also considered the pressure drop in NFs. They revealed the increment of heat transfer by 9.30 and 4.56% for 0.5% volume fraction of Al 2 O 3 -water and TiO 2 -water, respectively. More pressure loss than water was also reported for both nanofluids. In 7 , a similar study was carried out on the nanofluid convective flow in channels. According to their results, heat transfer as well as pressure loss rose by improving the nanoparticles volume fraction in the NF. So, the prediction of the changes in the nanofluid pressures in internal flows such as pipes and channels are important as a case for investigation. The computational fluid dynamics (CFD) tools have been widely employed by studies [8][9][10] . For example, Behroyan et al. [11][12][13] performed a comprehensive numerical investigation on different two-phase and single-phase CFD for modeling convective flow of NFs. They found that the single-phase model considering the Brownian model in thermal conductivity and the Lagrangian two-phase model shows the closest predictions to the experimental data. Garoosi et al. 1 used the CFD tool for modeling a heat exchanger working with nanofluids. Bhatti et al. 14 mathematically modeled MHD nanofluid flow through a porous cylinder pondering the chemical reaction. It was shown that the chemical reaction parameter possessed a substantial influence on increasing the nanoparticle concentration profile. A similar study on MHD nanofluid flow through horizontal parallel plates was carried out and reported in 15 . It was corroborated by their study that as the magnetic parameter and nanoparticle concentration increase, the nanofluid speed declines, while the temperature profile increases. Reddy et al. 16 modeled the thermal and hydrodynamic parameters of Williamson nanofluid flow over a stretching sheet. The numerical results showed that by enhancing the magnetic field, the velocity profiles decrease. However, the temperature and nanoparticle concentration profiles rise.
The CFD methods could effectively and accurately predict the pressure of the nanofluid flows in different circumstances. However, it could be expensive and time-consuming, especially in 3-dimension modeling and turbulent flow. In addition, CFD modeling alone could predict the pressure. An auxiliary method is required to find the relationship of the pressure to its effective parameters, including nanoparticle fraction and the temperature. Recently the Artificial Intelligence (AI) algorithm has shown some helps to tackle the CFD modeling difficulties in complicated cases [17][18][19][20][21][22][23] . The CFD results could be learned by the AI algorithm. Then, the AI algorithm could understand the logical behavior of the targeted variables with the changes in the boundary conditions, fluid properties, etc. For example, Babanezhad et al. 24 used the AI algorithm of the adaptive network in combination with the fuzzy inference system (ANFIS) for prediction of gas/liquid interaction of two-phase bubbly flow in a column reactor. They reported 17 high compatibility between the ANFIS and CFD outputs. The authors employed the ANFIS simulations in the combination with the Lagrangian CFD approach for particle tracking in a cavity. They claimed that using the ANFIS method could cause faster computational activities. However, there Scientific Reports | (2021) 11:902 | https://doi.org/10.1038/s41598-020-79628-w www.nature.com/scientificreports/ is not any data to compare the calculation time of the CFD and the ANFIS. This approach is in the first step of investigations. There is not any study to use the AI algorithms for developing the relationship between the CFD results. Besides, a comparison between the computational performance of the CFD and the AI algorithms does not exist. For filling such gaps, this research is intended to establish the adaptive network-based fuzzy inference system (ANFIS) as an auxiliary tool to collaborate with the CFD approach. For this purpose, the intelligence of the ANFIS is investigated and verified by the validated CFD results. The relationship of pressure with the nanoparticles fraction and the fluid temperature is founded. The computational performance and requirements of the CFD are compared with the ANFIS.

Methodology
CFD technique. In this investigation, ANSYS FLUENT V.16.1 software as a commercial package was appropriately applied on the basis of finite volume technique (FVT) to build the mechanistic model and run the simulations. In terms of the employed boundary conditions of model, constant heat flux was postulated for the walls, and uniform velocity and temperature were assumed for the inlet of the considered geometry. According to the above-mentioned employed boundary conditions, 3-D governing equations are derived for the momentum/heat transfers as below 25-27 : Continuity equation: Momentum equation: Energy equation: The k − ε turbulence model is known as a well-known model applied in this study to compute the energy dissipation rate (ε) , eddy viscosity, and kinetic energy (k) of turbulency as follows 12,13,25,28 : Nanofluid properties. In this work, a nanofluid constitutes of water as base fluid and copper (Cu) nanoparticles is simulated. All correlations being used in this study for calculation of the Cu/water NF properties are given in Table 1. User Defined Function (UDF) codes were developed for temperature-dependent conductivity (Brownian motion of nanoparticle) and it was added to ANSYS-FLUENT CFD code to complete the simulations.
Numerical method and grid test. This study has employed the numerical procedures of the Ansys Fluent CFD package of, V19. The Fluent works according to the finite volume technique (FVT). As discretization procedure, the 2nd order upwind technique is employed in the computations. SIMPLE coupling method was Table 1. Cu/water properties used in the simulations 12,13 .

Properties Equation
Density Brownian motion velocity of nanoparticles : πµ bf dp 2 Scientific Reports | (2021) 11:902 | https://doi.org/10.1038/s41598-020-79628-w www.nature.com/scientificreports/ adopted to link velocity and pressure. For the meshing process, design modeller toolbox in Ansys has been applied to construct the computational mesh. The mesh independence test was implemented for two sets of grid arrangements (i.e., 4473 nodes, and 5378 nodes). Comparing the mesh configurations, in terms of the velocity profile, the relative deviations were less than 0.05% (Fig. 1). Hence, the first grid case has been opted for the current investigation.
Validation test. For validation of the CFD outcomes, the estimated Nusselt values in this work are compared with the achieved measured data from the literature ( Table 2). The results show a good agreement with a maximum of 12% deviation.

ANFIS.
Soft computing approaches or intelligent algorithms have extensive utilization to predict the physical phenomena in industries and academia. Such techniques have the capability of learning physics and simulating the phenomena via its language. Its structure can be established based on the needed demands and evaluations. The current study deals with a learning framework for understanding the current data and defining an ANFIS pattern according to the information for predicting the non-present data in the considered specific data package. We created a novel set up data for estimation in the final phase of code development. Former papers 29,30 developed this phase for predicting the fluid properties. ANFIS method is explained as the learning stage of fuzzy system decisions and neural networks. Presently, in ANFIS pattern, the 1 st order Sugeno was implemented to represent 32 fuzzy rules: Figure 2 represents the logical system for the Sugeno model within the ANFIS structure. The ANFIS structure is included the number of membership functions (MFs) and rules in the inputs, the hidden layer, and the output. No. of clusters equals 2 for each input in this model. So, 2 membership functions (MF) are considered for each input and each function is in relation to the other functions of the other inputs. So, totally the number of rules and membership functions for the hidden layer and output is equal to 32 (i.e., 2 5 ). According to Fig. 2, ANFIS topology is comprised of 5 strands in which outputs of each node are calculated. Considering the output of each layer in the ANFIS network, the following layers functions of this network could be explained:  It is approximately corresponding to determine the neural nodes in the ANFIS model with similar layer. The output function of Ŵ th node in layer one is denoted by the Q(l, Ŵ) as: Layer one: The neural nodes are of adaptive type, and the bell function is utilized due to the considerable robustness for generalization of nonlinear parameters to estimate the interface as: Furthermore, a Ŵ , b Ŵ , c Ŵ denote a group of variables. This type of function has a changing role in terms of the number of adjustments for different parameters. Therefore, this function possesses the potential to cover some operational types for fuzzy functions of group A.
Layer 2: The function output can be expressed as: Layer 3: In this layer of ANFIS, the smart junctions cannot be altered, and the output can be obtained as: The outputs of this layer are known as normalized discharge abilities for greater accessibility. Layer 4: The function may be expressed as: n Ŵ , o Ŵ , p Ŵ , q Ŵ , r Ŵ , s Ŵ denote a set of parameters within the node. Layer 5: total value of outputs are calculated by this neural mesh as: Operative inputs are established to reach level 4. To re-colonize the resulting factors, the least-squares are predicted. The error value has a backward movement in the backward pass. Using the premise factors, a gradient is descended.

Results and discussion
The use of the nanofluids instead of their base fluids is a deal between the heat transfer and the pressure loss. The solid particles dispersion inside the base fluids could lead to the change of the thermo-physical specifications like viscosity and thermal conductivity. Although the thermal conductivity increment could be considered as an advantage, the increase of the dynamic viscosity is a drawback. The more thermal conductivity, the more heat transfer. But the more viscosity, the more pressure is lost along the pipe, and the more pumping power is needed. So, the pressure of nanofluids in wall-bounded flow has a crucial role. The nanofluids pressure is significantly related to the viscosity. The viscosity, in turn, depends on the nanoparticles fraction and the fluid temperature.
The CFD method could predict the flow characteristics, but this approach lacks the ability to find the connection between the fluid flow parameters. The potential of Artificial Intelligence (AI) algorithms could be used for developing a relation between the pressure of the nanofluid and its temperature and particle fraction in any position of the flow domain. The present paper tries to predict the pressure of a Cu/water flow in a pipe under constant wall heat transfer, and turbulent regime. The prediction, at first, is done by the CFD tool. Table 3 illustrates the simulation cases, assumptions, and the CFD method considered in this paper. The CFD outcomes are validated with the experimental data from the literature. Then, 75% of the CFD results are learned by the ANFIS, as the AI algorithm. The ANFIS predicts the whole CFD results, and the precision of the ANFIS predictions would be checked by comparison with the CFD. The intelligence of the ANFIS method is also tested by tuning different factors (x, y, z, nanoparticle content, and temperature) and various MF types.  Figs. 3a,b,4a,b, no variations are seen in histogram curves by changing the types of MF. For 2 inputs, the errors are distributed between ± 1000, while this distribution is between ± 100 for 3 inputs. As the number of inputs enhances from 2 to 3, the MSE declines from 175,550 to 1334, while the R gets closer to 1 (~ 0.996). Albeit, according to Figs. 5a,b, considering one more input (i.e., nanoparticle volume fraction), the domain of the error distribution decreases significantly (i.e., a maximum of ± 1.5), the MSE is decreased below 0.2, while the R value is still around unity. In this case, histogram curves are also sensitive to the type of membership function. For 4 inputs, gauss2mf shows the error distribution much closer to zero. The peak of the histogram curve of gauss2mf (i.e., 40 data) is higher than that of the other membership functions (i.e., 35 data). In addition, gauss2mf represents the minimum MSE (~ 0.0007). Although the best intelligence of the ANFIS is verified by 4 inputs and gauss2mf, the nanofluid temperature is considered as the fifth input as it is required for developing the pressure correlation. As Figs. 6a,b show, similar results to Fig. 5 are obtained and no changes in the histogram curves or in other words, in the intelligence of the ANFIS are found by 5 inputs.
The intelligence of ANFIS is confirmed, as shown in Fig. 7, where the correlation coefficient (R) is about 1 for five inputs and the membership function of gauss2mf.
According to Eq. (18), the pressure correlation is obtained once the Gaussian 2 function (µ) and the ANFIS factors (o, p, q, r, and s) are calculated. Table 4 represents the Gaussian 2 membership functions and their parameters (i.e., c1, σ1, c2, and σ2). After finding the required intelligence, the values of the Gaussian 2 parameters (Table 5) and the consequent parameters (Table 6) are found. As mentioned before and on the basis of Fig. 8, there are ten MF, and 32 rules and MF for the output and hidden layers. Figure 9 illustrates the membership functions versus each input. So, the horizontal axis shows the input domain, while the vertical axis illustrates the degree of each membership function. Afterward, the pressure of the nanofluid could be found in the pipe domain for each temperature and nanoparticle fraction. It means that there is no need for complex CFD calculations. Figure 10 illustrates the changes in the pressure versus each input. At first glance, there is a great agreement between the predicted pressures by both ANFIS and CFD. As be expected, no pressure changes are seen for the same cross-section planes (Figs. 10a,b). The pressure decreases in z-direction along the tube length (Fig. 10c). The pressure increases by the nanoparticle fraction (Fig. 10d) and decreases by the temperature (Fig. 10e).  Fig. 11, the CFD solution was converged when the scaled residual of the algebraic equations of the continuity, the velocity components, the energy and the turbulent kinetic energy (k), and the turbulent dissipation rate (ε) would be less than 10 -6 . The performance of the CFD and the ANFIS are given in Tables 7  and 8, respectively, for a comparison between both methods in the case of the computational efforts. For the CFD modeling, the convergence requirements are satisfied for around 700 iterations in each simulation. Every  www.nature.com/scientificreports/ simulation takes around 90-110 min. However, for the ANFIS method, the learning and the prediction times together for all types of the membership function is less than 369 s. It should be noted that the CFD modeling was done on a workstation computer, while the ANFIS method was run on a normal desktop. Table 9 illustrates the computer configurations using in this study. So, using the artificial intelligence approach in cooperation with the CFD approach could save time and expenses.
In which:

Conclusions
The nanofluid flow characteristics such as thermal conductivity and dynamic viscosity are influenced by the nanoparticles fraction in the whole volume of the base fluids. The pressure is one of the important flow parameters for pressure drop determination. The nanoparticle volume fraction, in turn, could highlight the impact of thermal conductivity on the temperature distribution. The temperature also affects the viscosity, and it is followed by the changes in the pressure. So, the pressure could be a function of the nanoparticle fraction and the temperature of the fluid flow. The computational fluid dynamics (CFD) approach is able to predict such changes. But this approach faces two main weak points. The former is the inability of the CFD in finding the connection of the pressure to the nanoparticle fraction and the temperature. The latter is related to the efforts and expenses relating to the simulation time and infrastructures. The idea of this study was to improve the CFD shortages by establishing an auxiliary method. Thus, the artificial intelligence algorithm was introduced and investigated for such purposes. The anticipation of Cu/water in a heated wall pipe was considered as a sample case. Primarily, the nanofluid was simulated using the finite volume method of the CFD tool. The CFD results were verified with the experiment from the literature. Then, the CFD results were learned by ANFIS as the artificial intelligence algorithm. The ANFIS could capture the pattern of the pressure changes of the nanofluid by the position (i.e., x, y, and z), the particle content, and the temperature.
The intelligence of the ANFIS method was examined by different inputs and different membership function types (i.e., gbellmf, gaussmf, gauss2mf, dsigmf, psigmf). The ANFIS was compared with the CFD regarding the accuracy of the prediction and performance. The following results have been achieved from this study: • For 5 inputs and the membership function of the Gauss2mf, the histogram graphs of the sensitivity analysis showed the error distribution and the correlation coefficient close to 0 and 1, respectively. • The artificial intelligence of ANFIS could predict the pressure with the same values of the CFD prediction.
• The artificial intelligence of ANFIS could find the relation of the nanofluid pressure to the nanoparticle fraction and the temperature. The CFD simulation could be replaced by such a correlation. • Every CFD simulation took around 90-110 min. However, for the ANFIS method, the learning and the prediction times together for all types of the membership function was less than 369 s. The CFD modeling was done on a workstation computer, while the ANFIS method was run on a normal desktop. • So, using the artificial intelligence approach in cooperation with the CFD approach could save time and expenses.