Font Size: a A A

Optimization And Realization Of Natural Gas Compressibility Factor Algorithm

Posted on:2020-06-21Degree:MasterType:Thesis
Country:ChinaCandidate:Y C XuFull Text:PDF
GTID:2381330590994951Subject:Microelectronics and Solid State Electronics
Abstract/Summary:PDF Full Text Request
With the development of the natural gas industry,the accuracy requirements for flow metering are increasing,and the compression factor is closely related to the accuracy of the measurement results.The AGA8-92DC and SGERG-88 compression factor algorithms in the standard GB/T 17747 have high accuracy,but the complexity of the calculation process limits its application platform,usually only in PC.For embedded devices such as portable flow meters and pipeline gas meters,it is difficult to guarantee the real-time performance of these algorithms due to the weak CPU processing capability.Therefore,studying and improving these algorithms to make them run fluently on low-power MCUs has great significance to enhance the practicability of gas meters and improve metering efficiency.Firstly,this paper studies the execution process of AGA8-92DC and SGERG-88algorithms,and elaborates them in detail.After that,the disadvantages of the existing compression factor calculation program based on the above algorithms,such as slow speed,large resource consumption and non-convergence of iteration,were identified through tracking and debugging,and specific improvement measures were proposed for each step of the program.For the original AGA8-92DC calculation program,solving the transcendental equation about the molar density is the most time-consuming part in the whole process.Based on this problem,the paper tried the dichotomy,secant method and Newton iteration method respectively to optimize this process and replace the inefficient method of traversing the solution interval with a fixed step size in the original program,and proposed the method of calculating both state equation function value and its derivative value in the same sum cycle to ensure the efficiency of the iterative process.In addition,the calculation process of Coefficient B and C_n~*requires a large number of constants.The paper simplified the solution steps of the coefficients above through studying the characteristics of the constants in this algorithm,and used storage optimizing method(such as triple-elements-group)to reduce the space occupied by the constants.Aiming at the SGERG-88 calculation program,firstly,the paper improved its double iterative loop structure by analyzing the trend of the iterative error and enhances the robustness of the program.Secondly,the calculation process of Virial coefficients B,C and its component coefficient polynomial was optimized,the number of multiplications was reduced.Finally,the tangent method was used to replace the original fixed point method to optimize the solution efficiency of the equation of state,and the convergence stability of the process was improved as well.At the end of the paper,a test program was designed to transplant the algorithms above to the target embedded platform to run the test.The execution time and error of each step of the calculation program before and after optimization are obtained.Through comparison and analysis,the reliability of the optimization result is verified.It has certain guiding significance to improve the usability of compression factor algorithm in GB/T17747.
Keywords/Search Tags:Natural gas compression factor, program optimization, AGA8-92DC algorithm, SGERG-88 algorithm
PDF Full Text Request
Related items