Lightweight algorithm for numerical simulation of hydrogen blending natural gas pipeline network
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.
Natural gas pipeline networkNumerical simulationCalculation efficiencyEquation of state(EOS)Speed-up ratioHydrogen blending