Method, device and equipment for calculating natural gas pipeline pipe inventory and storage medium

CN117010148BActive Publication Date: 2026-10-30CHINA UNIV OF PETROLEUM (BEIJING) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310729847.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2026-10-30
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

[0005]本发明提供一种天然气管道管存量计算方法、装置、设备及存储介质, 以解决现有技术利用平均温度和压力计算管存量的传统稳态计算方法,所存在的计算结果误差较大问题

Benefits of technology

[0048]本发明提供的天然气管道管存量计算方法、装置、设备及存储介质。将天然气管道划分为多个微元段,对每个微元段,获取微元段起点的压力初始值、温度初始值和压缩因子初始值;再计算微元段终点的压力计算值、温度计算值和压缩因子计算值;根据微元段起点压力初始值、温度初始值和压缩因子初始值,以及微元段终点的压力计算值、温度计算值和压缩因子计算值,得到微元段的管存量;针对所有的微元段的管存量进行求和,得到天然气管道的管存量。该方法解决了现有技术利用平均温度和压力计算管存量传统稳态计算方法,所存在的结果误差大问题,使得计算精度与稳态管存计算工具相比得到较大提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117010148B_ABST
    Figure CN117010148B_ABST
Patent Text Reader

Abstract

The application provides a natural gas pipeline pipe inventory calculation method, device, equipment and storage medium. The method comprises the following steps: dividing the natural gas pipeline into a plurality of micro-segments; for each micro-segment, obtaining the initial pressure value, the initial temperature value and the initial compression factor value of the starting point of the micro-segment; then calculating the pressure calculation value, the temperature calculation value and the compression factor calculation value of the ending point of the micro-segment; obtaining the pipe inventory of the micro-segment according to the initial pressure value, the initial temperature value and the initial compression factor value of the starting point of the micro-segment and the pressure calculation value, the temperature calculation value and the compression factor calculation value of the ending point of the micro-segment; and summing up the pipe inventories of all the micro-segments to obtain the pipe inventory of the natural gas pipeline, so that the calculation accuracy is greatly improved compared with the steady-state pipe inventory calculation tool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural gas transportation, and in particular to a method, apparatus, equipment, and storage medium for calculating the stock of natural gas pipelines. Background Technology

[0002] Natural gas pipeline inventory refers to the actual volume of natural gas stored in the pipeline under standard conditions. It is a comprehensive indicator reflecting the pressure, temperature, operational configuration, and efficiency of the pipeline during operation, and is also an important indicator for controlling the balance of gas entering and leaving the pipeline. Moreover, pipeline inventory calculation plays an important role in transmission difference analysis and loss rate analysis.

[0003] When calculating the inventory of natural gas pipelines, the traditional steady-state calculation method based on average temperature and average pressure is often used. Under standard conditions, the commonly used pipeline inventory calculation formula is derived from the theoretical calculation formula for actual gas state. Then, parameters such as average temperature and pressure are substituted into the pipeline inventory calculation formula to obtain the natural gas pipeline inventory under steady-state conditions.

[0004] Although existing technical solutions mainly rely on steady-state pipe inventory calculation formulas, they are not suitable for calculating pipe inventory in actual, unsteady-state conditions on-site. Traditional steady-state calculation methods that use average temperature and pressure to calculate pipe inventory are prone to large errors in the calculation results, making it difficult for on-site personnel of gas supply pipelines to accurately obtain pipeline inventory values. Summary of the Invention

[0005] This invention provides a method, apparatus, equipment, and storage medium for calculating the inventory of natural gas pipelines, in order to solve the problem of large calculation errors in the traditional steady-state calculation method that uses average temperature and pressure to calculate the inventory of pipelines.

[0006] In a first aspect, the present invention provides a method for calculating the stock of natural gas pipelines, comprising:

[0007] The natural gas pipeline is divided into multiple micro-segments;

[0008] For each micro-segment, obtain the initial values ​​of pressure, temperature, and compressibility factor at the starting point of the micro-segment;

[0009] Based on the initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment, the calculated pressure value at the ending point of the micro-segment is obtained; based on the initial temperature value at the starting point of the micro-segment, the initial pressure value at the starting point of the micro-segment, and the calculated pressure value at the ending point of the micro-segment, the calculated temperature value at the ending point of the micro-segment is obtained; based on the initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment, the calculated compressibility factor value at the ending point of the micro-segment is obtained.

[0010] Based on the initial pressure, initial temperature, and initial compressibility factor of the starting point of the micro-segment, and the calculated pressure, calculated temperature, and calculated compressibility factor of the ending point of the micro-segment, the pipe stock of the micro-segment is obtained.

[0011] The total pipe inventory of the natural gas pipeline is obtained by summing the pipe inventory of all the micro-segments.

[0012] In one possible design, the step of obtaining the calculated pressure value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment; obtaining the calculated temperature value of the endpoint of the micro-segment based on the initial temperature value, the initial pressure value, and the calculated pressure value of the endpoint of the micro-segment; and obtaining the calculated compressibility factor value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment, includes:

[0013] The initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment are input into the pressure formula to obtain the calculated pressure value at the ending point of the micro-segment.

[0014] The initial temperature value at the starting point of the micro-segment, the initial pressure value at the starting point of the micro-segment, and the calculated pressure value at the ending point of the micro-segment are input into the temperature formula to obtain the calculated temperature value at the ending point of the micro-segment.

[0015] The initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment are input into the compressibility factor formula to obtain the calculated compressibility factor value at the ending point of the micro-segment.

[0016] In one possible design, the pressure formula is:

[0017]

[0018] In the formula: P2 is the calculated pressure value at the end of the micro-element segment; P1 is the initial pressure value at the beginning of the micro-element segment; T1 is the initial temperature value at the beginning of the micro-element segment; Z1 is the initial compressibility factor value at the beginning of the micro-element segment. The flow rate of the micro-element pipe segment is m. 3 / s; Let be the inner diameter of the micro-element pipe segment, in meters (m). The relative density of the gas; is the friction coefficient, which is calculated using the F·Colebrook formula; dl is the length of the infinitesimal segment; C0 is a constant with a value of 0.03848.

[0019] In one possible design, the temperature formula is:

[0020]

[0021] In the formula: T2 is the calculated temperature at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; The natural gas throttling coefficient is expressed in °C / MPa. Where is the ambient temperature, K; P1 is the initial pressure value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; dl is the length of the micro-element.

[0022] in addition,

[0023] In the formula, The heat transfer coefficient from the outer surface of the pipe to the surrounding medium is expressed in W / (m²). 2 ·K); The gas mass flow rate is expressed in kg / s. Specific heat at constant pressure, kJ / kg·K.

[0024] In one possible design, the compression factor formula is:

[0025]

[0026] In the formula: Z2 is the calculated compressibility factor at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; Here, is the compressibility factor parameter; R is the universal gas constant, kJ / (kmol·K); Let be the molar density of the gas phase, kmol / m³. For the cross-section corresponding to the starting point of the micro-element, the calculation formula is:

[0027]

[0028] In the formula: P1 is the initial pressure value at the starting point of the micro-element segment; Z1 is the initial compressibility factor value at the starting point of the micro-element segment.

[0029] In one possible design, obtaining the pipe stock of the micro-segment based on the initial pressure, initial temperature, and initial compressibility factor values ​​at the starting point of the micro-segment, and the calculated pressure, calculated temperature, and calculated compressibility factor values ​​at the ending point of the micro-segment, includes:

[0030] Input the initial values ​​of the starting pressure, temperature, and compressibility factor of the micro-segment, as well as the calculated values ​​of the ending pressure, temperature, and compressibility factor of the micro-segment, into the pipe storage calculation formula of the micro-segment to solve for the pipe storage of the micro-segment.

[0031] In one possible design, the formula for calculating the storage capacity of the micro-element segment is:

[0032]

[0033]

[0034]

[0035] In the formula: This refers to the stock of micro-element tubes; Pressure under standard conditions, MPa; Temperature under standard conditions, in K; P1 is the compressibility factor of the gas under standard conditions; T1 is the initial pressure value at the beginning of the micro-element; T1 is the initial temperature value at the beginning of the micro-element; Z1 is the initial compressibility factor value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; T2 is the calculated temperature value at the end of the micro-element; Z2 is the calculated compressibility factor value at the end of the micro-element. For a fixed volume of a micro-element pipe segment, the formula is:

[0036]

[0037] In the formula, dl is the inner diameter of the micro-element pipe segment, in meters; dl is the length of the micro-element segment.

[0038] In a second aspect, the present invention provides a natural gas pipeline inventory calculation device, comprising:

[0039] The segmentation module is used to divide the natural gas pipeline into multiple micro-segments;

[0040] The acquisition module is used to acquire the initial pressure value, initial temperature value, and initial compressibility factor value of the starting point of each micro-segment.

[0041] The first calculation module is used to obtain the pressure calculation value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment; to obtain the temperature calculation value of the endpoint of the micro-segment based on the initial temperature value, the initial pressure value, and the initial pressure value of the endpoint of the micro-segment; and to obtain the compressibility factor calculation value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment.

[0042] The second calculation module is used to obtain the pipe inventory of the micro-segment based on the initial pressure, initial temperature and initial compressibility factor of the starting point of the micro-segment, and the calculated pressure, calculated temperature and calculated compressibility factor of the ending point of the micro-segment.

[0043] The summation module is used to sum the pipe inventory of all micro-segments to obtain the pipe inventory of the natural gas pipeline.

[0044] Thirdly, the present invention provides a computer device, comprising: at least one processor and a memory;

[0045] The memory stores computer-executed instructions;

[0046] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the natural gas pipeline inventory calculation method as described in the first aspect and various possible designs of the first aspect.

[0047] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the natural gas pipeline inventory calculation method described in the first aspect and various possible designs of the first aspect.

[0048] This invention provides a method, apparatus, equipment, and storage medium for calculating the inventory of natural gas pipelines. The natural gas pipeline is divided into multiple micro-segments. For each micro-segment, the initial pressure, initial temperature, and initial compressibility factor values ​​at the starting point are obtained. Then, the calculated pressure, calculated temperature, and calculated compressibility factor values ​​at the ending point of the micro-segment are calculated. Based on these initial values, the inventory of the micro-segment is obtained. Finally, the inventory values ​​of all micro-segments are summed to obtain the total inventory of the natural gas pipeline. This method solves the problem of large errors in traditional steady-state calculation methods that use average temperature and pressure to calculate pipeline inventory, resulting in a significant improvement in calculation accuracy compared to steady-state inventory calculation tools. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a schematic diagram illustrating an application scenario of the natural gas pipeline inventory calculation method provided in this embodiment of the invention.

[0051] Figure 2 A schematic diagram of the pipeline inventory calculation method for natural gas pipelines provided in an embodiment of the present invention;

[0052] Figure 3 This is a schematic diagram of the micro-segment division of a natural gas pipeline provided in an embodiment of the present invention;

[0053] Figure 4 A schematic diagram of the structure of a natural gas pipeline inventory calculation device provided in an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] Natural gas pipeline inventory refers to the actual volume of natural gas stored in the pipeline under standard conditions. It is a comprehensive indicator reflecting the pressure, temperature, operational configuration, and efficiency of the pipeline during operation, and is also an important indicator for controlling the balance of gas entering and leaving the pipeline. Moreover, pipeline inventory calculation plays an important role in transmission difference analysis and loss rate analysis.

[0057] When calculating pipeline inventory, the traditional steady-state calculation method based on average temperature and pressure is commonly used. Under standard conditions, with an inventory pressure of 101.325 kPa and a temperature of 20°C, the commonly used inventory calculation formula is derived from the theoretical calculation formula for actual gas conditions:

[0058]

[0059] In the formula For storage, m 3 ; For tube capacity, m 3 ; The actual average pressure of the pipe section is expressed in MPa. The actual average temperature of the pipe section, in K; The compressibility factor of a gas under actual temperature and pressure conditions; Pressure under standard conditions, MPa; Temperature under standard conditions, in K; This represents the compressibility factor of a gas under standard conditions. The formula for calculating the average pressure is as follows:

[0060]

[0061] In the formula The starting pressure of the pipe section is MPa; The pressure at the end of the pipe section is given in MPa. The average temperature is calculated using the following formula:

[0062]

[0063] In the formula The starting temperature of the pipe section, in K; The temperature at the end of the pipe section is K.

[0064] However, existing technical solutions mainly rely on steady-state pipe inventory calculation formulas, which are not suitable for calculating the actual unsteady-state pipe inventory in the field. Traditional steady-state calculation methods using average temperature and pressure to calculate pipe inventory are prone to large errors in the calculation results, hindering on-site personnel from accurately obtaining pipeline inventory values. To address these technical problems, this invention proposes the following technical concept: Considering the significant errors in existing steady-state pipe inventory calculation techniques, this invention calculates unsteady-state pipe inventory from the perspective of micro-elements. By dividing the natural gas pipeline into multiple micro-segments, and using the initial pressure, temperature, and compressibility factor values ​​at the starting point of each micro-segment, as well as the calculated pressure, temperature, and compressibility factor values ​​at the ending point of each micro-segment, the pipe inventory of each micro-segment is obtained. Then, the pipe inventory values ​​of all micro-segments are summed to obtain the total pipe inventory of the natural gas pipeline. This significantly improves the calculation accuracy compared to steady-state pipe inventory calculation tools, enabling on-site personnel to accurately obtain pipeline inventory values. Detailed embodiments are described below.

[0065] Figure 1 This is a schematic diagram illustrating an application scenario of the natural gas pipeline inventory calculation method provided in this embodiment of the invention. For example... Figure 1 As shown, the system includes a display terminal 101 and a computer device 102. The display terminal 101 receives various parameters of a micro-segment of the natural gas pipeline input by the user and transmits these parameters to the computer device 102. The computer device 102 calculates the total pipeline inventory of the natural gas pipeline after summing the inventory of each micro-segment, based on the pressure formula, temperature formula, compressibility factor formula, and inventory formula for that micro-segment. The computer device 102 then sends the calculated pipeline inventory to the display terminal 101 for display.

[0066] Figure 2 This is a schematic diagram of the pipeline inventory calculation method for natural gas pipelines provided in an embodiment of the present invention. The execution subject of this embodiment can be... Figure 1 The computer equipment shown in the illustrated embodiment is not specifically limited in this embodiment. Figure 2 As shown, the method includes:

[0067] S201: Divide the natural gas pipeline into multiple micro-segments.

[0068] In this embodiment of the invention, the derivation of the unsteady-state pipeline storage calculation formula is performed from the perspective of micro-elements, dividing the natural gas pipeline into micro-element segments of length dl, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of the micro-segment division of a natural gas pipeline.

[0069] S202: For each micro-segment, obtain the initial values ​​of pressure, temperature, and compressibility factor at the starting point of the micro-segment.

[0070] In this embodiment of the invention, the initial pressure, initial temperature, and initial compressibility factor at the inlet section I of the micro-element segment are P1, T1, and Z1, respectively; the calculated pressure, calculated temperature, and calculated compressibility factor at the outlet section II of the micro-element segment are set to P2, T2, and Z2, respectively. Figure 3 As shown.

[0071] S203: Based on the initial pressure value at the starting point of the infinitesimal segment, the initial temperature value at the starting point of the infinitesimal segment, and the initial compressibility factor value at the starting point of the infinitesimal segment, obtain the calculated pressure value at the ending point of the infinitesimal segment; based on the initial temperature value at the starting point of the infinitesimal segment, the initial pressure value at the starting point of the infinitesimal segment, and the calculated pressure value at the ending point of the infinitesimal segment, obtain the calculated temperature value at the ending point of the infinitesimal segment; based on the initial pressure value at the starting point of the infinitesimal segment, the initial temperature value at the starting point of the infinitesimal segment, and the initial compressibility factor value at the starting point of the infinitesimal segment, obtain the calculated compressibility factor value at the ending point of the infinitesimal segment.

[0072] In this embodiment of the invention, the computer device has pressure formulas, temperature formulas, and compressibility factor formulas for micro-segments.

[0073] Specifically, step S203 includes the following steps a~c:

[0074] Step a: Input the initial pressure value at the starting point of the micro-element, the initial temperature value at the starting point of the micro-element, and the initial compressibility factor value at the starting point of the micro-element into the pressure formula to obtain the calculated pressure value at the ending point of the micro-element.

[0075] The pressure formula is as follows:

[0076]

[0077] In the formula: P2 is the calculated pressure value at the end of the micro-element segment; P1 is the initial pressure value at the beginning of the micro-element segment; T1 is the initial temperature value at the beginning of the micro-element segment; Z1 is the initial compressibility factor value at the beginning of the micro-element segment. The flow rate of the micro-element pipe segment is m. 3 / s; Let be the inner diameter of the micro-element pipe segment, in meters (m). The relative density of the gas; is the friction coefficient, which is calculated using the F·Colebrook formula; dl is the length of the infinitesimal segment; C0 is a constant with a value of 0.03848.

[0078] Furthermore, if the elevation difference on this micro-segment is less than 200m, the gas pressure drop that rises to overcome the elevation difference accounts for a very small proportion of the total pressure drop, and it can be regarded as a horizontal pipe segment.

[0079] Step b: Input the initial temperature value at the starting point of the micro-element segment, the initial pressure value at the starting point of the micro-element segment, and the calculated pressure value at the ending point of the micro-element segment into the temperature formula to obtain the calculated temperature value at the ending point of the micro-element segment.

[0080] The temperature formula is as follows:

[0081]

[0082] In the formula: T2 is the calculated temperature at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; The natural gas throttling coefficient is expressed in °C / MPa. Where is the ambient temperature, K; P1 is the initial pressure value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; dl is the length of the micro-element.

[0083] in addition,

[0084] In the formula, The heat transfer coefficient from the outer surface of the pipe to the surrounding medium is expressed in W / (m²). 2 ·K); The gas mass flow rate is expressed in kg / s. Specific heat at constant pressure, kJ / kg·K.

[0085] The temperature formula utilizes the initial temperature and pressure values ​​at the starting point of the infinitesimal segment of section I and the calculated pressure value at the ending point of the infinitesimal segment of section II, and uses the Sukhov temperature drop formula to obtain the calculated temperature value at the ending point of the infinitesimal segment of section II.

[0086] Step c: Input the initial pressure value at the starting point of the micro-element, the initial temperature value at the starting point of the micro-element, and the initial compressibility factor value at the starting point of the micro-element into the compressibility factor formula to obtain the calculated compressibility factor value at the ending point of the micro-element.

[0087] The formula for the compression factor is:

[0088]

[0089] In the formula: Z2 is the calculated compressibility factor at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; Here, is the compressibility factor parameter; R is the universal gas constant, kJ / (kmol·K); Let be the molar density of the gas phase, kmol / m³. For the cross-section corresponding to the starting point of the micro-element, the calculation formula is:

[0090]

[0091] In the formula: P1 is the initial pressure value at the starting point of the micro-element; Z1 is the initial compressibility factor value at the starting point of the micro-element.

[0092] Furthermore, the formula was calculated using the more accurate BWRS equation.

[0093] S204: Based on the initial values ​​of pressure, temperature, and compressibility factor at the starting point of the micro-segment, and the calculated values ​​of pressure, temperature, and compressibility factor at the ending point of the micro-segment, the pipe stock of the micro-segment is obtained.

[0094] Specifically, step S204 includes: importing the initial pressure, initial temperature, and initial compressibility factor of the micro-segment starting point, as well as the calculated pressure, calculated temperature, and calculated compressibility factor of the micro-segment ending point, into the micro-segment's pipe storage calculation formula to obtain the pipe storage quantity of the micro-segment.

[0095] In this embodiment, the formula for calculating the storage capacity of the micro-element segment is:

[0096]

[0097]

[0098]

[0099] In the formula: This refers to the stock of micro-element tubes; Pressure under standard conditions, MPa; Temperature under standard conditions, in K; P1 is the compressibility factor of the gas under standard conditions; T1 is the initial pressure value at the beginning of the micro-element; T1 is the initial temperature value at the beginning of the micro-element; Z1 is the initial compressibility factor value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; T2 is the calculated temperature value at the end of the micro-element; Z2 is the calculated compressibility factor value at the end of the micro-element. For a fixed volume of a micro-element pipe segment, the formula is:

[0100]

[0101] In the formula, dl is the inner diameter of the micro-element pipe segment, in meters; dl is the length of the micro-element segment.

[0102] S205: Sum the pipe inventory of all micro-segments to obtain the pipe inventory of the natural gas pipeline.

[0103] In this embodiment of the invention, the total pipe inventory of the entire natural gas pipeline can be obtained by performing iterative calculations and summations on the pipe inventory of the micro-segments with equal step sizes.

[0104]

[0105] In the formula, This refers to the stock of natural gas pipelines. This refers to the inventory of micro-element segments.

[0106] As described in the above embodiments, the method for calculating the pipeline inventory of a natural gas pipeline divides the pipeline into multiple micro-segments. For each micro-segment, the initial pressure, initial temperature, and initial compressibility factor values ​​at the starting point are obtained. Then, the calculated pressure, calculated temperature, and calculated compressibility factor values ​​at the ending point of the micro-segment are calculated. Based on these initial values, the pipeline inventory of the micro-segment is obtained. Finally, the pipeline inventory of all micro-segments is summed to obtain the total pipeline inventory. This method solves the problem of large errors in traditional steady-state calculation methods that use average temperature and pressure to calculate pipeline inventory, resulting in a significant improvement in calculation accuracy compared to steady-state pipeline inventory calculation tools.

[0107] In one embodiment of the present invention, in the Visual Studio development software, the above-mentioned... Figure 2 The flowchart illustrating the method for calculating the pipeline inventory of a natural gas pipeline in this embodiment is presented. A pipeline inventory calculation toolbox suitable for natural gas pipelines has been developed, allowing field personnel to input relevant data about the natural gas pipeline and output its inventory level. This toolbox offers high accuracy and is well-suited for use by field personnel.

[0108] Figure 4 This is a schematic diagram of the structure of a natural gas pipeline inventory calculation device provided in an embodiment of the present invention. Figure 4 As shown, the natural gas pipeline inventory calculation device includes: a partitioning module 401, an acquisition module 402, a first calculation module 403, a second calculation module 404, and a summation module 405.

[0109] The partitioning module 401 is used to divide the natural gas pipeline into multiple micro-segments;

[0110] The acquisition module 402 is used to acquire the initial pressure value, initial temperature value and initial compressibility factor value of the starting point of each micro-segment;

[0111] The first calculation module 403 is used to obtain the pressure calculation value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment; to obtain the temperature calculation value of the endpoint of the micro-segment based on the initial temperature value, the initial pressure value, and the initial pressure value of the endpoint of the micro-segment; and to obtain the compressibility factor calculation value of the endpoint of the micro-segment based on the initial pressure value, the initial temperature value, and the initial compressibility factor value of the starting point of the micro-segment.

[0112] The second calculation module 404 is used to obtain the pipe inventory of the micro-segment based on the initial pressure, initial temperature and initial compressibility factor of the starting point of the micro-segment, and the calculated pressure, calculated temperature and calculated compressibility factor of the ending point of the micro-segment.

[0113] The summation module 405 is used to sum the pipe inventory of all micro-segments to obtain the pipe inventory of the natural gas pipeline.

[0114] In one possible implementation, the first computing module 403 includes:

[0115] The pressure calculation unit 4031 is used to input the initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment into the pressure formula to obtain the calculated pressure value at the ending point of the micro-segment.

[0116] Temperature calculation unit 4032 is used to input the initial temperature value of the starting point of the micro-element segment, the initial pressure value of the starting point of the micro-element segment, and the calculated pressure value of the ending point of the micro-element segment into a temperature formula to obtain the calculated temperature value of the ending point of the micro-element segment.

[0117] Compression factor unit 4033 is used to input the initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compression factor value at the starting point of the micro-segment into the compression factor formula to obtain the calculated compression factor value at the ending point of the micro-segment.

[0118] In one possible implementation, the pressure formula is:

[0119]

[0120] In the formula: P2 is the calculated pressure value at the end of the micro-element segment; P1 is the initial pressure value at the beginning of the micro-element segment; T1 is the initial temperature value at the beginning of the micro-element segment; Z1 is the initial compressibility factor value at the beginning of the micro-element segment. The flow rate of the micro-element pipe segment is m. 3 / s; Let be the inner diameter of the micro-element pipe segment, in meters (m). The relative density of the gas; is the friction coefficient, which is calculated using the F·Colebrook formula; dl is the length of the infinitesimal segment; C0 is a constant with a value of 0.03848.

[0121] In one possible implementation, the temperature formula is:

[0122]

[0123] In the formula: T2 is the calculated temperature at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; The natural gas throttling coefficient is expressed in °C / MPa. Where is the ambient temperature, K; P1 is the initial pressure value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; dl is the length of the micro-element.

[0124] in addition,

[0125] In the formula, The heat transfer coefficient from the outer surface of the pipe to the surrounding medium, W / (m²). 2 ·K); The gas mass flow rate is expressed in kg / s. Specific heat at constant pressure, kJ / kg·K.

[0126] In one possible implementation, the compression factor formula is:

[0127]

[0128] In the formula: Z2 is the calculated compressibility factor at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; Here, is the compressibility factor parameter; R is the universal gas constant, kJ / (kmol·K); Let be the molar density of the gas phase, kmol / m³. For the cross-section corresponding to the starting point of the micro-element, the calculation formula is:

[0129]

[0130] In the formula: P1 is the initial pressure value at the starting point of the micro-element; Z1 is the initial compressibility factor value at the starting point of the micro-element.

[0131] In one possible implementation, the second computing module 404 includes:

[0132] By importing the initial values ​​of pressure, temperature, and compressibility factor at the starting point of the micro-segment, as well as the calculated values ​​of pressure, temperature, and compressibility factor at the ending point of the micro-segment, into the pipe storage calculation formula of the micro-segment, the pipe storage quantity of the micro-segment is obtained.

[0133] In one possible implementation, the formula for calculating the storage capacity of the micro-element segment is:

[0134]

[0135]

[0136]

[0137] In the formula: This refers to the stock of micro-element tubes; Pressure under standard conditions, MPa; Temperature under standard conditions, in K; P1 is the compressibility factor of the gas under standard conditions; T1 is the initial pressure value at the beginning of the micro-element; T1 is the initial temperature value at the beginning of the micro-element; Z1 is the initial compressibility factor value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; T2 is the calculated temperature value at the end of the micro-element; Z2 is the calculated compressibility factor value at the end of the micro-element. For a fixed volume of a micro-element pipe segment, the formula is:

[0138]

[0139] In the formula, dl is the inner diameter of the micro-element pipe segment, in meters; dl is the length of the micro-element segment.

[0140] In one possible implementation, the summing module 405 includes:

[0141] In this embodiment of the invention, the total pipe inventory of the entire natural gas pipeline can be obtained by performing iterative calculations and summations on the pipe inventory of the micro-segments with equal step sizes.

[0142]

[0143] In the formula, This refers to the stock of natural gas pipelines. This refers to the inventory of micro-element segments.

[0144] Figure 5 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. (See diagram below.) Figure 5 As shown, the computer device 503 in this embodiment includes: a processor 501 and a memory 502; wherein

[0145] Memory 502 is used to store instructions executed by the computer;

[0146] The processor 501 is configured to execute computer execution instructions stored in the memory to implement the various steps performed by the computer device in the above embodiments. For details, please refer to the relevant descriptions in the foregoing method embodiments.

[0147] Alternatively, the memory 502 can be either standalone or integrated with the processor 501.

[0148] When the memory 502 is set up independently, the computer device also includes a bus 503 for connecting the memory 502 and the processor 501.

[0149] This invention also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the natural gas pipeline inventory calculation method described above.

[0150] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the natural gas pipeline inventory calculation method as described above.

[0151] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0152] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0153] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0154] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.

[0155] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0156] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0157] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0158] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0159] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.

[0160] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for calculating the inventory of natural gas pipelines, characterized in that, Applied to computer equipment, including: The natural gas pipeline is divided into multiple micro-segments; For each micro-segment, obtain the initial values ​​of pressure, temperature, and compressibility factor at the starting point of the micro-segment; The initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment are input into the pressure formula to obtain the calculated pressure value at the ending point of the micro-segment. The initial temperature value at the starting point of the micro-segment, the initial pressure value at the starting point of the micro-segment, and the calculated pressure value at the ending point of the micro-segment are input into the temperature formula to obtain the calculated temperature value at the ending point of the micro-segment. The initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment are input into the compressibility factor formula to obtain the calculated compressibility factor value at the ending point of the micro-segment. Based on the initial pressure, initial temperature, and initial compressibility factor of the starting point of the micro-segment, and the calculated pressure, calculated temperature, and calculated compressibility factor of the ending point of the micro-segment, the pipe stock of the micro-segment is obtained. The total pipe inventory of the natural gas pipeline is obtained by summing the pipe inventory of all the micro-segments. The pressure formula is: In the formula: P2 is the calculated pressure value at the end of the micro-element segment; P1 is the initial pressure value at the beginning of the micro-element segment; T1 is the initial temperature value at the beginning of the micro-element segment; Z1 is the initial compressibility factor value at the beginning of the micro-element segment. The flow rate of the micro-element pipe segment is m. 3 / s; Let be the inner diameter of the micro-element pipe segment, in meters (m). The relative density of the gas; is the friction coefficient, which is calculated using the F·Colebrook formula; dl is the length of the infinitesimal segment; C0 is a constant with a value of 0.03848; The temperature formula is: In the formula: T2 is the calculated temperature at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; The natural gas throttling coefficient is expressed in °C / MPa. Where is the ambient temperature, K; P1 is the initial pressure value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; dl is the length of the micro-element. in addition, In the formula, The heat transfer coefficient from the outer surface of the pipe to the surrounding medium is expressed in W / (m²). 2 ·K); The gas mass flow rate is expressed in kg / s. Specific heat at constant pressure, kJ / kg·K; The formula for the compression factor is: In the formula: Z2 is the calculated compressibility factor at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; Here, is the compressibility factor parameter; R is the universal gas constant, kJ / (kmol·K); Let be the molar density of the gas phase, kmol / m³. For the cross-section corresponding to the starting point of the micro-element, the calculation formula is: In the formula: P1 is the initial pressure value at the starting point of the micro-element segment; Z1 is the initial compressibility factor value at the starting point of the micro-element segment.

2. The method according to claim 1, characterized in that, The process of obtaining the pipe inventory of the micro-segment based on the initial pressure, initial temperature, and initial compressibility factor values ​​at the starting point of the micro-segment, and the calculated pressure, calculated temperature, and calculated compressibility factor values ​​at the ending point of the micro-segment, includes: Input the initial values ​​of the starting pressure, temperature, and compressibility factor of the micro-segment, as well as the calculated values ​​of the ending pressure, temperature, and compressibility factor of the micro-segment, into the pipe storage calculation formula of the micro-segment to solve for the pipe storage of the micro-segment.

3. The method according to claim 2, characterized in that, The formula for calculating the storage capacity of the micro-element segment is: In the formula: This refers to the stock of micro-element tubes; Pressure under standard conditions, MPa; Temperature under standard conditions, in K; P1 is the compressibility factor of the gas under standard conditions; T1 is the initial pressure value at the beginning of the micro-element; T1 is the initial temperature value at the beginning of the micro-element; Z1 is the initial compressibility factor value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; T2 is the calculated temperature value at the end of the micro-element; Z2 is the calculated compressibility factor value at the end of the micro-element. For a fixed volume of a micro-element pipe segment, the formula is: In the formula, dl is the inner diameter of the micro-element pipe segment, in meters; dl is the length of the micro-element segment.

4. A natural gas pipeline inventory calculation device, characterized in that, Applied to computer equipment, including: The segmentation module is used to divide the natural gas pipeline into multiple micro-segments; The acquisition module is used to acquire the initial pressure value, initial temperature value, and initial compressibility factor value of the starting point of each micro-segment. The first calculation module is used to input the initial pressure value at the starting point of the micro-element segment, the initial temperature value at the starting point of the micro-element segment, and the initial compressibility factor value at the starting point of the micro-element segment into the pressure formula to obtain the calculated pressure value at the ending point of the micro-element segment. The initial temperature value at the starting point of the micro-segment, the initial pressure value at the starting point of the micro-segment, and the calculated pressure value at the ending point of the micro-segment are input into the temperature formula to obtain the calculated temperature value at the ending point of the micro-segment. The initial pressure value at the starting point of the micro-segment, the initial temperature value at the starting point of the micro-segment, and the initial compressibility factor value at the starting point of the micro-segment are input into the compressibility factor formula to obtain the calculated compressibility factor value at the ending point of the micro-segment. The second calculation module is used to obtain the pipe inventory of the micro-segment based on the initial pressure, initial temperature and initial compressibility factor of the starting point of the micro-segment, and the calculated pressure, calculated temperature and calculated compressibility factor of the ending point of the micro-segment. The summation module is used to sum the pipe inventory of all micro-segments to obtain the pipe inventory of the natural gas pipeline. The pressure formula is: In the formula: P2 is the calculated pressure value at the end of the micro-element segment; P1 is the initial pressure value at the beginning of the micro-element segment; T1 is the initial temperature value at the beginning of the micro-element segment; Z1 is the initial compressibility factor value at the beginning of the micro-element segment. The flow rate of the micro-element pipe segment is m. 3 / s; Let be the inner diameter of the micro-element pipe segment, in meters (m). The relative density of the gas; is the friction coefficient, which is calculated using the F·Colebrook formula; dl is the length of the infinitesimal segment; C0 is a constant with a value of 0.03848; The temperature formula is: In the formula: T2 is the calculated temperature at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; The natural gas throttling coefficient is expressed in °C / MPa. Where is the ambient temperature, K; P1 is the initial pressure value at the beginning of the micro-element; P2 is the calculated pressure value at the end of the micro-element; dl is the length of the micro-element. in addition, In the formula, The heat transfer coefficient from the outer surface of the pipe to the surrounding medium is expressed in W / (m²). 2 ·K); The gas mass flow rate is expressed in kg / s. Specific heat at constant pressure, kJ / kg·K; The formula for the compression factor is: In the formula: Z2 is the calculated compressibility factor at the end of the infinitesimal segment; T1 is the initial temperature at the beginning of the infinitesimal segment; Here, is the compressibility factor parameter; R is the universal gas constant, kJ / (kmol·K); Let be the molar density of the gas phase, kmol / m³. For the cross-section corresponding to the starting point of the micro-element, the calculation formula is: In the formula: P1 is the initial pressure value at the starting point of the micro-element segment; Z1 is the initial compressibility factor value at the starting point of the micro-element segment.

5. A computer device, comprising: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the natural gas pipeline inventory calculation method as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by the processor, implement the natural gas pipeline inventory calculation method as described in any one of claims 1 to 3.