JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 ISSN 2541-6332 | e-ISSN 2548-4281 Journal homepage: http://ejournal.umm.ac.id/index.php/JEMMME Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 155 Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow over a Backward Facing Step Zaid Al Kahfi Ramadhana, Mohamad Yamin b* aLab Center of Automotive Research Universitas Gunadarma, b Jurusan Teknik Mesin Universitas Gunadarma, Jl. Margonda Raya No.100, Kota Depok, Provinsi Jawa Barat, Kode Pos 16424 *e-mail: mohay@staff.gunadarma.ac.id Abstract Backward Facing Step (BFS) has been widely recognized for its application to turbulence fields in deep flow. The flow separation occurs due to a sudden change in geometry. To know the phenomenon of flow in BFS, it can be conducted with a numerical approach. In some cases, numerical studies have a weakness in the computational time aspect. This study focuses on the prediction of Cp and Cf on BFS flow using Machine Learning. It begins with a meshing sensitivity approach with the number of elements as much as 22188 cels in a numerical simulation with a step height of 12.7 mm. This numerical study was carried out using Reynolds number in the turbulent region of Re 36000. The turbulent k-omega shear stress transport model was used to perform numerical simulations in the open-source software package OpenFOAM®. Simulation data in the form of speed and pressure at each node that represents the form of turbulence was used as a dataset in Machine Learning. Three Machine Learning models, namely Multi-Layer Perceptron, RandomForrest, and Multiple Linear Regression were used to predict Cp and Cf. The effectiveness of each of these models is -101.5% for Multi-Layer Perceptron, 96% for RandomForrest, and 99% for Multiple Linear Regression. With the best effectiveness value, the Machine Learning Multiple Linear Regression model is used to get the predicted Cp and Cf values from variations in step height of 9.525 mm, 6.35 mm, and 3.175 mm. With these results, it shows that the Machine Learning model can be used to predict the BFS turbulence flow obtained from the results of the OpenFoam® numerical approach. Keywords: Backward Facing Step, Machine Learning, OpenFoam, Cp Prediction 1. INTRODUCTION Computational fluid dynamics (CFD) is a numerical method for analyzing the structure and data of a fluid flow [1]. The use of the CFD method is a faster and cheaper alternative in research compared to conducting experimental studies. The backward- facing step (BFS) is a geometric model that can be analyzed using a CFD numerical approach. Backward Facing Step (BFS) is widely known for its application in the study of turbulence. BFS is one of the representation models for the separation of a stream. The flow separation in BFS is caused by a sudden change in geometry [2]. Various applications for BFS flow can be found in everyday life, such as airfoils, spoiler flows, flow separators behind vehicles, as well as flows around ships or buildings. [3] investigated the flow of BFS in three flow areas, namely laminar, transitional, and turbulent with a Reynolds number of 70-8000. These three areas are studied theoretically, experimentally, and computationally. It is concluded that the difference in flow characteristics occurs because of the difference in the separation height (step). [4] performed a numerical simulation of BFS in OpenFoam® using the k-ω SST turbulence model at Reynolds number 5000. The result was that the numerical simulation data had a http://ejournal.umm.ac.id/index.php/JEMMME mailto:mohay@staff.gunadarma.ac.idx JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 156 positive trend and was well compared to the experimental data verified by [5]. At other times, [6] performed a numerical simulation of the BFS in OpenFoam® using the Standard k-epsilon (k-ε) turbulence model in the Reynolds Number region >6600 based on the geometry [3] and the result is that the higher the Reynolds number, the Cp value will decrease, while the Cf value will increase. The use of machine learning has helped humans in everyday life. Today, machine learning can be found in all fields, including aerodynamics. Machine learning is used to reconstruct information on the flow model. [7] investigated the ability of a machine learning multilayer feed-forward neural network model to reconstruct data from large eddy simulation (LES) simulations. [8] conducted a detailed investigation of the ability of the neural network to reconstruct functions in the Spalart Allmaras turbulence model and demonstrated that it is indeed possible to replace the analytical representation of machine learning with the solver built into the CFD. The purpose of the study in this paper focuses on the prediction of Cp and Cf from the results of a 2-dimensional BFS numerical simulation using OpenFoam® using machine learning methods. 2. METHODS 2.1 Computing Method Geometry is created using OpenFoam® along the x,y, and z axes. For two- dimensional conditions, the fixed unit width is assigned to the model. The geometry and meshing are shown in Figure 1 and Figure 2. The expansion ratio (H/h) is 1.12 (H=114.3 mm & h=101.68 mm) with a step height of 12.62 mm. Geometry is divided into 6 blocks, by following the names of the inlet, outlet, upper- wall, lower-wall, and front&back. Meshing is done by keeping more cell concentrations in the step area. This is done to provide a better catch of turbulent flow in this region. The boundary conditions at the inlet are 'constant velocity profile', 'zero gradients' at the outlet, and 'wall (no-slip)' in the lower and upper wall areas. Numerical simulation in this study was carried out with a Reynolds number of 36000. The equation governing the flow in the Backward Facing Step is given by the Reynolds Averaged Navier-Stokes equation [9] which is given by Equation (1). i i j j eff j j j i i u u u p u v x x x x x        − + = −            (1) The turbulence model used in this numerical simulation is k-omega Shear Stress Transport (SST) [10]. The advantage of the k-omega SST Turbulence Model is that it has good capabilities in the area around the wall. The equation for the specific turbulence dissipation rate is given by equation (2). 2 1 ( ) ( ) 3 ( 2 ) ( 1) k D G D u F CD S Dt            = •  + − • − − − + (2) The equation for turbulent kinetic energy is shown by equation (3) and the turbulence viscosity is obtained by using equation (4). ( 2 ( ) ) ( ) 3 k k D k D k G k u k S Dt        = •  + − • − + (3) 1 1 1 23 ( ), k t a max a b F S   = (4) The solver used in this simulation is SIMPLEFOAM. SimpleFoam is a solver for incompressible turbulent flow, using the SIMPLE (Semi-Implicit Method for Pressure Linked Equations) algorithm. Where the SIMPLE method is used to solve equation (5). JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 157 0u• = (5) ( ) u u u R p S•  −• = − + (6) Equation (6) is the momentum equation. Where u is speed, p is the kinematic pressure, R is the stress tensor, uS and is the momentum source. Figure 1. Geometry of BFS Figure 2. Meshing area of the step region 2.2 Machine Learning Method Numerical simulation results using OpenFoam® are plotted into CSV form. Three machine learning models were selected to make predictions. The machine learning models used are Multi-Layer Perceptron, RandomForrest Regressor, and Multiple Linear Regression. The plotted dataset is split into two parts. As much as 80% is used as a data train for machine learning, and the remaining 20% is used as a data test. Table 1. Parameter MLP No. Parameter Value 1 number of hidden layers 25 2 number of nodes per hidden layer 100 3 activation function Swish 4 loss function MSE (Mean squared error) 5 optimization algorithm Adam 6 learning rate 2.5 x 10-6 7 batch size 10 8 L2 penalization coefficient 0 9 weight initialization function Xavier normal 10 patience for early stopping 30 Multi-Layer Perceptron (MLP) is the most widely used model in artificial neural network applications using back-propagation training algorithms. The definition of architecture in the MLP network is a very relevant point because the lack of connection can make the network unable to solve the problem of non-adjustable parameters, while excess connections can cause over-fitting of the training data [11]. JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 158 Table 2. RandomForrest Parameter Parameters No. Parameter Value 1 n_estimators 1000 2 criterion mse 3 max_depth 5 4 min_samples_split 2 5 min_samples_leaf 1 6 random_state 5 Table 3. Parameters of Multiple Linear Regression No. Parameter Value 1 fit_intercept true 2 normalize true 3 copy_X true 4 n_jobs none 5 random_state 0 6 positive false 3. RESULT AND DISCUSSION Post-processing of numerical simulation data is carried out in ParaView software. The extracted data are Cp and Cf in the area around the lower wall based on equation (7) and (8). 21 2 P P Cp U   − = (7) 21 2 wCf U    = (8) Where Pꝏ is the free-stream pressure (0Pa), P is the local pressure at the point (Pa), ρ is the density of the air (1.225 kg/m3), Uꝏ is the free-stream velocity (m/s), and τw is the local wall shear stress at the point (Pa). Figure 3. Cp H=12.62 mm JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 159 The re-attachment length is determined by the point where the Cp value begins to decrease from its maximum value or the point where the curve intersects the line along with the origin of the Y-axis (Cf). Figure 4. Cf H=12.62 mm In machine learning section, accuracy tests are carried out on each machine learning model used. Obtained for each accuracy value from the machine learning model as follows: Table 4. The value of machine learning model accuracy No. Model Value 1 Multi-Layer Perceptron -101.5% 2 RandomForrest Regressor 96% 3 Multiple Linear Regression 99% Based on the results of the accuracy test, in this study, predictions will be made using a machine learning model with the highest accuracy value, namely the Multiple Linear Regression model. The value of the model has a positive trend towards the test data shown in Figure 5. Figure 5. Distribution of predicted and actual data H=12.62 mm JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 160 However, the variation of BFS with a separation height of 9.465 mm, 6.31 mm, and 3.155 mm is predicted using the model that has been obtained. The obtained for Cp for each step height variation are as shown in Figure 6, and Cf in Figure 7. Figure 6. Cp BFS step with a height of 9,465 mm, 6.31 mm, and 3,155 mm predicted results Figure 7. Cf BFS step 9,465 mm, 6.31 mm, and 3,155 mm prediction results JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 161 Figure 8. Distribution of predicted and actual data 4. CONCLUSION Numerical simulations of BFS were performed in OpenFoam® software using the k- omega Shear Stress Transport (SST) turbulence model. Simulations were carried out on the Reynolds number of 36000 with the solver used was SIMPLEFOAM. The numerical simulation data is plotted into CSV form which is then used as a dataset for machine learning. In the machine learning section, 3 models were selected, namely Multi-Layer Perceptron, RandomForrest Regressor, and Multiple Linear Regression to predict Cp and Cf from the BFS variation with separation heights (steps) of 9,465 mm, 6.31 mm, and 3,155 mm using a numerical simulation dataset that has been done. The results of the accuracy test show that Multi-Layer Perceptron has an accuracy value of -101.5%, 96% for RandomForrest Regressor, and 99% for Multiple Linear Regression. With the highest accuracy value, Multiple Linear Regression was chosen to make predictions. The results show that the predicted value has a positive trend and is identical to the actual according to Figure 8. Thus, the machine learning model used in this study is said to be able to predict and reconstruct information from BFS turbulence from numerical simulation results. REFERENCES 1. Zawawi MH, Saleha A, Salwa A, Hassan NH, Zahari NM, Ramli MZ, et al. A review: Fundamentals of computational fluid dynamics (CFD). AIP Conference Proceedings. 2018;2030(November). Doi: https://doi.org/10.1063/1.5066893 2. Chen L, Asai K, Nonomura T, Xi G, Liu T. A review of Backward-Facing Step (BFS) flow mechanisms, heat transfer and control. Thermal Science and Engineering Progress. 2018;6(January):194–216. Doi: https://doi.org/10.1016/j.tsep.2018.04.004 3. Pereira JCF, SchöNung B. Experimental and theoretical investigation of backward- facing step flow. Journal of Fluid Mechanics. 1983;127(January):473–96. Doi: https://doi.org/10.1017/S0022112083002839 4. Al-Jelawy H, Kaczmarczyk S, Alkhafaji D, Mirhadizadeh S, Lewis R, Cross M. A Computational Investigation of a Turbulent Flow over a Backward Facing Step with OpenFOAM. Proceedings - 2016 9th International Conference on Developments in eSystems Engineering, DeSE 2016. 2017;301–7. Doi: https://doi.org/10.1109/DeSE.2016.47 https://doi.org/10.1063/1.5066893 https://doi.org/10.1016/j.tsep.2018.04.004 https://doi.org/10.1017/S0022112083002839 https://doi.org/10.1109/DeSE.2016.47 JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.6, No. 2, 2021 doi: https://doi.org/10.22219/jemmme.v6i2.19250 Ramadhan | Prediction Coefficient of Pressure and Wall Friction for Turbulent Flow 162 5. Ruck B, Makiola B. Flow separation over the inclined step. In: Physics of Separated Flows—Numerical, Experimental, and Theoretical Aspects. Springer; 1993. p. 47– 55. Doi: https://doi.org/10.1007/978-3-663-13986-7_8 6. Satheesh Kumar A, Singh A, Thiagarajan KB. Simulation of backward facing step flow using OpenFOAM®. AIP Conference Proceedings. 2020;2204(January). Doi: https://doi.org/10.1063/1.5141565 7. Sarghini F, Felice G, Santini S. Neural networks based subgrid scale modeling in large eddy simulations. Computers and Fluids. 2003;32(1):97–108. Doi: https://doi.org/10.1016/S0045-7930(01)00098-6 8. Tracey B, Duraisamy K, Alonso JJ. A machine learning strategy to assist turbulence model development. 53rd AIAA Aerospace Sciences Meeting. 2015;(January):1–23. Doi: https://doi.org/10.2514/6.2015-1287 9. Cappelli D, Mansour NN. Performance of Reynolds averaged Navier-Stokes models in predicting separated flows: Study of the hump flow model problem. 31st AIAA Applied Aerodynamics Conference. 2013;1–26. 10. Menter F. Zonal two equation k-turbulence models for aerodynamic flows, AIAA paper. In: 23rd fluid dynamics, plasmadynamics, and lasers conference, Orlando, Florida, USA. 1993. p. 2906. Doi: https://doi.org/10.2514/6.1993-2906 11. Ramchoun H, Amine M, Idrissi J, Ghanou Y, Ettaouil M. Multilayer Perceptron: Architecture Optimization and Training. International Journal of Interactive Multimedia and Artificial Intelligence. 2016;4(1):26. Doi: https://doi.org/10.9781/ijimai.2016.415 https://doi.org/10.1007/978-3-663-13986-7_8 https://doi.org/10.1063/1.5141565 https://doi.org/10.1016/S0045-7930(01)00098-6 https://doi.org/10.2514/6.2015-1287 https://doi.org/10.2514/6.1993-2906 https://doi.org/10.9781/ijimai.2016.415