NNPred: Deploying neural networks in computational fluid dynamics codes to facilitate data-driven modeling studies

被引:3
作者
Liu, Weishuo [1 ]
Song, Ziming [2 ]
Fang, Jian [3 ]
机构
[1] Beihang Univ, Sch Energy & Power Engn, 37 Xueyuan Rd, Beijing 100191, Peoples R China
[2] Chipone Technol Beijing Co Ltd, 2 Jingyuan North St, Beijing 100176, Peoples R China
[3] Sci & Technol Facil Council, Sci Comp Dept, Daresbury Lab, Keckwick Lane, Warrington WA4 4AD, England
基金
英国工程与自然科学研究理事会;
关键词
Data -driven modeling; Interfacing library; C plus plus; Fortran; CFD solver; TURBULENT CHANNEL FLOW; PREDICTION; SIMULATION;
D O I
10.1016/j.cpc.2023.108775
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
Data-driven modeling has contributed significantly to the field of computational fluid dynamics (CFD), but integrating machine-learning (ML) models into a CFD workflow still remains to be a challenging task. In this paper, we introduce an interface library for the deployment of ML models in CFD codes. The library supports multiple ML backends with binary interface compatibility and provides flexible data input/output (I/O) methods to match the type and layout of the data between ML models and CFD codes. For the convenience of CFD users, the library provides application programming interfaces for two widely used languages (i.e., C++ and Fortran), simplifying the deployment and prediction to only a few lines of code. Two data-driven modeling cases are demonstrated, along with the implementation details of the library in open-source CFD codes (i.e., OpenFOAM and CFL3D). The first case presents a simple heattransfer problem with assumed experimental data of unknown emissivity, where the basic use of the library in OpenFOAM is demonstrated by solving a diffusive equation with the source term modeled by various ML algorithms. The second case discusses the modeling of turbulence in channel flow, and applies an ML-integrated closure model in both OpenFOAM and CFL3D. In both software, the ML-RANS model reproduces almost identical results to the reference data and favorable extrapolation performance is maintained. In addition, the parallel efficiency is compared with the traditional closure model under the same homogeneous parallel architecture, and only limited additional cost is imposed by running the ML prediction. This library could benefit CFD researchers in rapidly testing data-driven models in their CFD solvers. modeling problem in heat transfer with assumed experimental data, whereas the second case reproduces the results of DNS with an ML-integrated turbulence model in two different CFD software (OpenFOAM and CFL3D). Finally, parallel computation is conducted using a homogeneous Message Passing Interface, which is adopted by most mainstream CFD programs. The extra costs are observed limited, and therefore users could validate their ideas on data-driven models with great convenience on parallel programs. Additional comments including restrictions and unusual features: Heterogeneous parallel strategy with GPU and associated applications need to be further developed. (c) 2023 The Author(s). Published by Elsevier B.V.
引用
收藏
页数:12
相关论文
共 43 条
[1]  
Abadi Martin, 2016, Proceedings of OSDI '16: 12th USENIX Symposium on Operating Systems Design and Implementation. OSDI '16, P265
[2]   Surface heat-flux fluctuations in a turbulent channel flow up to Reτ=1020 with Pr=0.025 and 0.71 [J].
Abe, H ;
Kawamura, H ;
Matsuo, Y .
INTERNATIONAL JOURNAL OF HEAT AND FLUID FLOW, 2004, 25 (03) :404-419
[3]   Direct numerical simulation of a fully developed turbulent channel flow with respect to the Reynolds number dependence [J].
Abe, H ;
Kawamura, H ;
Matsuo, Y .
JOURNAL OF FLUIDS ENGINEERING-TRANSACTIONS OF THE ASME, 2001, 123 (02) :382-393
[4]  
[Anonymous], 2022, ONNX RUNTIME HOME PA
[5]  
[Anonymous], 2022, INSTALL TENSORFLOW C
[6]  
Archambeau F., 2004, Int. J. Finite Volumes electronic journal, V1
[7]   A random forest guided tour [J].
Biau, Gerard ;
Scornet, Erwan .
TEST, 2016, 25 (02) :197-227
[8]   Perspective on machine learning for advancing fluid mechanics [J].
Brenner, M. P. ;
Eldredge, J. D. ;
Freund, J. B. .
PHYSICAL REVIEW FLUIDS, 2019, 4 (10)
[9]   Machine Learning for Fluid Mechanics [J].
Brunton, Steven L. ;
Noack, Bernd R. ;
Koumoutsakos, Petros .
ANNUAL REVIEW OF FLUID MECHANICS, VOL 52, 2020, 52 :477-508
[10]  
Bush I.J., 2007, NEW FORTRAN FEATURES