Computational reliability optimization method for gas pipeline network under unbalanced inflow and outflow and fast transient conditions

By using tolerance comparison method in transient simulation of natural gas pipeline network, the internal solution results of single-pipe are processed, and the problem of conflict between the internal variable update solution of single-pipe internal and pipeline endpoint solutions of pipelines in the pipeline network is solved, and the accuracy and stability of simulation calculations are improved.

CN119089827BActive Publication Date: 2025-03-14SHANGHAI THREE ZERO FOUR ZERO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411231710.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-03-14
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

When performing transient simulation calculation of natural gas pipeline networks in the prior art, there is a contradiction between the update solution of the internal variable of a single pipe and the joint solution results of the pipeline endpoints in the pipeline network, resulting in unstable calculation accuracy.

Method used

Through tolerance comparison, the internal solution results of a single-tube are judged and processed, and the difference between the first data and the second data of the pipeline endpoint is obtained. If it is within the preset error threshold range, the parameters of the pipeline nodes of the current transient simulation are updated; if not, the linear difference operation is performed to update the data.

Benefits of technology

It effectively resolves the contradiction between the update solution of internal variables of a single pipe and the joint solution results of pipeline endpoints in the pipeline network, and improves the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089827B_ABST
    Figure CN119089827B_ABST
Patent Text Reader

Abstract

This application provides a method for optimizing computational reliability under gas pipeline network inflow / outflow imbalance and rapid transient conditions. The method includes: obtaining first data for each pipeline endpoint based on a simultaneous solution matrix of pipeline endpoints, and obtaining data for child nodes at each spatial step within each pipeline, where the child node data includes second data for each pipeline endpoint; obtaining the difference between the first and second data, and determining whether the difference is within a preset error threshold: if so, updating the parameters of the pipeline nodes in the transient simulation at the current moment based on the data of the child nodes at each spatial step within the pipeline; if not, performing linear interpolation on the child nodes at each spatial step within the pipeline based on the first data of the pipeline endpoints to obtain updated data for the child nodes at each spatial step within the pipeline, and updating the parameters of the pipeline nodes in the transient simulation at the current moment based on the updated data. This application can effectively improve the accuracy, consistency, stability, and reliability of transient simulation calculation results for natural gas pipeline networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of integrated energy management information technology, especially to the field of industrial Internet, cloud computing, and big data professional service technology. Background Art

[0002] As the scale of my country's natural gas pipeline network increases and the complexity of operation increases, natural gas pipeline network simulation technology will play a more important role in the construction and operation of future pipeline networks. The main business directions of pipeline network simulation intervention in gas company operations include: dynamic optimization and allocation of gas sources according to gas company costs and user pressure and calorific value requirements, winter LNG peak regulation, pipeline network leakage emergency simulation analysis, pipeline network planning simulation, etc.

[0003] In most of these scenarios, the flow and pressure of the gas source and the user are not stable and change over time. Therefore, it is necessary to consider the change of the gas in the pipeline axial direction with time and distance in a differential way in the simulation calculation. Therefore, compared with steady-state simulation, transient pipeline network simulation (also known as dynamic simulation) has a larger actual situation and higher calculation accuracy.

[0004] The construction of all pipeline network simulation equations needs to be based on the conservation of mass, momentum and energy. Therefore, the technical evolution path of pipeline network simulation is the description of the momentum equation and the energy equation, from the initial extremely simplified description to the later process of adding more complex correction terms that are more realistic.

[0005] At present, the finite difference method is generally used for pipeline network simulation. However, due to the failure of the first-order time difference of the resistance coefficient, the imperfect automatic verification mechanism of the accuracy of transient calculations at continuous moments, and the contradiction between the update solution of the internal variables of a single pipe and the joint solution of the pipe endpoints in the pipeline network, the accuracy of transient simulation calculations using the finite difference method is unstable. Summary of the invention

[0006] The present application provides a calculation reliability optimization method under the conditions of gas pipeline network inlet and outlet imbalance and fast transient conditions, which is used to improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network.

[0007] In a first aspect, an embodiment of the present application provides a computational reliability optimization method under unbalanced inflow and outflow and fast transient conditions of a gas pipeline network, comprising: obtaining first data of each pipeline endpoint based on a simultaneous solution matrix of pipeline network endpoints, and obtaining data of sub-nodes on each spatial step inside each pipeline, wherein the data of the sub-nodes include second data of each pipeline endpoint; obtaining the difference between the first data of the pipeline endpoint and the second data of the pipeline endpoint, and determining whether the difference is within a preset error threshold: if so, updating the parameters of the pipeline node of the transient simulation at the current moment according to the data of the sub-nodes on each spatial step inside the pipeline; if not, performing a linear difference operation on the sub-nodes on each spatial step inside the pipeline according to the first data of the pipeline endpoint, obtaining updated data of the sub-nodes on each spatial step inside the pipeline, and updating the parameters of the pipeline node of the transient simulation at the current moment based on the updated data.

[0008] In an implementation of the first aspect, the first data of the pipeline endpoint includes pressure data and mass flow data of the pipeline endpoint; the acquisition of the first data of each pipeline endpoint based on the pipeline network endpoint simultaneous solution matrix includes: based on the spatial step of the pipeline, the collected data of the boundary node, the simulation result data and the single pipeline pre-solution matrix, obtaining the general solution of the pipeline sub-nodes of all spatial steps on each pipeline; substituting the general solution of the pipeline sub-nodes of all spatial steps on each pipeline into the pipeline network endpoint simultaneous solution matrix to obtain the pressure data and mass flow data of each pipeline endpoint.

[0009] In an implementation of the first aspect, the data of the sub-nodes on the spatial step include mass density and operating flow rate; the acquisition of the data of the sub-nodes on each spatial step inside each pipeline includes: based on the pressure data and mass flow data of each pipeline endpoint and the general solution of the pipeline sub-nodes of all spatial steps on each pipeline, the mass density and operating flow rate of each sub-node on the spatial step inside each pipeline are obtained.

[0010] In an implementation method of the first aspect, it also includes: configuring the initial assignment type of each boundary node to be flow data; obtaining calculated pressure data through the flow data of each boundary node, and obtaining the pressure difference between the calculated pressure data and the collected pressure data of each boundary node; detecting whether the pressure difference is less than a pressure difference threshold: if so, keeping the initial assignment type of the boundary node as flow data; if not, obtaining the pressure average value data of the calculated pressure data at the previous moment and the collected pressure data at the current moment, and assigning the pressure average value data to the boundary node.

[0011] In an implementation manner of the first aspect, each boundary node is a boundary node in the gas supply node.

[0012] In an implementation of the first aspect, after assigning the pressure average value data to the boundary node, it also includes: detecting whether the number of transient simulation calculations at the current moment is less than or equal to a preset number threshold; in response to detecting that the number of transient simulation calculations at the current moment is less than or equal to the preset number threshold, performing transient simulation calculations based on the current assigned data of the boundary node, and obtaining the flow calculation error of the boundary node; detecting whether the flow calculation error is greater than the flow error threshold: if so, obtaining the pressure average value data of the calculated pressure data at the previous moment and the collected pressure data at the current moment, and assigning the currently obtained pressure average value data to the boundary node, and adding 1 to the number of transient simulation calculations at the current moment; if not, ending the transient simulation calculation at the current moment; in response to detecting that the number of transient simulation calculations at the current moment is greater than the preset number threshold, performing steady-state simulation calculations based on the flow data of the boundary node, and replacing the simulation result obtained by the transient simulation calculation with the simulation result obtained by the steady-state simulation calculation.

[0013] In an implementation of the first aspect, it also includes: obtaining the boundary node with sudden flow change based on the assignment data of the boundary node at the previous moment and the assignment data of the boundary node at the current moment; obtaining the Reynolds number and resistance coefficient of each pipeline at the current moment based on the simulation calculation at the current moment; replacing the Reynolds number and resistance coefficient of each pipeline obtained at the previous moment with the Reynolds number and resistance coefficient of each pipeline at the current moment.

[0014] In an implementation method of the first aspect, based on the assignment data of the boundary node at the previous moment and the assignment data of the boundary node at the current moment, the boundary node with a sudden change in traffic is obtained: when the assignment data of the boundary node at the previous moment is 0 traffic data, and the assignment data of the boundary node at the current moment is greater than a preset traffic value, the boundary node at the current moment is determined to be a boundary node with a sudden change in traffic.

[0015] In a second aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for optimizing the computational reliability under the conditions of imbalance in the inflow and outflow of the gas pipeline network and fast transient conditions as described in any one of the first aspects of the present application.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory storing a computer program; a processor communicating with the memory, and executing the calculation reliability optimization method under the gas pipeline network inlet and outlet imbalance and fast transient conditions described in any one of the first aspect of the present application when calling the computer program.

[0017] The calculation reliability optimization method under the conditions of gas network inlet and outlet imbalance and fast transient conditions provided in the embodiment of the present application has the following beneficial effects:

[0018] 1. This application uses tolerance comparison to judge and process the internal solution results of a single pipe, which can effectively solve the problem of the contradiction between the internal variable update solution of a single pipe and the simultaneous solution results of the pipeline endpoints in the pipeline network, and effectively improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network;

[0019] 2. This application has improved the design of the value exchange logic of the boundary nodes. It no longer simply exchanges the collected data, but strives to perform refined processing while ensuring that the pressure and flow calculation accuracy are up to standard, so that the simulation will not produce a large jump in accuracy, effectively solving the problem of fluctuations in simulation results caused by value exchange and transient simulation calling steady-state simulation under conditions of relying on pipeline storage gas supply and fast transient conditions, and further improving the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network;

[0020] 3. When dealing with large-scale sudden flow changes in the pipeline network, the present application replaces the Reynolds number and resistance coefficient of each pipeline at the current moment with the Reynolds number and resistance coefficient of the previous moment, which can effectively alleviate the calculation error caused by the sudden increase of flow from 0, solve the problem of reduced simulation accuracy and lag of simulation results relative to the real results caused by the failure of the first-order time difference of the resistance coefficient, and further improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 Shown is a flow chart of a method for optimizing calculation reliability under unbalanced inflow and outflow of a gas pipeline network and fast transient conditions according to an embodiment of the present application.

[0022] Figure 2 Shown is a flow chart of obtaining the first data of the pipeline endpoint in a calculation reliability optimization method under gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application.

[0023] Figure 3 Shown is a schematic diagram of the specific implementation process of the calculation reliability optimization method under the conditions of gas network inlet and outlet imbalance and fast transient changes in one embodiment of the present application.

[0024] Figure 4 Shown is a flow chart of the exchange of boundary node assignments in a method for optimizing the computational reliability under unbalanced inflow and outflow of a gas network and fast transient conditions in one embodiment of the present application.

[0025] Figure 5 Shown is a flow chart of the assignment exchange and simulation in the calculation reliability optimization method under the conditions of gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application.

[0026] Figure 6Shown is a schematic diagram of the overall implementation process of value exchange and simulation in a calculation reliability optimization method under gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application.

[0027] Figure 7 Shown is a parameter correction flow chart at high flow startup in a calculation reliability optimization method under gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application.

[0028] Figure 8 Shown is a schematic diagram of the specific implementation process of parameter correction during high flow startup in a calculation reliability optimization method under gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application.

[0029] Fig. 9 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0031] The embodiment of the present application provides a calculation reliability optimization method under the conditions of gas pipeline network inlet and outlet imbalance and fast transient conditions, which is used to improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network.

[0032] The following will be combined with the attached examples of the present application Figure 1 To Attachment Fig. 9 , the technical solution in the embodiment of the present application is described in detail, so that those skilled in the art can understand and implement the calculation reliability optimization method of the embodiment under the condition of gas pipeline inlet and outlet imbalance and fast transient working conditions without creative labor.

[0033] In the transient simulation of natural gas pipeline network, the internal variable update solution of a single pipe and the simultaneous solution of the pipe endpoints in the pipeline network will have conflicting results. The core solution process of any discrete format pipeline network transient calculation can be divided into three steps:

[0034] The first step is to pre-solve the general solution of the sub-node variables of the spatial step in a single tube;

[0035] The second step is to update the pipeline endpoint variables based on the boundary point collection values ​​at the current moment;

[0036] In the third step, the unique numerical solution of the sub-node variables is solved based on the updated results of the pipeline endpoint variables and the general solution of the sub-node variables of each single pipe.

[0037] However, due to the long-term reliance on pipe storage for gas supply or the existence of fast transient conditions at the air inlet / outlet points, the result of the solution in the third step may conflict with that in the second step. The direct reason is that the relationship of the general solution in the first step is incorrect.

[0038] For example, after the second step, the pressure and flow rate at the end of a pipe are calculated to be 1 MPa and 1 m 3 / s, but after the general solution obtained in the first step of the pipeline is solved in the third step, the solution results of the pipeline at each sub-node (for example, there are 4 sub-nodes from the starting point to the end point) are as follows:

[0039] The pressure and flow rate of subnode 1 (i.e. the starting point of the pipeline) are 1.1MPa and 0.9m 3 / s;

[0040] Subnode 2 is 1.05MPa, 0.95m 3 / s;

[0041] Subnode 3 is 1.1MPa, 1m 3 / s;

[0042] Subnode 4 (the end of the pipeline) is 1.18MPa, 1.1m 3 / s.

[0043] It can be seen that the result of the third step solution (i.e., the update solution of the internal variables of a single pipe) is 1.18 MPa and 1.1 m at the end point of the pipe at subnode 4. 3 / s, and the result of the joint solution of the pipe network end variables in the second step is 1MPa and 1m 3 / s results are inconsistent. It does not mean that the solution of the third step is necessarily wrong, but if there are many contradictions between the third step and the second step, it means that the assignment information of the boundary nodes of the pipeline network at the current moment cannot be reflected in the final transient simulation solution.

[0044] The calculation reliability optimization method of the gas pipeline network under unbalanced inlet and outlet and fast transient conditions in this embodiment aims at the problem of inconsistency between the internal variable update solution of a single pipe and the joint solution result of the pipeline endpoints in the pipeline network. By comparing the tolerances, the internal solution result of a single pipe is judged and processed, which can effectively solve the problem of inconsistency between the internal variable update solution of a single pipe and the joint solution result of the pipeline endpoints in the pipeline network, and effectively improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network.

[0045] Figure 1The flowchart of the calculation reliability optimization method under the condition of gas pipeline network inflow and outflow imbalance and fast transient condition in the embodiment of the present application is shown. Figure 1 As shown, the calculation reliability optimization method under the conditions of gas network inlet and outlet imbalance and fast transient changes provided in the embodiment of the present application includes the following steps S110 to S150.

[0046] Step S110, obtaining first data of each pipeline endpoint based on the pipeline network endpoint simultaneous solution matrix, and obtaining data of sub-nodes at each spatial step inside each pipeline, wherein the data of the sub-nodes includes second data of each pipeline endpoint;

[0047] Step S120, obtaining a difference between the first data of the pipeline endpoint and the second data of the pipeline endpoint;

[0048] Step S130, determining whether the difference is within a preset error threshold range: if so, proceeding to step S140, if not, proceeding to step S150;

[0049] Step S140, updating the parameters of the pipeline nodes of the transient simulation at the current moment according to the data of the sub-nodes at each spatial step inside the pipeline;

[0050] Step S150, performing linear interpolation operation on the sub-nodes on each spatial step inside the pipeline according to the first data of the pipeline endpoint, obtaining updated data of the sub-nodes on each spatial step inside the pipeline, and updating the parameters of the pipeline nodes of the transient simulation at the current moment based on the updated data.

[0051] This embodiment aims to solve the technical problem that the general solution relation of the sub-nodes at each spatial step generated by the single-pipe pre-solution may be inaccurate, resulting in a contradiction between the endpoint results of the subsequent pipe network joint solution and the results of the internal solution of the single pipe at the pipe endpoint. This contradiction is effectively resolved through the tolerance comparison method, which can ensure the stable and accurate operation of the subsequent simulation.

[0052] In this embodiment, an example of the pipeline endpoint simultaneous solution matrix is ​​as follows:

[0053]

[0054] In this embodiment, each pipeline takes the pressure and mass flow rate at the starting point, and the pressure and mass flow rate at the end point. Taking pipeline No. 1 as an example, the solution variables of this pipeline are the pressure and mass flow rate of the starting node P1,1 and m1,1, where the subscript 1 represents pipeline No. 1, and the other 1 represents the starting subnode ID of pipeline No. 1, and the pressure and mass flow rate of the end point P1,N+1 and m1,N+1, where the subscript 1 represents pipeline No. 1, and N+1 represents the end node ID of pipeline No. 1. Therefore, there are 4 variables involved in the solution of a pipeline. When there are n pipelines in the pipeline network, the variables to be solved are 4n. The construction process of A and b matrices will not be described in detail here. It is only used to illustrate the solution variables of this part, that is, the pressure and mass flow rate of the starting and end points of all pipelines. The variables of the internal subnodes of the pipeline (the virtual subnodes located at the spatial step of the pipeline) will be further solved based on the solution results of these endpoints, such as flow rate, pressure, density and other information.

[0055] In this embodiment, the variable matrix of the sub-nodes inside a single tube is as follows:

[0056]

[0057] In this embodiment, the variables directly solved for the single pipe are mass density and operating flow rate. As shown in the single pipe internal sub-node variable solution matrix. The variables in the x matrix are the mass density and operating flow rate of all sub-nodes on the pipe from the starting point to the end point. This embodiment will not describe the construction process of the above matrix in detail, but only use it to illustrate the variables to be solved.

[0058] This embodiment uses a single pipeline internal solution matrix to obtain the density ρ and flow rate w of each sub-node, and then uses the following formula to obtain the pressure and mass flow of each sub-node.

[0059]

[0060]

[0061] Among them, R is a constant, T is temperature, 11 parameters such as A0 can be determined according to the gas composition, M is the relative molecular mass, and A is the cross-sectional area of ​​the pipeline.

[0062] It can be foreseen that when solving the internal sub-nodes of a single pipe, in addition to the density, velocity, pressure, and flow rate of the sub-nodes in the middle of the pipe, the variables of the pipe endpoints will also be solved. The pressure and mass flow rate of the pipe endpoints have been solved when the all-pipe endpoints in the pipe network are solved together. If the results (pressure, mass density) of the internal solution when updating the variables of the pipe endpoint solution are inconsistent with the results of the endpoint joint solution, the simulation accuracy will be reduced. The reason is that when solving the general solution of the internal node variables of a single pipe, the general solutions α, β, and γ are inaccurate. The deeper reason is that the block matrices (size 2×2) such as CE / DW / H are used, and the first-order time difference discrete format is used. If the parameters of the previous time are incorrect, it will affect the general solution relationship of the sub-node solution in the single pipe. The general solution matrix of the sub-node variables in a single pipe is as follows:

[0063]

[0064] The expressions of block matrices such as CE, DW and H are as follows:

[0065]

[0066] In this embodiment, the spatial step size is set in the pipeline and virtual sub-nodes are added. The purpose is to use the continuous change of fluid motion in space to improve the accuracy of transient simulation. Therefore, the pressure and flow rate solved by endpoint joint cannot be guaranteed to be completely equal to the pressure and flow rate of the endpoint obtained by solving the internal solution of a single tube. However, if the deviation between the two is large, it means that the block matrix CE / DW / H used for solving is greatly distorted. At this time, when determining the solution variables of the pipeline endpoint and the internal sub-node, the result of the single-tube internal solution can continue to be used, and the difference between it and the endpoint joint result can be ignored, or the single-tube internal solution result can be abandoned, the endpoint joint result can be used, and the internal sub-node can be linearly interpolated as the solution result at the current moment.

[0067] Practice has shown that when the pipeline network relies on pipe storage for gas supply, or the inlet / outlet gas volumes of the pipeline network are seriously unequal, it is more likely that there will be inconsistencies between the variables solved internally by a single pipe and solved jointly by the pipeline network at the end points of the pipeline. In this case, the method of this embodiment can be used to obtain results that meet the expected simulation accuracy.

[0068] The following specifically describes the calculation reliability optimization method under the gas network inlet and outlet imbalance and fast transient conditions of this embodiment.

[0069] Figure 2 The flowchart of obtaining the first data of the pipeline endpoint in the calculation reliability optimization method under the condition of gas pipeline network inlet and outlet imbalance and fast transient working conditions in one embodiment of the present application is shown. Figure 2As shown, in one implementation of this embodiment, the first data of the pipeline endpoint includes pressure data and mass flow data of the pipeline endpoint; the method of obtaining the first data of each pipeline endpoint based on the simultaneous solution matrix of the pipeline network endpoints includes the following steps S111 and S112.

[0070] Step S111, based on the spatial step of the pipeline, the collected data of the boundary nodes, the simulation result data and the single pipeline pre-solved matrix, obtain the general solution of the pipeline sub-nodes of all spatial steps on each pipeline;

[0071] Step S121, substituting the general solution of the pipeline sub-nodes of all spatial steps on each pipeline into the pipeline network endpoint simultaneous solution matrix to obtain the pressure data and mass flow data of each pipeline endpoint.

[0072] In one implementation of this embodiment, the data of the sub-nodes on the spatial step include mass density and operating flow rate; the data of the sub-nodes on each spatial step inside each pipeline includes: based on the pressure data and mass flow data of each pipeline endpoint and the general solution of the pipeline sub-nodes of all spatial steps on each pipeline, the mass density and operating flow rate of each sub-node on the spatial step inside each pipeline are obtained.

[0073] In this embodiment, the spatial step is generated based on the length of the pipeline, including but not limited to:

[0074] 1) obtaining the length of the pipeline;

[0075] 2) Determine the pipe length space to which the length of the pipe belongs; wherein, multiple levels of pipe length spaces are preset according to the length of the pipe, and each level of the pipe length space corresponds to the number of sub-pipes divided from the corresponding pipe; the length of n pipes corresponds to n+1 pipe length spaces; the array of the number of sub-pipes divided from the pipe is:

[0076] [2, 2, 3, 3, 4, 4, 8, 16, 32, 64, 128, 256, 512];

[0077] The array of pipe lengths is:

[0078] [10, 20, 50, 100, 500, 1000, 2000, 4000, 8000, 16000, 32000, 64000];

[0079] 3) Obtaining the number of sub-pipelines divided into the pipeline corresponding to the pipe length space to which the length of the pipeline belongs;

[0080] 4) Divide the length of the pipeline by the number of sub-pipelines divided from the pipeline to obtain the spatial step length.

[0081] In a possible implementation of this embodiment, obtaining a general solution of pipeline subnodes of all spatial steps on each pipeline based on the spatial step, the collected data of the boundary node, the simulation result data, and the single pipeline pre-solution matrix includes:

[0082] 1) establishing partial differential equations of mass conservation and momentum conservation with mass density and operating flow velocity as variables based on the spatial step size, the collected data of the boundary nodes, and the simulation result data;

[0083] 2) The partial differential equation is sequentially unified, linearized and discretized to obtain a basic matrix equation; wherein, in the discretization process, the time term is forward differentiated and the convection term is forward differentiated;

[0084] 3) Substituting the basic matrix equation into the single-pipeline pre-solution matrix, solving the single-pipeline pre-solution matrix, and obtaining the general solution of the pipeline sub-nodes of all spatial steps on each pipeline.

[0085] When solving the system of equations for transient simulation, the variables to be solved are generally pressure and mass flow rate. In order to improve the processing and solving speed of subsequent partial differential equations, the mass density and operating flow rate are used for the highest calculation efficiency. Therefore, the partial differential forms of mass conservation and momentum conservation with mass density and operating flow rate as variables in this embodiment are:

[0086] (1)

[0087] (2)

[0088] Among them, ρ represents mass density, ω is the operating flow velocity, A represents the cross-sectional area of ​​the pipe, g is the gravitational acceleration, and θ is the horizontal angle of the pipe.

[0089] To facilitate the subsequent linearization, the partial differential equations of mass conservation and momentum conservation with mass density and working flow velocity as variables are first unified, that is, the partial differential equations of mass conservation and momentum conservation are written in the form of AX=b:

[0090] (3)

[0091] Among them, the expressions of U, B, and F are shown in Table 1

[0092] Table 1 Unified element expression of equation

[0093]

[0094] Then the unified partial differential equations of mass conservation and momentum conservation are linearized. From the above formula (3), we can deduce:

[0095] (4)

[0096] (5)

[0097] From the above formulas (4) and (5), we can deduce:

[0098] (6)

[0099] The letters with a “—” above them represent the parameters at the previous moment.

[0100] (7)

[0101] (8)

[0102] The linearized equation is then discretized, where the time term is forward differentiated and the convection term is forward differentiated. This embodiment uses a fully implicit difference method for numerical solution. In the discrete format, the time term difference takes the parameters of the previous moment, and the convection term (spatial term) no longer takes the parameters of the previous time layer. The discrete object is the point (t+Δt, x+1 / 2Δx).

[0103] (9)

[0104] Substituting the above formulas (7) and (8) into formula (9), we obtain:

[0105] (10)

[0106] In this embodiment, the single-pipeline pre-solved matrix is:

[0107]

[0108] Substituting the parameters CE, DW, and H in formula (9) into the above matrix, we can solve the general solution of the variables of the subnodes in the spatial step on a single pipeline. For the linear uncorrelated matrix of 2N*2(N+1), there are 2 basic solution systems and 1 special solution. We can assume:

[0109]

[0110]

[0111] in:

[0112] ,

[0113] same , the same Rank column vector.

[0114] Establishing a single pipe boundary The correlation equation

[0115] (11)

[0116] Supplementary equations for the pipe network.

[0117] For a pipe network with M pipes, the unknown quantity is: 4M, because a pipe has 4 unknowns, namely the pressure and mass flow rate at the starting end point; the number of equations formed by boundary conditions: 2M; the number of pipe network supplementary equations: 2M; the matrix is ​​a square matrix, and a unique solution can be found. The matrix form of the pipe network endpoint simultaneous solution is as follows:

[0118]

[0119] The simultaneous solution matrix of the pipe network endpoints is used to update the pressure and mass flow rate of each pipe endpoint at the current moment. Then, the pressure and mass flow rate of the pipe endpoints and the general solution obtained in the single pipe pre-solution are used to solve the mass density and operating flow rate of the sub-nodes on the spatial step inside the pipe.

[0120]

[0121] The symbolic meaning and dimensions of the physical quantities involved in the above matrix are as follows:

[0122] A is the cross-sectional area of ​​the pipe, m2;

[0123] ρ2 natural gas density, kg / m3;

[0124] ωg / gas flow rate, m / s;

[0125] d: inner diameter of the pipe, m;

[0126] Θ is the pipe inclination angle, rad;

[0127] s Pipeline elevation, m;

[0128] g gravitational acceleration m / s2;

[0129] m Natural gas mass flow rate, kg / s;

[0130] p pressure, Pa;

[0131] T temperature, K;

[0132] The gas state equation is as follows:

[0133] (12)

[0134] p is the natural gas pressure, kPa; T is the natural gas temperature, K; ρ is the natural gas mass density, kg / m3; M is the molar mass, g / mol; P_mol is the natural gas molar density, kmol / m3; R is the gas constant, 8.3143 kJ / (kmol·mo.

[0135] A0, B0, C0, D0, E0, a, b, c, d, 8 are the 11 parameters of the state equation, for pure components, and the critical parameter T ci ,i ci and eccentricity factor ω ci The relationship is as follows (i represents the component, and the parameters can be found in Table 2 and Table 3). 11 In, B1 to B 11 ,1 ci ,T ci ,i ci The relationship between these 11 parameters in pure components is shown in formula (13).

[0136]

[0137] (13)

[0138] Table 2 A1 to A 11 and B1 to B 11 Value

[0139]

[0140] Table 3 Physical parameters of pure substances

[0141]

[0142] When calculating the mixed components, there will be interactions between the components, and the 11 parameters of the mixed substance can be obtained by applying formula (14). is the mole fraction of component i of the natural gas mixture; is the interaction coefficient between the two components. The specific values ​​are shown in Appendix 4. , C is the number of mixed gas types.

[0143]

[0144] (14)

[0145] Table 4. Binary interaction coefficients in the BWRS model

[0146]

[0147] Formula (12) is for finding pressure when density is known. When it comes to finding density when pressure is known, the following formula (15) is used for solution. The parameters such as A0 are consistent with those in the gas state equation of formula (12). When it comes to pure components or multi-component mixed gases, the method for solving the above 11 parameters such as A0 is consistent.

[0148] (15)

[0149] In CE and DW, some partial differential forms used are as follows:

[0150] (16)

[0151] (17)

[0152] (18)

[0153] (19)

[0154] When applying the above formula to solve a single pipe, the obtained operating flow rate is divided by the cross-sectional area to obtain the flow rate of each node or sub-node. Combined with the density formula (15), the mass density can be solved. Apply the single-pipe pre-solved matrix to obtain the solution of the variables of all spatial step nodes on each pipe. Since the number of rows of the A matrix is ​​less than the number of columns, the solution result is a general solution, that is, only the linear relationship on the sub-node solution variables on the single pipe can be obtained.

[0155] Figure 3 The figure shows a specific implementation process of the calculation reliability optimization method under the condition of gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application. Figure 3 As shown, in this embodiment, in the single-pipe pre-solution, for each pipe in the pipe network, based on the CE / DW / H block matrix derived from the first-order time difference and the central convection term difference, the sub-nodes in the single pipe are solved, and the solution variables are the mass density and working flow rate of each sub-node; the pipe network is combined based on the intersection relationship of each sub-node in the single pipe obtained by the single-pipe pre-solution, the pressure and mass flow rate of the starting point and the end point are linked, and then based on the current moment boundary point acquisition value and the pressure and flow rate of the internal nodes in the pipe network, the pipe network is combined to find the pressure of each pipe at the end point; the internal solution of the single pipe: based on the results of the pipe network combination and the results of the single-pipe pre-solution, the mass density and working flow rate of each internal sub-node of the pipe at time t+1 are updated and solved. The gas state equation is used to complete the update of the pressure, mass flow rate, and standard volume flow rate of the sub-node, and the sub-node here also includes the end point of each pipe.

[0156] Then compare the pipe endpoint results (pressure, mass flow) solved inside the single pipe with the solution results of the pipe network to check the relative errors of the pressure / mass flow, for example, whether they are both within 0.5%. If not, directly use the mass flow rate obtained by the pipe network joint result, and obtain the density and flow rate of the intermediate sub-node by linearly interpolating the density and flow rate at the two ends of each pipe. Then, combine the gas state equation to obtain the pressure of each sub-node, and then multiply the density by the cross-sectional area and flow rate to obtain the mass flow rate of each sub-node. If so, still use the process of solving inside the single pipe, and use the variables solved inside the single pipe as the final result of the transient simulation update at the current moment.

[0157] This embodiment obtains the tolerance between the first data of each pipeline endpoint and the data of the sub-nodes on each spatial step inside each pipeline by obtaining the simultaneous solution matrix of the pipeline network endpoints. By using the tolerance comparison method, the validity of the solution inside the single pipe is recognized within the tolerance. Outside the tolerance, the simultaneous pipeline endpoint results are used for linear interpolation to complete the variable update of the sub-nodes inside the pipeline, which effectively solves this contradiction and can ensure the stable and accurate operation of subsequent simulations.

[0158] Transient simulation calculation is a continuous process. In this process, the collected data available at each boundary point can only be selected between pressure and flow. If all of them are substituted into the equation, the system of equations will become an overdetermined matrix, that is, the number of equations is greater than the data of the variables to be solved, resulting in a decrease in solution speed and unstable solution accuracy. However, if only one assignment is used, the transient accuracy may become worse and worse over time and cannot be corrected, eventually leading to a significant decrease in accuracy at subsequent moments or even calculation collapse. This situation is easy to occur in a pipe network with unbalanced inlet / outlet.

[0159] There are currently two main approaches to solving this problem: a. If the value assigned to a boundary point is flow, the calculated value (pressure) and the collected value of the node at each moment are verified. If the difference between the calculated value and the collected value exceeds the tolerance, the assignment type of the node at that moment is switched from the assigned flow to the assigned pressure to ensure that the pressure at that moment is more reasonable; b. If the assignment exchange generates new calculation problems, the steady-state calculation is used instead at the current moment to avoid the collapse of transient calculations at subsequent moments.

[0160] The combination of these two solutions can indeed solve the problem of transient calculation error accumulation under most operating conditions. However, for enterprises that frequently perform fast transient conditions and rely on pipeline gas supply all year round, these two solutions are not enough to ensure that online simulation can continue to run with high precision. There are two main reasons: a. Under this condition, the steady-state simulation has good convergence only at certain moments (such as in the early morning). At other times, if the transient state switches to the steady state, the calculated accuracy will be worse, and it will still cause the transient calculation to crash at subsequent moments. As a result, the steady state is always called at subsequent moments, and the accuracy is always poor; b. The problem with the assignment exchange is that at the moment when the tolerance is exceeded, after the assignment exchange, the pressure difference between the previous and next moments may be relatively large, and an instantaneous flow peak will be calculated. For example, at t0 and before, a gas source has been assigning flow, and the calculated pressure has been smaller than the collected pressure, but the difference does not exceed the tolerance (for example, 1% as the tolerance). At t1, the difference between the calculated pressure and the collected value exceeds the tolerance. At this time, if the assignment exchange is triggered, the solver will combine the calculation result of the previous moment and the assignment information of the current moment to recalculate. Since the pressure of the previous moment is relatively small and the pressure of the current moment is large, the equation group solves the flow of the node at the current moment, which is likely to be a larger value. If the tolerance of the assignment exchange is reduced, the transient solver is likely to perform assignment exchange at every moment, and frequent assignment exchange will lose the accuracy of flow calculation while ensuring the accuracy of pressure. Therefore, even if the assignment exchange logic is used, this should limit its tolerance size to avoid frequent triggering of assignment exchange, but it returns to the problem mentioned above, that is, the peak value of the flow will be calculated instantly.

[0161] This embodiment improves the conventional assignment exchange logic. Instead of simply assigning and exchanging the collected data, it strives to perform refined processing while ensuring that the pressure and flow calculation accuracy are up to standard, so that the simulation will not produce a large jump in accuracy. First of all, it should be noted that the assignment exchange should not be used frequently, because if the original assigned flow of a node causes the pressure calculation to be inaccurate and the pressure assignment is switched, then the flow at that moment may be calculated inaccurately; conversely, if the original assigned pressure causes the flow calculation to be inaccurate and the flow assignment is switched, then the pressure at that moment may be calculated inaccurately. The core practical reasons for this problem may be: a. The data collected at the boundary points is inaccurate; b. The time interval for collecting data at the boundary points is long; c. Some attributes of the pipeline network data are inaccurate, such as pipe diameter, pipe material, etc.; d. The discrete format of the first-order time difference is not accurate enough when facing serious imbalance in the inlet / outlet gas of the pipeline network. Of course, these are issues related to data collection, data management and simulation theory, but they are often difficult to avoid when implementing pipeline simulation projects in reality. This embodiment strives to optimize the process of value exchange and steady-state calling on the basis of acknowledging these problems, so as to further maintain the accuracy and stability of transient calculations.

[0162] Figure 4 The flowchart of the exchange of boundary node assignments in the calculation reliability optimization method under the condition of gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application is shown. Figure 4 As shown, in one implementation of this embodiment, the calculation reliability optimization method under the gas network inlet and outlet imbalance and fast transient conditions also includes the following steps S161 to S165.

[0163] Step S161, configuring the initial value type of each boundary node to be flow data;

[0164] Step S162, obtaining calculated pressure data through the flow data of each boundary node, and obtaining the pressure difference between the calculated pressure data and the collected pressure data of each boundary node;

[0165] Step S163, detecting whether the pressure difference is less than a pressure difference threshold value: if so, proceeding to step S164, if not, proceeding to step S165;

[0166] Step S164, maintaining the initial value type of the boundary node as flow data;

[0167] Step S165, obtaining the pressure average value data of the calculated pressure data at the previous moment and the collected pressure data at the current moment, and assigning the pressure average value data to the boundary node.

[0168] In an implementation of this embodiment, each boundary node is a boundary node in the gas supply node.

[0169] Figure 5 The flowchart of the value exchange and simulation in the calculation reliability optimization method under the condition of gas pipeline inlet and outlet imbalance and fast transient condition in one embodiment of the present application is shown. Figure 5 As shown, in one implementation of this embodiment, after the pressure average value data is assigned to the boundary node, the calculation reliability optimization method under the gas network inlet and outlet imbalance and fast transient conditions also includes the following steps S166 to S1611.

[0170] Step S166, detecting whether the number of transient simulation calculations at the current moment is less than or equal to a preset number threshold;

[0171] Step S167, in response to detecting that the number of transient simulation calculations at the current moment is greater than the preset number threshold, a steady-state simulation calculation is performed based on the traffic data of the boundary node, and the simulation result obtained by the transient simulation calculation is replaced by the simulation result obtained by the steady-state simulation calculation.

[0172] Step S168, in response to detecting that the number of transient simulation calculations at the current moment is less than or equal to the preset number threshold, performing transient simulation calculations based on the current value assignment data of the boundary node, and obtaining the flow calculation error of the boundary node;

[0173] Step S169, detecting whether the flow calculation error is greater than the flow error threshold: if not, proceeding to step S1610; if yes, proceeding to step S1611;

[0174] Step S1610, ending the transient simulation calculation at the current moment;

[0175] Step S1611, obtaining the pressure average value data of the calculated pressure data at the previous moment and the collected pressure data at the current moment, assigning the currently obtained pressure average value data to the boundary node, and adding 1 to the number of transient simulation calculations at the current moment.

[0176] Figure 6 The diagram shows the overall implementation process of the value exchange and simulation in the calculation reliability optimization method under the condition of gas network inlet and outlet imbalance and fast transient conditions in one embodiment of the present application. Figure 6 As shown, this embodiment is described by taking the preset number threshold as 3, that is, calculating the pressure average value data three times, and the flow error threshold as 5%.

[0177] First, the initial assignment type of the boundary node is flow as much as possible; when the pressure error calculated by the flow at individual nodes is large, the assignment of these nodes is not directly switched to the pressure collection value, but the calculated pressure at the previous moment and the collected pressure at the current moment are averaged, and the new pressure value after the average is virtualized as the pressure collection value at the current moment, and then assigned to the gas supply node with large flow calculation error. It should be noted that this assignment exchange operation is limited to the gas supply node, and is not performed on the gas consumption node.

[0178] This embodiment uses time to exchange space. Even if the assignment exchange is to be performed, the collected pressure is not directly used because it must be greatly different from the pressure at the previous moment. When the transient partial differential equation is solved, the excessive pressure difference will inevitably lead to a larger flow value calculation at the current moment, resulting in a transient flow mutation. Therefore, under the premise of following this idea, this embodiment uses multiple pressure averaging operations to make the calculated flow as consistent as possible with the true value. However, at a specific moment, three pressure averaging operations can be allowed. On the one hand, this is to save calculation overhead. On the other hand, if there are too many pressure averaging operations at a certain moment, the final assignment pressure will be infinitely close to the pressure at the previous moment, and the meaning of the assignment exchange will be lost. If the flow calculation accuracy is still more than 5% after the assignment exchange at a certain moment and after three pressure averaging operations, it is considered that the transient calculation accuracy at the current moment cannot finally meet the standard. In order to avoid the transient accuracy being too low and affecting the subsequent calculation accuracy, the simulation calculation at the current moment is completed by calling the steady-state calculation. On the contrary, if the flow calculation accuracy of the gas supply node reaches the standard within the assignment exchange and three pressure averaging operations, it is considered that the simulation calculation effect at the current moment is good, and the simulation calculation at the current moment can be terminated, and the simulation calculation at the next moment is initiated.

[0179] Specifically, in this embodiment, flow rates are assigned to all nodes at any time, because accurate flow rate calculation is more difficult than accurate pressure calculation. When the pressure calculation of a gas source node at a certain moment exceeds the tolerance, the pressure acquisition value of the gas supply node at the current moment and the pressure calculation value of the node at the previous moment are averaged, and the value assigned to the gas supply node at the current moment is calculated using this average value. If the flow calculation of the gas supply node exceeds the tolerance, the above pressure averaging operation is repeated, and the number of operations does not exceed 3 times to ensure that the pressure change before and after is smaller, so that the flow of the gas supply node will not mutate. Because in a high-pressure environment, a 1-2% pressure change before and after corresponds to about 0.3-0.4 times the atmospheric pressure, it is very easy to calculate the flow mutation under the theoretical framework of implicit finite differences.

[0180] In addition, when the gas source in the pipeline network is suddenly started (or when a large user suddenly uses gas), the instantaneous flow rate will instantly increase from 0 to a larger value, and the Reynolds number will also increase significantly. The resistance coefficient calculated using the Reynolds number will drop significantly. Taking implicit finite differences as an example, the time item is a first-order difference, so the variables of the previous moment, such as flow rate, mass density, resistance coefficient, etc., will be used, combined with the general solution relationship obtained by single-pipe pre-solution at the current moment, to calculate the variable value at the current moment. However, due to the existence of this sudden increase in flow from 0, the calculation results at the current moment cannot keep up with the actual flow changes. The main impact of this problem is that the flow curve calculated by simulation has a lag relative to the actual flow, and sometimes the overall pipeline network accuracy will drop significantly due to insufficient accuracy at the previous moment.

[0181] Regardless of whether the discrete theory used is first-order time difference or multi-order time difference, the parameters of the previous time are required. In addition to the variables to be solved, such as pressure, flow, density, flow velocity, etc., these parameters also include some non-solved variables, such as Reynolds number and resistance coefficient.

[0182]

[0183]

[0184] in, is the Reynolds number, Q is the standard volume flow rate, d is the inner diameter of the pipe, ν is the operating viscosity, and λ is the resistance coefficient.

[0185] In addition, the formula of Reynolds number can also be directly expressed as a formula related to flow rate, but the results are consistent. For example, if the flow rate at the previous moment t0 is 0, then the flow rate is also 0. According to the above formula, the Reynolds number Re is 0, and the Klebrock formula for calculating the resistance coefficient is generally applicable to the case where Re is greater than 3000 or 4000. When Re is 0, it can be considered that λ is approximately equal to a larger number (100000). At t1, the gas source opens the valve to release gas instantly, or a large user suddenly uses gas, the flow rate will change dramatically. For example, Q is directly pulled up to 100,000 cubic meters / hour, then the corresponding Re will instantly increase at t1, and the resistance coefficient λ will instantly decrease. Since the transient calculation requires the parameters of the previous moment, that is, Re=0, λ=100000, under such conditions where the flow rate suddenly increases and the increase is extremely large, the discrete theory corresponding to the partial differential equation to be solved will be distorted to a certain extent.

[0186] In order to solve the working condition of sudden start-up with large flow, the present embodiment adjusts the Reynolds number and the resistance coefficient at the previous moment t0 to correspond to a calculated value of a non-zero flow, so as to alleviate the discrete distortion.

[0187] Figure 7 The flowchart of parameter correction during high flow startup in the calculation reliability optimization method under the condition of gas network inlet and outlet imbalance and fast transient working conditions in one embodiment of the present application is shown. Figure 7 As shown, in one implementation of this embodiment, the calculation reliability optimization method under the gas network inlet and outlet imbalance and fast transient conditions also includes the following steps S171 to S173.

[0188] Step S171, based on the value assignment data of the boundary node at the previous moment and the value assignment data of the boundary node at the current moment, obtaining the boundary node with sudden traffic change;

[0189] Step S172, obtaining the Reynolds number and resistance coefficient of each pipeline at the current moment based on the simulation calculation at the current moment;

[0190] Step S173, replacing the Reynolds number and resistance coefficient of each pipeline obtained at the previous moment with the Reynolds number and resistance coefficient of each pipeline at the current moment.

[0191] In one implementation of this embodiment, based on the assignment data of the boundary node at the previous moment and the assignment data of the boundary node at the current moment, the boundary node with a sudden change in traffic is obtained: when the assignment data of the boundary node at the previous moment is 0 traffic data, and the assignment data of the boundary node at the current moment is greater than the preset traffic value, the boundary node at the current moment is determined to be a boundary node with a sudden change in traffic.

[0192] This embodiment uses the boundary point assignments of no flow at the previous moment and the boundary point assignments of large flow at the current moment to calculate the Reynolds number and resistance coefficient of each pipeline at the current moment, and replaces the Reynolds number and resistance coefficient of the previous moment with this batch of calculated values, and then initiates a simulation calculation to alleviate this discrete distortion.

[0193] Figure 8 The figure shows a specific implementation process of parameter correction during high flow startup in the calculation reliability optimization method under the conditions of gas network inlet and outlet imbalance and fast transient working conditions in one embodiment of the present application. Figure 8 As shown, taking the adjustment of the resistance coefficient as an example, all boundary nodes are traversed at a certain moment to obtain the flow values ​​of these nodes at the previous moment and the current moment. For example, whether the flow values ​​of a node before and after the moment are respectively: less than 1*e-3m 3 / s, greater than 1*e-3m 3 / s, if not, all boundary points are tongue traversed after completion, indicating that there is no node with sudden flow rate change at the current moment, and no resistance coefficient adjustment is required; if yes, it means that there is a node with sudden flow rate change at the previous and next moments, and resistance coefficient adjustment is required, as follows: complete the simulation calculation at the current moment, calculate the resistance coefficient of each pipeline at the current moment, replace the resistance coefficient of each pipeline at the previous moment with the calculated resistance coefficient of each pipeline at the current moment, and initiate the simulation calculation again. At this time, the Reynolds number of the node with a flow rate of 0 at the previous moment is no longer 0, and the resistance coefficient is no longer 100,000, but has been adjusted to a Reynolds number and resistance coefficient corresponding to the flow rate, and the simulation calculation at the current moment is completed.

[0194] This embodiment proposes a two-step operation process to compensate for the limitations of implicit finite differences when the flow rate is 0 at the previous moment and increases dramatically at the subsequent moment. That is, after identifying this working condition, the Reynolds number and resistance coefficient of each pipeline at the current moment are completed through the first simulation, and the Reynolds number and resistance coefficient of each pipeline at the previous moment are replaced with the Reynolds number and resistance coefficient calculated for the first time, and then the calculation is completed through the second simulation. In this way, the difference between the resistance coefficient at the previous moment and the current moment will become smaller, thereby ensuring the accuracy of the simulation calculation.

[0195] Therefore, the method of this embodiment, when dealing with a large-scale sudden change in flow rate in the pipeline network, replaces the Reynolds number and resistance coefficient of each pipeline at the current moment with the Reynolds number and resistance coefficient of the previous moment, which can effectively alleviate the calculation error caused by the sudden increase in flow rate from 0, solve the problem of reduced simulation accuracy and lag of simulation results relative to real results caused by the failure of the first-order time difference of the resistance coefficient, and further improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network.

[0196] The protection scope of the calculation reliability optimization method under the imbalance of gas pipeline inlet and outlet and fast transient conditions described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.

[0197] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the calculation reliability optimization method under the imbalance of gas pipeline inlet and outlet and fast transient conditions provided in any embodiment of the present application is implemented.

[0198] In the embodiment of the present application, any combination of one or more storage media may be used. The storage medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.

[0199] An embodiment of the present application also provides an electronic device. Fig. 9 Shown is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. In some embodiments, the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) and other terminal devices. In addition, the calculation reliability optimization method under the imbalance of gas pipeline inlet and outlet and fast transient conditions provided in the present application can also be applied to databases, servers and terminal artificial intelligence-based service response systems. The embodiment of the present application does not impose any restrictions on the specific application scenarios of the calculation reliability optimization method under the imbalance of gas pipeline inlet and outlet and fast transient conditions.

[0200] like Fig. 9 As shown, the electronic device 100 provided in the embodiment of the present application includes a memory 101 and a processor 102 .

[0201] The memory 101 is used to store computer programs; preferably, the memory 101 includes: ROM, RAM, disk, USB flash drive, memory card or CD-ROM and other media that can store program codes.

[0202] Specifically, the memory 101 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 101 may include at least one program product, which has a set (e.g., at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.

[0203] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the calculation reliability optimization method under the imbalance of gas pipeline inlet and outlet and fast transient conditions provided in any embodiment of the present application.

[0204] Optionally, the processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0205] Optionally, the electronic device 100 in this embodiment may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is used to display a GUI interaction interface related to the calculation reliability optimization method under the gas network inlet and outlet imbalance and fast transient conditions.

[0206] In summary, the present application judges and processes the internal solution results of a single pipe by means of tolerance comparison, which can effectively solve the problem of the contradiction between the internal variable update solution of a single pipe and the joint solution results of the pipeline endpoints in the pipeline network, and effectively improve the accuracy, consistency, stability and reliability of the transient simulation calculation results of the natural gas pipeline network; the present application improves the design of the assignment exchange logic of the boundary nodes, and no longer simply assigns and exchanges the collected data, but strives to perform refined processing while ensuring that the pressure and flow calculation accuracies are up to standard, so that the simulation will not produce a large jump in accuracy, and effectively solves the assignment exchange and The problem of simulation result fluctuation caused by transient simulation calling steady-state simulation is solved, and the accuracy, consistency, stability and reliability of the calculation results of transient simulation of natural gas pipeline network are further improved; when dealing with large-scale flow mutation in the pipeline network, the Reynolds number and resistance coefficient of each pipeline at the current moment are replaced by the Reynolds number and resistance coefficient of the previous moment, which can effectively alleviate the calculation error caused by the sudden increase of flow from 0, solve the problem of simulation accuracy reduction caused by the failure of the first-order time difference of the resistance coefficient and the lag of simulation results relative to the real results, and further improve the accuracy, consistency, stability and reliability of the calculation results of transient simulation of natural gas pipeline network. Therefore, the present application effectively overcomes various shortcomings in the prior art and has high industrial utilization value.

[0207] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A calculation reliability optimization method under the condition of imbalance in inflow and outflow of gas pipeline network and fast transient conditions, characterized in that: include: Based on the pipeline network endpoint simultaneous solution matrix, the first data of each pipeline endpoint is obtained, and the data of the sub-nodes on each spatial step inside each pipeline are obtained, wherein the data of the sub-nodes include the second data of each pipeline endpoint; the first data of the pipeline endpoint includes the pressure data and mass flow data of the pipeline endpoint; the method of obtaining the first data of each pipeline endpoint based on the pipeline network endpoint simultaneous solution matrix includes: based on the spatial step of the pipeline, the collected data of the boundary node, the simulation result data and the single pipeline pre-solution matrix, obtaining the general solution of the pipeline sub-nodes of all spatial steps on each pipeline; substituting the general solution of the pipeline sub-nodes of all spatial steps on each pipeline into the pipeline network endpoint simultaneous solution matrix; Solve the matrix to obtain the pressure data and mass flow data of each pipeline endpoint; the data of the sub-nodes on the spatial step include mass density and operating flow rate; the data of the sub-nodes on each spatial step inside each pipeline includes: based on the pressure data and mass flow data of each pipeline endpoint and the general solution of the pipeline sub-nodes of all spatial steps on each pipeline, obtain the mass density and operating flow rate of each sub-node on the spatial step inside each pipeline; based on the mass density and operating flow rate of the sub-nodes on each spatial step and the sub-node pressure calculation formula and the sub-node mass flow calculation formula, calculate and obtain the pressure data and mass flow data of the sub-nodes on each spatial step; Obtaining a difference between the first data of the pipeline endpoint and the second data of the pipeline endpoint, and determining whether the difference is within a preset error threshold range: If yes, then update the parameters of the pipeline node of the transient simulation at the current moment according to the data of the sub-nodes on each spatial step inside the pipeline; If not, a linear interpolation operation is performed on the sub-nodes on each spatial step inside the pipeline according to the first data of the pipeline endpoint, updated data of the sub-nodes on each spatial step inside the pipeline are obtained, and the parameters of the pipeline nodes of the transient simulation at the current moment are updated based on the updated data.

2. The calculation reliability optimization method under the condition of imbalance in inflow and outflow of gas pipeline network and fast transient condition according to claim 1 is characterized in that: Also includes: Configure the initial value type of each boundary node to be flow data; Obtaining calculated pressure data through flow data of each boundary node, and obtaining a pressure difference between the calculated pressure data and the collected pressure data of each boundary node; Detect whether the pressure difference is less than a pressure difference threshold: If yes, then keep the initial value type of the boundary node as flow data; If not, then obtain the pressure average value data of the calculated pressure data at the previous moment and the collected pressure data at the current moment, and assign the pressure average value data to the boundary node.

3. The calculation reliability optimization method under the condition of gas pipeline network inlet and outlet imbalance and fast transient condition according to claim 2 is characterized in that: Each boundary node is a boundary node in the gas supply node.

4. The calculation reliability optimization method under the condition of imbalance in inflow and outflow of gas pipeline network and fast transient condition according to claim 2 is characterized in that: After assigning the pressure average value data to the boundary node, the method further includes: Detect whether the current transient simulation calculation times are less than or equal to a preset times threshold; In response to detecting that the number of transient simulation calculations at the current moment is less than or equal to the preset number threshold, performing transient simulation calculations based on the current value assignment data of the boundary node, and obtaining the flow calculation error of the boundary node; Detect whether the flow calculation error is greater than the flow error threshold: If yes, then average the calculated pressure data at the previous moment and the current pressure average data to obtain the currently acquired pressure average data, assign the currently acquired pressure average data to the boundary node, and increase the number of transient simulation calculations at the current moment by 1; If not, then end the transient simulation calculation at the current moment; In response to detecting that the number of transient simulation calculations at the current moment is greater than the preset number threshold, a steady-state simulation calculation is performed based on the traffic data of the boundary node, and the simulation result obtained by the transient simulation calculation is replaced by the simulation result obtained by the steady-state simulation calculation.

5. The calculation reliability optimization method under the condition of imbalance in inflow and outflow of gas pipeline network and fast transient condition according to claim 1 is characterized in that: Also includes: Based on the value assignment data of the boundary node at the previous moment and the value assignment data of the boundary node at the current moment, the boundary node with the sudden change in traffic is obtained; Based on the simulation calculation at the current moment, the Reynolds number and resistance coefficient of each pipeline at the current moment are obtained; The Reynolds number and resistance coefficient of each pipeline obtained at the previous moment are replaced by the Reynolds number and resistance coefficient of each pipeline at the current moment.

6. The calculation reliability optimization method under the condition of imbalance in inflow and outflow of gas pipeline network and fast transient condition according to claim 5 is characterized in that: Based on the value assignment data of the boundary node at the previous moment and the value assignment data of the boundary node at the current moment, obtain the boundary node with sudden traffic changes: When the value assigned to the boundary node at the previous moment is 0 flow data and the value assigned to the boundary node at the current moment is greater than the preset flow value, the boundary node at the current moment is determined to be a boundary node with a sudden flow change.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the calculation reliability optimization method under the gas pipeline network inlet and outlet imbalance and fast transient conditions described in any one of claims 1 to 6 is implemented.

8. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and executes the calculation reliability optimization method under the gas pipeline network inlet and outlet imbalance and fast transient conditions as described in any one of claims 1 to 6 when calling the computer program.

Citation Information

Patent Citations

  • Natural gas pipeline network simulation method and device

    CN104731761A

  • Natural gas pipeline network transient simulation numerical calculation method, storage medium and electronic equipment

    CN118211434A