天然气工业2024,Vol.44Issue(2) :156-165.DOI:10.3787/j.issn.1000-0976.2024.02.015

掺氢天然气管网数值仿真轻量化算法

Lightweight algorithm for numerical simulation of hydrogen blending natural gas pipeline network

石国赟 宇波
天然气工业2024,Vol.44Issue(2) :156-165.DOI:10.3787/j.issn.1000-0976.2024.02.015

掺氢天然气管网数值仿真轻量化算法

Lightweight algorithm for numerical simulation of hydrogen blending natural gas pipeline network

石国赟 1宇波2
扫码查看

作者信息

  • 1. 北京石油化工学院机械工程学院;北京市安全生产工程技术研究院;北京航空航天大学航空发动机研究院
  • 2. 北京石油化工学院机械工程学院
  • 折叠

摘要

目前针对管网数值仿真算法的优化主要集中在代数方程组的求解上.针对管网流动数值仿真算法提升计算效率方案中缺少针对封闭关系与状态方程的优化,分析了目前优化方案各模块的耗时情况,发现了仿真程序中耗时模块为封闭关系与状态方程求解.最后,结合计算机库函数的缺点以及现代CPU中SIMD(Single Instruction Multiple Data)模型的特点,提出了针对封闭关系与状态方程的轻量化算法,并验证了算法的高效性.研究结果表明:①封闭关系与状态方程模型中的耗时原因为直接调用库函数的次幂运算、指数运算、对数运算以及除法运算;②由于次幂运算效率远低于其他运算,通过变换消除了模型中几乎所有的次幂运算;③利用SIMD指令来计算指数运算与对数运算,实现了在单核CPU上同时计算多个数据的指数与对数,最后通过数学变换将所有除法转换为乘法;④轻量化算法加速效果显著,其整体加速比为 18,而在状态方程求解模块的加速比更是高达 70 以上.结论认为,该轻量化算法在不影响计算精度的条件下提高了计算速度,对于提高掺氢天然气管网在线仿真与智能管网的建设具有重要的理论价值和技术支撑.

Abstract

At present,optimization of the numerical simulation algorithm for pipeline networks mainly focuses on solving the algebraic equation set.The scheme to improve the calculation efficiency of numerical simulation algorithm for pipeline network flow lacks the optimization of loop relationship and equation of state(EOS).To this end,this paper analyzes the time consumption situations of each module in the optimization scheme.It shows that the time consuming module in the simulation program is used to solve loop relationship and EOS.Finally,based on the disadvantages of computer built-in function and the characteristics of SIMD(Single Instruction Multiple Data)model in CPU,a lightweight algorithm for loop relationship and EOS is developed,and its efficiency is verified.And the following research results are obtained.First,the time consumption of the loop relationship and EOS model is caused by the direction call of the power operation,exponentiation operation,logarithm operation and division operation of built-in function.Second,the efficiency of power operation is much lower than that of other operations,so nearly all power operations of the model are eliminated through transformation.Third,SIMD order is applied in exponentiation operation and logarithm operation,which realizes the simultaneous calculation of the exponentiations and logarithms of multiple data in the single-core CPU.Eventually,all divisions are transformed into multiplications through mathematical transformation.Fourth,the lightweight algorithm achieves a remarkable speed-up effect,and its overall speed-up ratio is 18 and even over 70 in the EOS solving module.In conclusion,this lightweight algorithm improves the calculation speed without influencing the calculation accuracy,which provides important theoretical value and technological support for the online simulation of hydrogen blending natural gas pipeline networks and the construction of intelligent pipeline networks.

关键词

天然气管网/数值仿真/计算效率/状态方程/加速比/掺氢

Key words

Natural gas pipeline network/Numerical simulation/Calculation efficiency/Equation of state(EOS)/Speed-up ratio/Hydrogen blending

引用本文复制引用

基金项目

国家重点研发计划"氢能技术"重点专项(2021YFB4001602)

出版年

2024
天然气工业
四川石油管理局 中国石油西南油气田公司 中国石油川庆钻探工程公司

天然气工业

CSTPCDCSCD北大核心EI
影响因子:2.298
ISSN:1000-0976
被引量1
参考文献量32
段落导航相关论文