PythonFOAM:使用OpenFOAM和Python进行现场数据分析
PythonFOAM: In-situ data analyses with OpenFOAM and Python
摘要:
我们概述了一个通用的基于Python的数据分析工具OpenFOAM的发展。我们的实现依赖于OpenFOAM应用程序的构造,这些应用程序绑定到Python中的数据分析库。使用NumPy C-API将OpenFOAM中的双精度数据转换为NumPy数组,然后可以使用Python模块进行任意数据分析和流场信息操作。我们强调如何建议的包装器可以用于在Python中实现的原位在线奇异值分解(SVD),并从OpenFOAM求解器PimpleFOAM访问。这里,“原位”是指允许在用于偏微分方程求解器的相同计算资源上并行计算数据分析的编程范例。此外,为了演示数据并行分析,我们部署了一个分布式SVD,它收集分布式仿真的各个行列的快照数据,以计算全局左奇异向量。至关重要的是,OpenFOAM和Python共享相同的消息传递接口(MPI)通信器,允许Python对象和函数跨行列交换NumPy数组。随后,我们提供了缩放评估的英特尔Broadwell和KNL架构的多个节点上的分布式SVD的典型测试情况下,如大涡模拟的一个向后面对的步骤和通道流在摩擦雷诺数为395。最后,我们展示了使用自动编码器压缩流场信息的深度神经网络的部署,以展示在Python生态系统中使用最先进的机器学习工具的能力。
英文摘要:
We outline the development of a general-purpose Python-based data analysis tool for OpenFOAM. Our implementation relies on the construction of OpenFOAM applications that have bindings to data analysis libraries in Python. Double precision data in OpenFOAM is cast to a NumPy array using the NumPy C-API and Python modules may then be used for arbitrary data analysis and manipulation on flow-field information. We highlight how the proposed wrapper may be used for an in-situ online singular value decomposition (SVD) implemented in Python and accessed from the OpenFOAM solver PimpleFOAM. Here, `in-situ' refers to a programming paradigm that allows for a concurrent computation of the data analysis on the same computational resources utilized for the partial differential equation solver. In addition, to demonstrate data-parallel analyses, we deploy a distributed SVD, which collects snapshot data across the ranks of a distributed simulation to compute the global left singular vectors. Crucially, both OpenFOAM and Python share the same message passing interface (MPI) communicator for this deployment which allows Python objects and functions to exchange NumPy arrays across ranks. Subsequently, we provide scaling assessments of this distributed SVD on multiple nodes of Intel Broadwell and KNL architectures for canonical test cases such as the large eddy simulations of a backward facing step and a channel flow at friction Reynolds number of 395. Finally, we demonstrate the deployment of a deep neural network for compressing the flow-field information using an autoencoder to demonstrate an ability to use state-of-the-art machine learning tools in the Python ecosystem.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。