计算机科学 ›› 2022, Vol. 49 ›› Issue (3): 3-10.doi: 10.11896/jsjkx.210700060

• 新兴分布式计算技术与系统* 上一篇    下一篇

OpenFoam中多面体网格生成的MPI+OpenMP混合并行方法

刘江1, 刘文博1,2, 张矩1   

  1. 1 中国科学院重庆绿色智能技术研究院 重庆400714
    2 中国科学院大学 北京100049
  • 收稿日期:2021-07-06 修回日期:2021-12-06 出版日期:2022-03-15 发布日期:2022-03-15
  • 通讯作者: 刘文博(liuwenbo@cigit.ac.cn)
  • 作者简介:(liujiang@cigit.ac.cn)
  • 基金资助:
    国家重点研发计划(2018YFC0116704);四川省科技计划项目(2020YFQ0056)

Hybrid MPI+OpenMP Parallel Method on Polyhedral Grid Generation in OpenFoam

LIU Jiang1, LIU Wen-bo1,2, ZHANG Ju1   

  1. 1 Chongqing Institute of Green and Intelligent Technology,Chinese Academy of Sciences,Chongqing 400714,China
    2 University of Chinese Academy Science,Beijing 100049,China
  • Received:2021-07-06 Revised:2021-12-06 Online:2022-03-15 Published:2022-03-15
  • About author:LIU Jiang,born in 1979,Ph.D,associate professor,is a member of China Computer Federation.His main research interests include computability theory,formal methods and computer algorithms.
    LIU Wen-bo,born in 1996,postgra-duate.His main research interests include computational fluid dynamics and high-performance computing.
  • Supported by:
    National Key R & D Program of China(2018YFC0116704) and Sichuan Science and Technology Program(2020YFQ0056).

摘要: 网格生成是计算流体力学中非常重要的一环,大规模数值模拟过程中对网格精度要求的提高会导致网格生成所耗的时间增加。文中基于OpenFoam开源软件中的网格生成算法,主要研究多面体网格的并行生成,并提出OpenMP和MPI混合并行的多面体网格生成方法。通过理论分析得到,使用混合并行方法生成相同质量的网格时,混合并行方法生成网格的时间消耗随着线程数量和网格单元数量的增加而减少。3组使用不同求解器的数值模拟实验结果表明,该混合并行方法不但可以保证生成网格的质量——可以正常进行数值计算模拟且模拟结果与原方法相比几乎没有差别,而且生成同样质量与数量网格的耗时最多可以缩短至未使用OpenMP并行方法之耗时的1/4以内。

关键词: MPI+OpenMP混合并行, OpenFoam, 并行效率, 多面体网格生成, 计算流体力学

Abstract: Grid generation is an important step of computational fluid dynamics.In the process of large-scale numerical simulation,the time consumption of grid generation increases with the number of grids which often increases with the simulation accuracy.Based on the grid generation algorithm in an open-source software called OpenFoam,this paper proposes a hybrid parallel me-thod of OpenMP and MPI for polyhedral grid generation.By theoretical analysis,we show that when the hybrid parallel method is used to generate the same quality grids,increasing the number of threads and grid cells will reduce the time consumption of grid generation.Three numerical simulations using different solvers show that the grids generated by the hybrid parallel method and the original method have close qualifications,and the simulation results are almost indistinguishable from those of the original method.Furthermore,the time consumption of this method to generate the same quality and quantity grids can be reduced to less than a quarter of the time consumption without using OpenMP parallel method.

Key words: Computational fluid dynamics, MPI+OpenMP hybrid parallelization, OpenFoam, Parallel efficiency, Polyhedral grid generation

中图分类号: 

  • V211.3
[1]LUO L,GAO Z X,JIANG C W.CFD Development and Application in Aviation[J].Aeronautical Manufacturing Technology,2016,515(20):77-81.
[2]WINTER M,HECKMEIER F M,BREITSAMTER C.CFD-based aeroelastic reduced-order modeling robust to structural parameter variations[J].Aerospace Science and Technology,2017,67:13-30.
[3]JAMESON A,MARTINELLI L,VASSBERG J.Using computational fluid dynamics for aerodynamics--a critical assessment [C]//Proceedings of the Proceedings of ICAS.2002.
[4]ALI Z,TYACKE J,WATSON R,et al.Efficient preprocessing of complex geometries for CFD simulations[J].International Journal of Computational Fluid Dynamics,2019,33(3):98-114.
[5]NGUYEN V T,VU D T,PARK W G,et al.Navier--Stokes solver for water entry bodies with moving Chimera grid method in 6DOF motions[J].Computers & Fluids,2016,140:19-38.
[6]ALFONSI G.Reynolds-averaged Navier--Stokes equations forturbulence modeling[J].Applied Mechanics Reviews,2009,62(4):933-944.
[7]AHRENS J,GEVECI B,LAW C.Paraview:An end-user tool for large data visualization[J].The Visualization Handbook,2005:717-31.
[8]WANG M.Design and Implementation of Parallel Graph-partitioning Methods for OpenFoam [D].Changsha:National University of Defense Technology,2012.
[9]JASAK H,JEMCOV A,TUKOVIC Z,et al.OpenFoam:AC++ library for complex physics simulations[C]//Proceedings of the International Workshop on Coupled Methods in Numerical Dynamics.2007.
[10]FABRITIUS B O,TABOR G.Improving the quality of finite volume meshes through genetic optimisation[J].Engineering with Computers,2016,32(3):425-440.
[11]KORTELAINEN J.Meshing Tools for Open Source CFD:APractical Point of View [J/OL].VTT.https://cris.vtt.fi/en/publications/meshing-tools-for-open-source-cfd-a-practical-point-of-view.
[12]GISEN D.Generation of a 3D mesh using snappyHexMesh featuring anisotropic refinement and near-wall layers [C]//Proceedings of the ICHE 2014 Proceedings of the 11th International Conference on Hydroscience & Engineering.2014.
[13]XU C F,CHE Y G,LI D L,et al.Research progresses of large-scale parallel computing for high-order CFD on the Tianhe supercomputer[J].Computer Engineering & Science,2020,42(10):1815-1826.
[14]SUN H Q.Redearch of Parallel Computing in ComputationalFluid Dynamics [D].Dalian:Dalian University of Technology,2005.
[15]LÖHNER R,CAMBEROS J,MERRIAM M.Parallel unstructured grid generation[J].Computer Methods in Applied Mechanics and Engineering,1992,95(3):343-357.
[16]LIU S.Research on High Quality Unstructured Mesh Generation Algorithms with Multilevel Parallelism [D].Changsha:National University of Defense Technology,2019.
[17]QI L,XIAO S M,LIU Y C,et al.Research on Parallel Unstructured Mesh Generation Technology Based on GPU[J].Machi-nery Design & Manufacture,2013,2:184-186.
[18]XU Q,LIU T T,LENG J L,et al.Multilevel parallel tetrahedral mesh generation for complex geometric models[J].Journal of National University of Defense Technology,2021,43(2):33-39.
[19]LEE S B.Numerical discrepancy between serial and MPI parallel computations[J].International Journal of Naval Architecture and Ocean Engineering,2016,8(5):434-441.
[20]TOWARA M,SCHANEN M,NAUMANN U.MPI-parallel discrete adjoint OpenFoam[J].Procedia Computer Science,2015,51:19-28.
[21]CAI Y L,XIAO S M,QI L.Locking paralleled GPU-based me-thod research for unstructured mesh generation[J].Computer Engineering and Applications,2013,50(6):56-60.
[22]WEI F,JIN L,LIU J,et al.GPU acceleration of a 2D compressible Euler solver on CUDA-based block-structured Cartesian meshes[J].Journal of the Brazilian Society of Mechanical Sciences and Engineering,2020,42(5):1-12.
[23]WANG N H,CHANG X H,ZHAO Z,et al.Implementation of hybrid MPI+OpenMP parallelization on unstructured CFD solver and its applications in massive unsteady simulations[J].Acta Aeronautica et Astronautica Sinica,2020,41(10):190-204.
[24]HU X,LU Z,ZHANG J,et al.A parallel algorithm for chimera grid with implicit hole cutting method[J].The International Journal of High Performance Computing Applications,2020,34(2):169-177.
[25]CHANG X H,MA R,WANG N H,et al.A parallel implicithole-cutting method based on background mesh for unstructured Chimera grid[J].Computers & Fluids,2020,198:104403.
[27]OpenFOAM User Guide [M/OL].https://www.openfoam.com/documentation/user-guide/4-mesh-generation-and-conversion/4.4-mesh-generation-with-the-snappyhexmesh-utility,2021.
[28]JARPNER C.Projection of a mesh on a.stl surface[J/OL].Chalmers University of Technology.http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2011/ChristofferJarpner/ReportInOpenFOAMbyChristofferJarpner.pdf.
[1] 陈鑫, 李芳, 丁海昕, 孙唯哲, 刘鑫, 陈德训, 叶跃进, 何香.
面向国产异构众核架构的CFD非结构网格计算并行优化方法
Parallel Optimization Method of Unstructured-grid Computing in CFD for DomesticHeterogeneous Many-core Architecture
计算机科学, 2022, 49(6): 99-107. https://doi.org/10.11896/jsjkx.210400157
[2] 汪晋, 刘江.
基于GPU的并行DILU预处理技术
GPU-based Parallel DILU Preconditioning Technique
计算机科学, 2022, 49(6): 108-118. https://doi.org/10.11896/jsjkx.210300259
[3] 孟德龙,文敏华,韦建文,林新华.
神威太湖之光上OpenFOAM的移植与优化
Porting and Optimizing OpenFOAM on Sunway TaihuLight System
计算机科学, 2017, 44(10): 64-70. https://doi.org/10.11896/j.issn.1002-137X.2017.10.012
[4] 王文义,王春霞,王杰.
基于CMP多核集群的混合并行编程技术研究
Research on Hybrid Parallel Programming Technique Based on CMP Multi-cure Cluster
计算机科学, 2014, 41(2): 19-22.
[5] 马欣荣,刘三阳,段治健.
带状线性方程组的含参交替方向并行算法
Parallel Alternating Direction Algorithm with Parameters for Solving Banded Linear Systems
计算机科学, 2014, 41(2): 249-252.
[6] 朱小谦,孟祥飞,营晓东,冯景华.
“天河一号”大规模并行应用程序测试
Performance Test of Massively Parallel Program on TH-lA
计算机科学, 2012, 39(3): 265-267.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!