## Introduction

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 applications1. 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 concentrations2,3,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 Al2O3–water and TiO2–water, respectively. More pressure loss than water was also reported for both nanofluids. In7, 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 studies8,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 in15. 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 cases17,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 reported17 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 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 below25,26,27:

Continuity equation:

$$\nabla \cdot \left( {\rho_{f} V} \right) = 0$$
(1)

Momentum equation:

$$\nabla .\left({\rho }_{f}VV\right)=-{\nabla }_{p}+\nabla .\tau$$
(2)

Energy equation:

$$\nabla .\left({\rho }_{f}V{C}_{p.f}T\right)=\nabla .\left({k}_{f}\nabla T-{C}_{p.f{\rho }_{f}}\overline{VT}\right)$$
(3)

The $$k-\varepsilon$$ turbulence model is known as a well-known model applied in this study to compute the energy dissipation rate $$(\varepsilon )$$, eddy viscosity, and kinetic energy $$(k)$$ of turbulency as follows12,13,25,28:

$$\nabla .(\rho kV) = \nabla .[(\frac{{\mu_{t} }}{{\sigma_{k} }})\nabla (k)] + G_{k} - \rho \varepsilon$$
(4)
$$\nabla .(\rho \varepsilon V) = \nabla .[\frac{{\mu_{t} }}{{\sigma_{\varepsilon } }}\nabla \varepsilon ] + \frac{\varepsilon }{k}(C_{1\varepsilon } G_{k} - C_{2\varepsilon } \rho \varepsilon )$$
(5)
$$G_{k} = \mu_{t} (\nabla V + (\nabla V)^{T} ), \, \mu_{t} = \rho C_{\mu } \frac{{k^{2} }}{\varepsilon }$$
(6)
$$C_{\mu } = 0.09,\sigma_{k} = 1.00,\sigma_{\varepsilon } = 1.30,C_{1\varepsilon } = 1.44,C_{2\varepsilon } = 1.92$$
(7)
$$k_{t} = \frac{{C_{p} \mu_{t} }}{{\Pr_{t} }}, \, \Pr_{t} = 0.8$$
(8)

### 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 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 1st order Sugeno was implemented to represent 32 fuzzy rules:

$${\text{if x is A}}_{{1}} {\text{and y is C}}_{{1}} \quad \varpi_{1} = \kappa_{1} x + q_{1} y + r_{1}$$
(9)
$${\text{if x is A}}_{{2}} {\text{and y is C}}_{{2}} \quad \quad \varpi_{2} = \kappa_{2} x + q_{2} y + r_{2}$$
(10)
$$\ldots {\text{and if x is A}}_{{{32}}} {\text{and y is C}}_{{{32}}} \quad \quad \varpi_{32} = \kappa_{32} x + q_{32} y + r_{32}$$
(11)

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., 25). 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 $${\Gamma }^{th}$$ node in layer one is denoted by the $$Q\left( {l,{\Gamma }} \right)$$ as:

$$\begin{gathered} Q_{{1,{\Gamma }}} = \mu_{{A_{1} {\Gamma }}} \left( x \right),{\Gamma } = 1,2 \hfill \\ Q_{{1,{\Gamma }}} = \mu_{{A_{2} {\Gamma } - 2}} \left( x \right),{\Gamma } = 3,4 \hfill \\ \ldots {\text{ and}}\,\,Q_{{1,{\Gamma }}} = \mu_{{A_{5} {\Gamma } - 8}} \left( x \right),{\Gamma } = 9,10 \hfill \\ \end{gathered}$$
(12)

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:

$$\mu A\left( x \right) = \frac{1}{{1 + (\frac{{x - c_{{\Gamma }} }}{{a_{{\Gamma }} }})^{{2b_{{\Gamma }} }} }}$$
(13)

Furthermore, $${a}_{\Gamma },{b}_{\Gamma },{c}_{\Gamma }$$ 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:

$$Q_{{2,{\Gamma }}} = \omega_{{\Gamma }} = \mu_{{A_{1} {\Gamma }}} \left( X \right)\mu_{{A_{2} {\Gamma }}} \left( Y \right)\mu_{{A_{3} {\Gamma }}} \left( Z \right)\mu_{{A_{4} {\Gamma }}} \left( \varphi \right)\mu_{{A_{5} {\Gamma }}} \left( T \right),{\Gamma } = 1,2, \ldots ,32$$
(14)

Layer 3: In this layer of ANFIS, the smart junctions cannot be altered, and the output can be obtained as:

$$Q_{{3,{\Gamma }}} = \overline{\omega }_{{\Gamma }} = \frac{{\omega_{{\Gamma }} }}{{\omega_{1} + \omega_{2} + \omega_{3} + \omega_{4} + \omega_{5} }},{\Gamma } = 1,2, \ldots ,32$$
(15)

The outputs of this layer are known as normalized discharge abilities for greater accessibility.

Layer 4: The function may be expressed as:

$$Q_{{4,{\Gamma }}} = \overline{\omega }_{{\Gamma }} \varpi_{i} = \overline{\omega }_{{\Gamma }} \left( {n_{{\Gamma }} X \times o_{{\Gamma }} Y \times p_{{\Gamma }} Z \times q_{{\Gamma }} \varphi \times r_{{\Gamma }} T \times s_{{\Gamma }} } \right)$$
(16)

$$n_{{\Gamma }} ,o_{{\Gamma }} ,p_{{\Gamma }} ,q_{{\Gamma }} ,r_{{\Gamma }} ,s_{{\Gamma }}$$ denote a set of parameters within the node.

Layer 5: total value of outputs are calculated by this neural mesh as:

$$Q_{{5,{\Gamma }}} = \mathop \sum \limits_{{\Gamma }} \overline{\omega }_{{\Gamma }} \varpi_{{\Gamma }} = \frac{{\mathop \sum \nolimits_{{\Gamma }} \omega_{{\Gamma }} \varpi_{{\Gamma }} }}{{\mathop \sum \nolimits_{{\Gamma }} \omega_{{\Gamma }} }}$$
(17)

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.

Figures 3,4,5 and 6 show the intelligence examinations of the ANFIS. The results are shown by the histogram curves (i.e., normal distribution of error) and their corresponding mean standard error (MSE) and correlation coefficient (R) values. According to 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).

According to 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 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.

$$Pressure = \frac{{\mathop \sum \nolimits_{i = 1}^{2} \mathop \sum \nolimits_{j = 1}^{2} \mathop \sum \nolimits_{k = 1}^{2} \mathop \sum \nolimits_{l = 1}^{2} \mathop \sum \nolimits_{m = 1}^{2} \left( {\mu_{1i} \times \mu_{2j} \times \mu_{3k} \times \mu_{4l} \times \mu_{4m} } \right) \times \left( {n_{m} X \times o_{m} Y \times p_{m} Z \times q_{m} \varphi \times r_{m} T \times s_{m} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{2} \mathop \sum \nolimits_{j = 1}^{2} \mathop \sum \nolimits_{k = 1}^{2} \mathop \sum \nolimits_{l = 1}^{2} \left( {\mu_{1i} \times \mu_{2j} \times \mu_{3k} \times \mu_{4l} \times \mu_{4m} } \right)}}$$

In which:

µ1i =$$e^{{\frac{{ - \left( {x - c_{i} } \right)^{2} }}{{2\sigma^{2} }}}}$$, µ2j =$$e^{{\frac{{ - \left( {x - c_{j} } \right)^{2} }}{{2\sigma^{2} }}}}$$, µ3k =$$e^{{\frac{{ - \left( {x - c_{k} } \right)^{2} }}{{2\sigma^{2} }}}}$$, µ4l =$$e^{{\frac{{ - \left( {x - c_{l} } \right)^{2} }}{{2\sigma^{2} }}}}$$, and µ5m =$$e^{{\frac{{ - \left( {x - c_{m} } \right)^{2} }}{{2\sigma^{2} }}}}$$.

## 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.