Machine Learning for RANS Turbulence Modelling of Variable Property Flows
Total Page:16
File Type:pdf, Size:1020Kb
Machine Learning for RANS Turbulence Modelling of Variable Property Flows Rafael Diez Technische Universiteit Delft Machine Learning for RANS Turbulence Modelling of Variable Property Flows by Rafael Diez in partial fulfillment of the requirements for the degree of Master of Science in Mechanical Engineering at the Delft University of Technology, to be defended publicly on Friday September 14, 2018 at 10:00 AM. Supervisor: Prof. dr. ir. R. Pecnik Thesis committee: Prof. dr. ir. B. J. Boersma, TU Delft Prof. dr. S. Hickel, TU Delft Prof. dr. ir. M. J. B. M. Pourquie, TU Delft An electronic version of this thesis is available at http://repository.tudelft.nl/. Abstract Turbulence modelling corresponds to one of the greatest unsolved problems in physics and mathemat- ics. This phenomenon is marked by the emergence of chaotic vortex structures in the solution of the Navier-Stokes equations, and it corresponds to the leading-order effect in the majority of the flows observed in nature. Due to the importance of turbulence modelling, researchers have designed RANS (Reynolds-Averaged Navier Stokes) turbulence models to understand their mean flow behavior. How- ever, one important limitation present in traditional RANS turbulence models is given by their focus on isothermal incompressible fluids, which present constant molecular properties. In order to overcome these limitations, the research previously done at the Process & Energy Department of the TU Delft has established new scaling theories for variable-property flows, which bring the greatest degree of univer- sal collapse observed to date. The application of these scaling theories to traditional RANS turbulence models has greatly improved their performance, although multiple-equation models still require further tuning. The present thesis work thus consisted in applying the principles of Machine Learning (ML) to build improved data-driven RANS turbulence models; using the DNS database assembled by the research group. Special emphasis was placed in an emerging technique called FIML (Field Inversion Machine Learning). This technique splits the process of building ML corrections into an initial data mining stage known as Field Inversion, and a subsequent Machine Learning stage where a predictive system is trained using the corrections found. During the present study, several advances were proposed for the previous methodology. The first contribution is given by the synthesis of a direct Hessian-free Field Inversion optimizer, which con- tinuously seeks the best learning hyper-parameters to use while remaining unconditionally stable. As a result, the Field Inversion optimization process can be fully automatized for any RANS turbulence model. This marked a large contrast with respect to the Field Inversion optimizers employed in leading publications, where probabilistic Bayesian inversion algorithms are used. These algorithms can result unnecessarily complex, since they perform a side-study of the probabilities associated to obtaining certain parameters, whereas the FIML approach only requires the final (or average) parameter distri- butions chosen. Beyond the previous discussion, performing a rigorous probabilistic analysis of a Field Inversion problem requires an expensive technique called MCMC (Markov-Chain Monte Carlo) sampling, which results intractable in large-scale systems. As a result, the probabilistic analysis performed by standard Field Inversion optimizers is based on strong Gaussian assumptions, whose effect cannot be immediately quantified. The overall Field Inversion methodology developed during the present work was further enhanced by creating a Sympy script to derive the algebraic expressions required to perform Field Inversion, which can be imported into any programming language. Thanks to this methodology, the running times registered in Python were improved by a factor of x1000 compared to the use of Automatic Dif- ferentiation libraries. Additionally, a strategy was created to build explicit source term corrections (휹) for any RANS turbulence model without compromising the numerical stability of the optimizers. This in- novation allowed Field Inversion optimizers to perform an unbiased analysis of any governing equation. Regarding the Neural Network systems built, the theoretical review performed revealed that loga- rithmic neurons could be added to the first layer of a Neural Network, such that the optimizer was able to identify the best parameter groups available. Important parameters can be found in this category, such as the Reynolds number, the Prandtl number, or any intermediate combinations (e.g., 푅푒푃푟). As a result, it was possible to build Neural Networks which could automatically discover adequate input features for the subsequent hidden layers, and the overall modelling process was greatly simplified. Furthermore, the present thesis work includes the derivation of a new intelligent relaxation factor methodology, which was created to eliminate any spurious corrections predicted by Neural Networks iii iv Abstract that may cause divergence. The methodology created scales well to large-scale systems, and it was able to perform an intelligent selection of the best corrections to keep in less than a millisecond during the tests performed. The final Field Inversion study centered in the Spalart-Allmaras (SA) and the MK turbulence models, since these models presented the lowest and the highest initial modelling errors respectively. The Field Inversion corrections obtained for the SA turbulence model presented a high degree of over-fitting and inconsistent patterns, which did not form a good basis to train Neural Networks. These issues were at- tributed to the high initial accuracy exhibited by the SA model, which implied that improvements could only be achieved through direct over-fitting. Similar trends were obtained during a secondary study performed for the turbulent Prandtl number (푃푟), which also presented inconsistent trends marginally deviating from 푃푟 ≈ 1. However, the Field Inversion corrections built for the MK turbulence model presented consistent trends, which were suitable for a Machine Learning study. After an exhaustive analysis, it was detected that the predictions made by Neural Networks for the source terms required by the k-equation of the MK turbulence model resulted more stable, and that the use of the intelligent relaxation factor methodology corresponded to an important asset. The FIML study for the MK turbu- lence model thus concluded with satisfactory results. From a global perspective, it was detected that the Field Inversion corrections built for RANS tur- bulence models presented a high degree of variability, which seems to be caused by their numerical properties instead of the actual flow physics. This insight was based on the derivation of a new tur- bulence parameter for rectangular channel flows, which was able to collapse the turbulence statistics of all the DNS flows studied into similar trajectory curves. As a result, it was finally concluded that the FIML methodology developed can be employed to perform successful Machine Learning studies, but also that new turbulence parameters should be developed in order to create more reliable predictive systems in the future. Contents List of Figures vii List of Tables xi Acknowledgements xiii 1 Introduction 1 1.1 Overview . 1 1.2 Thesis Objectives and Contributions . 2 1.3 Thesis Outline . 3 2 Theoretical Background 5 2.1 Fluid Mechanics . 5 2.1.1 Navier-Stokes Equations . 5 2.1.2 Energy Equation . 6 2.1.3 Dimensionless Form of the Governing Equations . 8 2.1.4 Reynolds-Averaged Navier-Stokes Equations . 11 2.1.5 Alternatives to RANS Turbulence Modelling . 13 2.1.6 Boundary Layer Structures. 15 2.1.7 RANS Turbulence Models . 17 2.2 Parameter Optimization . 21 2.2.1 General Paradigm . 21 2.2.2 Gradient-based Optimization. 22 2.2.3 Computation of the Jacobian Matrix . 23 2.2.4 Hessian Optimization . 25 2.2.5 Jacobian Optimization Algorithms. 27 2.3 Machine Learning Applied to CFD . 30 2.3.1 Neural Networks . 31 2.3.2 Convolutional Neural Networks . 33 2.3.3 Long Short Term Memory Neural Networks . 34 2.3.4 Logarithmic Neural Networks. 35 2.3.5 Model Selection . 36 2.3.6 Other Machine Learning Techniques . 37 2.3.7 Field Inversion Machine Learning . 39 3 Preliminary Examples 41 3.1 Field Inversion for a 1-D Radiative Heat Transfer Problem . 41 3.2 Recovery of a Laminar Viscosity Profile . 44 3.3 Field Inversion Optimization for the 푘-휔 Turbulence Model . 46 3.4 Deep Dreaming the Existence of the Reynolds Number . 49 4 Data-Driven RANS Turbulence Modelling for Variable Property Flows 53 4.1 RANS Equations Applied to Channel Flows . 53 4.2 DNS Database Assembled. 54 4.2.1 Performance of Traditional RANS Turbulence Models in the Dataset . 56 4.3 Field Inversion Optimization . 58 4.3.1 Field Inversion Formulation for the MK Turbulence Model . 58 4.3.2 Field Inversion Optimization for the Spalart-Allmaras Turbulence Model . 60 4.3.3 Field Inversion Study for the Turbulent Prandtl Number . 61 v vi Contents 4.4 Field Inversion Optimization Results . 62 4.4.1 MK Turbulence Model . 62 4.4.2 Field Inversion Results for the SA turbulence model . 70 4.4.3 Field Inversion Results for the Turbulent Prandtl Number . 73 4.5 Machine Learning Systems . 75 4.5.1 Derivation of an Intelligent Relaxation Factor . 75 4.5.2 Neural Network Architectures . 78 4.6 Final Remarks . 85 5 Alternative Machine Learning Formulation for Turbulent Channel Flows 87 5.1 Mathematical Derivation of a New Turbulence Parameter (Φ). 87 5.2 Machine Learning Predictive System . 90 5.3 Final Remarks . 94 6 Conclusions and Recommendations 95 6.1 Summary and Conclusions . 95 6.2 Recommendations . 97 A Source Code for the Examples Presented in Chapter 3 99 A.1 Field Inversion Optimization of a 1-D Radiative Heat Transfer Profile . 99 A.1.1 Version A: Build 휷 multipliers for 푃 (Inefficient) . 99 A.1.2 Version B: Build Explicit 휹 Source Term Corrections (Efficient) . .104 A.2 Recovery of a Dynamic Viscosity Profile . .109 A.3 Field Inversion Optimization for the 푘 − 휔 Turbulence Model .