Method, storage medium and device for adaptively repairing unreasonable working conditions of steady-state pipe network simulation
By adaptively adjusting the boundary conditions and node assignment data, the simulation calculation problems caused by unreasonable boundary conditions of multiple gas sources in the simulation simulation of natural gas pipeline network are solved, and the stable output of simulation results is achieved, which improves the simulation results. Accuracy and user experience.
Patent Information
- Application Number
- CN202411506371.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-28
AI Technical Summary
In the simulation of natural gas pipeline network, due to the unreasonable boundary conditions of multiple gas sources, the simulation calculation does not converge or returns incorrect results. Especially in the multi-gas source pipeline network, the flow calculation caused by the all-gas source assignment pressure is inaccurate, which may be a possible Negative traffic situation occurs, which is seriously diverging from the real situation.
Provide an adaptive method to repair the underreasonable working conditions of steady-state pipeline simulation. By obtaining the boundary conditions and constraint conditions of the boundary node, check whether the simulation results meet the constraint conditions. If they do not meet, they will be judged as abnormal working conditions and perform self-direction. Adaptation adjustments include changing the type and value of the node assignment data, and re-simulation until the constraints are met to obtain reasonable simulation results.
The steady-state solver of the pipeline network simulation is effectively optimized, avoiding the gas source reverse supply situation, ensuring the rationality and accuracy of the simulation results, and improving the reliability and user experience of the simulation results.
Smart Images

Figure CN119026293B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of integrated energy management information technology, and in particular to the field of Internet, cloud computing, and big data service technology. Background Art
[0002] In recent years, as the proportion of natural gas in my country's energy structure has increased, the construction of natural gas pipelines has been in full swing. At the same time, the trend of parallel natural gas pipeline networks in various regions has become increasingly obvious. It can be predicted that the scale of my country's independent natural gas pipeline network will increase significantly in the next few years. Therefore, as an important means of pipeline network process design and operation analysis, natural gas pipeline network simulation technology will play a more important role in the future pipeline network construction and operation.
[0003] Among them, simulation is most widely used in the scenario of pipeline network planning, design and evaluation. That is, after the pipeline network is modified, a steady-state simulation is initiated based on non-real virtual boundary conditions to verify whether the pressure of the end user can meet the supply guarantee needs under the gas source output pressure / flow conditions approved by the business. However, since the boundary conditions are fictitious, especially in a pipeline network with multiple gas sources, these set gas source boundary conditions may be unreasonable or even contradictory. This will cause the simulation calculation to either fail to converge and fall into a calculation crash, or return an incorrect result.
[0004] At present, in the simulation of natural gas pipeline networks, gas companies often assign pressures to different gas sources in pipeline networks involving multiple gas sources in order to control the pressure of gas sources, because the station can generally ensure stable pressure control, but it is difficult to achieve stable flow control. This is a reasonable demand in itself, but it will encounter problems in the simulation of pipeline networks, because the equal assignment of pressures to multiple gas sources is equivalent to the default pressure balance point of multiple gas sources, and in fluid theory, the pressure change is related to the flow and impedance (a concept composed of several physical coefficients, involving pipe diameter, roughness, Reynolds number, etc.). If the gas sources are assigned pressures, the flow value calculated due to the pressure difference between them is likely to not correspond to the flow assigned by the user end, which will cause the simultaneous solution of the equations for the entire pipeline network to not converge, or worse, it may cause the gas source to calculate a negative flow, which will seriously deviate from the actual situation. Summary of the invention
[0005] The present application provides a method, storage medium and device for adaptively repairing unreasonable working conditions of steady-state pipeline network simulation, which are used to adaptively adjust the gas source reverse supply situation in natural gas pipeline network simulation.
[0006] In the first aspect, an embodiment of the present application provides a method for adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation, comprising: obtaining boundary conditions and constraints of boundary nodes, and obtaining node assignment data that meets the constraints based on the boundary conditions and the constraints; obtaining simulation results of a steady-state solver based on the node assignment data; detecting whether the simulation results meet the constraints: if so, outputting the simulation results; if not, determining in turn whether the simulation results belong to a preset first abnormal working condition, a second abnormal working condition, and a third abnormal working condition, adaptively adjusting the boundary conditions under the corresponding abnormal working conditions, and obtaining the simulation results after the adaptive adjustment; wherein: if the node assignment data of each gas source in the area are all assigned pressure, and at least one of the gas sources in the simulation result has a negative flow, then it is determined that the simulation result belongs to the preset first abnormal working condition; under the first abnormal working condition, the boundary conditions are adjusted by changing the assignment type of the node assignment data and adjusting the value of the node assignment data. Adaptive adjustment is performed; if the node assignment data of all the gas sources in the area are assigned as flow and the sum of the gas source flow is not equal to the sum of the user flow within the tolerance range, or the node assignment data of some of the gas sources in the area are assigned as flow, and the sum of the flow of the node assignment data is less than the sum of the user flow in the area, then it is judged that the simulation result belongs to the preset second abnormal condition; under the second abnormal condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data; if the node assignment data of some of the gas sources in the area are assigned as flow, and the sum of the flow of the node assignment data is greater than the sum of the user flow in the area, then it is judged that the simulation result belongs to the preset third abnormal condition; under the third abnormal condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data.
[0007] In an implementation method of the first aspect, the adaptive adjustment of the boundary condition by changing the assignment type of the node assignment data and adjusting the value of the node assignment data under the first abnormal operating condition includes: changing the assignment type of the node assignment data to flow, and updating the index relationship between the verification equation in the steady-state solver and the variables in the variable pool and the value of the column matrix formed by the derivative of the variables of the verification equation in the Jacobian sparse matrix according to the changed node assignment data; updating the pressure variable and flow variable of the gas source whose assignment type of the node assignment data is changed in the initial value matrix of the steady-state solver; wherein the pressure variable is updated to the initial pressure value, and the flow variable is updated to 0.
[0008] In an implementation of the first aspect, under the first abnormal operating condition, after the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the value of the node assignment data, it also includes: re-simulating the steady-state solver and obtaining new simulation results; detecting whether the new simulation results meet the constraints: if so, outputting the simulation results; if not, adjusting the pressure value of the node assignment data up and down within a preset adjustment number and adjustment range; and returning the simulation results based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0009] In an implementation method of the first aspect, under the second abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data, including: when the node assignment data of all gas sources are assigned flow, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user; when the node assignment data of some gas sources are assigned flow, the sum of the flow of the node assignment data is less than the sum of the flow of users in the area and no negative flow occurs in the simulation result of the gas source, the pressure value of the node assignment data is adjusted up and down within a preset adjustment number and adjustment range; and the simulation result is returned based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0010] In an implementation method of the first aspect, when the node assignment data of some gas sources are assigned flow, and the sum of the flow of the node assignment data is not less than the sum of the user flow in the area, the process of adaptively adjusting the boundary conditions under the third abnormal operating condition is entered; when negative flow occurs in the gas source in the simulation result, the process of adaptively adjusting the boundary conditions under the first abnormal operating condition is entered.
[0011] In an implementation method of the first aspect, under the third abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data, including: when the sum of the flow rates of the node assignment data is greater than the sum of the flow rates of users in the area, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user; when there is no negative flow of the gas source in the simulation result, the pressure value of the node assignment data is adjusted up and down within a preset adjustment number and adjustment range; and the simulation result is returned based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0012] In an implementation method of the first aspect, in the adaptive adjustment of the boundary condition by alerting the gas source that needs to adjust the boundary condition and returning the alert to the gas source user, the gas source user is prompted to adjust the flow rate assigned by the node assignment data of the gas source so that the total inflow is equal to the total outflow within a preset tolerance range.
[0013] In an implementation method of the first aspect, returning the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data includes: if the gas source converges after adjusting the pressure value of the node assignment data, returning the converged simulation result; if the gas source does not converge after adjusting the pressure value of the node assignment data, obtaining the simulation result with the best convergence, and returning the simulation result with the best convergence.
[0014] 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 adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation as described in any one of the first aspects of the present application.
[0015] 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 method for adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation as described in any one of the first aspect of the present application when the computer program is called.
[0016] The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation provided by the embodiment of the present application has the following beneficial effects:
[0017] This application adaptively adjusts all abnormal operating conditions that may occur due to unreasonable boundary condition assignments when using a steady-state pipe network simulation solver for simulation, so that the output simulation results will not have gas source backsupply, effectively optimizing the pipe network simulation steady-state solver. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a principle flow chart of a method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation according to an embodiment of the present application.
[0019] Figure 2 Shown is a flow chart of a method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation according to an embodiment of the present application.
[0020] Figure 3 Shown is a flow chart of adaptively adjusting under a first abnormal condition in a method for adaptively repairing an unreasonable condition of a steady-state pipe network simulation according to an embodiment of the present application.
[0021] Figure 4Shown is a flow chart of a method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation in one embodiment of the present application, after adaptive adjustment and re-simulation under a first abnormal working condition.
[0022] Figure 5 Shown is an overall flow chart of the specific implementation process of performing adaptive adjustments under a first abnormal condition in a method for adaptively repairing an unreasonable condition of a steady-state pipeline network simulation according to an embodiment of the present application.
[0023] Figure 6 Shown is a flow chart of adaptively adjusting under a second abnormal condition in a method for adaptively repairing an unreasonable condition of a steady-state pipe network simulation according to an embodiment of the present application.
[0024] Figure 7 Shown is an overall flow chart of the specific implementation process of performing adaptive adjustments under a second abnormal condition in a method for adaptively repairing an unreasonable condition of a steady-state pipeline network simulation according to an embodiment of the present application.
[0025] Figure 8 Shown is a flow chart of adaptive adjustment under a third abnormal condition in a method for adaptively repairing an unreasonable condition of a steady-state pipe network simulation according to an embodiment of the present application.
[0026] Fig. 9 Shown is an overall flow chart of the specific implementation process of adaptive adjustment under the third abnormal condition in the method for adaptively repairing the unreasonable working condition of the steady-state pipeline network simulation according to one embodiment of the present application.
[0027] Fig.10 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0028] 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.
[0029] At present, gas companies use pipeline simulation software to plan pipeline networks. For example, when adding new gas sources, adding new large users, or simulating and measuring different levels of pressure control on existing gas sources, multiple gas sources often assign pressures and reverse supply occurs. The so-called reverse supply means that a certain gas source point is not supplying gas to the pipeline network, but is using gas like a user-type node. In the simulation results, this corresponds to the calculation of negative flow at certain gas source points. It is normal for negative flow to occur in pipelines, because each pipeline has a starting point number and an end point number in the GIS system, and the starting point and end point numbers of a large number of pipelines in the pipeline network do not represent the flow direction of the gas. It can be called the preset flow direction of the pipeline. Through pipeline network simulation, if some pipelines calculate negative flow, it means that the actual flow direction is opposite to the preset flow direction. This is very common in pipeline networks, but it is unreasonable to have negative flow in three situations, namely:
[0030] 1. There is only one pipeline directly connected to the gas source (or called the gas source outlet pipeline). Its preset flow direction must be from the gas source node as the starting point and the other end as the end point. The flow rate in the simulation result of this pipeline must be positive, indicating that the actual flow direction is consistent with the preset flow direction, that is, from the gas source to the pipeline network;
[0031] 2. For the pipeline directly connected to the user (or called the user's home pipeline), the preset flow direction must be the user node as the end point and the other end as the starting point. The flow in the simulation result of this kind of pipeline must also be positive, indicating that the actual flow direction is consistent with the preset flow direction, that is, it flows from the pipeline network to the user;
[0032] 3. There are two pipes directly connected to the pressure regulating equipment, one in and one out. The preset flow direction must be the real high-in and low-out flow direction, and the flow rate in the simulation result must also be positive, indicating that the actual flow direction is consistent with the preset flow direction, entering from the relatively high-pressure pipe network side and flowing out from the relatively low-pressure pipe network.
[0033] For example, gas source A wants to control the pressure at 1000kPa, and gas source B wants to control the pressure at 800kPa, and the user's flow rate m is given at the same time. If gas sources A and B are close to each other, the pressure difference of 200kPa between the two is calculated to correspond to the flow rate n. If it is greater than m, then gas source B is likely to calculate a negative flow rate, resulting in reverse supply. The solution to this problem is generally to adjust it through manual experience, such as lowering the pressure of gas source A to 900kPa. While keeping other boundary conditions unchanged, it is possible to calculate a normal situation. But this requires a lot of attempts.
[0034] It should be pointed out that in the simulation of pipeline network planning, steady-state solvers are generally used for calculation. The reason why transient solvers are not used is mainly because transient solvers require multiple sets of time boundary conditions to form a time series simulation chain. Therefore, transient simulations are more used for future scheduling plans, and future boundary condition predictions are generated by time series prediction algorithms based on LSTM and Transformer. The main significance of pipeline network planning is to transform existing gas sources (such as gas outages) or add new gas sources and users in pipeline network recommendations. It is to explore whether the gas supply capacity of the gas source can meet the usage needs under relatively stable boundary conditions. Therefore, the simulations performed in the planning and design stage all use steady-state solvers for pipeline network simulation. This patent will also explain the logical optimization of the steady-state solver in this scenario.
[0035] In the current existing technology, a large number of manual attempts are used to deal with negative flow in the gas source of the natural gas pipeline network simulation. Most of the current steady-state solvers do not have the ability to automatically analyze the reverse supply situation and adaptively adjust the boundary conditions. They can only rely on experienced engineers to manually check the simulation results and adjust the boundary conditions multiple times to obtain reasonable assignment schemes and simulation results. This limits the wide application of simulation products and the convenience of use by gas companies.
[0036] The embodiment of the present application provides a method for adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation, which is used to adaptively adjust the gas source reverse supply situation in a natural gas pipeline network simulation.
[0037] Figure 1 The following is a flow chart showing the principle of a method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation according to an embodiment of the present application. Figure 1 As shown, in this embodiment, the processing logic of normal working conditions and three types of abnormal working conditions are integrated into a processing flow framework. First, it is necessary to import the boundary conditions of all boundary points (assigned boundary data, such as assigned pressure data or assigned flow data), as well as the constraints of some or all boundary nodes, such as the pressure of a gas source, the user, the upper and lower limits of the flow, etc. Then, based on the input constraints, first determine whether the assignment is reasonable. If it is unreasonable, prompt the boundary points that do not meet the constraints, and need to be modified to meet the constraints before the simulation calculation can be started; in the steady-state solver, the simulation results completed for the first time are compared with the constraints. If they meet, the normal results are directly output; if they do not meet, they are compared with the situation in abnormal working condition type one. If they meet, they are handled according to the processing flow of abnormal working condition type one; if they do not meet, and they do not meet the situation in abnormal working condition type one, they are handled according to the processing flow of abnormal working condition type two; in the last case, they are handled according to the processing flow of abnormal working condition type three.
[0038] The following will be combined with the attached examples of the present application Figure 2 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 method of adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in the present embodiment without creative labor.
[0039] Figure 2 The flowchart of the method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation in the embodiment of the present application is shown. Figure 2 As shown, the method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation provided in an embodiment of the present application includes the following steps S100 to S300.
[0040] Step S100, obtaining boundary conditions and constraint conditions of boundary nodes, and obtaining node assignment data that meets the constraint conditions based on the boundary conditions and the constraint conditions;
[0041] Step S200, obtaining a simulation result of a steady-state solver based on the node assignment data;
[0042] Step S300, detecting whether the simulation result meets the constraint condition; if so, continuing to execute step S400, outputting the simulation result; if not, continuing to execute step S500, successively determining whether the simulation result belongs to the preset first abnormal working condition, the second abnormal working condition and the third abnormal working condition, adaptively adjusting the boundary condition under the corresponding abnormal working condition, and obtaining the simulation result after the adaptive adjustment; wherein step S500 specifically includes:
[0043] Step S510, if the node assignment data of each gas source in the area are all assigned pressure, and at least one of the gas sources in the simulation result has a negative flow, then it is determined that the simulation result belongs to the preset first abnormal working condition; under the first abnormal working condition, the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the value of the node assignment data;
[0044] Step S520, if the node assignment data of all gas sources in the area are assigned as flow and the sum of the gas source flow is not equal to the sum of the user flow within the tolerance range, or the node assignment data of some gas sources in the area are assigned as flow, and the sum of the flow of the node assignment data is less than the sum of the user flow in the area, then it is judged that the simulation result belongs to the preset second abnormal working condition; under the second abnormal working condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data;
[0045] Step S530, if the node assignment data of some of the gas sources in the area are assigned with flow, and the sum of the flow of the node assignment data is greater than the sum of the flow of users in the area, then it is judged that the simulation result belongs to the preset third abnormal operating condition; under the third abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data.
[0046] In this embodiment, in addition to the assignment of boundary conditions, the constraints of the upper and lower limits of pressure / flow at each boundary node are also clarified for the data input for simulation, so as to calculate the simulation calculation scheme that meets the needs of customers based on these constraints. In this embodiment, the working conditions based on the simulation of steady-state pipe network are divided into three abnormal types and one normal type. The three abnormal types of working conditions can cover various unreasonable boundary condition settings; this embodiment specifically makes adaptive adjustments for abnormal working condition type 1 (the first abnormal working condition), that is, multiple gas sources are assigned pressures, and the assignment is unreasonable; for abnormal working condition type 2 (the second abnormal working condition), that is, part or all of the assigned flow in multiple gas sources, and the sum of the assigned flow is less than the sum of the user flow in all areas, the simulation boundary conditions for this situation are adaptively adjusted; for abnormal working condition type 3 (the third abnormal working condition), that is, part or all of the assigned flow in multiple gas sources, and the sum of the assigned flow is greater than the sum of the user flow in all areas, the simulation boundary conditions for these situations are adaptively adjusted.
[0047] The following is a detailed description of the method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation according to this embodiment.
[0048] In this embodiment, the first abnormal working condition is defined as: there are multiple gas sources in the calculation area, and each gas source is assigned a simulated pressure. During steady-state solution, the equation group formed by the pressure drop equation, the middle node flow balance equation and the boundary point assignment verification equation is used to calculate one or more gas source negative flows. The equation establishment and solution process for steady-state solution are well known to those skilled in the art and will not be repeated in this embodiment.
[0049] In this embodiment, the principle of the occurrence of the first abnormal working condition is as follows: since the mass conservation equation used in steady-state calculations has no differential terms of time and space, for the air inlet and outlet ends of the pipe network to be calculated, it must mean that the total air intake is equal to the total air outlet. In the solution process, the residuals of the pressure drop equation, the flow balance equation and the boundary point check equation will be obtained between the gas sources and between the gas sources and each user. The convergence process of the final numerical solution of the equation group is the process of making the residuals continuously smaller. Since all gas sources are assigned pressures, the pressure difference between the gas sources will correspond to a flow m, and the flow m will continuously approach the total flow n at the user end through the flow balance equation. However, if the pressure difference between the gas sources is too large, m will be very large. If m is greater than n, the residual of the flow balance equation will not be reduced. However, in order to make the equation group converge, the numerical calculation method will solve this problem by calculating the negative flow of the gas source. For example, there are two gas sources A and B, both of which are assigned pressures, and the pressure of A is greater than that of B. The pressure difference between them corresponds to the pressure drop equation, which will calculate a flow of m. If m is greater than the sum of the user flows in the pipe network, n, then a negative flow will be calculated for B in the solution, making it a user in fact, with an absolute flow of mn. In this way, the total output of this pipe network area is: m-n+n = m, and the total input is also m. The equation group can be calculated to converge, but the gas source B has reverse supply, which violates the objective facts.
[0050] Based on this, this embodiment judges and processes the first abnormal operating condition through the following process.
[0051] Figure 3 The flowchart of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application is shown as follows: Figure 3 As shown, in an implementation method of this embodiment, under the first abnormal operating condition, the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the numerical value of the node assignment data, including the following steps S511 to S512.
[0052] Step S511, changing the assignment type of the node assignment data to flow, and updating the index relationship between the verification equation in the steady-state solver and the variables in the variable pool and the value of the column matrix formed by the derivative of the variables of the verification equation in the Jacobian sparse matrix according to the changed node assignment data;
[0053] Step S512, updating the pressure variable and flow variable of the gas source whose assignment type of the node assignment data is changed in the initial value matrix of the steady-state solver; wherein the pressure variable is updated to the initial pressure value, and the flow variable is updated to 0.
[0054] Figure 4 The flowchart of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application after adaptive adjustment and re-simulation under the first abnormal working condition is shown. Figure 4 As shown, in an implementation method of this embodiment, under the first abnormal operating condition, after the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the numerical value of the node assignment data, the following steps S513 to S512 are also included.
[0055] Step S513, re-simulating the steady-state solver and obtaining new simulation results;
[0056] Step S514, detecting whether the new simulation result meets the constraint condition: if so, continuing to execute step S514: outputting the simulation result; if not, continuing to execute step S515: adjusting the pressure value of the node assignment data up and down within a preset adjustment number and adjustment range;
[0057] Step S516, returning the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0058] Among them, in one implementation method of the present embodiment, the returning of the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data includes: if the gas source converges after adjusting the pressure value of the node assignment data, returning the converged simulation result; if the gas source does not converge after adjusting the pressure value of the node assignment data, obtaining the simulation result with the best convergence, and returning the simulation result with the best convergence.
[0059] Figure 5 The flowchart of the specific implementation process of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application is as follows: Figure 5 As shown in the figure, the boundary conditions and constraints of the simulation are imported, and then it is judged whether it belongs to the first abnormal working condition: whether each gas source has assigned pressure, and a gas source calculates a negative flow. If not, it does not belong to the first abnormal working condition, and other abnormal working condition types are judged; if so, it is determined to belong to the first abnormal working condition, and the adaptive adjustment processing flow of the first abnormal working condition is entered. For the gas source with negative flow, the assignment type is changed to flow, and the value is assigned to 0.
[0060] Specifically, since the total variable pool of the simulation contains both flow variables and pressure variables, it is necessary to change the index relationship between the original equation and the variables in the variable pool. In order to save calculation time, in this embodiment, the index relationship between the pressure drop equation and the middle node flow level equation and the variables can remain unchanged, and only the index of the original verification equation and the variable is deleted. Then, according to the new variable assignment, the index relationship between the verification equation and the variable is added. Then, delete the value of the column matrix of the variable derivative of the verification equation part in the Jacobi sparse matrix CSR format; then, according to the new variable assignment, add the column index of the corresponding variable in the verification equation, that is, replace the deleted part of the column matrix with the new value. Finally, update the pressure variable and flow variable of the corresponding changed gas source in the initial value matrix, where the pressure variable assignment is replaced with the general pressure initial value, such as 1e 6 Pa, and the initial value of the flow variable is changed to 0.
[0061] Afterwards, based on the above changes, the simulation calculation is re-initiated to determine whether the simulation results of the new simulation calculation meet the left and right constraints. If so, the simulation calculation results are returned. If not, without adjusting the assignment type of all boundary nodes, only the pressure value of the gas source point of the assigned pressure is adjusted upward or downward, and the number of up / down adjustments is, for example, not more than 5 times.
[0062] Finally, determine whether the assigned pressure gas source node converges after adjustment. If so, directly return the converged simulation calculation results. If not, return a set of simulation results with the best convergence during the adjustment process, where the best convergence means that the residual two norm of the equation group is the smallest during the simulation process.
[0063] It can be seen that this embodiment clearly defines the abnormal working condition type 1, that is, multiple gas sources are assigned pressures and the negative flow of the gas sources is calculated. And the automatic assignment change is completed by changing the relationship between equations and variable indexes, adjusting the Jacobian matrix and the initial value matrix. After re-initiating the simulation calculation, if the result does not meet the constraint conditions, the result with the best convergence is found as the simulation calculation scheme for the final output by adjusting the gas source of the assigned pressure up / down a limited number of times.
[0064] The first type of abnormal working condition is the situation where the gas sources in the area are all assigned pressure and a negative flow is calculated. However, more often, multiple gas sources do not have fully assigned flow, but also have partially assigned flow, partially assigned pressure, or even fully assigned flow. In this embodiment, the situation where part or all of the flow in multiple gas sources is assigned, and the sum of the assigned flow is less than the sum of the flow of users in all areas is determined as the second abnormal working condition.
[0065] Figure 6 The flowchart of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application is shown as follows: Figure 6As shown, in one implementation of this embodiment, under the second abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the numerical value of the node assignment data, including the following steps S521 to S523.
[0066] Step S521, when the node assignment data of all gas sources are assigned flow, the boundary conditions are adaptively adjusted by alarming the gas sources that need to adjust the boundary conditions and returning the alarm to the gas source user.
[0067] Among them, in one implementation method of the present embodiment, in the process of adaptively adjusting the boundary conditions by alerting the gas source that needs to adjust the boundary conditions and returning the alert to the gas source user, the gas source user is prompted to adjust the flow rate assigned by the node assignment data of the gas source so that the total inflow is equal to the total outflow within a preset tolerance range.
[0068] Step S522, when the node assignment data of some gas sources are assigned flow, and the sum of the flow of the node assignment data is less than the sum of the flow of users in the area and no gas source has negative flow in the simulation result, the pressure value of the node assignment data is adjusted up or down within a preset adjustment number and adjustment range;
[0069] Step S523, returning the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0070] Among them, in one implementation method of the present embodiment, the returning of the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data includes: if the gas source converges after adjusting the pressure value of the node assignment data, returning the converged simulation result; if the gas source does not converge after adjusting the pressure value of the node assignment data, obtaining the simulation result with the best convergence, and returning the simulation result with the best convergence.
[0071] Among them, in one implementation of the present embodiment, when the node assignment data of some gas sources are assigned flow, and the sum of the flow of the node assignment data is not less than the sum of the user flow in the area, the process of adaptively adjusting the boundary conditions under the third abnormal operating condition is entered; when negative flow occurs in the gas source in the simulation result, the process of adaptively adjusting the boundary conditions under the first abnormal operating condition is entered.
[0072] Figure 7 The flowchart of the specific implementation process of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application is as follows: Figure 7As shown, if all assigned flows are used, it is only necessary to check whether the sum of the assigned flows of the gas source is close to the sum of the user flows, that is, whether the total inflow is equal to the total outflow. A certain tolerance can be set, such as 2%. Although this situation is possible in practice, in the simulation of pipeline network planning and design, since a steady-state solver is used, the total outflow is basically equal to the total outflow by default. Therefore, if this tolerance is exceeded, the gas source point that needs to adjust the flow boundary conditions will be alarmed and returned to the user, requiring the gas source assigned flow to be adjusted so that the total inflow is equal to the total outflow within the tolerance range.
[0073] If part of the flow is assigned and part of the pressure is assigned, it is necessary to check whether the sum of the gas source flow of the assigned flow is less than the sum of the user flow. If it is less, it means that the sum of the calculated flow of the one or more gas sources of the assigned pressure and the sum of the flow of the gas source of the assigned flow may be equal to the sum of the flow assigned by the user. Of course, there are many different situations where convergence does not occur, and more judgments are needed.
[0074] If the simulation calculation initiated after the above boundary conditions are adjusted still has the situation in abnormal working condition type 1, that is, a gas source with a certain assigned pressure calculates a negative flow, then follow the processing flow in abnormal working condition type 1. Otherwise, check whether the simulation result meets the constraint conditions. If not, adjust the pressure of the gas source with the assigned pressure, and limit the number of adjustments to 5 times to avoid more calculation expenses. Find the result with the best calculation convergence among the limited number of simulation results as the final output result.
[0075] It can be seen from the above that this embodiment defines the situation where the simulation calculation result does not meet the constraint conditions when the sum of the gas source flow rates is not equal to the sum of the user flow rates within the tolerance range when all gas sources are assigned flow rates, or when some gas sources are assigned flow rates and some gas sources are assigned pressures, and the sum of the flow rates of the gas sources with assigned flow rates is less than the sum of the user flow rates, as abnormal operating condition type two.
[0076] When the sum of the gas source flows is greater than the sum of the user flows when all gas sources are assigned flows, an alarm is issued to require the user to adjust the flow of the assigned gas sources so that the total inflow is equal to the total outflow within the tolerance (2%).
[0077] For some gas sources with assigned flow and some gas sources with assigned pressure, when the sum of the flow of the gas sources with assigned flow is less than the sum of the user flow, the next step is performed by judging whether there is a negative flow in the gas source. If the negative flow of the gas source is calculated, the flow can be processed by referring to the processing flow of abnormal condition 1. Otherwise, it means that the simulation result does not meet the constraint conditions of the boundary node. The limited up / down adjustment of the gas source with assigned pressure is still adopted to find the result with the best convergence as the simulation calculation scheme for the final output.
[0078] If both abnormal operating conditions type one and two can be excluded, then logically, only one operating condition remains, which is the third abnormal operating condition of this embodiment: the gas source partially assigns pressure and partially assigns flow, and the sum of the flow of the gas source with the assigned flow is greater than the sum of the flow assigned by all users in the pipe network area. This objectively does not satisfy the total output equals the total output, and forced calculation will only calculate negative flow for those gas sources with assigned pressure. Therefore, it is necessary to return an alarm to inform the user to reduce the flow of the gas source with the assigned flow, at least to ensure that the sum of the flow of the assigned gas source is not greater than the sum of the flow of all users.
[0079] After the boundary conditions are modified according to the above requirements, if the simulation results still do not meet the convergence conditions, the corresponding processing flow can be directly found from Abnormal Condition 2.
[0080] Figure 8 The flowchart of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application is shown as follows: Figure 8 As shown, in an implementation method of the present embodiment, under the third abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the numerical value of the node assignment data, including the following steps S521 to S523.
[0081] Step S531, when the sum of the flow of the node valued data is greater than the sum of the flow of users in the area, the boundary condition is adaptively adjusted by alerting the gas source that needs to adjust the boundary condition and returning the alarm to the gas source user.
[0082] Among them, in one implementation method of the present embodiment, in the process of adaptively adjusting the boundary conditions by alerting the gas source that needs to adjust the boundary conditions and returning the alert to the gas source user, the gas source user is prompted to adjust the flow rate assigned by the node assignment data of the gas source so that the total inflow is equal to the total outflow within a preset tolerance range.
[0083] Step S532, when no negative flow of the gas source occurs in the simulation result, adjusting the pressure value of the node assignment data up or down within a preset adjustment number and adjustment range;
[0084] Step S533, returning the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
[0085] Among them, in one implementation method of the present embodiment, the returning of the simulation result based on the convergence of the gas source after adjusting the pressure value of the node assignment data includes: if the gas source converges after adjusting the pressure value of the node assignment data, returning the converged simulation result; if the gas source does not converge after adjusting the pressure value of the node assignment data, obtaining the simulation result with the best convergence, and returning the simulation result with the best convergence.
[0086] As can be seen from the above, in this embodiment, some of the remaining situations, that is, some gas sources are assigned flow, some gas sources are assigned pressure, and the sum of the flow of the gas sources with assigned flow is greater than the sum of the user flow, are defined as abnormal operating condition type three. The processing flow is to prompt the user to lower the flow of the assigned gas source through an alarm so that the total inflow is equal to the total outflow within the tolerance (2%), and then initiate the simulation after adjustment to determine whether the gas source has a negative flow. If the negative flow of the gas source is calculated, the processing flow can refer to the processing flow of abnormal operating condition one. Otherwise, it means that the simulation result only does not meet the constraint conditions of the boundary node. A limited number of up / down adjustments of the gas source with assigned pressure are still used to find the result with the best convergence as the simulation measurement scheme for the final output.
[0087] Fig. 9 The flowchart is a specific implementation process of the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation in one embodiment of the present application, in which the adaptive adjustment is performed under the third abnormal working condition. Fig. 9 As shown, the boundary conditions and constraints of the simulation are imported. First, it is determined whether all gas sources have assigned flow. If so, the gas source points that need to adjust the flow boundary conditions will be alarmed and returned to the user, requiring the gas source assigned flow to be adjusted so that the total inflow is equal to the total outflow within the tolerance range; if not, it continues to determine whether the sum of the gas source flows of the assigned flow is less than the sum of the flows of all users. If not, it means that it does not belong to abnormal type 2, and the abnormal working condition type 3 is continued to be processed. If so, it continues to determine whether the simulation calculation results show that the gas source point of the assigned pressure calculates a negative flow. If so, it is processed according to the processing flow of abnormal working condition type 1 and the simulation calculation results are returned. If not, without adjusting the assignment type of all boundary nodes, only the pressure value of the gas source point of the assigned pressure is adjusted upward or downward, and the number of up / down adjustments is, for example, not more than 5 times. Afterwards, determine whether the assigned pressure gas source node converges after adjustment. If so, directly return the converged simulation calculation results. If not, return a set of simulation results with the best convergence during the adjustment process, where the best convergence means that the residual two norm of the equation group is the smallest during the simulation process.
[0088] As can be seen from the above, this embodiment provides a comprehensive summary at the logical level without omissions for all abnormal conditions that may occur due to unreasonable boundary condition assignment when the steady-state pipeline simulation solver is used for simulation, and explains the overall direction of optimization of the algorithm architecture of the steady-state pipeline simulation solver; the processing flow of the three types of abnormal conditions is logical, and only a small number of alarms are used to prompt the user to make certain adjustments to the artificial boundary conditions, while most of the adjustments and recalculations are automatically performed by the solver background; the pipeline simulation steady-state solver optimized by this embodiment, when used for simulation and calculation of the planning and design scenarios within the pipeline, will obtain a calculation solution that is recognized and satisfactory by the customer with very few calculations, and the output simulation results will not have errors that violate common sense, such as gas source backflow.
[0089] The protection scope of the method for adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation described in the embodiment of the present application is not limited to the execution order of the steps listed in the present 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.
[0090] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for adaptively repairing unreasonable working conditions of a steady-state pipeline network simulation provided in any embodiment of the present application is implemented.
[0091] 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.
[0092] An embodiment of the present application also provides an electronic device. Fig.10Shown 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 method for adaptively repairing the unreasonable working conditions of the steady-state pipe network simulation provided in the present application can also be applied to databases, servers, and service response systems based on terminal artificial intelligence. The embodiment of the present application does not impose any restrictions on the specific application scenarios of the method for adaptively repairing the unreasonable working conditions of the steady-state pipe network simulation.
[0093] like Fig.10 As shown, the electronic device 100 provided in the embodiment of the present application includes a memory 101 and a processor 102 .
[0094] 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.
[0095] 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.
[0096] 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 method for adaptively repairing unreasonable working conditions of steady-state pipeline network simulation provided in any embodiment of the present application.
[0097] Optionally, the processor 102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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.
[0098] Optionally, the electronic device 100 in this embodiment may further include a display 103. The display 103 is communicatively connected with the memory 101 and the processor 102, and is used to display a GUI interaction interface related to the method for adaptively repairing the unreasonable working condition of the steady-state pipe network simulation.
[0099] In summary, the present application performs adaptive adjustments to all abnormal working conditions that may occur when the boundary condition assignment is unreasonable when the steady-state pipe network simulation solver is used for simulation, so that the output simulation results will not have gas source back-supply, and the steady-state pipe network simulation solver is effectively optimized. Therefore, the present application effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.
[0100] 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 method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation, characterized in that: include: Acquire boundary conditions and constraint conditions of boundary nodes, and acquire node assignment data that meets the constraint conditions based on the boundary conditions and the constraint conditions; Acquire a simulation result of a steady-state solver based on the node value assignment data; Check whether the simulation result meets the constraint condition: If so, output the simulation result; If not, determine in sequence whether the simulation result belongs to the preset first abnormal condition, the second abnormal condition and the third abnormal condition, adaptively adjust the boundary conditions under the corresponding abnormal conditions, and obtain the simulation result after the adaptive adjustment; wherein: If the node assignment data of each gas source in the area are all assigned pressure, and at least one of the gas sources in the simulation result has a negative flow, then the simulation result is judged to belong to the preset first abnormal working condition; under the first abnormal working condition, the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the value of the node assignment data; If the node assignment data of all gas sources in the area are assigned flow and the sum of the gas source flow is not equal to the sum of the user flow within the tolerance range, or the node assignment data of some gas sources in the area are assigned flow, and the sum of the flow of the node assignment data is less than the sum of the user flow in the area, then it is judged that the simulation result belongs to the preset second abnormal operating condition; under the second abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data; If the node assignment data of some of the gas sources in the area are assigned flow, and the sum of the flow of the node assignment data is greater than the sum of the flow of users in the area, then it is judged that the simulation result belongs to the preset third abnormal operating condition; under the third abnormal operating condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data.
2. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 1 is characterized in that: The step of adaptively adjusting the boundary condition by changing the assignment type of the node assignment data and adjusting the value of the node assignment data under the first abnormal working condition includes: The assignment type of the node assignment data is changed to flow, and the index relationship between the verification equation in the steady-state solver and the variables in the variable pool and the value of the column matrix formed by the derivative of the variables of the verification equation in the Jacobian sparse matrix are updated according to the changed node assignment data; The pressure variable and flow variable of the gas source whose assignment type of the node assignment data is changed in the initial value matrix of the steady-state solver are updated; wherein the pressure variable is updated to the initial pressure value, and the flow variable is updated to 0.
3. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 2 is characterized in that: Under the first abnormal working condition, after the boundary condition is adaptively adjusted by changing the assignment type of the node assignment data and adjusting the value of the node assignment data, the method further includes: Re-simulating the steady-state solver and obtaining new simulation results; Check whether the new simulation result meets the constraint condition: If so, output the simulation result; If not, then adjusting the pressure value of the node assignment data up or down within a preset adjustment number and adjustment range; The simulation result is returned based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
4. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 1 is characterized in that: Under the second abnormal working condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or adjusting the value of the node assignment data, including: When the node assignment data of all gas sources are assigned as flow, the boundary conditions are adaptively adjusted by giving an alarm to the gas source that needs to adjust the boundary conditions and returning the alarm to the gas source user; When the node assignment data of some gas sources are assigned with flow, and the sum of the flow of the node assignment data is less than the sum of the flow of users in the area, and no gas source has negative flow in the simulation result, the pressure value of the node assignment data is adjusted up or down within a preset adjustment number and adjustment range; The simulation result is returned based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
5. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 4 is characterized in that: When the node assignment data of some gas sources are assigned with flow, and the sum of the flow of the node assignment data is not less than the sum of the flow of users in the area, the process of adaptively adjusting the boundary conditions under the third abnormal working condition is entered; When a negative flow rate occurs in the gas source in the simulation result, a process of adaptively adjusting the boundary condition under the first abnormal working condition is entered.
6. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 1 or 5, characterized in that: Under the third abnormal working condition, the boundary condition is adaptively adjusted by alarming the gas source that needs to adjust the boundary condition and returning it to the gas source user, or by adjusting the value of the node assignment data, including: When the sum of the flow of the node valued data is greater than the sum of the flow of users in the area, the boundary condition is adaptively adjusted by alerting the gas source that needs to adjust the boundary condition and returning the alarm to the gas source user; When the gas source does not have a negative flow in the simulation result, adjusting the pressure value of the node assignment data up or down within a preset adjustment number and adjustment range; The simulation result is returned based on the convergence of the gas source after adjusting the pressure value of the node assignment data.
7. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 4 or 6, characterized in that: In the adaptive adjustment of the boundary conditions by alerting the gas source that needs to adjust the boundary conditions and returning the alert to the gas source user, the gas source user is prompted to adjust the flow assigned by the node assignment data of the gas source so that the total inflow is equal to the total outflow within a preset tolerance range.
8. The method for adaptively repairing unreasonable working conditions of steady-state pipe network simulation according to claim 3, 4 or 6, characterized in that: The convergence of the gas source after adjusting the pressure value of the node assignment data and returning the simulation result includes: If the gas source converges after adjusting the pressure value of the node assignment data, the converged simulation result is returned; If the gas source after adjusting the pressure value of the node assignment data does not converge, a simulation result with optimal convergence is obtained, and the simulation result with optimal convergence is returned.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation as described in any one of claims 1 to 8 is implemented.
10. 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 method for adaptively repairing unreasonable working conditions of a steady-state pipe network simulation as described in any one of claims 1 to 8 when calling the computer program.