Natural gas network model construction method and device, medium and equipment

By converting the partial differential equations of the dynamic transmission process of natural gas pipelines into a time-domain linear algebra model and introducing constraints, combined with the Schur complement strategy, the complexity problem of natural gas network model is solved and the calculation efficiency is improved.

CN118350162BActive Publication Date: 2024-11-08TAIYUAN UNIVERSITY OF TECHNOLOGY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410445652.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2024-11-08
Estimated Expiration
2044-04-15

AI Technical Summary

Technical Problem

The existing natural gas network model solution method is difficult to effectively manage and schedule complex natural gas pipelines due to the complexity of partial differential equations.

Method used

The partial differential equations of the dynamic transmission process of natural gas pipelines are converted into a time-domain linear algebra model, and the constraint equations, initial conditions and boundary conditions of intermediate nodes are introduced. The Schur complement strategy is used to simplify the matrix equations and reduce the computational complexity.

Benefits of technology

It significantly reduces the complexity of solving natural gas networks, improves the computing speed, and improves the computing efficiency of dynamic trends in natural gas networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118350162B_ABST
    Figure CN118350162B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device, medium, and equipment for constructing a natural gas network model. The method includes: establishing a dynamic physical model of the natural gas network based on the flow characteristics of natural gas flowing through the pipeline in the network; establishing constraints based on the characteristics of the nodes in the natural gas network, wherein the constraints include initial constraints, boundary constraints, and topological constraints; performing differential processing on the dynamic physical model to obtain a differential model, and simplifying the differential model and constraints based on the variables at each moment to obtain a time-domain two-port model of the natural gas network, wherein the variables include mass flow variables and pressure variables. The method of the present application converts the group of partial differential equations describing the dynamic transmission process of the natural gas pipeline into a time-domain linear algebraic model that is easy to solve. Compared with the traditional finite difference method, the constructed model introduces constraint equations, initial conditions, and boundary conditions of intermediate nodes, which effectively reduces the complexity of solving the natural gas network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of energy system modeling and analysis, and in particular to a method, device, medium, and equipment for constructing a natural gas network model. Background Art

[0002] In recent years, natural gas has occupied an increasingly large share in the energy consumption structure due to its high quality, high efficiency and cleanliness. In 2022, the world's natural gas consumption reached 3.94 trillion cubic meters. However, with the further expansion of the scale of the natural gas pipeline network, the pipeline network structure has become increasingly complex, and the difficulty of safety management and operation scheduling has increased. The one-dimensional flow process of the natural gas network can be described by a set of partial differential equations. However, due to its heterogeneity, high dimensionality and significant nonlinearity, the direct solution of partial differential equations is very complicated. Currently, the commonly used solution methods include Weymouth equation, Linepack model, implicit finite difference method, explicit finite difference method, signal transformation method, etc. However, the above methods have limited accuracy and high computational complexity. Summary of the invention

[0003] In view of this, the present application provides a method and apparatus, medium, and equipment for constructing a natural gas network model. By converting a set of partial differential equations describing the dynamic transmission process of the natural gas pipeline into an easy-to-solve time-domain linear algebraic model, the constructed model introduces constraint equations, initial conditions, and boundary conditions of intermediate nodes compared to the traditional finite difference method, effectively reducing the complexity of solving the natural gas network.

[0004] According to one aspect of the present application, a method for constructing a natural gas network model is provided, comprising:

[0005] Based on the flow characteristics of natural gas flowing through the pipelines in the network, a dynamic physical model of the natural gas network is established, wherein the dynamic physical model includes a momentum equation, a mass balance equation and a state equation;

[0006] Establishing constraint conditions based on the characteristics of the nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints and topological constraints;

[0007] The dynamic physical model is differentially processed to obtain a differential model, and the differential model and the constraint conditions are simplified based on variables at each moment to obtain a time-domain two-port model of the natural gas network, wherein the variables include mass flow variables and pressure variables.

[0008] Optionally, after establishing the dynamic physical model of the natural gas network, the method further comprises:

[0009] In the dynamic physical model, the gas temperature is set constant, the pipeline height is set constant, and the convection is set to 0, and the nonlinear terms in the dynamic physical model are linearized to obtain a simplified dynamic physical model.

[0010] Optionally, the nodes include a gas source node, a load node and an intermediate node, and the intermediate node includes an N-type intermediate node and an L-type intermediate node;

[0011] Accordingly, the initial constraint is used to constrain the initial gas pressure and initial mass flow of all nodes in the natural gas network;

[0012] The boundary constraint is used to constrain the mass flow of the load node and the L-shaped intermediate node;

[0013] The topology constraint is used to constrain the air pressure and mass flow balance of the intermediate node.

[0014] Optionally, performing differential processing on the dynamic physical model includes:

[0015] The dynamic physical model is differentiated based on a time step and a space step using a Wendroff format, wherein the space step is a variable space step.

[0016] Optionally, the simplification of the differential model and the constraint condition based on the variables at each moment to obtain a time-domain two-port model of the natural gas network includes:

[0017] Extracting the mass flow variable and the pressure variable from the differential model, and taking the mass flow variable and the pressure variable at time t as known variables, and the mass flow variable and the pressure variable at time t+1 as unknown variables, to simplify the differential model;

[0018] If the natural gas network includes the intermediate node, the topological constraints of the natural gas network are added as supplementary equations to the simplified differential model;

[0019] The simplified differential model is converted into a matrix equation HU=BY+C, and the matrix equation is used as a time-dependent two-port model of the natural gas network, wherein the matrix H is determined according to the mass balance equation, the momentum equation, and the topological constraints and is adjusted based on the natural gas pipeline of the gas source node or the load node, the matrix U represents the unknown variable vector containing the mass flow and pressure of each node at time t+1, the matrix B is derived from the matrix H, the matrix Y represents the known variable vector containing the mass flow and pressure of each node at time t, and the matrix C is related to the constraint conditions.

[0020] Optionally, after obtaining the time-domain two-port model of the natural gas network, the method further comprises:

[0021] The matrix equation is solved based on the Schur complement strategy to obtain the value of the matrix U, and the flow quality and pressure of the pipeline in the natural gas network are output according to the value of the matrix U.

[0022] Optionally, solving the matrix equation based on the Schur complement strategy includes:

[0023] Divide the matrix H into blocks, and get

[0024] Based on the matrix equation HU=BY+C, the matrix D at time t is calculated, where D=BY+C, and the matrix D is processed in blocks to obtain D=[D 1 ,D 2 ] T ;

[0025] Based on the matrix Q in the matrix H after Schur complement, block matrix D 1 and D 2 , calculate the matrix U.

[0026] According to another aspect of the present application, a natural gas network model construction device is provided, the device comprising:

[0027] An equation building module, used to build a dynamic physical model of the natural gas network based on the flow characteristics of natural gas flowing through the pipelines in the network, wherein the dynamic physical model includes a momentum equation, a mass balance equation and a state equation;

[0028] A constraint establishment module, used to establish constraint conditions based on the characteristics of the nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints and topological constraints;

[0029] The model simplification module is used to perform differential processing on the dynamic physical model to obtain a differential model, and simplify the differential model and the constraint conditions based on the variables at each moment to obtain a time-domain two-port model of the natural gas network, wherein the variables include mass flow variables and pressure variables.

[0030] Optionally, the equation building module is further used for:

[0031] In the dynamic physical model, the gas temperature is set constant, the pipeline height is set constant, and the convection is set to 0, and the nonlinear terms in the dynamic physical model are linearized to obtain a simplified dynamic physical model.

[0032] Optionally, the nodes include a gas source node, a load node and an intermediate node, and the intermediate node includes an N-type intermediate node and an L-type intermediate node;

[0033] Accordingly, the initial constraint is used to constrain the initial gas pressure and initial mass flow of all nodes in the natural gas network;

[0034] The boundary constraint is used to constrain the mass flow of the load node and the L-shaped intermediate node;

[0035] The topology constraint is used to constrain the air pressure and mass flow balance of the intermediate node.

[0036] Optionally, the model simplification module is used to:

[0037] The dynamic physical model is differentiated based on a time step and a space step using a Wendroff format, wherein the space step is a variable space step.

[0038] Optionally, the model simplification module is used to:

[0039] Extracting the mass flow variable and the pressure variable from the differential model, and taking the mass flow variable and the pressure variable at time t as known variables, and the mass flow variable and the pressure variable at time t+1 as unknown variables, to simplify the differential model;

[0040] If the natural gas network includes the intermediate node, the topological constraints of the natural gas network are added as supplementary equations to the simplified differential model;

[0041] The simplified differential model is converted into a matrix equation HU=BY+C, and the matrix equation is used as a time-dependent two-port model of the natural gas network, wherein the matrix H is determined according to the mass balance equation, the momentum equation, and the topological constraints and is adjusted based on the natural gas pipeline of the gas source node or the load node, the matrix U represents the unknown variable vector containing the mass flow and pressure of each node at time t+1, the matrix B is derived from the matrix H, the matrix Y represents the known variable vector containing the mass flow and pressure of each node at time t, and the matrix C is related to the constraint conditions.

[0042] Optionally, the device further comprises a computing module, configured to:

[0043] The matrix equation is solved based on the Schur complement strategy to obtain the value of the matrix U, and the flow quality and pressure of the pipeline in the natural gas network are output according to the value of the matrix U.

[0044] Optionally, the calculation module is used to:

[0045] Divide the matrix H into blocks, and get

[0046] Based on the matrix equation HU=BY+C, the matrix D at time t is calculated, where D=BY+C, and the matrix D is processed in blocks to obtain D=[D 1 ,D 2 ] T ;

[0047] Based on the matrix Q in the matrix H after Schur complement, block matrix D 1 and D 2 , calculate the matrix U.

[0048] According to another aspect of the present application, a medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the above-mentioned natural gas network model construction method is implemented.

[0049] According to another aspect of the present application, a device is provided, including a storage medium and a processor, wherein the storage medium stores a computer program, and the processor implements the above-mentioned natural gas network model construction method when executing the computer program.

[0050] By means of the above technical solution, the present application transforms the partial differential equations describing the dynamic transmission process of the natural gas pipeline into a time-domain linear algebraic model that is easy to solve. Compared with the traditional finite difference method, the constructed model introduces constraint equations, initial conditions and boundary conditions of the intermediate nodes, which effectively reduces the complexity of solving the natural gas network. On this basis, the present application adopts the Schur complement strategy to effectively reduce the dimension of the matrix equation during the calculation process. Therefore, when solving the dynamic equations of the natural gas network, the calculation cost can be greatly reduced, and the calculation speed of the dynamic flow of the natural gas network can be significantly improved.

[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0053] Figure 1 A schematic diagram of a process of constructing a natural gas network model provided in an embodiment of the present application is shown;

[0054] Figure 2A schematic diagram of a process of another natural gas network model construction method provided in an embodiment of the present application is shown;

[0055] Figure 3 A schematic diagram of a natural gas pipeline connection provided in an embodiment of the present application is shown;

[0056] Figure 4 A schematic diagram of a finite difference unit operation provided in an embodiment of the present application is shown;

[0057] Figure 5 A schematic diagram of a process for solving a natural gas network model provided in an embodiment of the present application is shown;

[0058] Figure 6 A structural block diagram of a natural gas network model building device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0059] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0060] In this embodiment, a method for constructing a natural gas network model is provided, specifically a method for constructing a natural gas network model, such as Figure 1 As shown, the method includes:

[0061] Step 101, based on the flow characteristics of natural gas flowing through pipelines in the network, a dynamic physical model of the natural gas network is established, wherein the dynamic physical model includes a momentum equation, a mass balance equation, and a state equation.

[0062] Specifically, the change process of the natural gas network has significant dynamic characteristics. When the load of the natural gas network changes, each state quantity needs a certain amount of time to reach a stable state. Based on this, this step uses the momentum equation, mass balance equation and state equation to characterize the one-dimensional flow process of natural gas through the pipeline.

[0063] Among them, the momentum equation describes the momentum transfer in the continuous gas, and its expression is:

[0064]

[0065] In the formula, t represents time; x represents spatial distance; ρ represents the gas density on the horizontal plane (kg / m 3 );ρ α Indicates the density of the gas at an angle α to the horizontal plane (kg / m 3 ), ω represents gas velocity (m / s), π represents gas pressure (Pa), g represents gravitational acceleration (m / s 2), d is the pipe diameter (m), and λ is the friction coefficient per unit length of the pipe.

[0066] The mass balance equation represents the mass relationships in a natural gas network as follows:

[0067]

[0068] The equation of state relates gas temperature, density, and pressure and can be expressed as:

[0069] π=c 2 ρ (3)

[0070] In the formula, c 2 =ZRT, c represents the speed of sound in the gas (m / s); Z represents the gas compressibility coefficient; R represents the gas constant of natural gas; T represents the temperature (K)

[0071] Step 102: Establish constraint conditions based on the characteristics of nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints, and topological constraints.

[0072] In this step, the constraints of the dynamic physical model are established based on the characteristics of the nodes in the natural gas network. The natural gas network includes gas source nodes, load nodes, and intermediate nodes. The intermediate nodes include N-type intermediate nodes and L-type intermediate nodes. The name and description of each node are shown in Table 1 below.

[0073] Table 1 Description of nodes in the natural gas network

[0074] node describe Gas source node Connect directly to the gas source. Load Node Only connected to one branch and carrying load. N-type intermediate node Contains two or more branches and has no load. L-type intermediate node Contains two or more branches and carries loads.

[0075] Among them, the constraints include initial constraints, boundary constraints and topological constraints. The initial constraints are used to constrain the initial gas pressure and initial mass flow of all nodes in the natural gas network; the boundary constraints are used to constrain the mass flow of load nodes and L-shaped intermediate nodes; the topological constraints are used to constrain the gas pressure and mass flow balance of the intermediate nodes.

[0076] Step 103, performing differential processing on the dynamic physical model to obtain a differential model, and simplifying the differential model and constraints based on variables at each moment to obtain a time-domain two-port model of the natural gas network, wherein the variables include mass flow variables and pressure variables.

[0077] In this step, the dynamic physical model obtained in the previous step is converted into a time-domain two-port model to facilitate model solution. Specifically, the finite difference method can be used to perform differential approximation on the differential terms in the differential equation, thereby converting the differential equation into a set of algebraic equations to obtain a differential model. The differential model at this time needs to additionally introduce constraints such as those set in the previous step 102. Considering the complexity of the solution, this step proposes a time-domain two-port model of the natural gas network based on the differential model and the constraints. First, the mass flow variable and the pressure variable in the differential equation are extracted, and then the model is simplified based on the extracted variables. When the system contains intermediate nodes, the constraints are introduced, and the equation is converted into the form of a matrix equation to obtain a time-domain two-port model.

[0078] This embodiment transforms a set of partial differential equations describing the dynamic transmission process of the natural gas pipeline into an easy-to-solve time-domain linear algebraic model. Compared with the traditional finite difference method, the constructed model introduces constraint equations, initial conditions and boundary conditions of intermediate nodes, which effectively reduces the complexity of solving the natural gas network.

[0079] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for constructing a natural gas network model is provided, such as Figure 2 As shown, the method comprises the following steps:

[0080] Step 201 : establishing a dynamic physical model of the natural gas network based on the flow characteristics of natural gas flowing through pipelines in the network, wherein the dynamic physical model includes a momentum equation, a mass balance equation, and a state equation.

[0081] Step 202, in the dynamic physical model, the gas temperature is set to be constant, the pipe height is set to be constant, the convection is set to be 0, and the nonlinear terms in the dynamic physical model are linearized to obtain a simplified dynamic physical model.

[0082] In this step, in order to reduce the computational burden and maintain satisfactory accuracy, the following reasonable assumptions can be adopted: Assumption 1: Assume that the process of gas transmission along the pipeline is isothermal, that is, the temperature of the gas remains unchanged. When the change of gas temperature is ignored, c in the above formula (3) is 2 can be regarded as a constant; Assumption 2, assuming that the pipeline height remains unchanged, then α in the above formula (1) is 0, so the fourth term g(ρ-ρ a )sinα is equal to 0; Assumption 3, assume that the second term (convection term) in the above equation (1) is 0, because it only exists when the gas flow rate is close to the speed of sound.

[0083] Applying the above three assumptions to equation (1), we can obtain the following simplified momentum equation:

[0084]

[0085] Introducing mass flow rate f, the relationship between f and gas density ρ is shown as follows:

[0086] f=ρωA (1)

[0087] Using the mass flow rate f to represent the gas flow rate ω, we can obtain the equivalent form of equation (2) and equation (4):

[0088]

[0089]

[0090] Where f is the mass flow rate (kg / s); A is the cross-sectional area of ​​the pipe (m 2 ).

[0091] Since the third term (deviatoric stress tensor) in Eq. (4) is a quadratic term ω 2 The nonlinear term is the product of the first-order term ρ, which leads to the existence of the square term of the mass flow rate f in equation (7). In order to simplify the model of the gas pipeline, the average gas flow rate can be used For the nonlinear term f in equation (7), 2 Linearization is performed. The simplified result is:

[0092]

[0093] Substituting equation (8) into equation (7), we can obtain the simplified gas momentum equation as follows:

[0094]

[0095] The gas state equation (3) remains unchanged without further simplification.

[0096] Step 203: establishing constraint conditions based on the characteristics of the nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints, and topological constraints.

[0097] In this step, the initial conditions, boundary conditions, and topological conditions of the dynamic physical model are established. Assuming that the natural gas system is in a steady state at the initial moment, the gas pressure and mass flow rate of all nodes are known in the initial conditions, and the following initial conditions can be obtained:

[0098]

[0099]

[0100] In the formula, π Ni and f NiThey represent the gas pressure and mass flow rate of each node in the natural gas network under steady state conditions.

[0101] In addition, the mass flow rate f of the L-shaped intermediate node and load node i,t The following boundary conditions should be met:

[0102]

[0103]

[0104] In the formula, f Li,t and f Di,t are the natural gas loads at the L-shaped intermediate node and load node, respectively.

[0105] In addition, the air pressure at the air source node π i,t Keep constant and meet the following boundary conditions:

[0106]

[0107] In addition, for Figure 3 The gas pipeline connection shown in the figure should keep the gas pressure at the intermediate nodes equal, that is, satisfy the following topological constraints:

[0108] π i,t =π i+1,t =π i+2,t =… (11)

[0109] At the intermediate node, the mass flow in and out of the pipeline should be balanced. The mass flow of N-type and L-type intermediate nodes should satisfy the following topological constraints respectively:

[0110]

[0111]

[0112] In the formula, f i,t A is the mass flow rate from pipeline ij into the intermediate node; i is the cross-sectional area of ​​the pipe ij; A md is the equivalent cross-sectional area.

[0113] Step 204 , based on the time step and the space step, the dynamic physical model is differentiated using the Wendroff format to obtain a differential model, wherein the space step is a variable space step.

[0114] In this step, the partial differential equations (6) and (9) describing the dynamic flow of the natural gas network can be approximated using the Wendroff difference format. The Wendroff difference format has a stage error of O(Δt 2 +Δx 2) has the second-order accuracy, and its differential format is as follows:

[0115]

[0116] Where Δt represents the time step; Δx represents the space step. The finite difference unit is as follows: Figure 4 As shown. In the above differential format, the pipeline is divided into several sections. According to the momentum equation and the mass balance equation, each section of the pipeline with a length of Δx is analyzed. In this embodiment, a variable spatial step length Δx is used, and solution nodes are set at i and j on both sides of the pipeline. Therefore, the node i+1 in equation (18) is replaced by the node j on the other side of the pipeline, and Δx is replaced by the pipeline length L ij Replace. Applying equation (18) to equation (6) and equation (9) for approximate calculation, the constraint equation of each pipeline ij can be expressed as:

[0117]

[0118]

[0119] In the formula, represents the average gas flow rate in the pipeline (m / s), which can be calculated by the following formula (21):

[0120]

[0121] According to equations (19) and (20), during the flow of natural gas pipelines, gas pressure and mass flow are coupled in time and space. When the gas pressure changes, the mass flow also changes. Conversely, when the mass flow changes, the gas pressure also changes.

[0122] Step 205, extract the mass flow variable and the pressure variable from the differential model, and use the mass flow variable and the pressure variable at time t as known variables and the mass flow variable and the pressure variable at time t+1 as unknown variables to simplify the differential model.

[0123] In this step, based on the above equations (19) and (20) which are natural gas network dynamic models based on the differential format, a time domain two-port model considering the dynamic characteristics of the natural gas network is constructed.

[0124] Specifically, the mass flow rate and pressure variables in the differential equations (19) and (20) are first extracted to obtain the following equations:

[0125]

[0126]

[0127] Without considering the initial and boundary conditions, all variables at time t are considered known variables, and all variables at time t+1 are considered unknown variables.

[0128] Assumptions:

[0129]

[0130]

[0131]

[0132] Put the unknown variables on the left side of the equation, the known variables on the right side of the equation, and apply the above substitutions, equations (22) and (23) can be simplified to:

[0133] kf j,t+1 -kf i,t+1 +π j,t+1 +π i,t+1 =-kf j,t +kf i,t +π j,t +π i,t (twenty three)

[0134] (a+1)f j,t+1 +(a+1)f i,t+1 +bπ j,t+1 -bπ i,t+1 =(1-a)f j,t +(1-a)f i,t -bπ j,t +bπ i,t (twenty four)

[0135] Step 206: If the natural gas network includes intermediate nodes, the topological constraints of the natural gas network are added as supplementary equations to the simplified differential model.

[0136] In this step, when the system contains intermediate nodes, the topological constraints of the natural gas network should also be added as a supplementary equation. Equation (15) can be transformed into the following form:

[0137]

[0138]

[0139] Step 207, converting the simplified differential model into a matrix equation HU=BY+C, and using the matrix equation as a time-dependent two-port model of the natural gas network, wherein the matrix H is determined according to the mass balance equation, the momentum equation, and the topological constraints and is adjusted based on the natural gas pipeline of the gas source node or the load node, the matrix U represents the unknown variable vector including the mass flow and pressure of each node at time t+1, the matrix B is derived from the matrix H, the matrix Y represents the known variable vector including the mass flow and pressure of each node at time t, and the matrix C is related to the constraint conditions.

[0140] In this step, the i-th natural gas pipeline is divided into m i Parts, and number each part of the pipeline in turn, where m i Determined according to the total length of the pipeline and the spatial step length. The above equation can be converted into a matrix equation as follows: HU = BY + C (27)

[0141] Wherein, the matrix U represents the unknown variable vector including the mass flow rate f and pressure π of each node at time t+1, which can be expressed as:

[0142] U=[F 1,t+1 ,F 2,t+1 ,...,F i,t+1 ,...,P 1,t+1 ,P 2,t+1 ,...,P i,t+1 ,...] T (28)

[0143] Matrix F i,t+1 and P i,t+1 It can be expressed as:

[0144]

[0145]

[0146] Where r i and i It can be written as:

[0147]

[0148]

[0149] The matrix Y represents the known variable vector containing the mass flow rate f and pressure π of each node at time t. Its format is the same as that of the matrix U. Due to limited space, it will not be repeated here.

[0150] Matrices H, B, and C are known parameter matrices. Matrix H can be expressed as:

[0151]

[0152] In the formula, the matrix H 1 and H 2 It can be obtained from the mass balance equation (27), the matrix H 3 and H 4 It can be obtained from the momentum equation (28), the matrix H 5 and H 6 can be obtained from the topological constraints (12), (13), (29) and (30). In addition, the matrix H 1 , H 2 , H 3 and H 4 The format is the same and can be expressed as:

[0153]

[0154] Where:

[0155]

[0156]

[0157]

[0158] In addition, when the i-th natural gas pipeline contains a gas source node or a load node, the above matrix needs to be adjusted. Specifically, when a load node is included, the matrix H 1i and H 3i Need to be adjusted, when including the gas source node matrix H 2i and H 4i An adjustment is required, which can be expressed as:

[0159]

[0160]

[0161]

[0162]

[0163] Matrix H 5 and H 6 It can be expressed as:

[0164] H 5 =[H 51 ,H 52 ,...,H 5i ,...,O] T (43)

[0165] H 6 =[O,H 61 ,H 62,...,H 6i ,...] T (44)

[0166] In the formula, the matrix H 5i and H 6i It can be expressed as:

[0167]

[0168]

[0169] Where n represents the number of branches of the i-th intermediate node. and They can be recorded as:

[0170]

[0171] In the formula, E i and L i They represent the set of pipes flowing into and out of the intermediate node i respectively.

[0172]

[0173] In the formula, O i is the i-th element in the set O of pipes with the smallest pipe number connected to the intermediate node. is the set of other pipelines connected to the intermediate node N i The j-th element of .

[0174] It is worth noting that the matrix H 6i Each row of contains only two non-zero entries (1 and -1), and element 1 should be in the same column.

[0175] Similar to matrix H, matrix B can be expressed as:

[0176]

[0177] According to the derivation, the matrix B 1 , B 2 , B 3 and B 4 It can be described as:

[0178]

[0179] B 2 =-H 2 (51)

[0180] B 3 =-H 3 (52)

[0181] B 4=H 4 (53)

[0182] The matrix C is related to the constraints of the system and can be expressed as:

[0183] C=[C 11 ,C 12 ,...,C 1i ,...,C 21 ,C 22 ,...,C 2i ,...,C 3 ] T (54)

[0184] Matrix C 1i , C 2i and C 3 It can be expressed as:

[0185]

[0186]

[0187]

[0188] In the formula, the matrix C 3 and the matrix H 5 The same number of rows, It can be written as:

[0189]

[0190] Therefore, the two-port models corresponding to the mass balance equation, momentum equation and constraint conditions are shown in (63), (64) and (65), respectively.

[0191] [H 1 H 2 ]U=[B 1 B 2 ]Y+[C 11 ,C 12 ,...,C 1i ,...] T (59)

[0192] [H 3 H 4 ]U=[B 3 B 4 ]Y+[C 21 ,C 22 ,...,C 2i ,...] T (60)

[0193]

[0194] At this point, the time domain two-port model of the natural gas network is obtained, as shown in formula (66):

[0195]

[0196] The model has the following two characteristics: it converts the set of partial differential equations describing the dynamic transmission process of the natural gas pipeline into an easy-to-solve time-domain linear algebraic model, which is easy to solve; compared with the traditional finite difference method, the model introduces constraint equations, initial conditions and boundary conditions of the intermediate nodes, which effectively reduces the complexity of solving the natural gas network.

[0197] like Figure 5 As shown, in another embodiment, after obtaining the time-domain two-port model of the natural gas network, the method further includes:

[0198] Step 301, solving the matrix equation based on the Schur complement strategy to obtain the value of the matrix U, and outputting the flow quality and pressure of the pipeline in the natural gas network according to the value of the matrix U.

[0199] In this step, although the time domain two-port model can reduce the computational complexity when solving the dynamic characteristics of the natural gas network, the dimension of the variable is still high due to the time and space step size of seconds and hundreds of meters, resulting in a slow calculation speed. In order to improve the calculation efficiency, this embodiment proposes a numerical method based on the Schur complement strategy.

[0200] Specifically, using matrix D to represent BY+C, the time domain two-port model (66) can be transformed into:

[0201] HU=D (63)

[0202] The matrix H is an n×n non-singular matrix and can be represented as a block matrix:

[0203]

[0204] Wherein, matrices Q and T are both block matrices, and the orders of matrices Q and T are equal to the order of matrix H 1 and H 2 The number of columns.

[0205] If the matrix Q is non-singular, then the matrix H can be subjected to elementary transformations of block matrices.

[0206]

[0207] By calculating the determinant of formula (69), we can obtain:

[0208]

[0209] According to formula (70), the matrix H and T-SQ -1 The invertibility of R is the same. Since the matrix H is invertible, the matrix T-SQ -1 R is also invertible. Therefore, the Schur complement of the matrix Q in the matrix H exists and can be defined as: T-SQ -1 R (67)

[0210] It should be noted that when using the Schur complement strategy, it is necessary to ensure that the matrix Q is a full-rank matrix. If this prerequisite cannot be met, the constraints should be adjusted in advance. By transforming the rows of the matrix H, it is easy to ensure that the matrix Q is a full-rank matrix.

[0211] Formula (67) can be transformed into:

[0212]

[0213] Equation (72) can be transformed into a matrix equation system consisting of two matrix equations.

[0214] QU 1 +RU 2 =D 1 (69)

[0215] SU 1 +TU 2 =D 2 (70)

[0216] Using the Schur complement strategy, multiply equation (73) by SQ -1 :

[0217] SU 1 +SQ -1 RU 2 =SQ -1 D 1 (71)

[0218] By performing matrix operations on equations (74) and (75), we can obtain the solution of the matrix equation system, that is, the solution of the matrix equation (67).

[0219] U 2 =(T-SQ -1 R) -1 (D 2 -SQ -1 D 1 ) (72)

[0220] U 1 =Q -1 (D 1 -RU 2 ) (73)

[0221] This embodiment adopts the Schur complement strategy to effectively reduce the dimension of the matrix equation during the calculation process, so when solving the dynamic equation of the natural gas network, it can greatly reduce the calculation cost and significantly improve the calculation speed of the dynamic flow of the natural gas network.

[0222] In one embodiment, the proposed natural gas network dynamic power flow calculation method process is as follows:

[0223]

[0224]

[0225] The embodiment of the present application firstly derives a time-domain two-port model taking into account the dynamic characteristics of natural gas based on the finite difference method of the Wendroff format, which effectively reduces the complexity of solving the natural gas network. On this basis, a numerical method based on the Schur complement strategy is developed to improve the computational efficiency. The proposed method can greatly reduce the order of the matrix equation and significantly reduce the calculation time of the dynamic flow of large-scale natural gas systems.

[0226] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0227] Furthermore, as a specific implementation of the above-mentioned natural gas network model construction method, the embodiment of the present application provides a natural gas network model construction device, such as Figure 6 As shown, the device includes: an equation building module, a constraint building module and a model simplification module, wherein:

[0228] An equation building module, used to build a dynamic physical model of the natural gas network based on the flow characteristics of natural gas flowing through the pipelines in the network, wherein the dynamic physical model includes a momentum equation, a mass balance equation, and a state equation;

[0229] A constraint establishment module, used to establish constraint conditions based on the characteristics of nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints and topological constraints;

[0230] The model simplification module is used to perform differential processing on the dynamic physical model to obtain a differential model, and simplify the differential model and constraints based on the variables at each moment to obtain a time-domain two-port model of the natural gas network, wherein the variables include mass flow variables and pressure variables.

[0231] In a specific application scenario, optionally, the equation building module is also used to:

[0232] In the dynamic physical model, the gas temperature and the pipe height are set to be constant, the convection is set to be 0, and the nonlinear terms in the dynamic physical model are linearized to obtain a simplified dynamic physical model.

[0233] In a specific application scenario, optionally, the node includes a gas source node, a load node, and an intermediate node, and the intermediate node includes an N-type intermediate node and an L-type intermediate node;

[0234] Accordingly, the initial constraints are used to constrain the initial gas pressure and initial mass flow rate of all nodes in the natural gas network;

[0235] Boundary constraints are used to constrain the mass flow at load nodes and L-shaped intermediate nodes;

[0236] Topological constraints are used to constrain the pressure and mass flow balance of intermediate nodes.

[0237] In a specific application scenario, optionally, the model simplification module is used to:

[0238] The Wendroff format is used to differentiate the dynamic physical model based on the time step and the space step, where the space step is a variable space step.

[0239] In a specific application scenario, optionally, the model simplification module is used to:

[0240] Extract the mass flow variable and the pressure variable in the differential model, and take the mass flow variable and the pressure variable at time t as known variables, and the mass flow variable and the pressure variable at time t+1 as unknown variables, to simplify the differential model;

[0241] If the gas network contains intermediate nodes, the topological constraints of the gas network are added as supplementary equations to the simplified difference model;

[0242] The simplified differential model is transformed into a matrix equation HU=BY+C, and the matrix equation is used as a time-dependent two-port model of the natural gas network, where the matrix H is determined according to the mass balance equation, momentum equation and topological constraints and is adjusted based on the natural gas pipeline of the gas source node or load node. The matrix U represents the unknown variable vector containing the mass flow and pressure of each node at time t+1, the matrix B is derived from the matrix H, the matrix Y represents the known variable vector containing the mass flow and pressure of each node at time t, and the matrix C is related to the constraints.

[0243] In a specific application scenario, optionally, the device further includes a computing module, which is used to:

[0244] The matrix equation is solved based on the Schur complement strategy to obtain the value of the matrix U, and the flow quality and pressure of the pipeline in the natural gas network are output according to the value of the matrix U.

[0245] In a specific application scenario, optionally, the computing module is used to:

[0246] Divide the matrix H into blocks, and get

[0247] Based on the matrix equation HU = BY + C, the matrix D at time t is calculated, where D = BY + C, and the matrix D is processed in blocks to obtain D = [D 1 ,D 2 ] T ;

[0248] Based on the Schur complement of matrix Q in matrix H, the matrix D after block division 1 and D 2 , calculate the matrix U.

[0249] According to another aspect of the present application, a medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the above-mentioned natural gas network model construction method is implemented.

[0250] It should be noted that for other corresponding descriptions of the functional modules involved in the natural gas network model building device provided in the embodiment of the present application, reference can be made to the corresponding descriptions in the above method and will not be repeated here.

[0251] Based on the above method, accordingly, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the above method for constructing a natural gas network model is implemented.

[0252] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0253] Based on the above Figures 1 to 5 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a device, which can be a personal computer, a server, a network device, etc. The electronic device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figures 1 to 5 The natural gas network model construction method shown in Figure 2 is shown in Figure 2.

[0254] Optionally, the electronic device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0255] Those skilled in the art will appreciate that the electronic device structure provided in this embodiment does not limit the electronic device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0256] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the electronic device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the various controls inside the storage medium, and communication with other hardware and software in the physical device.

[0257] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware.

[0258] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the units or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the units in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The units of the above-mentioned implementation scenarios can be combined into one unit, or can be further split into multiple sub-units.

[0259] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A method for constructing a natural gas network model. It is characterized in that The method comprises: Based on the flow characteristics of natural gas flowing through the pipelines in the network, a dynamic physical model of the natural gas network is established, wherein the dynamic physical model includes a momentum equation, a mass balance equation and a state equation; Based on the characteristics of the nodes in the natural gas network, constraints are established, wherein the constraints include initial constraints, boundary constraints and topological constraints, the nodes include gas source nodes, load nodes and intermediate nodes, and the intermediate nodes include N Type intermediate nodes and L Type intermediate node; Accordingly, the initial constraint is used to constrain the initial gas pressure and initial mass flow of all nodes in the natural gas network; The boundary constraint is used to constrain the load node and the L The mass flow of the intermediate nodes of the type; The topological constraint is used to constrain the air pressure and mass flow balance of the intermediate node; The dynamic physical model is subjected to differential processing to obtain a differential model, and the mass flow variable and the pressure variable are extracted from the differential model. t The mass flow rate variable and pressure variable at the moment are taken as known variables. t The mass flow rate variable and the pressure variable at time +1 are taken as unknown variables to simplify the differential model; If the natural gas network includes the intermediate node, the topological constraint of the natural gas network is added as a supplementary equation to the simplified differential model; Convert the simplified difference model into a matrix equation HU=BY+C , and the matrix equation is used as the time-dependent two-port model of the natural gas network, where the matrix H According to the mass balance equation, the momentum equation and the topological constraint, and based on the natural gas pipeline adjustment of the gas source node or the load node, the matrix U express t+1 The unknown variable vector containing the mass flow rate and pressure of each node at the moment, the matrix B By the matrix H It is deduced that the matrix Y express t The known variable vector containing the mass flow rate and pressure of each node at the moment, the matrix C associated with the constraint condition, wherein the variables include a mass flow variable and a pressure variable; The matrix H Divide into blocks, get ; Based on the matrix equation HU=BY+C calculate t The matrix of moments D ,in D=BY+C , and the matrix D After block processing, we get D = [ D 1 , D 2 ] T ; Based on the matrix Q In the matrix H Schur complement and block matrix in D 1 as well as D 2 , calculate the matrix U , and obtain the matrix U The value of the matrix U is obtained, and the flow quality and pressure of the pipeline in the natural gas network are output according to the value of the matrix U.

2. The method according to claim 1, It is characterized in that After establishing the dynamic physical model of the natural gas network, the method further comprises: In the dynamic physical model, the gas temperature is set constant, the pipeline height is set constant, and the convection is set to 0, and the nonlinear terms in the dynamic physical model are linearized to obtain a simplified dynamic physical model.

3. The method according to claim 1, It is characterized in that The performing differential processing on the dynamic physical model comprises: The dynamic physical model is differentiated based on a time step and a space step using a Wendroff format, wherein the space step is a variable space step.

4. A natural gas network model building device, It is characterized in that The device comprises: An equation building module, used to build a dynamic physical model of the natural gas network based on the flow characteristics of natural gas flowing through the pipelines in the network, wherein the dynamic physical model includes a momentum equation, a mass balance equation and a state equation; A constraint establishment module is used to establish constraint conditions based on the characteristics of the nodes in the natural gas network, wherein the constraint conditions include initial constraints, boundary constraints and topological constraints, the nodes include gas source nodes, load nodes and intermediate nodes, and the intermediate nodes include N Type intermediate nodes and L Type intermediate node; accordingly, the initial constraint is used to constrain the initial gas pressure and initial mass flow of all nodes in the natural gas network; the boundary constraint is used to constrain the load node and the L The topological constraint is used to constrain the air pressure and mass flow balance of the intermediate node; The model simplification module is used to perform differential processing on the dynamic physical model to obtain a differential model, and extract the mass flow variable and the pressure variable from the differential model, and convert t The mass flow rate variable and pressure variable at the moment are taken as known variables. t The mass flow variable and pressure variable at time +1 are taken as unknown variables to simplify the differential model; if the natural gas network contains the intermediate node, the topological constraints of the natural gas network are added as supplementary equations to the simplified differential model; the simplified differential model is converted into a matrix equation HU=BY+C , and the matrix equation is used as the time-dependent two-port model of the natural gas network, where the matrix H According to the mass balance equation, the momentum equation and the topological constraint, and based on the natural gas pipeline adjustment of the gas source node or the load node, the matrix U express t+1 The unknown variable vector containing the mass flow rate and pressure of each node at the moment, the matrix B By the matrix H It is deduced that the matrix Y express t The known variable vector containing the mass flow rate and pressure of each node at the moment, the matrix C associated with the constraint condition, wherein the variables include a mass flow variable and a pressure variable; A calculation module is used to convert the matrix H Divide into blocks, get ; The calculation module is also used to calculate the matrix equation HU=BY+C calculate t The matrix of moments D ,in D=BY+C , and the matrix D After block processing, we get D = [ D 1 , D 2 ] T Based on the matrix Q In the matrix H Schur complement and block matrix in D 1 as well as D 2 , calculate the matrix U , and obtain the matrix U The value of , and output the flow quality and pressure of the pipeline in the natural gas network according to the value of the matrix U.

5. A storage medium having a program or instruction stored thereon, It is characterized in that When the program or instruction is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

6. An electronic device comprising a storage medium and a processor, It is characterized in that The storage medium stores a computer program, and the processor implements the method according to any one of claims 1 to 3 when executing the computer program.

Citation Information

Patent Citations

  • Gas-liquid two-phase flow simulating and calculating method for pressure-control well drilling

    CN104153759A

  • Method for acquiring dynamic energy flow of electricity-gas integrated energy system based on explicit difference

    CN113343531A

  • Remote safety estimation method for natural gas pipeline network leakage monitoring

    CN113656923A

  • A Dynamic Modeling Method for Natural Gas Systems

    CN114936522A

  • Design and control of multiple tubing string well systems

    US20110320047A1