CN115688340B - Method and system for solving dynamic simulation of natural gas transmission pipe network system - Google Patents
Method and system for solving dynamic simulation of natural gas transmission pipe network system Download PDFInfo
- Publication number
- CN115688340B CN115688340B CN202211397298.5A CN202211397298A CN115688340B CN 115688340 B CN115688340 B CN 115688340B CN 202211397298 A CN202211397298 A CN 202211397298A CN 115688340 B CN115688340 B CN 115688340B
- Authority
- CN
- China
- Prior art keywords
- pipeline
- node
- gas transmission
- natural gas
- flow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 title claims abstract description 112
- 230000005540 biological transmission Effects 0.000 title claims abstract description 84
- 239000003345 natural gas Substances 0.000 title claims abstract description 56
- 238000005094 computer simulation Methods 0.000 title claims abstract description 52
- 238000000034 method Methods 0.000 title claims abstract description 47
- 239000007789 gas Substances 0.000 claims abstract description 91
- 238000012937 correction Methods 0.000 claims description 25
- 239000011159 matrix material Substances 0.000 claims description 13
- 230000008859 change Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 9
- 238000004088 simulation Methods 0.000 claims description 7
- 238000012545 processing Methods 0.000 claims description 6
- 230000006835 compression Effects 0.000 claims description 3
- 238000007906 compression Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本公开属于天然运行控制技术领域,具体涉及一种天然气输气管网系统动态仿真的求解方法及系统,包括:获取天然气输气网络的拓扑结构,搭建输气管道动态偏微分方程;对所搭建的偏微分方程进行离散化和线性化处理,得到线性方程组;对所得到的线性方程组进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量,预测输气网络的节点气压和管道流量,完成天然气输气管网系统的动态仿真。
The disclosure belongs to the technical field of natural gas operation control, and specifically relates to a solution method and system for dynamic simulation of a natural gas transmission pipeline network system, including: obtaining the topological structure of the natural gas transmission network, and constructing a dynamic partial differential equation of the gas transmission pipeline; Discretize and linearize the partial differential equations to obtain a system of linear equations; iteratively solve the obtained system of linear equations to obtain the pressure and mass flow at each grid node of the gas transmission network under the same time layer, and predict the gas transmission network. The node pressure and pipeline flow of the gas network are used to complete the dynamic simulation of the natural gas transmission pipeline network system.
Description
技术领域technical field
本公开属于天然运行控制技术领域,具体涉及一种天然气输气管网系统动态仿真的求解方法及系统。The disclosure belongs to the technical field of natural operation control, and in particular relates to a solution method and system for dynamic simulation of a natural gas transmission pipeline network system.
背景技术Background technique
本部分的陈述仅仅是提供了与本公开相关的背景技术信息,不必然构成在先技术。The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
输气管网是天然气系统的重要组成部分,对于天然气系统仿真的关键在于对输气管网气体动态流动过程的仿真。通过建立输气网络的动态仿真模型并进行求解,能够模拟给定条件下的天然气系统动态运行状况,并预测未来一段时间系统节点气压和管道流量等状态量的变化。输气网络的动态仿真结果可以为天然气系统的优化运行提供参考,为工程实践提供理论依据。为使模型能更有效地应用于系统的优化运行研究,就需要采用合理方法对输气网络动态仿真模型进行快速准确求解,以提高规划运行效率,否则求解速度过慢,精度过低,模型就会失去实际的应用价值。The gas transmission network is an important part of the natural gas system, and the key to the simulation of the natural gas system is the simulation of the gas dynamic flow process in the gas transmission network. By establishing a dynamic simulation model of the gas transmission network and solving it, it is possible to simulate the dynamic operation of the natural gas system under given conditions, and predict changes in state variables such as system node air pressure and pipeline flow in the future. The dynamic simulation results of the gas transmission network can provide a reference for the optimal operation of the natural gas system and provide a theoretical basis for engineering practice. In order for the model to be more effectively applied to the optimal operation research of the system, it is necessary to use a reasonable method to quickly and accurately solve the dynamic simulation model of the gas transmission network to improve the planning and operation efficiency. Otherwise, the solution speed is too slow and the accuracy is too low, and the model will fail. It will lose its practical application value.
据发明人了解,输气网络动态偏微分方程模型的求解面临以下难点,使得难以对天然气系统进行快速精确仿真:天然气在管道内部的一维动态流动过程由一组偏微分方程来描述,刻画输气管道动态仿真模型的原始输偏微分方程组十分复杂,气体压力、密度以及流速等状态参数之间相互关联,并且均为时间和空间的函数,即使现有研究采用一些普遍认可的假设对方程进行简化,但偏微分方程本身仍然难以直接进行有效求解;此外,方程组中存在非线性项,方程复杂度高、非凸性强,采用非线性求解方法计算量大,计算速度慢。对于实际工程中具有数百甚至数千个相互连接的管道的大规模管网系统,复杂的偏微分方程组的求解方案会导致计算时间过长,求解效率降低,并且大量数据的储存需求也会导致计算成本上升。According to the inventor's understanding, the solution of the dynamic partial differential equation model of the gas transmission network faces the following difficulties, which make it difficult to quickly and accurately simulate the natural gas system: the one-dimensional dynamic flow process of natural gas inside the pipeline is described by a set of partial differential The original differential equations of the gas pipeline dynamic simulation model are very complex, and the state parameters such as gas pressure, density, and flow rate are interrelated, and they are all functions of time and space. Simplification, but the partial differential equation itself is still difficult to solve directly and effectively; in addition, there are nonlinear terms in the equation system, the equations are highly complex and non-convex, and the nonlinear solution method requires a large amount of calculation and slow calculation speed. For a large-scale pipe network system with hundreds or even thousands of interconnected pipelines in actual engineering, the solution scheme of complex partial differential equations will lead to long calculation time, low solution efficiency, and the storage requirement of a large amount of data will also increase. lead to an increase in computational cost.
发明内容Contents of the invention
为了解决上述问题,本公开提出了一种天然气输气管网系统动态仿真的求解方法控系统,基于线性化和离散化网格方法将描述输气网络动态仿真的偏微分方程组模型转化为线性方程组模型,提高模型求解速度,并通过迭代求解保证精度。所提的方法与传统方法相比提高了仿真求解的稳定性,减少了所需求解的变量数目,并能够实现对动态过程的良好拟合。In order to solve the above problems, this disclosure proposes a solution method for the dynamic simulation of the natural gas transmission pipeline network system control system, based on the linearization and discretization grid method, the partial differential equation model describing the dynamic simulation of the gas transmission network is transformed into a linear Equation model, improve the speed of model solution, and ensure the accuracy through iterative solution. Compared with the traditional method, the proposed method improves the stability of the simulation solution, reduces the number of variables to be solved, and can achieve a good fitting of the dynamic process.
根据一些实施例,本公开的第一方案提供了一种天然气输气管网系统动态仿真的求解方法,采用如下技术方案:According to some embodiments, the first solution of the present disclosure provides a solution method for dynamic simulation of a natural gas transmission pipeline network system, which adopts the following technical solution:
一种天然气输气管网系统动态仿真的求解方法,包括:A solution method for dynamic simulation of a natural gas transmission pipeline network system, comprising:
获取天然气输气网络的拓扑结构,搭建输气管道动态偏微分方程;Obtain the topological structure of the natural gas transmission network, and construct the dynamic partial differential equation of the gas transmission pipeline;
对所搭建的偏微分方程进行离散化和线性化处理,得到线性方程组;Discretize and linearize the constructed partial differential equations to obtain a system of linear equations;
对所得到的线性方程组进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量,预测输气网络的节点气压和管道流量,完成天然气输气管网系统的动态仿真。Iteratively solve the obtained linear equations, obtain the air pressure and mass flow at each grid node of the gas transmission network under the same time layer, predict the node air pressure and pipeline flow of the gas transmission network, and complete the natural gas transmission pipeline network system Dynamic simulation.
作为进一步的技术限定,识别天然气各个管道之间的连接关系,统计各管道末端的负荷情况;建立输气管道偏微分方程模型,并采用一般性假设进行简化,可以得到由气体压力p(t,x)和质量流量q(t,x)描述的输气管道偏微分方程模型:As a further technical limitation, identify the connection relationship between various natural gas pipelines, and count the load at the end of each pipeline; establish a partial differential equation model of the gas pipeline, and simplify it with general assumptions, the gas pressure p(t, x) and mass flow q(t,x) describe the gas pipeline partial differential equation model:
其中,t代表时间,x代表沿管道轴线方向的距离,p代表气压,D代表管道内径,A代表管道横截面积,λ代表管道摩阻系数,Z代表气体压缩系数,R代表气体常数,T代表温度,q代表质量流量。Among them, t represents time, x represents the distance along the axis of the pipe, p represents the air pressure, D represents the inner diameter of the pipe, A represents the cross-sectional area of the pipe, λ represents the friction coefficient of the pipe, Z represents the gas compression coefficient, R represents the gas constant, T Represents temperature, q represents mass flow.
作为进一步的技术限定,选取空间步长和时间步长,将输气网络的所有管道划分为网格,对偏微分方程进行离散化和线性化;As a further technical limitation, the space step and time step are selected, all the pipelines of the gas transmission network are divided into grids, and the partial differential equations are discretized and linearized;
稳态时,管道内气体压力不随时间变化,气体流量不随时间和空间变化,对空间偏导数离散,得到稳态条件下的管道压力计算公式:In the steady state, the gas pressure in the pipeline does not change with time, the gas flow does not change with time and space, and the space partial derivative is discrete, and the calculation formula of the pipeline pressure under steady state conditions is obtained:
其中,和/>代表稳态时网格节点n和n-1处的气体压力,/>表示稳态时第i根管道的质量流量;in, and /> represents the gas pressure at grid nodes n and n-1 at steady state, /> Indicates the mass flow rate of the i-th pipe at steady state;
动态时,基于节点类型的不同,即节点所处管道位置的不同,采用不同的离散格式:In dynamic mode, different discrete formats are used based on the different node types, that is, the different pipeline positions of the nodes:
对于管道中间的网格节点,采用如下所示离散格式:For mesh nodes in the middle of the pipeline, the discretization format is as follows:
对于管道首端节点和管道末端节点,采用如下所示离散格式:For the pipeline start node and pipeline end node, the following discrete formats are used:
为简化表达,定义常数:To simplify the expression, define constants:
其中,Δx表示离散的空间步长,Δt表示离散的时间步长。Among them, Δx represents a discrete space step, and Δt represents a discrete time step.
进一步的,设置需要迭代求解的变量,建立迭代变量矩阵;对于一根管道,给定上个时刻已知量和本时刻气压分布,直接计算出本时刻的流量分布,将气压和各分支管道首端流量作为迭代求解变量,建立压力变量矩阵和流量变量矩阵。Further, set the variables that need to be solved iteratively, and establish an iterative variable matrix; for a pipeline, given the known quantity at the previous time and the air pressure distribution at this time, the flow distribution at this time is directly calculated, and the air pressure and the initial pressure of each branch pipeline are calculated. The end flow is used as the iterative solution variable, and the pressure variable matrix and flow variable matrix are established.
进一步的,基于稳态压力公式和给定的稳态气体质量流量,计算各网格节点的稳态节点压力,作为网络动态仿真的初始状态,通过定义网格点压力和流量修正值,得到节点气压误差方程、节点气压修正方程、流量误差方程和流量修正方程,完成偏微分方程的离散化和线性化处理,得到线性方程组。Further, based on the steady-state pressure formula and the given steady-state gas mass flow rate, the steady-state node pressure of each grid node is calculated as the initial state of the network dynamic simulation. By defining the grid point pressure and flow correction value, the node Air pressure error equation, node air pressure correction equation, flow error equation and flow correction equation, complete discretization and linearization of partial differential equations, and obtain linear equations.
作为进一步的技术限定,在迭代求解的过程中,将上一时刻的节点气压和质量流量作为本时刻待求变量的假设值p*和q*,即迭代的初始值;通过节点气压误差方程和流量误差方程计算误差,判断所计算的误差与容许值之间的大小关系,若所得到的误差小于容许值,则基于迭代求解后的气压和流量,计算剩余节点的流量,完成天然气输气管网系统的动态仿真求解。As a further technical limitation, in the process of iterative solution, the nodal air pressure and mass flow at the previous moment are taken as the hypothetical values p * and q * of the variables to be obtained at this moment, which are the initial values of the iteration; through the nodal air pressure error equation and The flow error equation calculates the error, and judges the relationship between the calculated error and the allowable value. If the obtained error is less than the allowable value, the flow of the remaining nodes is calculated based on the air pressure and flow after iterative solution, and the natural gas pipeline is completed. Network system dynamic simulation solution.
进一步的,若所得到的误差不小于容许值,则构建线性修正方程组,通过矩阵运算求解,得到修正变量,根据所得到的修正变量重新计算误差,直到所得到的误差小于容许值为止。Further, if the obtained error is not less than the allowable value, construct a linear correction equation group, solve it by matrix operation, obtain the correction variable, and recalculate the error according to the obtained correction variable until the obtained error is less than the allowable value.
根据一些实施例,本公开的第二方案提供了一种天然气输气管网系统动态仿真的求解系统,采用如下技术方案:According to some embodiments, the second solution of the present disclosure provides a solution system for dynamic simulation of a natural gas transmission pipeline network system, which adopts the following technical solution:
一种天然气输气管网系统动态仿真的求解系统,包括:A solution system for dynamic simulation of a natural gas transmission pipeline network system, comprising:
获取模块,其被配置为获取天然气输气网络的拓扑结构,搭建输气管道动态偏微分方程;The obtaining module is configured to obtain the topology structure of the natural gas transmission network, and construct the dynamic partial differential equation of the gas transmission pipeline;
处理模块,其被配置为对所搭建的偏微分方程进行离散化和线性化处理,得到线性方程组;A processing module configured to perform discretization and linearization processing on the built partial differential equations to obtain a linear equation system;
求解模块,其被配置为对所得到的线性方程组进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量,预测输气网络的节点气压和管道流量,完成天然气输气管网系统的动态仿真。The solution module is configured to iteratively solve the obtained linear equations to obtain the air pressure and mass flow at each grid node of the gas transmission network under the same time layer, predict the node air pressure and pipeline flow of the gas transmission network, and complete Dynamic simulation of natural gas transmission pipeline network system.
根据一些实施例,本公开的第三方案提供了一种计算机可读存储介质,采用如下技术方案:According to some embodiments, the third solution of the present disclosure provides a computer-readable storage medium, adopting the following technical solution:
一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如本公开第一方面所述的天然气输气管网系统动态仿真的求解方法中的步骤。A computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the steps in the method for solving the dynamic simulation of the natural gas transmission pipeline network system according to the first aspect of the present disclosure are implemented.
根据一些实施例,本公开的第四方案提供了一种电子设备,采用如下技术方案:According to some embodiments, the fourth solution of the present disclosure provides an electronic device, which adopts the following technical solution:
一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现如本公开第一方面所述的天然气输气管网系统动态仿真的求解方法中的步骤。An electronic device, including a memory, a processor, and a program stored on the memory and operable on the processor, when the processor executes the program, the natural gas transmission pipeline network system according to the first aspect of the present disclosure is realized Steps in the solution method for a dynamic simulation.
与现有技术相比,本公开的有益效果为:Compared with the prior art, the beneficial effects of the present disclosure are:
本基于线性化和离散化网格方法将描述输气网络动态仿真的偏微分方程组模型转化为线性方程组模型,提高模型求解速度,并通过迭代求解保证精度。所提的方法与传统方法相比提高了仿真求解的稳定性,减少了所需求解的变量数目,并能够实现对动态过程的良好拟合。Based on the linearization and discretization grid method, the partial differential equation model describing the dynamic simulation of the gas transmission network is transformed into a linear equation model, which improves the speed of model solution and ensures the accuracy through iterative solution. Compared with the traditional method, the proposed method improves the stability of the simulation solution, reduces the number of variables to be solved, and can achieve a good fitting of the dynamic process.
附图说明Description of drawings
构成本公开的一部分的说明书附图用来提供对本公开的进一步理解,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。The accompanying drawings constituting a part of the present disclosure are used to provide a further understanding of the present disclosure, and the exemplary embodiments and descriptions of the present disclosure are used to explain the present disclosure, and do not constitute improper limitations to the present disclosure.
图1是本公开实施例一中的天然气输气管网系统动态仿真的求解方法的流程图;FIG. 1 is a flowchart of a solution method for dynamic simulation of a natural gas transmission pipeline network system in
图2是本公开实施例一中的离散化的简单网络示意图;FIG. 2 is a schematic diagram of a discretized simple network in
图3是本公开实施例一中的迭代求解的流程图;FIG. 3 is a flowchart of an iterative solution in
图4是本公开实施例二中的天然气输气管网系统动态仿真的求解系统的结构框图。Fig. 4 is a structural block diagram of a solution system for dynamic simulation of a natural gas transmission pipeline network system in
具体实施方式Detailed ways
下面结合附图与实施例对本公开作进一步说明。The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments.
应该指出,以下详细说明都是例示性的,旨在对本公开提供进一步的说明。除非另有指明,本文使用的所有技术和科学术语具有与本公开所属技术领域的普通技术人员通常理解的相同含义。It should be noted that the following detailed description is exemplary and intended to provide further explanation of the present disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs.
需要注意的是,这里所使用的术语仅是为了描述具体实施方式,而非意图限制根据本公开的示例性实施方式。如在这里所使用的,除非上下文另外明确指出,否则单数形式也意图包括复数形式,此外,还应当理解的是,当在本说明书中使用术语“包含”和/或“包括”时,其指明存在特征、步骤、操作、器件、组件和/或它们的组合。It should be noted that the terminology used herein is only for describing specific embodiments, and is not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly dictates otherwise, the singular is intended to include the plural, and it should also be understood that when the terms "comprising" and/or "comprising" are used in this specification, they mean There are features, steps, operations, means, components and/or combinations thereof.
在本公开中,术语如“上”、“下”、“左”、“右”、“前”、“后”、“竖直”、“水平”、“侧”、“底”等指示的方位或位置关系为基于附图所示的方位或位置关系,只是为了便于叙述本公开各部件或元件结构关系而确定的关系词,并非特指本公开中任一部件或元件,不能理解为对本公开的限制。In this disclosure, terms such as "upper", "lower", "left", "right", "front", "rear", "vertical", "horizontal", "side", "bottom" etc. refer to The orientation or positional relationship is based on the orientation or positional relationship shown in the drawings, and is only a relative term determined for the convenience of describing the structural relationship between the components or elements of the present disclosure. Public restrictions.
本公开中,术语如“固接”、“相连”、“连接”等应做广义理解,表示可以是固定连接,也可以是一体地连接或可拆卸连接;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的相关科研或技术人员,可以根据具体情况确定上述术语在本实公开中的具体含义,不能理解为对本公开的限制。In this disclosure, terms such as "fixed", "connected", and "connected" should be interpreted in a broad sense, which means that they can be fixedly connected, integrally connected or detachably connected; they can be connected directly or through an intermediate connection. The medium is indirectly connected. For relevant researchers or technical personnel in the field, the specific meanings of the above terms in the present disclosure can be determined according to specific situations, and should not be construed as limitations on the present disclosure.
在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。In the case of no conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other.
实施例一Embodiment one
本公开实施例一介绍了一种天然气输气管网系统动态仿真的求解方法。
本实施例提供了一种基于离散化网格和线性化的输气网络偏微分方程模型动态仿真求解方法,求解变量为气体压力p和气体的质量流量q。本方法将输气网络动态仿真模型的求解分为三个阶段,首先,第一阶段识别输气网络的拓扑结构并构建输气管道偏微分方程模型。在该阶段,识别每根管道末端的连接管道数或连接负荷,建立连接管道之间的对应关系,并建立简化后的由压力和质量流量描述的输气管道偏微分方程模型;然后,第二阶段将输气网络的所有管道划分为网格,进而对偏微分方程模型进行离散化和线性化,将偏微分方程组转化为线性方程组,并基于第一阶段的拓扑信息设置需要迭代求解的变量;最后,第三阶段对所有需要迭代求解的变量,基于离散后的线性化方程模型,推导对应的误差方程和修正方程,构建线性方程组并进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量。重复最后阶段,逐步实现对给定初始稳态条件下,规定时间段内的输气网络的节点气压和管道质量流量的动态仿真。This embodiment provides a dynamic simulation solution method for a partial differential equation model of a gas transmission network based on discretized grids and linearization, and the solution variables are gas pressure p and gas mass flow rate q. This method divides the solution of the dynamic simulation model of the gas transmission network into three stages. First, the first stage identifies the topological structure of the gas transmission network and constructs a partial differential equation model of the gas transmission pipeline. In this stage, identify the number of connected pipes or connected loads at the end of each pipe, establish the corresponding relationship between connected pipes, and establish a simplified partial differential equation model of the gas pipeline described by pressure and mass flow rate; then, the second In the first stage, all the pipelines of the gas transmission network are divided into grids, and then the partial differential equation model is discretized and linearized, and the partial differential equations are transformed into linear equations, and based on the topological information of the first stage, the iterative solutions are set. Finally, in the third stage, for all the variables that need to be solved iteratively, based on the discretized linearized equation model, the corresponding error equation and correction equation are derived, and the linear equations are constructed and solved iteratively to obtain the gas transmission under the same time layer Air pressure and mass flow at each mesh node of the network. Repeat the final stage to gradually realize the dynamic simulation of the node pressure and pipeline mass flow of the gas transmission network within a specified period of time under the given initial steady-state conditions.
如图1所示的一种天然气输气管网系统动态仿真的求解方法,包括:As shown in Figure 1, a solution method for dynamic simulation of a natural gas transmission pipeline network system includes:
获取天然气输气网络的拓扑结构,搭建输气管道动态偏微分方程;Obtain the topological structure of the natural gas transmission network, and construct the dynamic partial differential equation of the gas transmission pipeline;
对所搭建的偏微分方程进行离散化和线性化处理,得到线性方程组;Discretize and linearize the constructed partial differential equations to obtain a system of linear equations;
对所得到的线性方程组进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量,预测输气网络的节点气压和管道流量,完成天然气输气管网系统的动态仿真。Iteratively solve the obtained linear equations, obtain the air pressure and mass flow at each grid node of the gas transmission network under the same time layer, predict the node air pressure and pipeline flow of the gas transmission network, and complete the natural gas transmission pipeline network system Dynamic simulation.
作为一种或多种实施方式,识别输气网络的拓扑结构,构建输气管道动态偏微分方程模型。识别各管道之间的连接关系并统计各管道末端的负荷情况。基于质量守恒定律、牛顿第二运动定律(动量守恒定律)、热力学第一定律(能量守恒定律)和真实气体定律,建立输气管道偏微分方程模型,并采用一般性假设进行简化,可以得到由气体压力p(t,x)和质量流量q(t,x)描述的输气管道偏微分方程模型:As one or more implementations, the topological structure of the gas transmission network is identified, and a dynamic partial differential equation model of the gas transmission pipeline is constructed. Identify the connection relationship between each pipeline and count the load at the end of each pipeline. Based on the law of conservation of mass, Newton's second law of motion (law of conservation of momentum), the first law of thermodynamics (law of conservation of energy) and the real gas law, a gas pipeline partial differential equation model is established and simplified by general assumptions, which can be obtained by Gas pipeline partial differential equation model described by gas pressure p(t,x) and mass flow q(t,x):
其中,t代表时间,x代表沿管道轴线方向的距离,p代表气压,D代表管道内径,A代表管道横截面积,λ代表管道摩阻系数,Z代表气体压缩系数,R代表气体常数,T代表温度,q代表质量流量。在本实施例中,假设管道内的气流量方向不变,因此质量流量用标量表示。Among them, t represents time, x represents the distance along the axis of the pipe, p represents the air pressure, D represents the inner diameter of the pipe, A represents the cross-sectional area of the pipe, λ represents the friction coefficient of the pipe, Z represents the gas compression coefficient, R represents the gas constant, T Represents temperature, q represents mass flow. In this embodiment, it is assumed that the direction of the gas flow in the pipeline is constant, so the mass flow is represented by a scalar.
作为一种或多种实施方式,选取合适的空间步长和时间步长,将输气网络的所有管道划分为网格。对偏微分方程模型进行离散化和线性化;划分后的网格示意图如图2所示,n为节点的编号,(pn,qn)表示网格节点n处储存的气压和质量流量,qi和qj表示各分支管道的首端流量。As one or more implementations, an appropriate space step and time step are selected to divide all pipelines in the gas transmission network into grids. Discretize and linearize the partial differential equation model; the schematic diagram of the divided grid is shown in Figure 2, n is the number of the node, (p n , q n ) represents the air pressure and mass flow stored at the grid node n, q i and q j represent the head-end flow of each branch pipeline.
稳态时,管道内气体压力不随时间变化,仅是空间位置的函数。气体流量不随时间和空间变化,为常数。从而可以忽略式(1)的第一个方程以及第二个方程中的时间导数项,对空间偏导数离散,得到稳态条件下的管道压力计算公式:In the steady state, the gas pressure in the pipeline does not change with time, but is only a function of the spatial position. The gas flow does not change with time and space and is constant. Therefore, the first equation of formula (1) and the time derivative term in the second equation can be ignored, and the space partial derivative can be discretized to obtain the pipeline pressure calculation formula under steady-state conditions:
式中,和/>代表稳态时网格节点n和n-1处的气体压力,/>表示稳态时第i根管道的质量流量。为简化表达式,定义两个常系数a=ZRT和/> In the formula, and /> represents the gas pressure at grid nodes n and n-1 at steady state, /> Indicates the mass flow rate of the i-th pipe at steady state. To simplify the expression, define two constant coefficients a=ZRT and />
基于节点类型的不同,即节点所处管道位置的不同,采用如下所示不同的离散格式:Based on the different node types, that is, the different positions of the nodes in the pipeline, different discrete formats are used as follows:
对于管道中间的网格节点,采用如下所示离散格式:For mesh nodes in the middle of the pipeline, the discretization format is as follows:
对于管道首端节点和管道末端节点,采用如下所示离散格式:For the pipeline start node and pipeline end node, the following discrete formats are used:
为简化表达,定义常数:To simplify the expression, define constants:
式中,Δx表示离散的空间步长,Δt表示离散的时间步长。需要注意的是,为简化表示,忽略本时刻待求变量的上标t,而上标t-1则表示上一时刻的对应变量的值,在本时刻的求解过程中为常数。In the formula, Δx represents the discrete space step, and Δt represents the discrete time step. It should be noted that, in order to simplify the expression, the superscript t of the variable to be calculated at this moment is ignored, and the superscript t-1 indicates the value of the corresponding variable at the previous moment, which is a constant during the solution process at this moment.
作为一种或多种实施方式,设置需要迭代求解的变量,建立迭代变量矩阵。除气源节点气压已知,负荷节点流量已知外,其他网格节点的气压和流量均为待求量,但是注意,在本实施例中待求量并不需要全部进行迭代求解。As one or more implementation manners, variables that need to be solved iteratively are set, and an iterative variable matrix is established. Except for the air pressure of the gas source node and the known flow rate of the load node, the air pressure and flow rate of other grid nodes are the required quantities, but it should be noted that in this embodiment, all the required quantities do not need to be iteratively solved.
根据公式(3)和(4),对于一根管道而言,在给定上个时刻已知量和本时刻气压分布后,可以直接计算出本时刻的流量分布,因此只需将气压作为迭代求解变量;对于网络而言,以图2为例,从管道末端流向各分支管道的流量也是未知的,因此,除气压外还需要将各分支管道首端流量作为迭代求解变量。即对离散后的输气管网,除气源节点压力已知外,将其他离散网格节点的压力作为迭代求解变量,建立压力变量矩阵;根据拓扑识别,除连接气源的管道外,将其他管道的首端流量作为迭代求解变量,建立流量变量矩阵。According to formulas (3) and (4), for a pipeline, given the known quantity at the previous time and the air pressure distribution at this time, the flow distribution at this time can be directly calculated, so it is only necessary to use the air pressure as an iterative Solution variables; for the network, taking Figure 2 as an example, the flow from the end of the pipeline to each branch pipeline is also unknown. Therefore, in addition to the air pressure, the flow at the head end of each branch pipeline needs to be used as an iterative solution variable. That is, for the discrete gas pipeline network, except for the known gas source node pressure, the pressure of other discrete grid nodes is used as the iterative solution variable to establish the pressure variable matrix; according to the topology identification, except for the pipeline connected to the gas source, The head-end flow of other pipelines is used as the iterative solution variable to establish the flow variable matrix.
利用稳态压力公式和给定的稳态气体质量流量,计算各网格节点的稳态节点压力,作为网络动态仿真的初始状态。Using the steady-state pressure formula and the given steady-state gas mass flow rate, the steady-state node pressure of each grid node is calculated as the initial state of the network dynamic simulation.
作为一种或多种实施方式,为简化表示,定义如下常系数:As one or more implementations, for simplified representation, the following constant coefficients are defined:
以管道中间节点为例说明,中间节点与其相邻的两个节点的方程均采用(3)所示离散格式,即得:Taking the middle node of the pipeline as an example, the equations of the middle node and its two adjacent nodes all adopt the discrete format shown in (3), that is:
如果假设压力分布为p*并代入(7),由于p*不准确而产生误差:If the pressure distribution is assumed to be p * and substituted into (7), an error occurs due to the inaccuracy of p * :
在此需要定义网格点压力和流量修正值:Here the grid point pressure and flow correction values need to be defined:
式中,qi表示本时刻第i根管道设置的需要迭代求解的管道首端质量流量,为该变量的假设值。在之后的迭代求解步骤中,会将对应变量上一时刻的值作为本时刻的假设初始值。In the formula, q i represents the mass flow rate at the head end of the pipeline that needs to be solved iteratively for the i-th pipeline at this moment, is the hypothetical value of this variable. In the subsequent iterative solution step, the value of the corresponding variable at the previous moment will be used as the assumed initial value at this moment.
基于公式(7)和公式(8):Based on formula (7) and formula (8):
C2*p′n-dp′n+2-dp′n-2=-En (10)C2*p' n -dp' n+2 -dp' n-2 = -E n (10)
公式(8)和公式(10)分别为节点气压误差方程和节点气压修正方程。同理可以建立其他节点的压力误差方程和压力修正方程。下面直接给出几种特殊节点的误差和修正方程,其结构与中间节点不同,但是本质都是由(3)和(4)离散格式推导而来,因此不再做具体说明。Formula (8) and formula (10) are the node pressure error equation and the node pressure correction equation respectively. In the same way, the pressure error equation and pressure correction equation of other nodes can be established. The error and correction equations of several special nodes are directly given below. Their structures are different from those of intermediate nodes, but they are essentially derived from the discrete format of (3) and (4), so no specific explanation will be given.
管道末端节点:Pipe end node:
式中,表示管道末端节点连接的k根分支管道首端流量假设值之和,也即该末端节点的质量流量的假设值,注意当管道末端连接负荷时,该项对应的变量转化为常量。In the formula, Indicates the sum of the hypothetical values of the head-end flow of the k-branch pipeline connected to the end node of the pipeline, that is, the assumed value of the mass flow rate of the end node. Note that when the end of the pipeline is connected to a load, the corresponding variable of this item is converted into a constant.
管道末端节点的上一个节点:The previous node of the end node of the pipeline:
列举该节点的方程是为了说明虽然其误差方程和修正方程的结构与末端节点一致,但由于本发明在方程推导时规定采用的离散格式不同,相应的系数会发生变化。The equation of this node is listed to illustrate that although the structure of its error equation and correction equation is consistent with that of the terminal node, the corresponding coefficients will change due to the different discrete formats used in the derivation of the equations in the present invention.
管道首端节点(气源节点除外):Pipeline head-end nodes (except gas source nodes):
C4*p′n-dp′n+2+q′i=-En (16)C4*p′ n -dp′ n+2 +q′ i =-E n (16)
由于设置的迭代求解的流量变量均为对应管道首端的流量,变量与对应管道的前接管道的末端节点和对应管道的首端节点相关,采用式(4)的离散格式,其误差方程和修正方程为:Since the flow variables of the set iterative solution are all the flow at the head end of the corresponding pipeline, and the variables are related to the end node of the preceding pipeline of the corresponding pipeline and the head node of the corresponding pipeline, the discrete format of formula (4) is adopted, and the error equation and correction The equation is:
q′i-2dp′i,1+2dp′i,2=-Ei (18)q′ i -2dp′ i,1 +2dp′ i,2 =-E i (18)
式中,和/>分别代表第i根管道的前接管道的末端节点气压和第i根管道的首端节点气压。In the formula, and /> Represent the air pressure at the end node of the preceding pipeline of the i-th pipeline and the air pressure at the head-end node of the i-th pipeline, respectively.
如图3所示的迭代求解的流程图,在迭代求解的过程中,将上一时刻的节点气压和质量流量作为本时刻待求变量的假设值p*和q*,即迭代的初始值;通过节点气压误差方程和流量误差方程计算误差,判断所计算的误差与容许值之间的大小关系,若所得到的误差小于容许值,则基于迭代求解后的气压和流量,计算剩余节点的流量,完成天然气输气管网系统的动态仿真求解;若所得到的误差不小于容许值,则构建线性修正方程组,通过矩阵运算求解,得到修正变量,根据所得到的修正变量重新计算误差,直到所得到的误差小于容许值为止;即实现给定时间段内的输气管网的动态仿真。The flow chart of iterative solution shown in Figure 3, in the process of iterative solution, the node air pressure and mass flow at the previous moment are used as the hypothetical values p * and q * of the variables to be obtained at this moment, that is, the initial value of iteration; Calculate the error through the node pressure error equation and flow error equation, and judge the size relationship between the calculated error and the allowable value. If the obtained error is less than the allowable value, calculate the flow of the remaining nodes based on the air pressure and flow after iterative solution. , to complete the dynamic simulation solution of the natural gas transmission pipeline network system; if the obtained error is not less than the allowable value, construct a linear correction equation group, solve it by matrix operation, and obtain the correction variable, and recalculate the error according to the obtained correction variable until Until the obtained error is less than the allowable value; that is, to realize the dynamic simulation of the gas pipeline network within a given period of time.
本实施例基于线性化和离散化网格方法将描述输气网络动态仿真的偏微分方程组模型转化为线性方程组模型,提高模型求解速度,并通过迭代求解保证精度。所提的方法与传统方法相比提高了仿真求解的稳定性,减少了所需求解的变量数目,并能够实现对动态过程的良好拟合。In this embodiment, based on the linearization and discretization grid method, the partial differential equation model describing the dynamic simulation of the gas transmission network is transformed into a linear equation model, so as to improve the speed of model solution and ensure the accuracy through iterative solution. Compared with the traditional method, the proposed method improves the stability of the simulation solution, reduces the number of variables to be solved, and can achieve a good fitting of the dynamic process.
实施例二Embodiment two
本公开实施例二介绍了一种天然气输气管网系统动态仿真的求解系统。
如图4所示的一种天然气输气管网系统动态仿真的求解系统,包括:As shown in Figure 4, a solution system for dynamic simulation of a natural gas transmission pipeline network system includes:
获取模块,其被配置为获取天然气输气网络的拓扑结构,搭建输气管道动态偏微分方程;The obtaining module is configured to obtain the topology structure of the natural gas transmission network, and construct the dynamic partial differential equation of the gas transmission pipeline;
处理模块,其被配置为对所搭建的偏微分方程进行离散化和线性化处理,得到线性方程组;A processing module configured to perform discretization and linearization processing on the built partial differential equations to obtain a linear equation system;
求解模块,其被配置为对所得到的线性方程组进行迭代求解,得到同一时层下的输气网络各网格节点处的气压和质量流量,预测输气网络的节点气压和管道流量,完成天然气输气管网系统的动态仿真。The solution module is configured to iteratively solve the obtained linear equations to obtain the air pressure and mass flow at each grid node of the gas transmission network under the same time layer, predict the node air pressure and pipeline flow of the gas transmission network, and complete Dynamic simulation of natural gas transmission pipeline network system.
详细步骤与实施例一提供的天然气输气管网系统动态仿真的求解方法相同,在此不再赘述。The detailed steps are the same as the solution method of the dynamic simulation of the natural gas transmission pipeline network system provided in
实施例三Embodiment three
本公开实施例三提供了一种计算机可读存储介质。Embodiment 3 of the present disclosure provides a computer-readable storage medium.
一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如本公开实施例一所述的天然气输气管网系统动态仿真的求解方法中的步骤。A computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the steps in the method for solving the dynamic simulation of the natural gas transmission pipeline network system according to
详细步骤与实施例一提供的天然气输气管网系统动态仿真的求解方法相同,在此不再赘述。The detailed steps are the same as the solution method of the dynamic simulation of the natural gas transmission pipeline network system provided in
实施例四Embodiment Four
本公开实施例四提供了一种电子设备。Embodiment 4 of the present disclosure provides an electronic device.
一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的程序,所述处理器执行所述程序时实现如本公开实施例一所述的天然气输气管网系统动态仿真的求解方法中的步骤。An electronic device, including a memory, a processor, and a program stored in the memory and operable on the processor, when the processor executes the program, the natural gas transmission pipeline network system according to
详细步骤与实施例一提供的天然气输气管网系统动态仿真的求解方法相同,在此不再赘述。The detailed steps are the same as the solution method of the dynamic simulation of the natural gas transmission pipeline network system provided in
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。The above descriptions are only preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.
上述虽然结合附图对本公开的具体实施方式进行了描述,但并非对本公开保护范围的限制,所属领域技术人员应该明白,在本公开的技术方案的基础上,本领域技术人员不需要付出创造性劳动即可做出的各种修改或变形仍在本公开的保护范围以内。Although the specific implementation of the present disclosure has been described above in conjunction with the accompanying drawings, it does not limit the protection scope of the present disclosure. Those skilled in the art should understand that on the basis of the technical solutions of the present disclosure, those skilled in the art do not need to pay creative work Various modifications or variations that can be made are still within the protection scope of the present disclosure.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211397298.5A CN115688340B (en) | 2022-11-09 | 2022-11-09 | Method and system for solving dynamic simulation of natural gas transmission pipe network system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211397298.5A CN115688340B (en) | 2022-11-09 | 2022-11-09 | Method and system for solving dynamic simulation of natural gas transmission pipe network system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115688340A CN115688340A (en) | 2023-02-03 |
CN115688340B true CN115688340B (en) | 2023-06-02 |
Family
ID=85049522
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211397298.5A Active CN115688340B (en) | 2022-11-09 | 2022-11-09 | Method and system for solving dynamic simulation of natural gas transmission pipe network system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115688340B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN120012334B (en) * | 2025-04-16 | 2025-07-01 | 山东大学 | Natural gas pipe network system simulation method, system and medium based on parameter reconstruction |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112084689A (en) * | 2020-08-25 | 2020-12-15 | 中海油田服务股份有限公司 | Unsteady state seepage simulation method and system for natural gas reservoir |
CN113221428A (en) * | 2021-06-01 | 2021-08-06 | 昆明理工大学 | Rapid decomposition method for dynamic energy flow calculation of electricity-heat comprehensive energy system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102779198B (en) * | 2011-05-13 | 2015-01-21 | 中国石油天然气股份有限公司 | Method for establishing dynamic simulation system of natural gas pipe network conveying system |
CN111259547B (en) * | 2020-01-16 | 2021-12-03 | 清华大学 | Natural gas path modeling method for operation control of comprehensive energy system |
CN114239199B (en) * | 2021-12-08 | 2024-09-27 | 天津大学 | Steam pipe network dynamic simulation method considering condensed water |
CN114880817B (en) * | 2022-03-19 | 2025-05-09 | 清华大学 | Gas pipeline dynamic hydraulic prediction method, device, electronic equipment and storage medium |
-
2022
- 2022-11-09 CN CN202211397298.5A patent/CN115688340B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112084689A (en) * | 2020-08-25 | 2020-12-15 | 中海油田服务股份有限公司 | Unsteady state seepage simulation method and system for natural gas reservoir |
CN113221428A (en) * | 2021-06-01 | 2021-08-06 | 昆明理工大学 | Rapid decomposition method for dynamic energy flow calculation of electricity-heat comprehensive energy system |
Also Published As
Publication number | Publication date |
---|---|
CN115688340A (en) | 2023-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112069692B (en) | An Optimal Solution Method for Calculation of Transmission Difference in Natural Gas Pipeline Network | |
CN102063566B (en) | Multi-gas-source steam pipe network computing system of hydraulic thermal-coupling simulation model | |
CN111209703B (en) | Regional steam heating network topology optimization method and system considering delay | |
CN111709171A (en) | An isogeometric solution and heat dissipation topology generation method for strongly coupled heat flow problem | |
CN113111515B (en) | Unified modeling method of comprehensive energy system | |
CN111259547A (en) | A Natural Gas Path Modeling Method for Operation Control of Integrated Energy System | |
CN114117819A (en) | Method, system, equipment and medium for simulating steady state of hot steam network | |
CN115688340B (en) | Method and system for solving dynamic simulation of natural gas transmission pipe network system | |
CN115079592A (en) | A simulation method of thermal system pipeline network of ship nuclear power plant | |
CN111783309A (en) | Dynamic Simulation Method of Steam Heating Network Based on Internal Conservation | |
CN118335211B (en) | A method for constructing a dynamic thickening flame model optimized by artificial intelligence | |
CN112861448B (en) | Solving method and device for section linear performance flow model of electric-gas coupling system | |
CN114896891A (en) | A steam simulation calculation method based on kernel extreme learning machine error correction | |
CN114880817A (en) | Gas pipeline dynamic hydraulic prediction method, device, electronic device and storage medium | |
CN114943192A (en) | Method for calculating unsteady steady solution of airfoil flow based on reduced order model and gradient optimization | |
CN109948197A (en) | System optimization analysis method based on AADL V1 | |
CN113962131A (en) | Method for efficiently simulating flowing heat transfer of large natural gas pipe network | |
CN117709034A (en) | C# based pipe network system topology graph construction method and computer equipment | |
CN116384199A (en) | Thermal solution method, equipment, storage medium and products for transient simulation based on finite difference | |
CN114021490B (en) | A dynamic full analysis method for hot water network | |
CN113269449B (en) | Node-level decentralized method for gas source supply flow scheduling in natural gas systems | |
CN117150734A (en) | Multi-energy network digital twin real-time simulation system and method based on pure embedding | |
CN115292827A (en) | Optimization and design method of two-fluid porous heat exchanger based on three-period minimal surface | |
CN109002419B (en) | Dynamic analysis method and device for natural gas pipe network | |
CN117332725B (en) | Steam network dynamic calculation method and device of comprehensive energy system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |