Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Numerical investigation of nanofluid flow using CFD and fuzzy-based particle swarm optimization

## Abstract

This paper is focused on the application and performance of artificial intelligence in the numerical modeling of nanofluid flows. Suspension of metallic nanoparticles in the fluids has shown potential in heat transfer enhancement of the based fluids. There are many numerical studies for the investigation of thermal and hydrodynamic characteristics of nanofluids. However, the optimization of the computational fluid dynamics (CFD) modeling by an artificial intelligence (AI) algorithm is not considered in any study. The CFD is a powerful technique from an accuracy point of view. However, it could be time and cost-consuming, especially in large-scale and complicated problems. It is expected that the machine learning technique of the AI algorithms could improve such CFD drawbacks by patterning the CFD data. Once the AI finds the CFD pattern intelligently, there is no need for CFD calculations. The particle swarm optimization-based fuzzy inference system (PSOFIS) is considered in this study to predict the velocity profile of Al2O3/water turbulent flow in a heated pipe. One of the challenging problems in CFD modeling is the lost data for a specific boundary condition. For example, the CFD data are available for wall heat fluxes of 75, 85, 105, and 125 w/m2, but there is no data for the wall heat flux of 95 w/m2. So, the PSOFIS learns the available CFD data, and it predicts the velocity profile for where the data is not available (i.e., wall heat flux of 95 w/m2). The intelligence of PSOFIS is checked by the coefficient of determination (R2 pattern) for different values of accept ratio (AR) and inertia weight damping ratio (IWDR). The best intelligence is obtained for the AR and IWDR of 0.7 and 0.99, respectively. At this condition, the velocity profile predicted by both CFD and PSOFIS is compatible. As the performance of the PSOFIS, for learning time of 268 s, the prediction of the CFD data lost was negligible (~ 1 s). In contrast, the CFD calculation takes around 600 s for each simulation.

## Introduction

Based on the studies on thermal features, it is indicated that a weak thermal conductivity is exhibited by all today's liquid coolants utilized as heat transfer fluids compared to solid metals. Limited enhancement can be obtained by supplementary attempts to increment the heat transfer coefficient by incrementing area, agitation, or solid dispersion by the fluid’s low thermal conductivity. Hence, it is rational that attempts are based on increasing the cooling fluid’s thermal conduction performance. There have been former attempts on incrementing the base fluids’ thermal conductivity by suspending solid particles in macro sizes in fluids due to the solid’s thermal conductivity typically 2–3 times higher than the liquids. Nevertheless, the addition of micrometer size particles results in various problems causing sedimentation, clogging, erosion, and pressure drop in channels, conduits, or pipes. As the new multi-element fluids, nanofluids comprise solid particles with their distinctive sizes (< 100 nm). Their dispersion in pure fluids alters the viscosity and thermal conductivity of the solid nanoparticles. The benefits of utilizing the nanoparticles dispersed within a base fluid in different thermal systems were provided1,2,3,4,5,6,7,8,9,10,11. In one study, the flow characteristics and convective heat transfer for a Cu–water nanofluid flowing within a constant heat flux straight tube at turbulent and laminar flow circumstances were experimentally assessed12. The findings indicated that the suspended nanoparticles considerably improved the conventional base fluid’s heat transfer behavior, and there was good consistency between their friction factor and the water. Moreover, they proposed novel convective heat transfer correlations to predict the nanofluid’s heat transfer coefficients for both turbulent and laminar flow circumstances. The effects of SiO2 nanoparticles on heat transfer in a cavity were numerically analyzed13. In this work, an experimental setup was used for determining the nanofluid’s thermal conductivity. Another study tested the convective heat transfer coefficients of CuO–water and Al2O3–water nanofluids in laminar flow11. Results showed that increasing the concentration of the solution increased the heat transfer coefficient. Quantitative research found that the Ethylene Glycol–Water mixes provide different effects on heat transfer for turbulent flows of Al2O3, SiO2, and CuO nanoparticles in the presence of varying volume concentrations running in a tube under constant heat flux settings14. The increase in nanoparticle volume concentration induces an increase in heat transfer coefficient.

The numerical approaches are usually used to estimate the empirical variables and avoid the experiments' implementation cost. Numerous research papers have already studied the computational fluid dynamics (CFD) modeling of nanofluids15,16,17,18,19,20,21. Almost all investigations focused on the CFD model accuracy for the prediction of heat and fluid flow variables. The CFD must discretize and solve many partial differential equations describing the governing equations for finite volume cells of the fluid flow domain. Although the CFD is known as a robust method for predicting heat transfer and fluid dynamics parameters, this method requires a lot of computational time and expenses for complex CFD problems (i.e., large geometries, turbulent flows, etc.). The use of CFD techniques in artificial intelligence has gained attention in the last few years. An adaptive network-based fuzzy inference system (ANFIS) was also credited with the contribution of artificial intelligence to CFD in a few types of research22,23,24,25,26,27,28. The results released the efficiency of the ANFIS for the accurate predictions of the CFD results. However, a deep gap is seen for investigating any other algorithms and their tuning parameters for the best intelligence. In addition, the accuracy of the AI algorithm for the prediction of the lost CFD data is examined. AI algorithms can train the CFD results.

The performance of the CFD models can be predicted when the boundary conditions of the CFD examples are adjusted. This work is designed to address the aforementioned research gap, in part, using a particle swarm optimization (PSO) algorithm paired with a CFD simulation. The prediction of the velocity profile of Al2O3/water turbulent flow in a heated pipe is the main objective of this study.

## Methodology

### CFD approach

The flow research used a nanofluid solution in a straight tube. The tube length is one meter, and its diameter is 0.01 m. The tube is under a constant wall heat flux. The fluid is introduced into the tube with consistent axial temperature and velocity. This is a highly nonlinear fluid dynamic problem by considering turbulence effect and temperature-dependent nanofluid thermophysical properties. This problem was solved using the computational fluid dynamics code of the commercial ANSYS-Fluent 14.5 software. The continuity of mass, momentum, and energy are considered for many finite volume cells. These governing equations are also coupled with the turbulence model equations. As a result, many nonlinear partial differential equations were made. The leading equation systems (1)–(3) must be discretized and solved using the control volume method. By the control-volume method, the governing equations are converted to algebraic equations that can be numerically solved. The heading equations for the fluid flow include29,30:

Continuity equation:

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

Momentum equation:

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

Energy equation:

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

The k–ε turbulence model is based on previously published research and is used to determine the turbulent eddy viscosity, energy dissipation rate $$(\varepsilon$$), and kinetic energy (k)16,18,31.

For modeling such a case, the ANSYS-Fluent 14.5 CFD software is used. This CFD package software works based on the finite volume method (FVM). For discretization, the second-order-upwind scheme is used for the continuity and k–ε turbulence equations. The SIMPLE algorithm is adopted as the pressure and velocity coupling scheme. The scaled residuals for velocity components and energy are equal to 10–9.

### PSO algorithm

PSO is a method based on a stochastic optimization population. PSO optimization procedure is initiated by a population of particles or solutions selected randomly in the search space, consequently looking for optima by iterative updating of generations. Each particle is updated based on two higher and outstanding compared to the gbest fitness; updating the gbest fitness factors is essential. In the second state, where the particle fitness is higher and superior to the pbest fitness, it is essential to update the related parameters of pbest fitness. Ultimately, based on the second phase again the further particles should be assessed.

### Fuzzy Inference System (FIS)

Fuzzy inference is widely used in computers, particularly in fuzzy reasoning, fuzzy set theory, and if–then logic. While it was widely adopted in many different areas, the technique was hard to apply in domains that required interaction design or application software. FIS can carry out three separate kinds of fuzzy reasoning, using the if–then rules used by Takagi and Sugeno32. To get velocity as output, the three input variables of x coordinate, y coordinate, and wall heat flux (Qwall) are used. Incoming signals from the last stage are multiplied according to the AND rule. For case, the i-th rule function is

$${w}_{i}={\mu }_{Ai}\left(X\right) {\mu }_{Bi}\left(Y\right){\mu }_{Ci}(Qwall)$$
(4)

The wi variable represents the signal output from the node while $${\mu }_{Ai}$$, $${\mu }_{Bi}$$ and $${\mu }_{Ci}$$ indicate the input signals, containing X, Y, and, the Qwall value.

For the next stage, each rule’s firing strength is estimated relative to the total weight of all rules:

$$\overline{{w }_{i}}=\frac{{w}_{i}}{\sum \left({w}_{i}\right)}$$
(5)

Node function can be written as:

$$\overline{{w }_{i}}{f}_{i}=\overline{{w }_{i}}({p}_{i}X+{q}_{i}Y+{r}_{i}Qwall+{s}_{i})$$
(6)

Consequent parameters of the if–then rules, often called pi, qi, ri, and si, respectively. To compute the estimate result, the signals of the last stage are used. In this instance, the MFs and consequent parameters are both updated using a hybrid learning method that combines gradient descent and LSE techniques33,34.

## Results

The suspension of metallic nanoparticles can enhance the heat transfer of water. Although many studies have investigated the nanofluid fluid flow numerically, there are no investigations to optimize the CFD modeling by the artificial intelligence algorithm. This study aims to include the finite volume method (FVM) results from computational fluid dynamics (CFD) into the learning process of a machine learning system. Models of computational fluid dynamics use partial differential equations to describe mass, momentum, and energy governing equations. When the equations are discretized and arranged within specific boundary conditions, the FVM can solve all of the equations. Solving the governing equations, the independent variables such as velocity, pressure, and temperature are achieved for each node in the domain. The FVM solutions are learned by one of the artificial intelligence (AI) algorithms. Once the best intelligence of the algorithm is obtained, it is no longer necessary to solve the governing equations. The machine learning approach of AI algorithms could save much computational time and cost, especially in large-scale problems. An artificial algorithm could also substitute the CFD modeling for doing further simulations. For example, for CFD data loss, where the CFD data are unavailable for specific boundary conditions, the AI algorithm could predict the lost data based on the pattern of the existing data. When it refers to artificial intelligence algorithms, the particle swarm optimization-based fuzzy inference system (PSOFIS) is one of the most widely utilized. The turbulent flow of Al2O3/water nanofluid inside a pipe is considered as a case for simulation. The pipe is conducted under different constant wall heat fluxes (Qwall). The velocity profile, corresponding to each wall heat flux, is adopted as an independent variable for prediction by the PSOFIS.

Figure 1 shows different steps for the PSOFIS algorithm setup to predict velocity in the present study. The type of data clustering is subtractive clustering. After adopting the CFD data as inputs (i.e., x, y, and Qwall) and output (i.e., nanofluid velocity), the subtractive clustering parameters, including accept ratio, reject ratio, squash factor, and cluster influence range (CIR), are determined. The constant values of 0.15 and 1.25 are considered for reject ratio and squash factor, respectively. The constant values of 0.8, 0.15, and 1.25 are considered for CIR, reject ratio, and squash factor. However, a sensitivity test is done for the effect of accept ratio (AR) on the intelligence of the PSOFIS.

For particle swarm optimization (PSO) parameters, the swarm size is supposed to be constant (i.e., 100), while different values of inertia weight damping ratio (IWDR) are tested for the best intelligence. The fuzzy inference system (FIS) is generalized based on the subtractive clustering parameters. The intelligence of PSOFIS is checked by the coefficient of determination (R2 pattern). The highest coefficient of determination means that the best intelligence has been achieved. The PSOFIS does the CFD data learning for the wall heat fluxes of 75, 85, 105, and 115 w/m2. The sensitivity tests are done for different AR values (i.e. 0.3, 0.4, 0.5, 0.6, and 0.7) and IWDR values (i.e. 0.6, 0.7, 0.8, 0.9, and 0.99). The CFD results validate the results of the PSOFIS. After achieving the intelligence, the PSOFIS can predict any CFD data which did not attend in the machine learning (e.g., velocity profile extraction for Qwall = 95 w/m2).

According to Figs. 2 and 3, the highest coefficient of determination and, as a result, the best intelligence is obtained for the AR and IWDR of 0.7 and 0.99, respectively. This is confirmed by the regression number of 0.98 for both training and testing processes of the PSOFIS, as shown in Fig. 4. The highest compatibility between the CFD results and the PSOFIS predictions is shown in Fig. 5. The velocity profile extracted by the PSOFIS is the same as that predicted by the CFD.

The CFD data in this study are divided into two types. The first type is the data used in the learning process of the PSOFIS. But the second ones are those just used for prediction. Figure 6 illustrates both types of data. The CFD data for Qwall of 75, 85, 105, and 125 w/m2 are used for learning. After achieving the intelligence, the velocity profile is predicted by the PSOFIS for Qwall of 95 w/m2, as shown in Fig. 7. The comparison of results between the CFD and the PSOFIS is also illustrated in Fig. 7. The velocity predictions of the CFD and the PSOFIS are in good agreement. Table 1 illustrates the performance of the PSOFIS as the learning (i.e., training and testing) time and the prediction time compared to the CFD time calculation. It shows that after learning the CFD data for a specific time (268 s), the prediction of the data lost could be made in little time (1 s). In contrast, the CFD calculation takes around 600 s for each simulation. So, after mapping the CFD data and achieving the intelligence, the PSOFIS saves computational time. In another comparison, the computer hardware requirements are considered. The PSOFIS calculations could be carried out by typical computer specifications (Intel Core i5 CPU 650 @ 3.20 GHz, 3333 MHz, 2 Cores). In contrast, a workstation computer (Intel Xeon CPU E5-2685 v3 @ 2.60 GHz, 12 Cores) is required for CFD modeling.

## Conclusions

This study is aimed to investigate the application and performance of artificial intelligence (AI) algorithms on facilitating CFD calculations of modeling nanofluid flows. The flow simulation was conducted for varying constant wall heat fluxes to see how they influence the turbulent flow of Al2O3/water within a pipe. The finite volume method (FVM) solved the partial differential equations of mass, momentum, and energy. Fuzzy, artificial intelligence-based particle swarm optimization (PSOFIS) method was also used to apply FVM solutions to the system. The learning process was performed for the CFD data where the wall heat fluxes were 75, 85, 105, and 115 w/m2. The sensitivity tests were done for different accept ratio (AR) values (i.e. 0.3, 0.4, 0.5, 0.6, and 0.7) and inertia weight damping ratio (IWDR) values (i.e. 0.6, 0.7, 0.8, 0.9, and 0.99). After the best intelligence achievement, the accuracy of the PSOFIS for the prediction of the lost data was tested. One of the challenges of the CFD modeling is the lost data for a specific boundary condition. In this study, the CFD data were supposed to be available for wall heat fluxes of 75, 85, 105, and 125 w/m2, while there is no data for the wall heat flux of 95 w/m2. So, the PSOFIS learns the available CFD data and predicts the velocity profile for where the data is not available (i.e., wall heat flux of 95 w/m2). The CFD calculation was repeated for the wall heat flux of 95 w/m2 and the PSOFIS predictions compared with the CFD results.

The results of this study can be summarized as follows.

• The highest coefficient of determination and, as a result, the best intelligence is obtained for the AR and IWDR of 0.7 and 0.99, respectively.

• For the best intelligence, the regression number is about 0.98.

• The velocity profile of the PSOFIS corresponding to the learned data is the same as that of the CFD prediction.

• The PSOFIS can predict the velocity profile of the data, which is absent in learning, with the highest compatibility to the CFD prediction.

• For the performance assessment of the PSOFIS and for such a model, the learning (i.e., training and testing) time was 268 s, while the prediction of the CFD data lost was negligible (~ 1 s). In contrast, the CFD calculation takes around 600 s for each simulation.

## References

1. Choi, S. U. & Eastman, J. A. Enhancing Thermal Conductivity of Fluids with Nanoparticles (Argonne National Lab, 1995).

2. Song, Y.-Q. et al. Solar energy aspects of gyrotactic mixed bioconvection flow of nanofluid past a vertical thin moving needle influenced by variable Prandtl number. Chaos Solitons Fractals. 151, 111244 (2021).

3. Gowda, R. P. et al. Exploring magnetic dipole contribution on ferromagnetic nanofluid flow over a stretching sheet: An application of Stefan blowing. J. Mol. Liquids. 335, 116215 (2021).

4. Song, Y.-Q. et al. Physical impact of thermo-diffusion and diffusion-thermo on Marangoni convective flow of hybrid nanofluid (MnZiFe2O4–NiZnFe2O4–H2O) with nonlinear heat source/sink and radiative heat flux. Mod. Phys. Lett. B 35(22), 2141006 (2021).

5. Madhukesh, J. K. et al. Bio-Marangoni convection flow of Casson nanoliquid through a porous medium in the presence of chemically reactive activation energy. Appl. Math. Mech. 42(8), 1191–1204 (2021).

6. Azizifar, S., Ameri, M. & Behroyan, I. Experimental investigation of the subcooled flow boiling heat transfer of water and nanofluids in a horizontal metal foam tube. Heat Mass Transf. 57, 1499–1511. https://doi.org/10.1007/s00231-021-03042-9 (2021).

7. Darzi, A. R., Farhadi, M. & Sedighi, K. Heat transfer and flow characteristics of Al2O3–water nanofluid in a double tube heat exchanger. Int. Commun. Heat Mass Transfer 47, 105–112 (2013).

8. Kumar, R. R., Sridhar, K. & Narasimha, M. Heat transfer performance in heat pipe using Al2O3-DI water nanofluid. Int. J. Mater. Mech. Eng. 3, 1–5 (2014).

9. Qu, J., Wu, H.-Y. & Cheng, P. Thermal performance of an oscillating heat pipe with Al2O3–water nanofluids. Int. Commun. Heat Mass Transfer 37(2), 111–115 (2010).

10. Qu, J. & Wu, H. Thermal performance comparison of oscillating heat pipes with SiO2/water and Al2O3/water nanofluids. Int. J. Therm. Sci. 50(10), 1954–1962 (2011).

11. Heris, S. Z., Esfahany, M. N. & Etemad, S. G. Experimental investigation of convective heat transfer of Al2O3/water nanofluid in circular tube. Int. J. Heat Fluid Flow 28(2), 203–210 (2007).

12. Xuan, Y. & Li, Q. Investigation on convective heat transfer and flow features of nanofluids. J. Heat transfer 125(1), 151–155 (2003).

13. Jahanshahi, M. et al. Numerical simulation of free convection based on experimental measured conductivity in a square cavity using Water/SiO2 nanofluid. Int. Commun. Heat Mass Transfer 37(6), 687–694 (2010).

14. Namburu, P. K. et al. Numerical study of turbulent flow and heat transfer characteristics of nanofluids considering variable properties. Int. J. Therm. Sci. 48(2), 290 (2009).

15. Behroyan, I. et al. CFD models comparative study on nanofluids subcooled flow boiling in a vertical pipe. Numer. Heat Transfer Part A Appl. 73(1), 55–74 (2018).

16. Ganesan, P. et al. Turbulent forced convection of Cu–water nanofluid in a heated tube: Improvement of the two-phase model. Numer. Heat Transfer Part A Appl. 69(4), 401–420 (2016).

17. Behroyan, I. et al. A comprehensive comparison of various CFD models for convective heat transfer of Al2O3 nanofluid inside a heated tube. Int. Commun. Heat Mass Transfer 70, 27–37 (2016).

18. Behroyan, I. et al. Turbulent forced convection of Cu–water nanofluid: CFD model comparison. Int. Commun. Heat Mass Transfer 67, 163–172 (2015).

19. Madhukesh, J. et al. Numerical simulation of AA7072–AA7075/water-based hybrid nanofluid flow over a curved stretching sheet with Newtonian heating: A non-Fourier heat flux model approach. J. Mol. Liquids. 335, 116103 (2021).

20. Prasannakumara, B. C. Numerical simulation of heat transport in Maxwell nanofluid flow over stretching sheet considering magnetic dipole effect. Partial Differ. Eqn. Appl. Math. 4, 100064 (2021).

21. Kumar, R. N. et al. Inspection of convective heat transfer and KKL correlation for simulation of nanofluid flow over a curved stretching sheet. Int. Commun. Heat Mass Transfer. 126, 105445 (2021).

22. Nguyen, Q. et al. Fluid velocity prediction inside bubble column reactor using ANFIS algorithm based on CFD input data. Arab. J. Sci. Eng. 45, 7487–7498 (2020).

23. Zhou, J. et al. Performance evaluation of hybrid FFA-ANFIS and GA-ANFIS models to predict particle size distribution of a muck-pile after blasting. Eng. Comput. 37(1), 265–274 (2021).

24. Xu, P. et al. Flow visualization and analysis of thermal distribution for the nanofluid by the integration of fuzzy c-means clustering ANFIS structure and CFD methods. J. Visual. 23(1), 97–110 (2020).

25. Selimefendigil, F. & Öztop, H. F. Numerical analysis and ANFIS modeling for mixed convection of CNT–water nanofluid filled branching channel with an annulus and a rotating inner surface at the junction. Int. J. Heat Mass Transf. 127, 583–599 (2018).

26. Pourtousi, M. et al. Prediction of multiphase flow pattern inside a 3D bubble column reactor using a combination of CFD and ANFIS. RSC Adv. 5(104), 85652–85672 (2015).

27. Pourtousi, M. et al. A combination of computational fluid dynamics (CFD) and adaptive neuro-fuzzy system (ANFIS) for prediction of the bubble column hydrodynamics. Powder Technol. 274, 466–481 (2015).

28. Babanezhad, M. et al. Performance and application analysis of ANFIS artificial intelligence for pressure prediction of nanofluid convective flow in a heated pipe. Sci. Rep. 11(1), 1–18 (2021).

29. Shih, T. M. Numerical Heat Transfer (CRC Press, 1984).

30. Fluent, A. 14.5. User’s and Theory Guide (ANSYS, 2014).

31. Aly, W. I. Numerical study on turbulent heat transfer and pressure drop of nanofluid in coiled tube-in-tube heat exchangers. Energy Convers. Manage. 79, 304–316 (2014).

32. Takagi, T. & Sugeno, M. Fuzzy identification of systems and its applications to modeling and control. IEEE Trans. Syst. Man Cybern. 1, 116–132 (1985).

33. Babanezhad, M. et al. Prediction of gas velocity in two-phase flow using developed fuzzy logic system with differential evolution algorithm. Sci. Rep. 11(1), 1–14 (2021).

34. Ciano, T. et al. Prediction of velocity profile of water based copper nanofluid in a heated porous tube using CFD and genetic algorithm. Sci. Rep. 11(1), 1–12 (2021).

## Author information

Authors

### Contributions

All authors prepared the results, figures, main manuscript text and reviewed the manuscript.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Syah, R., Elveny, M., Nasution, M.K.M. et al. Numerical investigation of nanofluid flow using CFD and fuzzy-based particle swarm optimization. Sci Rep 11, 20973 (2021). https://doi.org/10.1038/s41598-021-00279-6

• Accepted:

• Published:

• DOI: https://doi.org/10.1038/s41598-021-00279-6

• ### Measurement of the mass-flow-rate characterization parameters of high-pressure pneumatic servo slide valves

• Dijia Zhang
• Longlong Gao
• Baoren Li

Scientific Reports (2022)