Gas pipeline dynamic hydraulic prediction method, device, electronic equipment and storage medium

By constructing a finite difference format and circuit-like model of gas pipelines and using central differential for discrete, the problems of complexity and error of dynamic hydraulic prediction methods of gas pipelines in the prior art are solved, and a higher prediction accuracy and simplified calculation process are achieved.

CN114880817BActive Publication Date: 2025-05-09TSINGHUA UNIVERSITY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210273775.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-19
Publication Date
2025-05-09
Estimated Expiration
2042-03-19

AI Technical Summary

Technical Problem

The existing Wendroff pipeline dynamic hydraulic prediction method is difficult to reveal the intrinsic connection between the power grid and the gas grid, resulting in complex iteration formats, long calculation time, large errors, and not conducive to programming implementation.

Method used

Analogize the solution method of the transmission line of the power system, build a finite difference format of the gas pipeline, establish a gas pipeline circuit model, and use the central difference to discrete space and time to obtain the iterative relationship between air pressure and mass flow.

Benefits of technology

It improves the accuracy of dynamic hydraulic prediction, simplifies iterative relationships, reduces calculation costs and prediction time, is easy to program and implement, and can provide design parameters and operational data support for pipeline construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114880817B_ABST
    Figure CN114880817B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for dynamic hydraulic prediction of a gas pipeline. The method includes: establishing a gas pipeline circuit model according to the changes of the gas pressure, gas flow rate and gas density in the gas pipeline with the pipe length and time; using the central difference to perform spatial discretization and temporal discretization on the gas pressure and mass flow of the gas pipeline respectively, to obtain the spatial discretization relationship between the gas pressure and the mass flow, and the temporal discretization relationship between the gas pressure and the mass flow; substituting the spatial discretization relationship between the gas pressure and the mass flow, and the temporal discretization relationship between the gas pressure and the mass flow into the gas pipeline circuit model to obtain the iterative relationship for dynamic hydraulic prediction of the gas pipeline; inputting the initial conditions into the iterative relationship to obtain the dynamic hydraulic prediction value of the gas pipeline. The method can improve the accuracy of dynamic hydraulic prediction, help reduce the calculation cost, shorten the prediction time, and also facilitate programming implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of integrated energy system operation and control technology, and in particular to a method, device, electronic equipment and storage medium for dynamic hydraulic prediction of a gas pipeline. Background Art

[0002] In recent years, as people's requirements for energy efficiency continue to increase, integrated energy systems that couple multiple forms of energy such as electricity, heat, cooling, gas, and transportation have gradually become a research hotspot in the field of technology. Compared with single energy systems, integrated energy systems have more complex and diverse internal connections and higher requirements for system security.

[0003] The dynamic hydraulic prediction of gas pipelines is one of the safety issues of integrated energy systems. The existing Wendroff pipeline dynamic hydraulic prediction method uses different models for the power grid or gas grid, which makes it difficult to reveal the internal connection between the two energy forms, which goes against the original intention of the integrated energy system to break the "barriers" between different energy sources. As a result, the Wendroff pipeline dynamic hydraulic prediction method has a complex iteration format, a long calculation time, is not conducive to programming implementation, and the obtained dynamic flow results have large errors. Summary of the invention

[0004] In order to at least partially solve the technical problems existing in the prior art, by analogy with the solution method of the power system transmission line equation, a finite difference format for dynamic hydraulic prediction of a natural gas pipeline is constructed. The inventor has made the present invention, and through specific implementation methods, a method, device, electronic device and storage medium for dynamic hydraulic prediction of a gas pipeline are provided.

[0005] In a first aspect, an embodiment of the present invention provides a method for dynamic hydraulic prediction of a gas pipeline, comprising the following steps:

[0006] According to the changes of gas pressure, gas flow rate and gas density in the gas pipeline with pipe length and time, a gas pipeline circuit model is established;

[0007] The air pressure and mass flow of the gas pipeline are spatially discretized and temporally discretized by using central difference to obtain a spatial discretization relationship between the air pressure and the mass flow and a temporal discretization relationship between the air pressure and the mass flow;

[0008] Substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain a dynamic hydraulic prediction iterative relationship for the gas pipeline;

[0009] The initial conditions are input into the iterative relationship to obtain the dynamic hydraulic prediction value of the gas pipeline.

[0010] Optionally, establishing a gas pipeline circuit model according to the changes of gas pressure, gas flow rate, and gas density in the gas pipeline with pipe length and time includes the following steps:

[0011] The gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as:

[0012] p=p(x,t),v=v(x,t),ρ=ρ(x,t) Equation 1

[0013] In the formula, x is the tube length, t is the time,

[0014] The equation of motion, continuity equation and gas state equation are established according to formula 1:

[0015]

[0016] p=ZRTρ Formula 4

[0017] Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas;

[0018] Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to:

[0019]

[0020] Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get:

[0021]

[0022] Using mass flow rate m = ρvA, convert equations 5 and 6:

[0023]

[0024] In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe,

[0025] Substituting the parameters in Equation 7, we can obtain the gas pipeline circuit model:

[0026]

[0027] in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

[0028] Optionally, the method of using central difference to spatially discretize and temporally discretize the air pressure and mass flow of the gas pipeline to obtain a spatial discretization relationship between the air pressure and the mass flow and a temporal discretization relationship between the air pressure and the mass flow comprises the following steps:

[0029] The total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure space discrete points, and the mass flow and corresponding spatial coordinates of the mass flow space discrete points;

[0030] The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points;

[0031] According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain:

[0032]

[0033] Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

[0034] Optionally, substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain the dynamic hydraulic prediction iterative relationship of the gas pipeline includes the following steps:

[0035] Substituting equation 9 and equation 10 into equation 8, we get:

[0036]

[0037] Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

[0038] In a second aspect, an embodiment of the present invention provides a gas pipeline dynamic hydraulic prediction device, comprising:

[0039] A circuit-like model building module is used to build a circuit-like model of the gas pipeline according to the changes of gas pressure, gas flow rate, and gas density in the gas pipeline with pipe length and time;

[0040] A discrete relationship determination module is used to perform spatial discretization and temporal discretization on the air pressure and mass flow of the gas pipeline by using central difference to obtain a spatial discrete relationship between the air pressure and the mass flow and a temporal discrete relationship between the air pressure and the mass flow;

[0041] An iterative relationship determination module, used for substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain a dynamic hydraulic prediction iterative relationship for the gas pipeline;

[0042] The dynamic hydraulic prediction module is used to input the initial conditions into the iterative relationship to obtain the dynamic hydraulic prediction value of the gas pipeline.

[0043] Optionally, the circuit-like model building module is specifically used for:

[0044] The gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as:

[0045] p=p(x,t),v=v(x,t),ρ=ρ(x,t) Equation 1

[0046] In the formula, x is the tube length, t is the time,

[0047] The equation of motion, continuity equation and gas state equation are established according to formula 1:

[0048]

[0049] p=ZRTρ Formula 4

[0050] Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas;

[0051] Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to:

[0052]

[0053] Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get:

[0054]

[0055] Using mass flow rate m = ρvA, convert equations 5 and 6:

[0056]

[0057] In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe,

[0058] Substituting the parameters in Equation 7, we can obtain the gas pipeline circuit model:

[0059]

[0060] in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

[0061] Optionally, the discrete relationship determination module is specifically used to:

[0062] The total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure space discrete points, and the mass flow and corresponding spatial coordinates of the mass flow space discrete points;

[0063] The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points;

[0064] According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain:

[0065]

[0066] Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

[0067] Optionally, the iterative relationship determination module is specifically used to:

[0068] Substituting equation 9 and equation 10 into equation 8, we get:

[0069]

[0070] Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

[0071] Based on the same inventive concept, an embodiment of the present invention also provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned gas pipeline dynamic hydraulic prediction method when executing the computer program.

[0072] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are executed, the aforementioned gas pipeline dynamic hydraulic prediction method is implemented.

[0073] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:

[0074] By analogy with the solution method of power transmission lines, a differential iterative format of the gas grid pipeline model is constructed, and a dynamic hydraulic prediction model of the gas pipeline with an intrinsic connection between the two energy forms of the power grid and the gas grid is established. As a result, the accuracy of the dynamic hydraulic prediction is improved, and the iterative relationship of the dynamic hydraulic prediction method is simplified, which is conducive to reducing the calculation cost and shortening the prediction time. It is also conducive to programming implementation, can provide design parameters for pipeline construction, and provide data support for the operation of the gas pipeline system, so as to facilitate the emergency response of the operating unit to emergencies.

[0075] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0076] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0078] Figure 1 This is a flow chart of a method for dynamic hydraulic prediction of a gas pipeline in an embodiment of the present invention;

[0079] Figure 2 Schematic diagram of gas pipeline parameter design in an embodiment of the present invention;

[0080] Figure 3 The mass flow rate at the head end of the gas pipeline varies with time in the embodiment of the present invention;

[0081] Figure 4 The curve of load pressure at the end of the gas pipeline changing with time in the embodiment of the present invention;

[0082] Figure 5 It is a block diagram of a dynamic hydraulic prediction device for a gas pipeline in an embodiment of the present invention;

[0083] Figure 6 The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0084] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0085] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method, device, electronic equipment and storage medium for dynamic hydraulic prediction of a gas pipeline.

[0086] Embodiment 1

[0087] Embodiment 1 of the present invention provides a method for dynamic hydraulic prediction of a gas pipeline, the process of which is as follows: Figure 1 As shown, the following steps are included:

[0088] Step S101: Establish a gas pipeline circuit model according to the changes of gas pressure, gas flow rate and gas density in the gas pipeline with pipe length and time.

[0089] A “quasi-circuit” model of the natural gas pipeline is established. With the change of operation mode and load fluctuation, only the time-varying process of pressure p, flow velocity v and density ρ along the pipe length is considered.

[0090] Optionally, the gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as:

[0091] p=p(x,t),v=v(x,t),ρ=ρ(x,t)

[0092] Formula 1

[0093] In the formula, x is the tube length, t is the time,

[0094] The equation of motion, continuity equation and gas state equation are established according to formula 1:

[0095]

[0096] p=ZRTρ Formula 4

[0097] Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas;

[0098] According to the application in actual engineering, the second term in Formula 2 is meaningful only when the gas velocity in the pipeline is extremely large (close to the speed of sound), so this term is ignored. At the same time, when the oblique angle of the pipeline is not too large, the fourth term in Formula 2 can usually be ignored.

[0099] Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to:

[0100]

[0101] Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get:

[0102]

[0103] Since flow rate is often used for analysis and measurement statistics in practical engineering applications, the mass flow rate m = ρvA is used to convert equations 5 and 6:

[0104]

[0105] In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe,

[0106] Substituting the parameters in Equation 7, we can obtain the gas pipeline circuit model:

[0107]

[0108] in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

[0109] Step S102: using central difference to perform spatial discretization and temporal discretization on the air pressure and mass flow of the gas pipeline, respectively, to obtain a spatial discretization relationship between the air pressure and the mass flow, and a temporal discretization relationship between the air pressure and the mass flow.

[0110] A finite-difference time-domain format for natural gas transmission equations is constructed with reference to the solution method of power system transmission line equations.

[0111] Optionally, the total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure spatial discrete points, and the mass flow and corresponding spatial coordinates of the mass flow spatial discrete points;

[0112] The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points;

[0113] For example, take the node pressure p and the mass flow rate m between nodes as the solution components, and discretize the transmission direction of the pipeline in one dimension with a spatial interval Δx. If the total length of the pipeline is l and it is discretized into M segments, the pressures are p1, p3, p5…, p 2M+1 , whose spatial coordinates are 0, Δx, 2Δx…, MΔx; the mass flow rates are m2, m4, m6…, m 2M , and their spatial coordinates are 0.5Δx, 1.5Δx, 2.5Δx…, (M-0.5)Δx. Therefore, there are M+1 discrete points for air pressure and M discrete points for mass flow. The discrete points are staggered and the spatial interval is 0.5Δx.

[0114] Similarly, the time dimension is discretized with time interval Δt. If the total time length is T, and it is discretized into N segments, and the discrete points of air pressure and mass flow are also staggered, then the air pressure is p (0) ,p (2) ,p (4) …,p (2N) , whose time coordinates are 0, Δt, 2Δt…, NΔt, and the mass flow rate is m (1) ,m (3) ,m (5) …,m (2N-1) , and their time coordinates are 0.5Δt, 1.5Δt, 2.5Δt…, (M-0.5)Δt. Therefore, there are N+1 and N discrete points of air pressure and mass flow, respectively.

[0115] According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain:

[0116]

[0117] Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

[0118] Step S103: Substitute the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain a dynamic hydraulic prediction iterative relationship for the gas pipeline.

[0119] Optionally, substitute equation 9 and equation 10 into equation 8 and rearrange to obtain:

[0120]

[0121] Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

[0122] Step S104: inputting the initial conditions into the iterative relationship to obtain the dynamic hydraulic prediction value of the gas pipeline.

[0123] Based on the given initial conditions and boundary conditions, the dynamic hydraulic prediction values ​​of natural gas pipeline transmission can be solved in sequence according to the iterative relationship of Formula 11, including the mass flow rate and gas pressure prediction values.

[0124] For example, a single pipeline is used to illustrate the dynamic hydraulic prediction method of a gas pipeline according to an embodiment of the present invention. The pipeline parameters are designed as follows: Figure 2 As shown, the total length of the pipeline is L = 60 km, the diameter of the pipeline is D = 0.6 m, the air pressure p1 at the beginning of the pipeline is fixed at 70 bar, and the flow rate at the beginning of the pipeline changes from 99.64 kg / s at the beginning of the total time to 103.62 kg / s at the end of the total time. in represents the natural gas input, q out Natural gas output, p2 represents the terminal gas pressure.

[0125] Assume that the first end of the pipeline is the gas source node, and the pressure of the gas source node is controlled to be a constant value; the end is the load node, and the mass flow rate of the load node is controlled to produce a step change. These are the boundary conditions for solving the partial differential equation.

[0126] In addition, in order to obtain the initial conditions, the Weymouth equation for steady-state hydraulic calculation of gas pipelines is used, and the gas pressure p and mass flow rate m are used as the variables to be determined.

[0127]

[0128] Where is and je represent the starting point and end point of the pipeline respectively, λ is the friction resistance coefficient of the gas pipeline, c is the speed of sound in the gas, l is the total length of the pipeline, and d is the diameter of the pipeline.

[0129] After calculation, the steady-state values ​​of the mass flow rate at the first end of the pipeline and the air pressure at the end before and after the load fluctuation are shown in the following table:

[0130] Power flow variables Before volatility After the fluctuation First end flow rate (kg / s) 99.64 103.62 End pressure (bar) 51.27 49.43

[0131] Then, the dynamic hydraulics of the pipeline are analyzed, that is, the dynamic changes of the mass flow rate at the head end of the pipeline and the load pressure at the end are calculated. In order to verify the effectiveness of this method, its calculation results are compared with the calculation results of the Wendroff difference format and the simulation results of the natural gas system commercial software Synergi, as shown below Figure 3 , Figure 4 As shown in the figure, the time step of both difference methods is 10 s and the spatial step is 10 km. Figure 3 The curve of mass flow rate at the head end of the pipeline changing with time. The horizontal axis represents time in min, and the vertical axis represents mass flow in kg / s. Represents the simulation results of the commercial software Synergi, which is equivalent to the actual value of mass flow in the real pipeline, and the curve The closer it is, the higher the prediction accuracy. represents the mass flow curve obtained using the existing Wendroff pipeline dynamic hydraulic prediction method. The mass flow curve obtained by the method provided by the present invention is shown. It can be seen that the mass flow curve obtained by the present method is closer to the true value, so the accuracy of mass flow prediction by the present method is higher.

[0132] Figure 4 The curve of the load pressure at the end of the pipeline changing with time. The horizontal axis represents time in min, and the vertical axis represents pressure in bar. Represents the simulation result of the commercial software Synergi, which is equivalent to the actual value of the air pressure in the real pipeline, and the curve The closer it is, the higher the prediction accuracy. The pressure curve is obtained by using the existing Wendroff pipeline dynamic hydraulic prediction method. It shows the air pressure curve obtained by the method provided by the present invention. It can be seen that the air pressure curve obtained by the present method is closer to the true value, so the accuracy of air pressure prediction by the present method is higher.

[0133] Depend on Figure 3 , Figure 4 It can be seen that since the embodiment assumes that the end load flow rate is a step-like jump, there are a large number of high-frequency components in the initial stage of the fluctuation, so the head end mass flow rate has abnormal short-term violent fluctuations, which can be ignored in the analysis. Compared with the simulation results of the commercial software Synergi, it can be seen that the dynamic flow results obtained by the FDTD method proposed in this paper are more accurate than the existing Wendroff method, and its maximum relative error is 0.69%, which is lower than the maximum relative error of the Wendroff method of 1.70%. At the same time, the calculation time of this method is 1.037 seconds, which is less than the 2.873 seconds of the Wendroff method, and the iterative format is simpler and easy to program.

[0134] In the above method of this embodiment, the differential iterative format of the gas grid pipeline model is constructed by analogy with the solution method of the power transmission line, and a dynamic hydraulic prediction model of the gas pipeline with an intrinsic connection between the two energy forms of the power grid and the gas grid is established. As a result, the accuracy of the dynamic hydraulic prediction is improved, and the iterative relationship of the dynamic hydraulic prediction method is simplified, which is conducive to reducing the calculation cost and shortening the prediction time. It is also conducive to programming implementation, can provide design parameters for pipeline construction, provide data support for the operation of the gas pipeline system, and facilitate the emergency response of the operating unit to emergencies.

[0135] Embodiment 2

[0136] Embodiment 2 of the present invention provides a gas pipeline dynamic hydraulic prediction device, the structure of which is as follows: Figure 5 As shown, including:

[0137] The circuit-like model building module 101 is used to build a circuit-like model of the gas pipeline according to the changes of the gas pressure, gas flow rate and gas density in the gas pipeline with the pipe length and time.

[0138] A “quasi-circuit” model of the natural gas pipeline is established. With the change of operation mode and load fluctuation, only the time-varying process of pressure p, flow velocity v and density ρ along the pipe length is considered.

[0139] Optionally, the gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as:

[0140] p=p(x,t),v=v(x,t),ρ=ρ(x,t) Equation 1

[0141] In the formula, x is the tube length, t is the time,

[0142] The equation of motion, continuity equation and gas state equation are established according to formula 1:

[0143]

[0144] p=ZRTρ Formula 4

[0145] Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas;

[0146] According to the application in actual engineering, the second term in Formula 2 is meaningful only when the gas velocity in the pipeline is extremely large (close to the speed of sound), so this term is ignored. At the same time, when the oblique angle of the pipeline is not too large, the fourth term in Formula 2 can usually be ignored.

[0147] Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to:

[0148]

[0149] Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get:

[0150]

[0151] Since flow rate is often used for analysis and measurement statistics in practical engineering applications, the mass flow rate m = ρvA is used to convert equations 5 and 6:

[0152]

[0153] In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe,

[0154] Substituting the parameters in Equation 7, we can obtain the gas pipeline circuit model:

[0155]

[0156] in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

[0157] The discrete relationship determination module 102 is used to perform spatial discretization and temporal discretization on the air pressure and mass flow of the gas pipeline by using central difference to obtain the spatial discretization relationship between the air pressure and the mass flow and the temporal discretization relationship between the air pressure and the mass flow.

[0158] A finite-difference time-domain format for natural gas transmission equations is constructed with reference to the solution method of power system transmission line equations.

[0159] Optionally, the total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure spatial discrete points, and the mass flow and corresponding spatial coordinates of the mass flow spatial discrete points;

[0160] The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points;

[0161] For example, take the node pressure p and the mass flow rate m between nodes as the solution components, and discretize the transmission direction of the pipeline in one dimension with a spatial interval Δx. If the total length of the pipeline is l and it is discretized into M segments, the pressures are p1, p3, p5…, p2M+1 , whose spatial coordinates are 0, Δx, 2Δx…, MΔx; the mass flow rates are m2, m4, m6…, m 2M , and their spatial coordinates are 0.5Δx, 1.5Δx, 2.5Δx…, (M-0.5)Δx. Therefore, there are M+1 discrete points for air pressure and M discrete points for mass flow. The discrete points are staggered and the spatial interval is 0.5Δx.

[0162] Similarly, the time dimension is discretized with time interval Δt. If the total time length is T, and it is discretized into N segments, and the discrete points of air pressure and mass flow are also staggered, then the air pressure is p (0) ,p (2) ,p (4) …,p (2N) , whose time coordinates are 0, Δt, 2Δt…, NΔt, and the mass flow rate is m (1) ,m (3) ,m (5) …,m (2N-1) , and their time coordinates are 0.5Δt, 1.5Δt, 2.5Δt…, (M-0.5)Δt. Therefore, there are N+1 and N discrete points of air pressure and mass flow, respectively.

[0163] According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain:

[0164]

[0165] Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

[0166] The iterative relationship determination module 103 is used to substitute the spatial discrete relationship between air pressure and mass flow and the temporal discrete relationship between air pressure and mass flow into the gas pipeline circuit model to obtain the dynamic hydraulic prediction iterative relationship of the gas pipeline.

[0167] Optionally, substitute equation 9 and equation 10 into equation 8 and rearrange to obtain:

[0168]

[0169] Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

[0170] The dynamic hydraulic prediction module 104 is used to input the initial conditions into the iterative relationship to obtain the dynamic hydraulic prediction value of the gas pipeline.

[0171] Based on the given initial conditions and boundary conditions, the dynamic hydraulic prediction values ​​of natural gas pipeline transmission can be solved in sequence according to the iterative relationship of Formula 11, including the mass flow rate and gas pressure prediction values.

[0172] For example, a single pipeline is used to illustrate the dynamic hydraulic prediction method of a gas pipeline according to an embodiment of the present invention. The pipeline parameters are designed as follows: Figure 2 As shown, the total length of the pipeline is L = 60 km, the diameter of the pipeline is D = 0.6 m, the air pressure p1 at the beginning of the pipeline is fixed at 70 bar, and the flow rate at the beginning of the pipeline changes from 99.64 kg / s at the beginning of the total time to 103.62 kg / s at the end of the total time. in represents the natural gas input, q out Natural gas output, p2 represents the terminal gas pressure.

[0173] Assume that the first end of the pipeline is the gas source node, and the pressure of the gas source node is controlled to be a constant value; the end is the load node, and the mass flow rate of the load node is controlled to produce a step change. These are the boundary conditions for solving the partial differential equation.

[0174] In addition, in order to obtain the initial conditions, the Weymouth equation for steady-state hydraulic calculation of gas pipelines is used, and the gas pressure p and mass flow rate m are used as the variables to be determined.

[0175]

[0176] Where is and je represent the starting point and end point of the pipeline respectively, λ is the friction resistance coefficient of the gas pipeline, c is the speed of sound in the gas, l is the total length of the pipeline, and d is the diameter of the pipeline.

[0177] After calculation, the steady-state values ​​of the mass flow rate at the first end of the pipeline and the air pressure at the end before and after the load fluctuation are shown in the following table:

[0178] Power flow variables Before volatility After the fluctuation First end flow rate (kg / s) 99.64 103.62 End pressure (bar) 51.27 49.43

[0179] Then, the dynamic hydraulics of the pipeline are analyzed, that is, the dynamic changes of the mass flow rate at the head end of the pipeline and the load pressure at the end are calculated. In order to verify the effectiveness of this method, its calculation results are compared with the calculation results of the Wendroff difference format and the simulation results of the natural gas system commercial software Synergi, as shown below Figure 3 , Figure 4 As shown in the figure, the time step of both difference methods is 10 s and the spatial step is 10 km. Figure 3 The curve of mass flow rate at the head end of the pipeline changing with time. The horizontal axis represents time in min, and the vertical axis represents mass flow in kg / s. Represents the simulation results of the commercial software Synergi, which is equivalent to the actual value of mass flow in the real pipeline, and the curve The closer it is, the higher the prediction accuracy. represents the mass flow curve obtained using the existing Wendroff pipeline dynamic hydraulic prediction method. The mass flow curve obtained by the method provided by the present invention is shown. It can be seen that the mass flow curve obtained by the present method is closer to the true value, so the accuracy of mass flow prediction by the present method is higher.

[0180] Figure 4 The curve of the load pressure at the end of the pipeline changing with time. The horizontal axis represents time in min, and the vertical axis represents pressure in bar. Represents the simulation result of the commercial software Synergi, which is equivalent to the actual value of the air pressure in the real pipeline, and the curve The closer it is, the higher the prediction accuracy. The pressure curve is obtained by using the existing Wendroff pipeline dynamic hydraulic prediction method. It shows the air pressure curve obtained by the method provided by the present invention. It can be seen that the air pressure curve obtained by the present method is closer to the true value, so the accuracy of air pressure prediction by the present method is higher.

[0181] Depend on Figure 3 , Figure 4 It can be seen that since the embodiment assumes that the end load flow rate is a step-like jump, there are a large number of high-frequency components in the initial stage of the fluctuation, so the head end mass flow rate has abnormal short-term violent fluctuations, which can be ignored in the analysis. Compared with the simulation results of the commercial software Synergi, it can be seen that the dynamic flow results obtained by the FDTD method proposed in this paper are more accurate than the existing Wendroff method, and its maximum relative error is 0.69%, which is lower than the maximum relative error of the Wendroff method of 1.70%. At the same time, the calculation time of this method is 1.037 seconds, which is less than the 2.873 seconds of the Wendroff method, and the iterative format is simpler and easy to program.

[0182] In this embodiment, a differential iterative format of the gas grid pipeline model is constructed by analogy with the solution method of the power transmission line, and a dynamic hydraulic prediction model of the gas pipeline with an intrinsic connection between the two energy forms of the power grid and the gas grid is established. As a result, the accuracy of the dynamic hydraulic prediction is improved, and the iterative relationship of the dynamic hydraulic prediction method is simplified, which is conducive to reducing the calculation cost and shortening the prediction time. It is also conducive to programming implementation, can provide design parameters for pipeline construction, provide data support for the operation of the gas pipeline system, and facilitate the emergency response of the operating unit to emergencies.

[0183] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, whose structure is as follows: Figure 6As shown, it includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the aforementioned gas pipeline dynamic hydraulic prediction method when executing the computer program.

[0184] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and when the computer executable instructions are executed, the aforementioned gas pipeline dynamic hydraulic prediction method is implemented.

[0185] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

Claims

1. A method for dynamic hydraulic prediction of a gas pipeline, characterized in that: The following steps are involved: According to the changes of gas pressure, gas flow rate and gas density in the gas pipeline with pipe length and time, a gas pipeline circuit model is established; The air pressure and mass flow of the gas pipeline are spatially discretized and temporally discretized by using central difference to obtain a spatial discretization relationship between the air pressure and the mass flow and a temporal discretization relationship between the air pressure and the mass flow; Substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain a dynamic hydraulic prediction iterative relationship for the gas pipeline; Inputting the initial conditions into the iterative relationship to obtain a dynamic hydraulic prediction value of the gas pipeline; The method of establishing a gas pipeline circuit model according to the changes of gas pressure, gas flow rate and gas density in the gas pipeline with pipe length and time includes the following steps: The gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as: p=p(x,t),v=v(x,t),ρ=ρ(x,t) Formula 1 In the formula, x is the tube length, t is the time, The equation of motion, continuity equation and gas state equation are established according to formula 1: p=ZRTρ Formula 4 Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas; Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to: Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get: Using mass flow rate m = ρvA, convert equations 5 and 6: In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe, Substituting the parameters in equation 7, we can obtain the gas pipeline circuit model: in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

2. The method according to claim 1, characterized in that The method of using central difference to spatially discretize and temporally discretize the air pressure and mass flow of the gas pipeline to obtain a spatial discretization relationship between the air pressure and the mass flow and a temporal discretization relationship between the air pressure and the mass flow includes the following steps: The total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure space discrete points, and the mass flow and corresponding spatial coordinates of the mass flow space discrete points; The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points; According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain: Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

3. The method according to claim 2, characterized in that Substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain the dynamic hydraulic prediction iterative relationship of the gas pipeline includes the following steps: Substituting equation 9 and equation 10 into equation 8, we get: Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

4. A gas pipeline dynamic hydraulic prediction device, characterized in that: include: A circuit-like model building module is used to build a circuit-like model of the gas pipeline according to the changes of gas pressure, gas flow rate, and gas density in the gas pipeline with pipe length and time; A discrete relationship determination module is used to perform spatial discretization and temporal discretization on the air pressure and mass flow of the gas pipeline by using central difference to obtain a spatial discrete relationship between the air pressure and the mass flow and a temporal discrete relationship between the air pressure and the mass flow; An iterative relationship determination module, used for substituting the spatial discrete relationship between the air pressure and the mass flow rate and the temporal discrete relationship between the air pressure and the mass flow rate into the gas pipeline circuit model to obtain a dynamic hydraulic prediction iterative relationship for the gas pipeline; A dynamic hydraulic prediction module, used to input the initial conditions into the iterative relationship to obtain a dynamic hydraulic prediction value of the gas pipeline; The circuit model building module is specifically used for: The gas pressure p, gas flow rate v, and gas density ρ in the gas pipeline are expressed as: p=p(x,t),v=v(x,t),ρ=ρ(x,t) Formula 1 In the formula, x is the tube length, t is the time, The equation of motion, continuity equation and gas state equation are established according to formula 1: p=ZRTρ Formula 4 Where g is the acceleration of gravity, α is the angle between the pipeline and the horizontal plane, λ is the friction coefficient of the gas pipeline, Z is the compression factor of natural gas, R is the gas constant of natural gas, and T is the thermodynamic temperature of natural gas; Ignore the second term in Equation 2 And the fourth term gρsinα, simplifying Equation 2 to: Assuming a constant temperature process, we have Speed ​​of sound in gas Combining equation 3 and equation 4, we get: Using mass flow rate m = ρvA, convert equations 5 and 6: In the formula, A is the cross-sectional area of ​​the pipe, d is the diameter of the pipe, Substituting the parameters in equation 7, we can obtain the gas pipeline circuit model: in, G0=0, gas resistance R0 represents the resistance of gas transmission in the pipeline, gas conductance G0 represents gas leakage in the pipeline, and its value of zero represents normal gas transmission in the pipeline without leakage, gas sense L0 represents the inertia of gas transmission, and gas capacity C0 represents the gas storage characteristics of the pipeline.

5. The device according to claim 4, characterized in that The discrete relationship determination module is specifically used for: The total length of the pipeline is spatially discretized at a spatial interval Δx along the gas propagation direction to obtain the air pressure and corresponding spatial coordinates of the air pressure space discrete points, and the mass flow and corresponding spatial coordinates of the mass flow space discrete points; The total time length is time-discrete at time intervals Δt to obtain the air pressure and the corresponding time coordinates at the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates at the mass flow time discrete points; According to the air pressure and the corresponding spatial coordinates of the air pressure spatial discrete points, the mass flow rate and the corresponding spatial coordinates of the mass flow rate spatial discrete points, the air pressure and the corresponding time coordinates of the air pressure time discrete points, and the mass flow rate and the corresponding time coordinates of the mass flow rate time discrete points, the air pressure and the mass flow rate of the gas pipeline are spatially and temporally discretized respectively by using central difference to obtain: Where j is the number of the spatial discrete point and k is the number of the temporal discrete point.

6. The device according to claim 5, characterized in that The iterative relationship determination module is specifically used for: Substituting equation 9 and equation 10 into equation 8, we get: Formula 11 is the iterative relationship of dynamic hydraulic prediction of gas pipeline.

7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for dynamic hydraulic prediction of a gas pipeline as described in any one of claims 1 to 3 when executing the computer program.

8. A computer storage medium, characterized in that The computer storage medium stores computer executable instructions, which, when executed, implement the gas pipeline dynamic hydraulic prediction method described in any one of claims 1-3.