Abstract
Many numerical methods have been used to simulate the fluid flow pattern in different industrial devices. However, they are limited with modeling of complex geometries, numerical stability and expensive computational time for computing, and large hard drive. The evolution of artificial intelligence (AI) methods in learning large datasets with massive inputs and outputs of CFD results enables us to present completely artificial CFD results without existing numerical method problems. As AI methods can not feel barriers in numerical methods, they can be used as an assistance tool beside numerical methods to predict the process in complex geometries and unstable numerical regions within the short computational time. In this study, we use an adaptive neuro-fuzzy inference system (ANFIS) in the prediction of fluid flow pattern recognition in the 3D cavity. This prediction overview can reduce the computational time for visualization of fluid in the 3D domain. The method of ANFIS is used to predict the flow in the cavity and illustrates some artificial cavities for a different time. This method is also compared with the genetic algorithm fuzzy inference system (GAFIS) method for the assessment of numerical accuracy and prediction capability. The result shows that the ANFIS method is very successful in the estimation of flow compared with the GAFIS method. However, the GAFIS can provide faster training and prediction platform compared with the ANFIS method.
Similar content being viewed by others
Introduction
Artificial intelligence (AI) has been frequently used in the prediction of physical and industrial processes1,2,3,4. They are also used as an assistance tool besides exact studies, either numerical or experimental, during optimization of processes, and they can mimic and then provide mathematical descriptions for processes5,6,7,8. Recently, AI has been combined with computational fluid dynamics to simulate the fluid flow pattern in different geometries, such as square cavity and the cylindrical bubble column reactors9,10,11. In this combination, the AI learns the process from the computational fluid dynamics (CFD) data set, specifically from each CFD node in the domain, and then represents the new data set for different conditions. The flow pattern in this condition is also based on the CFD data and is completely independent of boundary conditions, mesh sensitivity, and stability of numerical methods12,13,14,15. The AI shows the evolution of the flow pattern between the range of exact models, which is helpful to avoid exact modeling repetition with expensive computational expenses in the optimization process.
In the multiphase flow application, Pourtousi et al.16 employed the ANFIS method to learn CFD data from different heights of a bubble column reactor and predicted the new data set of the flow pattern for different heights and sparger (gas distributor) specifications. They also used this method to learn CFD data about formation, detachment and to raise the bubble at few CFD time steps, and after learning data, they predicted the interface between continuous and dispersed phase for the very small time step. Pourtousi et al.17 showed that the prediction of the interface between dispersed and continuous phase is not very accurate with the combination of ANFIS and CFD, and it requires a huge number of rules.
There are also several tuning parameters to accurately predict the shape of the pattern in the AI18. For instance, in the ANFIS technique, number of rules and membership functions can be changed for each input and results in improvement of the pattern6,19.
The selection of different datasets during the learning process enables us for better pattern recognition. One of the main advantages of this accurate fluid flow pattern prediction is the CFD method does not require to save each time step and then store the data. In this case, AI plays a role as an assistance tool to provide non-existing data, which sometimes needs large computational time and hard drive for storing data. This technique can be replaced with computational fluid dynamics, and it enables us to avoid storing data for a very small time step and replace smart modeling instead of CFD modeling.
Recently there are several machine learning (ML) tools that have been developed to predict the pattern of flow in a domain. They showed that the number of input parameters and the number of membership functions could significantly impact on accurate prediction of flow pattern. However, the selection of each model based on the learning time has not been fully considered. Additionally, the prediction of more futures in the pattern has not been fully investigated. In this work, we consider the prediction of flow pattern in the domain and represent new features of flow characteristics based on the predictions ability.
We use different patterns of fluid flow for different time steps as a data set, and with the ANFIS method, all time steps are learned. After training all patterns of fluid, the AI predicts missing times with the CFD method, which has not been used in the training method. We also compare prediction results with the existing model in literature called the genetic algorithm fuzzy inference system (GAFIS) to evaluate the capability of models in predicting flow patterns. For the first time, we present a new mathematical correlation based on AI for the flow pattern in the cavity domain. This correlation can represent the local values for the fluid flow when there is a shear flow.
Method
In this study, to build-up a large dataset for the fluid flow, we simulate the 3D cavity by the Lattice Boltzmann method (LBM). This dataset enables us to study the ability of ML prediction process in the simulation of fluid flow pattern recognition in a simple fluid problem. The AI is used to get several slices for various simulation time at the center of the cavity, in x–y coordinate. Then it tries to learn the process and predict many simulation times that are not simulated by the CFD method or saved on the computer. This ability enables us to visualize the fluid pattern in a short period of time.
Lattice Boltzmann Method (LBM)
For simulation of single-phase fluid flow in the 3D cavity, we use the lattice Boltzmann method, and the collision term is computed based on Bhatnagar-Gross-Krook (BGK). The model of D3Q19 is used to present the location of LB points. The LB equation, which represents the streaming and collision part, is written as:
where \(f_{i}\) is the density distribution and \(f_{i}^{{{ }eq}}\) is the equilibrium distribution for particles in the domain. \(c_{i} = ce_{i}\) is the discrete velocity in the domain of cavity, while \(e_{i}\) presents unit lattice velocity. \(F\) is also the external force in the direction of \(i\).
The equilibrium distribution (\(f_{i}^{eq}\)) with different weight factors (\(w\)) describes as:
The weight factors are as w0 = 1/3, w1−6 = 1/18 and w5−9 = 1/36. The macroscopic density and velocity of fluid can be calculated based on:
\(\rho\) and \(u\) present the density and velocity of fluid flow, respectively.
ANFIS
ANFIS is a fuzzy implication structure that precisely forecasts the manners of nonlinear and complex systems20,21. Three various sorts of fuzzy reasoning are present, which Sugeno and Takagi suggested if–then rules applied in the ANFIS framework22. Herein x coordination (x), y coordination (y), and time (t) are engaged for the achievement of fluid velocity in place of output. The function of the ith rule is written as:
where wi is the signal coming out of the second layer's node and μAi, μBi and μCi are received signals from implemented MFs on inputs, x coordination (x), y coordination (y) and time (t), to the second layer's node. More details on ANFIS can be found elsewhere22.
Results and discussion
The analysis of liquid flow pattern by CFD methods in 3D geometries requires high computational time. Saving all fluid properties in the three dimensions for each time step is time-consuming and needs a very large hard drive for storing data. In this study, we specifically, simulate the 3D cavity and save data at the center of the domain for several time steps. Then we use some data in training ANFIS for prediction of the liquid pattern. During learning data, we examine different combinations of membership functions, rules, and the number of inputs to evaluate the best condition for the prediction of flow patterns with AI. After learning all data, we call ANFIS function to generate the liquid flow pattern for different time steps, and we compare them with some of the CFD data that has not been presented in the training process. This procedure enables us to facilitate fast visualization of the data in a short computational time.
The prediction of flow pattern recognition in the domain requires the high accuracy of the learning process in artificial intelligence algorithms. This accuracy called "intelligence of the method" can be achieved with all tuning parameters in the AI and way of processing and training data. In this study, to achieve the intelligence of the method, we start training with different numbers of inputs and outputs. At first, we train data with one input and output and observe the accuracy of the method. The results show that the accuracy of the method is very low when only one input is used in the training process. This accuracy can not increase by increasing the number of rules or the number of membership functions. To achieve better accuracy of the method, we can increase the number of inputs. Increasing the number of inputs causes an increment in the number of neural in the system. For clustering data in the ANFIS method, we select grid partition clustering and also select generalized bell-shaped membership function (Gbellmf) as a type of fuzzy membership functions (MFs). The percentage of data utilized for training is %60, the maximum iteration in ANFIS is 500, and the number of data is considered 65,000. With the above parameters and considering x coordinate as the first input and different number of MFs, the ANFIS learning is implemented. Figure 1 shows the regression (R) about 0.117 for the training, and 0.116 for the testing. This value of R shows %11 of ANFIS intelligence for reaching a high ANFIS intelligence, we consider y coordinate as the second input and repeat the ANFIS training/testing when the number of MFs = 2,3 and 4.
Results depicted in Fig. 2 reveal that the amount of R is drastically risen up, and when the number of MFs = 2, the value of R for training/testing is about 0.92. Changes in the number of MFs from 2 to 4 indicated an increase in the amount of R from 0.92 to 0.96, which had a great influence over achieving %96 of ANFIS intelligence which is depicted in Fig. 3.
To reach a high percentage of ANFIS intelligence, we add time as the third input, and the learning step for the number of MFs = 2, 3, and 4 are done. By comparing R when the number of inputs is three and two, which indicates an increase in R in the testing and training, particularly when the number MFs = 4, percentage of ANFIS intelligence is %99.5, which is a significant achievement in the ANFIS intelligence.
According to Fig. 4, ANFIS prediction points have good adaptation with the CFD points; eventually, we predict surfaces that indicate velocity as the ANFIS output based on different inputs. By using predicted surfaces, there is a suitable capability to achieve more points in the cavity, which most of them have not been present in the ANFIS learning processes (see Fig. 5).
The highest intelligence is achieved when the number of inputs equals three and the number of MFs = 4. The degree of MFs is illustrated in Fig. 6; furthermore, Figs. 7 and 8 indicate MSE error and RMSE error for the training and testing processes in the highest level of ANFIS intelligence. In the following section, the velocity prediction patterns are depicted for the times that its data are present in the ANFIS learning processes, the velocity prediction patterns are depicted on the left side of Fig. 9, also the velocity prediction patterns for the times that are absent in the learning processes are depicted on the right side of Fig. 9.
Furthermore, in Fig. 10, the velocity prediction patterns for the different times are illustrated. In the following section of this study, we select five points that are highlighted in Fig. 11, and their velocity are predicted at different times, also we compare the predicted velocity of five points with the CFD velocity of five points that are depicted in Fig. 12. Results show that there is a good adaptation between the prediction velocity lines and the CFD velocity lines.
Generalized Bell-shaped membership function (Gbellmf) from different types of MFs, and its equation can be seen in Table 1. Gbellmf is selected for prediction of velocity that is obtained from the following equation:
\(\mu_{1i} , \mu_{1j}\) and \(\mu_{1k}\) are written in Eq. 6, as:
Table 2 shows membership function parameters for each input separately in the first layer of ANFIS structure. Also, Table 3 shows Eq. (6) parameters that are extracted from the bottom layer of ANFIS structure, using these parameters in Eq. (6) we can predict fluid velocity based on ANFIS inputs (x and y coordinates and time).
For better evaluation of the ANFIS method, we compare this method of prediction with the GAFIS method. Similar to the previous analysis, again, we start with training assessment, and after learning data set in both ANFIS and GAFIS, we compare then with R evaluation criteria. The results in Fig. 13 show that the ANFIS method is more capable in the training of CFD dataset, and the ratio of \(\frac{{R^{ANFIS} }}{{R^{GAFIS} }} > 1\) that shows the high ability of training data for the ANFIS method. In another assessment, we included more datasets in the process of the assessment called “testing process”. In this stage of evaluation, we observe similar behavior as the training process, and the ANFIS method shows a higher ability with regards to accuracy.
In addition to the accuracy criteria, we compare these methods with regards to error, \({R}^{2}\), STD, and computational time (training and testing times). Table 4 shows that the ANFIS method contains less error than GAFIS when both methods have the same number of iterations, inputs, and percentage of training data set. Both methods reach the best level of accuracy. However, the training time for the ANFIS method is almost two times more than the GAFIS method. In the prediction process, the GAFIS method is even much faster, and the speed of the prediction process is almost 7 times more than the ANFIS method.
For the better comparison between the ANFIS and GAFIS method, the artificial flow characteristics (velocity distributions) should be compared at local computing points with CFD local dataset. Figure 14a,b shows the flow distribution for the ANFIS and GAFIS method, respectively, and then all velocity distributions are compared with CFD flow distributions in the cavity. The prediction results for the ANFIS method shows that this method can fully predict the flow distribution in the cavity with the minimal difference with CFD dataset, particularly near boundary conditions. However, the prediction results for the GAFIS method show that this method is unable to predict the flow at many local points. The low capability of prediction for some of the local points can be modified with consideration of data filtration near all boundary conditions or introducing boundary conditions as a numerical restriction into the learning algorithms. Another alternative method can be a dense CFD mesh near the boundary condition to have more datasets at those particular locations. We also predict the flow distribution for a different time, and we compare the ANFIS, GAFIS, and CFD methods at the time that the machine learning method does not have training sessions. Figure 15 shows the velocity for ANFIS, GAFIS, and CFD at different points in the cavity domain. Two velocity profiles for ANFIS and GAFIS are completely artificial and based on the prediction ability of machine learning. The results for the ANFIS results are comparable with CFD calculations at different time frames. However, the GAFIS is not as accurate as the ANFIS in the prediction of the flow pattern as a function of time.
For future study, changes in a type of clusterings such as subtractive clustering and fuzzy c-means clustering, and their variable parameters such as the number of cluster in fuzzy c-means clustering and cluster influence range (CIR) in subtractive clustering are worth studying and evaluation.
Conclusion
In this study, a type of AI called ANFIS method is considered. For ANFIS learning processes, we considered data as inputs and outputs that were extracted from the CFD simulations. In the CFD method, we simulated a cavity and extracted data such as x and y direction and fluid velocity at different times. After making some changes in ANFIS variable parameters to achieve the highest percentage of ANFIS intelligence, ANFIS intelligence became conscious eventually. Fluid velocity as an ANFIS output is predicted in many points of the cavity in comparison with cavity points that are simulated via the CFD method. Particularly, in this study, we considered five points of the cavity at different times and predicted these points at any time in the CFD method period of time. By using this capability of the ANFIS method, we predicted the velocity of the fluid in times that no data existed in the learning processes. For the assessment of prediction capability in the ANFIS method, we compared this method with the GAFIS algorithm. The result shows that the prediction capability in the ANFIS method is higher than the GAFIS method. The ANFIS method can even better predict the flow patter at all local computing points. However, training and prediction time for the ANFIS method is much higher than the GAFIS method.
References
Shamshirband, S., Babanezhad, M. & Mosavi, A. Prediction of flow characteristics in the bubble column reactor by the artificial pheromone-based communication of biological ants. (2019).
Wang, W.-C., Chau, K.-W., Qiu, L. & Chen, Y.-B. Improving forecasting accuracy of medium and long-term runoff using artificial neural network based on EEMD decomposition. Environ. Res. 139, 46–54 (2015).
Wu, C. & Chau, K. Rainfall–runoff modeling using artificial neural network coupled with singular spectrum analysis. J. Hydrol. 399, 394–409 (2011).
Babanezhad, M., Nakhjiri, A. T. & Shirazian, S. Changes in the number of membership functions for predicting the gas volume fraction in two-phase flow using grid partition clustering of the ANFIS method. ACS Omega 5, 16284 (2020).
Yilmaz, I. & Kaynar, O. Multiple regression, ANN (RBF, MLP) and ANFIS models for prediction of swell potential of clayey soils. Expert Syst. Appl. 38, 5958–5966 (2011).
Boyacioglu, M. A. & Avci, D. An adaptive network-based fuzzy inference system (ANFIS) for the prediction of stock market return: the case of the Istanbul stock exchange. Expert Syst. Appl. 37, 7908–7912 (2010).
Nguyen, Q., Babanezhad, M., Taghvaie Nakhjiri, A., Rezakazemi, M. & Shirazian, S. Prediction of thermal distribution and fluid flow in the domain with multi-solid structures using Cubic-Interpolated Pseudo-Particle model. PLoS ONE 15, e0233850 (2020).
Nguyen, Q., Taghvaie Nakhjiri, A., Rezakazemi, M. & Shirazian, S. Thermal and flow visualization of a square heat source in a nanofluid material with a cubic-interpolated pseudo-particle. ACS Omega 5, 17658 (2020).
Xu, P., Babanezhad, M., Yarmand, H. & Marjani, A. Flow visualization and analysis of thermal distribution for the nanofluid by the integration of fuzzy c-means clustering ANFIS structure and CFD methods. J. Visualization 23, 1–14 (2019).
Tian, E., Babanezhad, M., Rezakazemi, M. & Shirazian, S. Simulation of a bubble-column reactor by three-dimensional cfd: multidimension-and function-adaptive network-based fuzzy inference system. Int J Fuzzy Syst 22, 477 (2019).
Pourtousi, M., Sahu, J., Ganesan, P., Shamshirband, S. & Redzwan, G. 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).
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).
Jawad, H. L., Abdullah, S., Zulkifli, R. & Mahmood, W. Prediction of centrifugal compressor performance by using adaptive neuro-fuzzy inference system (ANFIS). IREMOS 5, 1580–1587 (2012).
Rezakazemi, M. & Shirazian, S. Gas-liquid phase recirculation in bubble column reactors: development of a hybrid model based on local CFD–adaptive neuro-fuzzy inference system (ANFIS). J. Non-Equilib. Thermodyn. 44, 29–42 (2019).
Nabipour, N., Babanezhad, M., Taghvaie Nakhjiri, A. & Shirazian, S. Prediction of nanofluid temperature inside the cavity by integration of grid partition clustering categorization of a learning structure with the fuzzy system. ACS Omega 5, 3571–3578 (2020).
Pourtousi, M., Zeinali, M., Ganesan, P. & Sahu, J. N. Prediction of multiphase flow pattern inside a 3D bubble column reactor using a combination of CFD and ANFIS. RSC Adv. 5, 85652–85672. https://doi.org/10.1039/c5ra11583c (2015).
Pourtousi, M. CFD modelling and anfis development for the hydrodynamics prediction of bubble column reactor ring sparger (University of Malaya, Malaya, 2016).
Mitra, P., Maulik, S., Chowdhury, S. & Chowdhury, S. in 2007 42nd International Universities Power Engineering Conference. 397–401 (IEEE).
Yun, Z. et al. RBF neural network and ANFIS-based short-term load forecasting approach in real-time price environment. IEEE Trans. Power Syst. 23, 853–858 (2008).
Abdulshahed, A. M., Longstaff, A. P. & Fletcher, S. The application of ANFIS prediction models for thermal error compensation on CNC machine tools. Appl. Soft Comput. 27, 158–168 (2015).
Azwadi, C. S. N., Zeinali, M., Safdari, A. & Kazemi, A. Adaptive-network-based fuzzy inference system analysis to predict the temperature and flow fields in a lid-driven cavity. Numer. Heat Transfer, Part A Appl. 63, 906–920 (2013).
Takagi, T. & Sugeno, M. Fuzzy identification of systems and its applications to modeling and control. IEEE Trans. Syst. Man Cybern. SMC-15, 116–132 (1985).
Author information
Authors and Affiliations
Contributions
M.B.: Simulations, Analysis, Writing-draft A.T.N.: Validation, Software, Writing-draft, Revision A.M.: Software, Project administration, Funding acquisition S.S.: Analysis, Supervision, Writing-review.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Babanezhad, M., Nakhjiri, A.T., Marjani, A. et al. Pattern recognition of the fluid flow in a 3D domain by combination of Lattice Boltzmann and ANFIS methods. Sci Rep 10, 15908 (2020). https://doi.org/10.1038/s41598-020-72926-3
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-020-72926-3
This article is cited by
-
Machine learning approach to predict viscous fingering in Hele-Shaw cells
International Journal on Interactive Design and Manufacturing (IJIDeM) (2023)
-
Velocity prediction of nanofluid in a heated porous pipe: DEFIS learning of CFD results
Scientific Reports (2021)
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.