CN103970610A - Method for monitoring node flow of water supply network - Google Patents
Method for monitoring node flow of water supply network Download PDFInfo
- Publication number
- CN103970610A CN103970610A CN201410184642.1A CN201410184642A CN103970610A CN 103970610 A CN103970610 A CN 103970610A CN 201410184642 A CN201410184642 A CN 201410184642A CN 103970610 A CN103970610 A CN 103970610A
- Authority
- CN
- China
- Prior art keywords
- node
- matrix
- flow
- water supply
- diagonal matrix
- 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.)
- Pending
Links
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明公开了一种供水管网中节点流量的监控方法,包括以下步骤:根据供水管网的流量和水头的损失关系,构建供水管网的原始系统方程组;对原始系统方程组的系数矩阵进行分解,得到一个带状对角矩阵和一个残余矩阵,然后将所述的带状对角矩阵划分为若干个小带状对角矩阵;将各个小带状对角矩阵分别同时与所述的残余矩阵结合,得到供水管网中所有节点的初始流量值;将所有节点的初始流量值作为供水系统的初始输入,迭代至得到所有节点的最终流量值。本发明利用矩阵分解来充分利用计算机GPU的超强并行计算能力,加快供水管网中节点流量计算时的迭代收敛速度,得到节点流量的实时数据,实现对节点流量的监控。The invention discloses a method for monitoring node flow in a water supply pipe network, comprising the following steps: constructing an original system equation group of the water supply pipe network according to the loss relationship between the flow rate of the water supply pipe network and the water head; and the coefficient matrix of the original system equation group Decompose to obtain a banded diagonal matrix and a residual matrix, then divide the banded diagonal matrix into several small banded diagonal matrices; each small banded diagonal matrix is respectively simultaneously with the described Combine the residual matrix to obtain the initial flow values of all nodes in the water supply network; take the initial flow values of all nodes as the initial input of the water supply system, and iterate until the final flow values of all nodes are obtained. The invention utilizes matrix decomposition to make full use of the super parallel computing capability of the computer GPU, accelerates the iterative convergence speed when calculating the node flow in the water supply pipe network, obtains real-time data of the node flow, and realizes the monitoring of the node flow.
Description
技术领域technical field
本发明涉及城市给排水领域,具体涉及一种供水管网中节点流量的监控方法。The invention relates to the field of urban water supply and drainage, in particular to a method for monitoring node flow in a water supply pipe network.
背景技术Background technique
我国城市中的供水管网、石油炼化企业的原油管网、农田水力管网、供汽管网、供热管网等非常发达,而且这些管网的规模都很大,管网的节点压力、流体成份等是管网日常维护中必须掌控的运行参数。The water supply pipeline network in my country's cities, the crude oil pipeline network of petroleum refining and chemical enterprises, the farmland hydraulic pipeline network, the steam supply pipeline network, and the heat supply pipeline network are very developed, and the scale of these pipeline networks is very large, and the node pressure of the pipeline network , Fluid composition, etc. are the operating parameters that must be controlled in the daily maintenance of the pipeline network.
准确实时地分析模拟这些运行参数是所有管网维护面临的共性问题,解决该共性问题的关键是流体管网力学及成份高效实时动态仿真技术,这些技术的应用可以为管网的日常维护提供提前规划、实时动态管理、事后应急、安全控制、节能减排等功能。Accurate and real-time analysis and simulation of these operating parameters is a common problem faced by all pipeline network maintenance. The key to solving this common problem is the efficient real-time dynamic simulation technology of fluid pipeline network mechanics and components. The application of these technologies can provide advance Planning, real-time dynamic management, post-event emergency response, safety control, energy saving and emission reduction and other functions.
目前流体管网的管理主要采用以下方式:At present, the management of the fluid pipe network mainly adopts the following methods:
第一类是人工设计计算,基于人工采样和手工计算。这种方式较为落后,效率很低,手工计算繁琐,错误率高,而且只能计算小范围的管网,无法对大范围的管网进行统一的计算,通常会导致顾此失彼,难以做到统筹兼顾。The first category is artificial design calculations, based on manual sampling and manual calculations. This method is relatively backward, the efficiency is very low, the manual calculation is cumbersome, the error rate is high, and it can only calculate a small-scale pipe network, and cannot perform a unified calculation for a large-scale pipe network. .
第二类是应用计算机进行管网的设计计算,这也是目前应用最为广泛的方式。但这种方式目前也存在一个较大的问题,就是当管网规模较大的时候,运行速度不尽如人意,严重影响了管网数据的分析速度,随着管网规模的扩大,管网力学、成份的实时动态模拟几乎不可能,例如一般4000个节点的管网力学模拟计算需要12G的内存以及大约30分钟的迭代逼近才能够比较准确地模拟实际情况。The second category is the application of computers to design and calculate pipe networks, which is currently the most widely used method. However, there is still a big problem with this method at present, that is, when the scale of the pipe network is large, the running speed is not satisfactory, which seriously affects the analysis speed of the pipe network data. With the expansion of the pipe network scale, the pipe network Real-time dynamic simulation of mechanics and components is almost impossible. For example, a general 4,000-node pipe network mechanics simulation calculation requires 12G of memory and about 30 minutes of iterative approximation to accurately simulate the actual situation.
导致运行速度慢的原因主要有两个,第一就是目前大多数方法在解大规模方程组的时候,迭代次数太多,有时候甚至根本无法收敛;第二就是受限于目前CPU的运行速度,使得计算速度无法再进行提升,因此如何找到解决这两个问题的技术方案,并将其应用于实际工程中,就变得至关重要。There are two main reasons for the slow running speed. The first is that most current methods have too many iterations when solving large-scale equations, and sometimes they cannot converge at all; the second is that they are limited by the current running speed of the CPU. , so that the calculation speed can no longer be improved, so how to find a technical solution to these two problems and apply it to practical engineering becomes very important.
目前已经有很多水力水质分析的软件,它们大多运用了上面提到的技术,这些软件都可以解决成千上万根管段的水力计算问题。由美国环境保护总署国家风险管理研究实验室开发,主要应用于有压管网系统的水力和水质分析的软件,具有管网平差、运行模拟、信息管理、运行管理等方面的功能。它基于解节点方程的方法,可对管网不经过简化处理直接建模,减少了计算所需要的时间和存储单元,基于其应用的方便性和直观性被越来越广泛地应用于有压管网系统的平差计算。At present, there are many hydraulic and water quality analysis software, most of which use the technology mentioned above, and these software can solve the hydraulic calculation problems of thousands of pipe sections. Developed by the National Risk Management Research Laboratory of the United States Environmental Protection Agency, it is mainly used in the hydraulic and water quality analysis software of pressurized pipe network systems. It has the functions of pipe network adjustment, operation simulation, information management, and operation management. Based on the method of solving node equations, it can directly model the pipe network without simplification, reducing the time and storage units required for calculation. Based on its convenience and intuitiveness, it is more and more widely used in pressure Adjustment calculation for pipe network systems.
SynerGEE Gas可以对管网、调压器、阀门、压缩机、储气田和集气井进行仿真建模和分析,SynerGEE Gas作为一种通用型管网仿真工具,适用于天然气、丙烷、蒸汽、氧气、二氧化碳、氮气、氯气和空气,并且不仅限于此。SynerGEE Gas提供了最先进的商业化管道仿真器所具有的功能,并可在简易而熟悉的windows操作系统上运行。SynerGEE Gas can perform simulation modeling and analysis on pipeline networks, pressure regulators, valves, compressors, gas storage fields and gas gathering wells. As a general-purpose pipeline network simulation tool, SynerGEE Gas is suitable for natural gas, propane, steam, oxygen, Carbon dioxide, nitrogen, chlorine, and air, but not limited to. SynerGEE Gas provides the functionality of the most advanced commercial pipeline simulators and runs on the easy and familiar windows operating system.
目前上述系统在应用于巨型管网的模拟仿真方面都存在速度太慢,效率太低的问题。未来的面向管网的仿真软件的发展方向是:通过并行运算提高模拟仿真的速度和效率,增强软件在实时动态仿真巨型管网的各种力学以及成分的能力,为提前规划、事前预警、动态监测、安全应急等应用提供及时高效的软件支撑。At present, the above-mentioned systems are too slow and inefficient when applied to the simulation of giant pipe networks. The future development direction of simulation software for pipeline networks is to improve the speed and efficiency of simulation through parallel computing, and enhance the ability of the software to dynamically simulate various mechanics and components of giant pipeline networks in real time. Provide timely and efficient software support for monitoring, security emergency and other applications.
发明内容Contents of the invention
本发明提供了一种供水管网中节点流量的监控方法,利用矩阵分解来充分利用计算机GPU的超强并行计算能力,加快供水管网中节点流量计算时的迭代收敛速度,得到节点流量的实时数据,实现对节点流量的监控。The invention provides a monitoring method for node flow in a water supply pipe network, which uses matrix decomposition to fully utilize the super parallel computing capability of a computer GPU, speeds up the iterative convergence speed when calculating node flow in a water supply pipe network, and obtains real-time information on node flow. data to monitor node traffic.
一种供水管网中节点流量的监控方法,包括以下步骤:A method for monitoring node flow in a water supply network, comprising the following steps:
(1)根据供水管网的流量和水头的损失关系,构建供水管网的原始系统方程组。(1) According to the relationship between the flow rate and head loss of the water supply network, construct the original system equations of the water supply network.
根据实际数据构建给定时间点,供水管网的水力状态的流量连续性方程和水头损失原始系统方程组,所述原始系统方程组为:Construct the flow continuity equation and head loss original system equations of the hydraulic state of the water supply pipe network at a given time point according to the actual data, and the original system equations are:
AH=FAH=F
式中:A为N×N的雅可比矩阵;H为N×1的供水管网中未知节点水头的向量矩阵;F为N×1的常数项向量矩阵,N为连接节点的总数;In the formula: A is the Jacobian matrix of N×N; H is the vector matrix of unknown node water head in the N×1 water supply network; F is the vector matrix of N×1 constant items, and N is the total number of connected nodes;
所述雅可比矩阵的对角线元素为:Aii=∑jPij;The diagonal elements of the Jacobian matrix are: A ii =∑ j P ij ;
所述雅可比矩阵的非零且非对角线元素为Aij=-Pij;The non-zero and off-diagonal elements of the Jacobian matrix are A ij =-P ij ;
式中:Pij表示节点i和节点j之间管段水头损失对于流量求导的倒数,对于节点i和节点j之间的管道: In the formula: P ij represents the reciprocal of the flow derivation of the head loss between node i and node j, for the pipeline between node i and node j:
式中:r为阻力系数;Qij为节点i到节点j的流量;n为流量指数;m为局部损失系数;In the formula: r is the resistance coefficient; Q ij is the flow from node i to node j; n is the flow index; m is the local loss coefficient;
对于节点i和节点j之间的水泵: For a pump between node i and node j:
式中:ω为水泵的相对转速;Qij为节点i到节点j的流量;s和t表示水泵的曲线系数;In the formula: ω is the relative speed of the water pump; Q ij is the flow rate from node i to node j; s and t represent the curve coefficients of the water pump;
常数项向量矩阵F中的各项元素为:The elements in the constant item vector matrix F are:
Fij=(∑jQij-Di)+∑jyij+∑fPifHf F ij =(∑ j Q ij -D i )+∑ j y ij +∑ f P if H f
式中:Di表示节点i的需水量;In the formula: D i represents the water demand of node i;
yij为流量校正因子,对于节点i和节点j之间的管道:y ij is the flow correction factor, for the pipeline between node i and node j:
yij=Pij(r|Qij|n+m|Qij|2)sgn(Qij)y ij =P ij (r|Q ij | n +m|Q ij | 2 )sgn(Q ij )
对于节点i和节点j之间的水泵:For a pump between node i and node j:
Hf为已知的节点f的节点水头;H f is the known node water head of node f;
h0为水泵的虚总扬程;h 0 is the virtual total lift of the pump;
Pif表示将节点i连接至已知水头的节点f的管段水头损失对于流量求导的倒数。P if represents the inverse of the derivative of the head loss with respect to flow for the link linking node i to node f of known head.
sgn(Qij)中,当Qij>0时,sgn(Qij)取值为1,Qij对于水泵而言总为正。In sgn(Q ij ), when Q ij >0, the value of sgn(Q ij ) is 1, and Q ij is always positive for the water pump.
(2)对原始系统方程组的系数矩阵进行分解,得到一个带状对角矩阵和一个残余矩阵,然后将所述的带状对角矩阵划分为若干个小带状对角矩阵。(2) Decomposing the coefficient matrix of the original system of equations to obtain a banded diagonal matrix and a residual matrix, and then dividing the banded diagonal matrix into several small banded diagonal matrices.
对原始系统方程组AH=F的系数矩阵A进行分解的具体操作如下:The specific operation of decomposing the coefficient matrix A of the original system of equations AH=F is as follows:
将系数矩阵A中每一行的第一个和最后一个不为零的元素设为零,得到带状对角矩阵D;保留系数矩阵A中每一行的第一个和最后一个不为零的元素,其余元素设为零,得到残余矩阵R;Set the first and last non-zero elements of each row in the coefficient matrix A to zero to obtain a banded diagonal matrix D; retain the first and last non-zero elements of each row in the coefficient matrix A , the rest of the elements are set to zero, and the residual matrix R is obtained;
将带状对角矩阵D进一步划分为h个小带状对角矩阵Di,如下所示:The banded diagonal matrix D is further divided into h small banded diagonal matrices D i , as follows:
若带状对角矩阵D的行数为m,则每一个小带状对角矩阵Di的行数C=[m/h],i<h的小带状对角矩阵Di由带状对角矩阵D中的第(i-1)×C+1到第i×C行中每一行第一个不为零的元素到最后一个不为零的元素构成;小带状对角矩阵Dh由带状对角矩阵D中的第i×C+1到第m行中每一行第一个不为零的元素到最后一个不为零的元素构成。If the number of rows of the striped diagonal matrix D is m, then the number of rows of each small striped diagonal matrix Di is C=[m/h], and the small striped diagonal matrix D i of i<h is composed of striped pairs The (i-1)×C+1 to i×C rows in the corner matrix D are formed from the first non-zero element to the last non-zero element in each row; the small banded diagonal matrix D h It is composed of the first non-zero element to the last non-zero element in each row of i×C+1 to m-th row in the banded diagonal matrix D.
(3)将各个小带状对角矩阵分别同时与所述的残余矩阵结合,得到供水管网中所有节点的初始流量值,具体操作如下:(3) Combine each small banded diagonal matrix with the residual matrix at the same time to obtain the initial flow values of all nodes in the water supply network. The specific operations are as follows:
3-1、令残余矩阵R中的奇数行元素取值为零,使残余矩阵R转化为近似残余矩阵 3-1. Let the odd-numbered row elements in the residual matrix R be zero, so that the residual matrix R is converted into an approximate residual matrix
3-2、将每个小带状对角矩阵扩展为与系数矩阵A大小相同的矩阵,作为小带状对角矩阵的近似矩阵 3-2. Expand each small striped diagonal matrix to a matrix with the same size as the coefficient matrix A, as an approximate matrix of the small striped diagonal matrix
将所述的近似残余矩阵和小带状对角矩阵的近似矩阵带入原始系统方程组AH=F中,得到近似系统方程如下所示:The approximate residual matrix and the approximation matrix of the small banded diagonal matrix Bringing it into the original system of equations AH=F, the approximate system equations are obtained as follows:
式中,为任意一个小带状对角矩阵的近似矩阵;In the formula, is an approximate matrix of any small banded diagonal matrix;
为近似残余矩阵, is an approximate residual matrix,
H为N×1的供水管网中未知节点水头的向量矩阵(也即供水管网中所有节点的流量值组成的向量矩阵);H is the vector matrix of the unknown node water head in the N×1 water supply network (that is, the vector matrix composed of the flow values of all nodes in the water supply network);
F为原始系统方程组的常数项向量矩阵;F is the constant term vector matrix of the original system of equations;
3-3、利用式计算得到矩阵G,将矩阵G中所有非零元素对应的节点作为非零节点集合,为的逆矩阵;3-3. Utilization The matrix G is calculated, and the nodes corresponding to all non-zero elements in the matrix G are regarded as a set of non-zero nodes. for the inverse matrix;
3-4、利用所得到的非零节点集合构建小型系统方程组:3-4. Use the obtained non-zero node set to construct a small system of equations:
式中: In the formula:
IZ为单位矩阵;I Z is the identity matrix;
GZ为非零节点集合中所有节点在供水管网中对应的节点的流量值构成的矩阵;G Z is a matrix formed by the flow values of all nodes in the non-zero node set corresponding to the nodes in the water supply network;
为供水管网中与非零节点集合中所有节点对应的节点流量值组成的向量; is a vector composed of node flow values corresponding to all nodes in the non-zero node set in the water supply network;
其中,g1,g2,…gs分别是的第1,2,……s个分量的值,s为非零节点集合中的节点的个数; Among them, g 1 , g 2 ,…g s are respectively The value of the 1st, 2nd, ... s components of , s is the number of nodes in the non-zero node set;
3-5、使用预处理共轭梯度迭代方法求解小型系统方程组,得到非零节点集合中所有节点的初始流量值;对于小带状对角矩阵Di中不属于非零节点集合的节点,以非零节点集合中与该节点距离最小的节点的初始流量值作为该节点的初始流量值,得到各个小带状对角矩阵对应的节点的初始流量值向量H1,H2,…Hh。3-5. Use the preprocessing conjugate gradient iterative method to solve the small system equations, and obtain the initial flow values of all nodes in the non-zero node set; for the nodes in the small banded diagonal matrix D i that do not belong to the non-zero node set, Take the initial flow value of the node with the smallest distance from the node in the non-zero node set as the initial flow value of the node, and obtain the initial flow value vectors H 1 , H 2 ,...H h of the nodes corresponding to each small strip diagonal matrix .
采用GPU的不同线程分别对各个小带状对角矩阵和残余矩阵的结合进行计算,GPU的核数与小带状对角矩阵的个数相等。Different threads of the GPU are used to calculate the combination of each small striped diagonal matrix and the residual matrix, and the number of cores of the GPU is equal to the number of small striped diagonal matrices.
(4)将所有节点的初始流量值作为供水系统的初始输入,迭代至得到所有节点的最终流量值,步骤如下:(4) Take the initial flow values of all nodes as the initial input of the water supply system, iterate until the final flow values of all nodes are obtained, the steps are as follows:
4-1、将初始流量值向量H1,H2,…Hh的每个分量对应的节点的初始流量值作为向量H中该节点对应的分量的取值;4-1. The initial flow value of the node corresponding to each component of the initial flow value vector H 1 , H 2 , ... H h is taken as the value of the component corresponding to the node in the vector H;
4-2、求解原始系统方程组AH=F,得到新的节点水头之后,新的流量为:4-2. Solve the original system equations AH=F, after obtaining the new node water head, the new flow is:
Qij=Qij-(yij-Pij(Hi-Hj))Q ij =Q ij -(y ij -P ij (H i -H j ))
新的流量需满足如下流量连续方程:The new flow rate needs to satisfy the following flow continuity equation:
∑jQij-Di=0;i=1,.......,N;∑ j Q ij - D i = 0; i = 1, ..., N;
式中:Qij为节点i到节点j的流量;Di表示节点i的需水量;N为节点的总个数;In the formula: Q ij is the flow from node i to node j; D i is the water demand of node i; N is the total number of nodes;
4-3、若绝对流量变化之和与所有管段的总流量相比,大于允许的数值,则利用新的流量重新求解矩阵方程AH=F,得到新的流量;4-3. If the sum of absolute flow changes is greater than the allowable value compared with the total flow of all pipe sections, use the new flow to re-solve the matrix equation AH=F to obtain a new flow;
4-4、重复步骤4-3直至绝对流量变化之和与所有管段的总流量相比,不大于允许的数值,得到所有节点的最终流量值。4-4. Repeat step 4-3 until the sum of absolute flow changes is not greater than the allowable value compared with the total flow of all pipe sections, and the final flow value of all nodes is obtained.
本发明供水管网中节点流量的监控方法根据管网的结构数据构建了原始系统方程组,对原始系统方程组的系数矩阵进行分解,产生大小大致相同的带状对角矩阵和残余矩阵;然后将带状对角矩阵划分为若干小带状对角矩阵并分配给GPU的不同线程进行计算,充分利用了GPU的数据并行处理能力,大大提高了运算速率,使巨型管网数据的实时模拟成为可能,且内存消耗低,可扩展到广泛的应用程序中。The monitoring method of the node flow in the water supply pipe network of the present invention constructs the original system equation group according to the structural data of the pipe network, decomposes the coefficient matrix of the original system equation group, and produces a striped diagonal matrix and a residual matrix with approximately the same size; and then The banded diagonal matrix is divided into several small banded diagonal matrices and assigned to different threads of the GPU for calculation, making full use of the data parallel processing capability of the GPU, greatly improving the computing speed, and making the real-time simulation of giant pipe network data a possible, with low memory consumption, and scalable to a wide range of applications.
本发明通过将原始系统方程组的系数矩阵进行分解,对每一个分解得到的小型系统方程组采用并行处理的迭代操作,在得到供水管网中各个节点的初始流量值后,将所有节点的初始流量值作为原始系统的初始值(即输入)代入原始系统方程组直接求解,在外部迭代器中执行一个直接法计算全解,当外部迭代收敛时,完成求解,可以克服直接法和迭代法的缺点,The present invention decomposes the coefficient matrix of the original system equation group, and adopts the iterative operation of parallel processing for each decomposed small system equation group. After obtaining the initial flow value of each node in the water supply network, the initial flow value of all nodes is The flow value is substituted into the original system equations as the initial value (i.e. input) of the original system to solve directly, and a direct method is executed in the external iterator to calculate the full solution. When the external iteration converges, the solution is completed, which can overcome the limitations of the direct method and the iterative method. shortcoming,
比直接解决器的可扩展性能更好,比传统的预处理迭代解决器更健壮。Better scalable performance than direct solvers and more robust than traditional preconditioned iterative solvers.
具体实施方式Detailed ways
下面对本发明供水管网中节点流量的监控方法做详细描述。The method for monitoring node flow in the water supply pipe network of the present invention will be described in detail below.
一种供水管网中节点流量的监控方法,包括以下步骤:A method for monitoring node flow in a water supply network, comprising the following steps:
(1)根据供水管网的流量和水头的损失关系,构建供水管网的原始系统方程组,构建方法参见Mahmoud A.Elsheikh,Hazem I.Saleh,Ibrahim M.Rashwan.Hydraulic modelling of water supply distribution for improving itsquantity and quality.Sustain.Environ.Res.,23(6),403-411(2013)。(1) According to the relationship between the flow rate and head loss of the water supply network, construct the original system equations of the water supply network. For the construction method, see Mahmoud A.Elsheikh, Hazem I.Saleh, Ibrahim M.Rashwan.Hydraulic modeling of water supply distribution for Improving its quantity and quality. Sustain. Environ. Res., 23(6), 403-411 (2013).
在具有N个节点和NF个已知水头节点(即水池和水库)的供水管网中,节点i和节点j之间管道的流量和水头损失关系方程如下:In a water supply network with N nodes and NF known head nodes (i.e., pools and reservoirs), the flow and head loss relationship equation of the pipeline between node i and node j is as follows:
式中:Hi为节点i的节点水头;Hj为节点j的节点水头;hij为节点i到节点j的水头损失;r为阻力系数(取决于使用的沿程水头损失公式);Qij为节点i到节点j的流量;n为流量指数;m为局部损失系数。In the formula: H i is the node head of node i; H j is the node head of node j; h ij is the head loss from node i to node j; r is the drag coefficient (depending on the formula of head loss along the way used); Q ij is the flow from node i to node j; n is the flow index; m is the local loss coefficient.
节点i和节点j之间水泵的流量和水头损失(负的水头)关系方程如下:The relationship equation between the pump flow and head loss (negative head) between node i and node j is as follows:
式中:h0为水泵的虚总扬程;ω为水泵的相对转速;Qij为节点i到节点j的流量;s和t表示水泵的曲线系数。In the formula: h 0 is the virtual head of the pump; ω is the relative speed of the pump; Q ij is the flow rate from node i to node j; s and t represent the curve coefficients of the pump.
根据实际数据构建给定时间点,供水管网的水力状态的流量连续性方程和水头损失原始系统方程组如下:Based on actual data, the flow continuity equation and head loss original system equations of the hydraulic state of the water supply network at a given time point are constructed as follows:
AH=FAH=F
式中:A为N×N的雅可比矩阵;H为N×1的供水管网中未知节点水头的向量矩阵;F为N×1的常数项向量矩阵,N为连接节点的总数;In the formula: A is the Jacobian matrix of N×N; H is the vector matrix of unknown node water head in the N×1 water supply network; F is the vector matrix of N×1 constant items, and N is the total number of connected nodes;
雅可比矩阵的对角线元素为:Aii=∑jPij;The diagonal elements of the Jacobian matrix are: A ii =∑ j P ij ;
雅可比矩阵的非零且非对角线元素为Aij=-Pij;The non-zero and off-diagonal elements of the Jacobian matrix are A ij =-P ij ;
式中:Pij表示节点i和节点j之间管段水头损失对于流量求导的倒数,对于节点i和节点j之间的管道: In the formula: P ij represents the reciprocal of the flow derivation of the head loss between node i and node j, for the pipeline between node i and node j:
式中:r为阻力系数;Qij为节点i到节点j的流量;n为流量指数;m为局部损失系数;In the formula: r is the resistance coefficient; Q ij is the flow from node i to node j; n is the flow index; m is the local loss coefficient;
对于节点i和节点j之间的水泵: For a pump between node i and node j:
式中:ω为水泵的相对转速;Qij为节点i到节点j的流量;s和t表示水泵的曲线系数;In the formula: ω is the relative speed of the water pump; Q ij is the flow rate from node i to node j; s and t represent the curve coefficients of the water pump;
常数项向量矩阵F中的各项元素包括了节点中净流量的不平衡与流量校正因子之和,常数项向量矩阵F中的各项元素为:The elements in the vector matrix F of the constant items include the sum of the unbalance of the net flow in the node and the flow correction factor, and the elements in the vector matrix F of the constant items are:
Fij=(∑jQij-Di)+∑jyij+∑fPifHf F ij =(∑ j Q ij -D i )+∑ j y ij +∑ f P if H f
式中:Di表示节点i的需水量;In the formula: D i represents the water demand of node i;
yij为流量校正因子,对于节点i和节点j之间的管道:y ij is the flow correction factor, for the pipeline between node i and node j:
yij=Pij(r|Qij|n+m|Qij|2)sgn(Qij)y ij =P ij (r|Q ij | n +m|Q ij | 2 )sgn(Q ij )
对于节点i和节点j之间的水泵:For a pump between node i and node j:
Hf为已知的节点f的节点水头;H f is the known node water head of node f;
h0为水泵的虚总扬程;h 0 is the virtual total lift of the pump;
Pif表示将节点i连接至已知水头的节点f的管段水头损失对于流量求导的倒数。P if represents the inverse of the derivative of the head loss with respect to flow for the link linking node i to node f of known head.
∑fPifHf表示将节点i(节点i为未知水头的节点)连接至已知水头的节点f的管段。∑ f P if H f represents the pipe segment connecting node i (node i is a node with unknown water head) to node f with known water head.
(2)对原始系统方程组的系数矩阵进行分解,得到一个带状对角矩阵和一个残余矩阵,然后将带状对角矩阵划分为若干个小带状对角矩阵,具体操作如下:(2) Decompose the coefficient matrix of the original system of equations to obtain a banded diagonal matrix and a residual matrix, and then divide the banded diagonal matrix into several small banded diagonal matrices. The specific operations are as follows:
将系数矩阵A中每一行的第一个和最后一个不为零的元素设为零,得到带状对角矩阵D,带状对角矩阵D尽量逼近原始系统方程的系数矩阵A;保留系数矩阵A中每一行的第一个和最后一个不为零的元素,其余元素设为零,得到残余矩阵R,即带状对角矩阵和残余矩阵满足A=D+R;Set the first and last non-zero elements of each row in the coefficient matrix A to zero to obtain a banded diagonal matrix D, which is as close as possible to the coefficient matrix A of the original system equation; keep the coefficient matrix The first and last elements of each row in A are not zero, and the remaining elements are set to zero to obtain the residual matrix R, that is, the banded diagonal matrix and the residual matrix satisfy A=D+R;
将带状对角矩阵D进一步划分为h个小带状对角矩阵Di,如下所示:The banded diagonal matrix D is further divided into h small banded diagonal matrices D i , as follows:
若带状对角矩阵D的行数为m,则每一个小带状对角矩阵Di的行数C=[m/h](中括号表示向下取整运算,例如则C取10),i<h的小带状对角矩阵Di由带状对角矩阵D中的第(i-1)×C+1到第i×C行中每一行第一个不为零的元素到最后一个不为零的元素构成;小带状对角矩阵Dh由带状对角矩阵D中的第i×C+1到第m行中每一行第一个不为零的元素到最后一个不为零的元素构成。If the number of rows of the banded diagonal matrix D is m, then the number of rows C=[m/h] of each small banded diagonal matrix D i (the square brackets represent the rounding down operation, for example Then C takes 10), the small banded diagonal matrix D i of i<h is formed from the (i-1)×C+1th to i×Cth rows in the banded diagonal matrix D. From the zero element to the last non-zero element; the small banded diagonal matrix D h consists of the i×C+1th to the mth row in the banded diagonal matrix D, and the first one of each row is not zero elements to the last non-zero element.
小带状对角矩阵的个数取决于GPU的核数,小带状对角矩阵划分完毕后,每个小带状对角矩阵分别分配给GPU的一个线程,以进行后续的计算。The number of small striped diagonal matrices depends on the number of cores of the GPU. After the small striped diagonal matrices are divided, each small striped diagonal matrix is assigned to a thread of the GPU for subsequent calculations.
(3)将各个小带状对角矩阵分别同时与残余矩阵结合,得到供水管网中所有节点的初始流量值,具体操作如下:(3) Combine each small strip diagonal matrix with the residual matrix at the same time to obtain the initial flow values of all nodes in the water supply network. The specific operations are as follows:
3-1、令残余矩阵R中的奇数行元素取值为零,使残余矩阵R转化为近似残余矩阵 3-1. Let the odd-numbered row elements in the residual matrix R be zero, so that the residual matrix R is converted into an approximate residual matrix
3-2、每个小带状对角矩阵扩展为与系数矩阵A大小相同的矩阵,作为小带状对角矩阵的近似矩阵将近似残余矩阵和小带状对角矩阵的近似矩阵带入原始系统方程组AH=F中,得到近似系统方程如下所示:3-2. Each small striped diagonal matrix is expanded to a matrix with the same size as the coefficient matrix A, which is used as an approximate matrix of the small striped diagonal matrix will approximate the residual matrix and the approximation matrix of the small banded diagonal matrix Bringing it into the original system of equations AH=F, the approximate system equations are obtained as follows:
式中,为任意一个小带状对角矩阵的近似矩阵;In the formula, is an approximate matrix of any small banded diagonal matrix;
为近似残余矩阵, is an approximate residual matrix,
H为供水管网中所有节点的流量值组成的向量矩阵;H is a vector matrix composed of flow values of all nodes in the water supply network;
F为原始系统方程组的常数项向量矩阵;F is the constant term vector matrix of the original system of equations;
3-3、利用式计算得到矩阵G,将矩阵G中所有非零元素对应的节点作为非零节点集合,为的逆矩阵;3-3. Utilization The matrix G is calculated, and the nodes corresponding to all non-zero elements in the matrix G are regarded as a set of non-zero nodes. for the inverse matrix;
3-4、利用所得到的非零节点集合构建小型系统方程组:3-4. Use the obtained non-zero node set to construct a small system of equations:
式中: In the formula:
IZ为单位矩阵;I Z is the identity matrix;
GZ为非零节点集合中所有节点在供水管网中对应的节点的流量值构成的矩阵;G Z is a matrix formed by the flow values of all nodes in the non-zero node set corresponding to the nodes in the water supply network;
为供水管网中与非零节点集合中所有节点对应的节点流量值组成的向量; is a vector composed of node flow values corresponding to all nodes in the non-zero node set in the water supply network;
其中,g1,g2,…gs分别是的第1,2,……s个分量的值,s为非零节点集合中的节点的个数; Among them, g 1 , g 2 ,…g s are respectively The value of the 1st, 2nd, ... s components of , s is the number of nodes in the non-zero node set;
3-5、使用预处理共轭梯度迭代方法求解小型系统方程组,得到非零节点集合中所有节点的初始流量值;对于小带状对角矩阵Di中不属于非零节点集合的节点(即在中不存在对应元素的节点),以非零节点集合中与该节点距离最小的节点的初始流量值作为该节点的初始流量值。3-5. Use the preprocessing conjugate gradient iterative method to solve the small system equations to obtain the initial flow values of all nodes in the non-zero node set; for the nodes in the small strip diagonal matrix Di that do not belong to the non-zero node set (ie exist There is no corresponding element in the node), and the initial flow value of the node with the smallest distance from the node in the non-zero node set is taken as the initial flow value of the node.
GPU的线程分别对小带状对角矩阵D1,小带状对角矩阵D2,小带状对角矩阵D3…小带状对角矩阵Dh进行步骤3-2~步骤3-5的处理,得到各个小带状对角矩阵对应的节点的初始流量值向量H1,H2,…Hh。The threads of the GPU perform step 3-2 to step 3-5 on the small banded diagonal matrix D1, the small banded diagonal matrix D2, the small banded diagonal matrix D 3 ... the small banded diagonal matrix D h , to obtain the initial flow value vectors H 1 , H 2 , ... H h of the nodes corresponding to each small strip diagonal matrix.
(4)将所有节点的初始流量值作为供水系统的初始输入,迭代至得到所有节点的最终流量值,步骤如下:(4) Take the initial flow values of all nodes as the initial input of the water supply system, iterate until the final flow values of all nodes are obtained, the steps are as follows:
4-1、将初始流量值向量H1,H2,…Hh的每个分量对应的节点的初始流量值作为向量H中该节点对应的分量的取值;例如,H1中的某个元素对应供水管网中的第i个节点(即节点i),则说明该元素为供水管网中的第i个节点的初始流量值,将该元素作为向量H中的第i行的分量。4-1. Take the initial flow value of the node corresponding to each component of the initial flow value vector H 1 , H 2 , ... H h as the value of the component corresponding to the node in the vector H; for example, a certain value in H 1 The element corresponds to the i-th node in the water supply network (namely, node i), which means that the element is the initial flow value of the i-th node in the water supply network, and this element is used as the component of the i-th row in the vector H.
由于初始流量值向量H1,H2,…,Hh组合覆盖带状对角矩阵D中所有行,因此初始流量值向量H1,H2,…,hh组合可以得到所有节点的初始流量值。Since the combination of initial flow value vectors H 1 , H 2 ,…,H h covers all the rows in the banded diagonal matrix D, the combination of initial flow value vectors H 1 , H 2 ,…,h h can get the initial flow of all nodes value.
4-2、求解原始系统方程组AH=F,得到新的节点水头之后,新的流量为:4-2. Solve the original system equations AH=F, after obtaining the new node water head, the new flow is:
Qij=Qij-(yij-Pij(Hi-Hj))Q ij =Q ij -(y ij -P ij (H i -H j ))
新的流量需满足如下流量连续方程:The new flow rate needs to satisfy the following flow continuity equation:
∑jQij-Di=0;i=1,.......,N;∑ j Q ij - D i = 0; i = 1, ..., N;
式中:Qij为节点i到节点j的流量;Di表示节点i的需水量;N为节点的总个数;In the formula: Q ij is the flow from node i to node j; D i is the water demand of node i; N is the total number of nodes;
4-3、若绝对流量变化之和与所有管段的总流量相比,大于允许的数值(例如0.001),则利用新的流量重新求解矩阵方程AH=F,得到新的流量;4-3. If the sum of absolute flow changes is greater than the allowable value (for example, 0.001) compared with the total flow of all pipe sections, then use the new flow to re-solve the matrix equation AH=F to obtain a new flow;
4-4、重复步骤4-3直至绝对流量变化之和与所有管段的总流量相比,不大于允许的数值,得到所有节点的最终流量值。4-4. Repeat step 4-3 until the sum of absolute flow changes is not greater than the allowable value compared with the total flow of all pipe sections, and the final flow value of all nodes is obtained.
本发明利用现有的流体力学建模技术、流体管网成份建模技术、计算机并行计算技术,针对流体力学以及成份的特点,改进力学以及成份计算的计算模型,加快方程的收敛速度,利用矩阵分解来充分利用计算机GPU的超强并行能力,解决目前大型流体管网在提前预警、节能减排、安全供给、规划设计实时分析中的低效问题,提升仿真的速度,满足实时的应用需求。The present invention utilizes the existing fluid mechanics modeling technology, fluid pipe network composition modeling technology, and computer parallel computing technology, and aims at the characteristics of fluid mechanics and composition, improves the calculation model of mechanics and composition calculation, accelerates the convergence speed of the equation, and utilizes the matrix Decomposition to make full use of the super parallel capability of the computer GPU to solve the inefficiency of the current large-scale fluid pipeline network in early warning, energy saving and emission reduction, safe supply, planning and design real-time analysis, improve the speed of simulation, and meet real-time application requirements.
本发明在实际应用过程中应用广泛,例如,当已知水头变化时,利用本发明方法能够快速算得供水管网中各节点的流量值,具体而言,当某一水库的水头发生变化时,能够及时算得某一区域对应的节点的流量,即查看该区域供水是否正常。The present invention is widely used in practical applications. For example, when the water head changes, the method of the present invention can be used to quickly calculate the flow value of each node in the water supply pipe network. Specifically, when the water head of a certain reservoir changes, It can calculate the flow rate of the node corresponding to a certain area in time, that is, check whether the water supply in this area is normal.
又如,当需要某一节点的流量达到某一数值时,可以连续改变已知水头的值,直至某一值时,节点能够算得预期流量,已知水头调整为相应值后,节点即能够得到预期流量。For another example, when the flow of a certain node needs to reach a certain value, the value of the known water head can be continuously changed until it reaches a certain value, and the node can calculate the expected flow. After the known water head is adjusted to the corresponding value, the node can obtain expected traffic.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410184642.1A CN103970610A (en) | 2014-04-30 | 2014-04-30 | Method for monitoring node flow of water supply network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410184642.1A CN103970610A (en) | 2014-04-30 | 2014-04-30 | Method for monitoring node flow of water supply network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103970610A true CN103970610A (en) | 2014-08-06 |
Family
ID=51240142
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410184642.1A Pending CN103970610A (en) | 2014-04-30 | 2014-04-30 | Method for monitoring node flow of water supply network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103970610A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105221933A (en) * | 2015-08-24 | 2016-01-06 | 哈尔滨工业大学 | A kind of pipeline network leak detecting method in conjunction with resistance identification |
CN105550405A (en) * | 2015-12-07 | 2016-05-04 | 哈尔滨工业大学 | Method for building municipal pipeline hydraulic model |
CN108197725A (en) * | 2017-12-06 | 2018-06-22 | 浙江大学 | Water supply network node water requirement check method based on water requirement prior information |
CN115017744A (en) * | 2022-08-08 | 2022-09-06 | 河北建投水务投资有限公司 | Modeling method and system of groundwater source water supply hydraulic calculation model |
-
2014
- 2014-04-30 CN CN201410184642.1A patent/CN103970610A/en active Pending
Non-Patent Citations (4)
Title |
---|
SUBHASISH DAS ET AL.: "Analysis of pipe flow & head loss of a modeled network based on EPANET in a Water Treatment Plant at Raipur, West Bengal", 《JOURNAL OF THE IPHE》 * |
ZHAO LEI ET AL.: "Matrix Decomposition graphics processing unit solver for Poisson image editing", 《JOURNAL OF ELECTRONIC IMAGING》 * |
姜伟: "给水管网系统数值计算方法研究及应用", 《中国优秀硕士论文全文数据库 工程科技II辑》 * |
张珽: "城市供水管网漏损定位计算方法的研究", 《中国优秀硕士论文全文数据库 工程科技II辑》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105221933A (en) * | 2015-08-24 | 2016-01-06 | 哈尔滨工业大学 | A kind of pipeline network leak detecting method in conjunction with resistance identification |
CN105550405A (en) * | 2015-12-07 | 2016-05-04 | 哈尔滨工业大学 | Method for building municipal pipeline hydraulic model |
CN105550405B (en) * | 2015-12-07 | 2018-03-20 | 哈尔滨工业大学 | A kind of city planting ductwork hydraulic model construction method |
CN108197725A (en) * | 2017-12-06 | 2018-06-22 | 浙江大学 | Water supply network node water requirement check method based on water requirement prior information |
CN108197725B (en) * | 2017-12-06 | 2021-05-28 | 浙江大学 | Water demand check method of water supply network nodes based on prior information of water demand |
CN115017744A (en) * | 2022-08-08 | 2022-09-06 | 河北建投水务投资有限公司 | Modeling method and system of groundwater source water supply hydraulic calculation model |
CN115017744B (en) * | 2022-08-08 | 2022-11-18 | 河北建投水务投资有限公司 | Modeling method and system of groundwater source water supply hydraulic calculation model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110334431B (en) | A single well controlled reserve calculation and residual gas analysis method for low permeability tight gas reservoirs | |
CN111222271B (en) | Numerical simulation method and system of fractures in reservoirs based on matrix-fracture unsteady cross-flow | |
CN103476051B (en) | A kind of communication net node importance evaluation method | |
CN107944111B (en) | Based on the river network degree of communication calculation method for improving graph theory and hydrological simulation | |
CN105160162B (en) | Lake based on splitting algorithm three-dimensional hydrodynamic force water temperature and quality simulating and predicting method | |
CN103258235B (en) | A kind of water supply network reorganization and expansion optimization method based on improving artificial fish-swarm algorithm | |
CN106447106A (en) | Comprehensive resistance weight and graph theory-based river network connectivity assessment method and gate dam optimization method | |
CN106355003B (en) | Markov chain Monte-Carlo automatic history matching method and system based on t distributions | |
CN103853934A (en) | Method and system for calculating river networks model | |
CN103914619A (en) | River network modeling method | |
CN103970610A (en) | Method for monitoring node flow of water supply network | |
CN112084727A (en) | A Transition Prediction Method Based on Neural Network | |
CN106354918B (en) | The construction method of fluid structurecoupling problem numerical simulation in a kind of hydraulic fracturing | |
Rao et al. | A general physics-based data-driven framework for numerical simulation and history matching of reservoirs | |
US20220147674A1 (en) | Graph network fluid flow modeling | |
CN103761448A (en) | Adjustable weight parameter determination method in coal seam floor water inrush variable weight vulnerability evaluation method | |
CN104216341A (en) | Reservoir production real-time optimization method based on improved random disturbance approximation algorithm | |
CN104616215A (en) | Energy efficiency comprehensive evaluation method for thermal power plant | |
CN105808311A (en) | Reservoir simulation fast matching method based on dimension reduction strategy | |
CN108804382A (en) | A kind of automatic reverse method of parameter and device | |
CN116822400B (en) | One-dimensional unsteady flow simulation method suitable for large-scale plain river network | |
CN105354362A (en) | Cubic spline multi-scale finite element method for simulating two-dimension flow movement | |
CN112113146B (en) | Synchronous self-adaptive check method for roughness coefficient and node water demand of water supply pipe network pipeline | |
CN103617563B (en) | A kind of water supply network theoretical based on geo-statistic spatial analysis is without monitoring node pressure determination statement | |
Xu et al. | A fractal physics-based data-driven model for water-flooding reservoir (FlowNet-fractal) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140806 |
|
RJ01 | Rejection of invention patent application after publication |