1. Introduction
The problems of flow distribution are the fundamental problems of analysis and justification of decisions on the management of operation modes of pipeline systems (PLSs) of various types and purposes (heat-, water-, oil-, gas supply, etc.) in their design, operation, and supervisory control. The requirements for the efficiency of the methods of solving these problems are constantly increasing. Such requirements include the following: (1) speed; (2) reliability, which manifests itself in the guaranteed solutions with a predetermined accuracy; (3) ability to solve high-dimensional problems; (4) universality with respect to an arbitrary structure of the object of the analysis, the composition of its elements, and changes in design conditions.
The expediency of development and elaboration of unified methods for modeling operation modes of PLSs of various types is due to the commonality of the following: (1) their structural and topological properties; (2) physical laws of liquid (gas) flow in individual elements; (3) conservation laws of networks; (4) conceptual and mathematical statements of analysis problems. Therefore, in what follows, when considering models and methods, we will use the term “hydraulic circuit” (HC), irrespective of the specific purpose of the PLSs being modeled.
The conventional model of steady-state isothermal flow distribution in the HC with concentrated parameters includes Kirchhoff laws and closing relations. It represents a system of linear and nonlinear algebraic equations, and there are two basic forms of writing such models: the nodal and loop ones. The nodal model is as follows [
1,
2]:
where
—a complete
-matrix of incidences of nodes and branches of the directed graph of the analytical circuit model with elements of
, if node
is initial (final) one for branch
and
, if branch
is not incident to node
;
—
-dimensional vectors of flow rates and pressure drops at the branches of the analytical circuit model;
—a
-matrix of incidences formed from
by crossing out one of the linearly dependent lines;
—a
-dimensional vector-function with elements
, reflecting the laws of the pressure drop as a function of flow rate (flow model) at the branches of the HC;
—a (
)-dimensional vector of nodal flow rates with elements
(
) if node
has an inflow (extraction) and
, if node
is a simple branch connection point;
—a
-dimensional vector of nodal pressures.
The loop model differs only in the way the second Kirchhoff law is written: instead of the second relation in (1) one uses
. Here (
) is a (
)-matrix of loops, with elements
, if the orientation of branch
coincides (does not coincide) with the direction of traversal of loop
and
, if branch
is not included in loop
;
is the number of main loops equal to the number of branches of the HC not included in the spanning tree of the HC, and called chords. Hence
. The equivalence of both forms of notation follows from the fact that
due to the well-known property of orthogonality of matrices
and
[
3].
Let , then the classical problem of flow distribution consists in determining vectors and given the known form of , , predetermined matrix , vector , and pressure at one of the nodes (), which for simplicity’s sake is assumed to be zero. In the loop model, vector is determined after solving the problem with respect to and .
Numerous methods and algorithms for solving this problem are known, an overview of which can be found, for example, in [
1,
4], etc. However, the main ones are the classical methods: those of node and loop methods (NM and LM) [
1,
2,
5,
6,
7,
8], etc., which have been widely adopted in modeling the operation modes of PLSs of heat- [
1,
9,
10], etc., water- [
1,
9], etc., gas supply [
11,
12,
13], etc.
Both methods are based on the Newton-Raphson method in conjunction with special methods of decreasing the order of the system of linearized equations to be solved. Let us introduce decomposition
, where
are the flow rate vectors at the chords and branches of the spanning tree, respectively. Finding the direction of the Newton-Raphson decrement to the flow rates at the chords (
) in the LM and to the nodal pressures (
) in the NM at the
-th iteration involves solving the following systems of equations:
where
is the diagonal matrix of partial derivatives at point
.
In both systems the coefficient matrices are symmetric. For two-dimensional circuits (which is typical of most real-life PLSs), matrix (2) of coefficients of the system has a strict diagonal predominance, and in (3) it is not strict. Therefore, the LM usually requires fewer iterations than the NM (although the situation is corrected if one applies a decrement length adjustment to the NM). Computational costs are also related to the order of systems to be solved, which are different in these methods (
in (2) and
in (3)).
Figure 1 shows limiting examples of analytical circuit models illustrating the absolute dominance of the LM for the circuit in
Figure 1a and that of the NM for the circuit in
Figure 1b, since in this case each of systems (2) and (3) is reduced to a single equation. But these systems can be arbitrarily large if one applies the LM to the circuit in
Figure 1b, and the NM to the circuit in
Figure 1a. Therefore, in general, both methods have their place and the areas of applications where one of them proves more preferable than the other.
Analysis of numerous dependencies and formulas for the description of the steady isothermal flow of the working fluid (liquid or gas) through pipelines and other elements of the PLS allows one to introduce the following classification as derived from the standpoint of their mathematical features [
14]: (1) conventional (explicit); (2) implicit flow rate-based; (3) pressure-dependent flow models; (4) 2-and-3 hybrid cases.
In the conventional case , where is the hydraulic loss of the branch, is the pressure increment at active branches (e.g., with pumping stations) and at passive branches (e.g., for pipeline sections). Here we have explicit expressions for derivative and function inverse to .
Implicit flow rate-based models of the flow are mainly applicable to pipelines. It follows from the basic Darcy-Weisbach formula [
15]
that
, since
and
. Here:
—head loss (m) and flow velocity;
—pressure loss and mass flow rate of the working fluid;
—pipe length and inside diameter;
—density of the transported fluid;
—gravitational acceleration. The coefficient of friction drag
can be treated as a constant only in the region of fully-developed turbulence, while in the general case it depends on velocity (Reynolds number)
, where
is the kinematic viscosity coefficient of the fluid. Examples of such dependencies are the common Colebrook-White [
16]
and Altshul [
17]
formulas. Therefore, friction loss
for the branch that models the pipeline will generally be a function of
. Function
becomes implicit, and the derivatives required for the LM or NM to be applied must already be determined by the rules of differentiation of such functions, which produces [
14]:
where
,
,
.
Pressure-dependent flow models mainly arise from the working fluid (natural gas, water vapor, etc.) compressibility effect. Here the pressure loss depends not only on the flow rate but also on the value of the pressure itself. Let us give examples of such models, denoting by , the pressures of the working fluid at the beginning and at the end of the modeled PLS element.
The dependency of the pressure built up by a centrifugal gas compressor unit on its inlet volumetric flow rate (
) is represented as a graphical characteristic of the compression ratio
. Functions
are approximated with sufficient accuracy by algebraic polynomials of degree three or lower [
18,
19]
. Taking into account that
and the equation of state of the gas can be represented as
(where
is a known coefficient for a given gas temperature
and its physical properties: gas constant
R and compressibility coefficient
Z) we arrive at the following flow model
Numerous variations of this model are known [
20,
21], etc., they are introduced as a result of neglecting some of the terms of the polynomial or approximating
instead of
.
In [
22], the authors present a gas pipeline section model that allows factoring in more adequately the difference in geodetic heights of its ends
where
—pipe angle;
Z—compressibility factor;
R—gas constant;
T—average gas temperature. In [
23] an alternative model is given
where
is the coefficient that depends on the difference of geodetic heights of the ends of the section.
When modeling the pipelines of water-steam circuits of steam-turbine plants, the following formula is used to calculate the pressure drop [
24,
25]
where
,
—densities of liquid and vapor phases of the flow in the function of average pressure
;
—cross-sectional area of the pipe;
—coefficient that accounts for the effect of the structure of the steam-water flow on the friction loss;
—mass vapor content of the flow.
For turbine control valves the following formula applies [
26]
The above examples (4)–(8) attest to the impossibility of reducing it to conventional form
, where
. Conceivably, the technique of double iteration cycles [
1,
2] is applicable to the analysis of the HC with such flow models. Here, in the inner iteration cycle, the classical flow-distribution problem is solved (by means of the LM or NM) at fixed values
of pressure-dependent functions
,
of flow models
, and in the outer cycle, the values of these functions are defined more precisely depending on the obtained values of flow rates and pressures. For example, in (5) one can assume
in (6)
, etc. The technique is sufficiently universal, but its application is associated with the ambiguity of arriving at functions
, the need for special justification and ensuring convergence, a multiple increase in computational costs if compared to the conventional case.
The above analysis of the published research shows that many authors: (1) pay attention to the fundamental difference of the models of the flow of compressible fluid from that of the case of incompressible fluid [
12,
21,
22,
25,
27,
28,
29]; (2) note the impossibility or significant difficulties of applying conventional methods of analysis of the flow distribution in these cases [
12,
21,
22,
23,
25,
27,
28,
29,
30,
31]; (3) state the lack of general, universal methods [
12,
21,
22,
25,
28,
30]; (4) propose their own methods and algorithms for calculating the flow distribution in complex systems of conveying gas through trunk pipelines [
12,
21,
22,
28,
29,
30,
31], heat and steam supply systems [
25], process pipelines systems [
27] and other PLSs, transporting gases or gas-liquid mixtures. The methods proposed in the published research boil down either to the technique of double iteration cycles [
25,
27,
28], or presuppose increasing the dimensionality of the systems of equations to be solved as compared to (2) or (3) [
22,
23,
30]. So, for example, at each step of the solution of the flow-distribution problem by the Newton-Raphson method in [
12,
21,
22,
23], etc., it is proposed to solve a system of linearized equations of order
to simultaneously find the step direction by flow rates (
) and pressures (
), and in [
30] it is proposed to solve that of order
by flow rates (
).
A new method, called the modified node method (MNM), was proposed in the study [
14]. It provides a solution to the problem with arbitrary flow models in the space of vector
. That is, at each step of the iterative process linear systems of equations of order
are solved. Below, for the first time, an attempt is made to generalize the problems and methods of calculating the steady-state isothermal flow distribution in hydraulic circuits for arbitrary models of the fluid flow. In particular, a new (modified) loop method (MLM) is proposed, which provides a solution to the problem in the space of loop flow rates (
) of the order of
.
2. Generalization of the Flow Distribution Model and the Node Method
All of the above types of liquid or gas flow models along the elements of the HC can be reduced to a general form of writing down pressure-dependent model
. With this in mind, instead of (1), the following generalized model of flow distribution is proposed [
14]
where
—
-dimensional vectors of pressures at the beginning and end of branches, respectively,
—
-matrices of incidences that capture separately the initial and final nodes of branches so that
,
—a vector-function with elements
,
, reflecting arbitrary flow laws, including conventional ones, implicitly determined by flow and pressure-dependent.
Here are the main provisions of MNM for solving the problem of flow distribution based on model (9)–(12). Let at the
k-th iteration there be value
, to which we can map unequivocal values of
,
and
from (10), (11), and (12), respectively. Linearization of Equations (9)–(12) yields
where
, and
,
,
—diagonal matrices of partial derivative matrices of order
. Let us express
from (15)—
. Given (14) we obtain
Substituing (16) in (13) yields
By the rules of differentiation of implicit functions
Hence,
,
and are the diagonal matrices of the corresponding partial derivatives of order
. Then system (17) can be represented as
Thus, the proposed MNM is reduced to an iterative process of finding a solution in the space of nodal pressures , where is determined based on the solution of (18), —step length as determined by the condition of one-dimensional minimization of some norm of vector .
We will also show that the considered NM modification covers the canonical case when
In this case
,
, where
is a unit matrix of order
, and
Given that , instead of (17) we have (3).
This section may be divided by subheadings. It should provide a concise and precise description of the experimental results, their interpretation as well as the experimental conclusions that can be drawn.
5. Algorithmization of a Generalized Loop Method
A computational scheme of the proposed generalized method of loop flow rates is reduced to the following. Let a next approximation be given, then: (1) calculate value such that ; (2) calculate and, if , where is a specified accuracy of residuals in loops, end the calculation; (3) build and solve a system of equations with respect to ; (4) calculate a new approximation , , and go to step 1.
There are two main distinctions from the conventional scheme here.
The conventional method of loop flow rates suggests that value is calculated at the point of problem solution with respect to . It is also necessary to determine in each iteration to find the derivatives at the point of running solution with respect to both , and . This operation does not pose any difficulties as can be calculated algorithmically by alternate application of relationships along the branches of a spanning tree starting from its root with a given pressure .
The conventional method of loop flow rates contains finite relations for nonzero elements of the coefficient matrix
[
1,
2]. For example,
, where
is a set of branches that enter the loop
r and
,
,
, where
is a branch that belongs simultaneously to loops
and
, and sign
is a result of scalar product
, i.e., it depends on the direction of
i-branch with respect to the direction of a “bypass” of each loop
and
. Obviously, the construction of the coefficient matrix
of the system (38) by formally performing operations of inversion, multiplication, and addition of high-dimensional matrices is associated with significant computational costs. Therefore, this issue requires special consideration.
Denote
,
,
. By virtue of (31), each
-th row of the
—matrix
contains no more than two nonzero elements that correspond to the indices of the initial (
) and finite (
) nodes of the
-th branch of the hydraulic circuit and it has only one node if the branch is incident to node
. This means that
, if
;
, if
;
, if
and
. Given this, the elements of matrix (39) will be determined as
It remains to clarify how to define the elements of .
Nodes and branches of the directed spanning tree of the hydraulic circuit can always be renumbered so that
. Then, the
—matrix
will be an upper triangular one, and
Accordingly, matrix
is also an upper triangular one, and its elements will be determined as
The proof relies on the known relationship , from which:
at , given (40), we have the equation , and then ;
at
, we obtain the equation, which, by virtue of (40), has only two terms
Potentially, relationship (41) makes it possible to organize a recurrent scheme for calculating elements of (guaranteeing that for each combination , value in the right-hand part of (41) is already known) in two forms:
row-by-row (top to bottom) , ;
column-by-column (from left to right) , .
This guarantee follows from the ascending sequences for . Nevertheless, here we suppose that (3) will be applied times, i.e., for all elements of the upper triangle , among which there can be many nonzero ones.
Let us show
, if there is a path from node
to node
and
, if there is no such path. Assume that
. Then the recurrent formula for
can be expanded as
where
,
and so on. Since
the sequence of indices of branches is ascending (
), and the branches themselves belong to some path that finishes at node
. At the
-th step of building such a sequence, there can be three cases:
—the sequence can be continued;
—according to (41), ;
—as it follows from (41), .
Case 2 means that the path from node to node is found and here , and in case 3, there is no such path, and .
From this, one can obtain a formula for calculating only nonzero elements of : , where is a set of indices of branches that belong to the path from node to node . The main flaw of using this formula is a repetition of operations for included paths, since the sequence means that . In this regard, the following recurrent algorithm will be the most optimal: for each , assume , and as long as , perform , .
This algorithm can be called “row-by-row bottom-up”, since there can also be a column-by-column (left to right) calculation pattern. However, it works well with the formulas for calculating the matrix of coefficients , if the order of summation is changed to a reverse one.
7. Numerical Case Study
Let us consider a numerical case study on the application of proposed methods to a fragment of the high-pressure gas transmission system [
21], presented in
Figure 4.
All pipeline sections are horizontal and modeled by the relationship
,
, with
= 0.006;
= 0.253;
= 4.757;
= 0.436;
= 1.332;
= 0.349. Relationships for compressor have the form
and values of their coefficients are indicated in
Table 1.
Derivatives of this relationship have the form , , .
Withdrawals at nodes (million m3/day) are = 19.1; = 14.8; = 0.632; = 0.32. Set pressure is = 33.778 at.
The following technique is used to obtain the initial approximation in the MNM, which is equivalent to the initial approximation employed in MLM. Let an arbitrary value be set, then , and is determined from .
The results of calculating the MLM by iterations are shown in
Table 2,
Table 3 and
Table 4. In this study,
. As seen, the initial approximation (
k = 0) is rather far from the solution. It has the flow values opposite to the orientations of branches, and negative pressure values that are beyond the solution. Nevertheless, both methods provide monotonic convergence, which is illustrated in
Figure 5. Here, for MNM
, and for MLM
. Thus, the MNM required 6 iterations (with step length regulation), while MLM needed only 4 iterations.
Figure 6 shows the results of testing MNM and MLM on 100 vectors of initial approximations, which were generated by a generator of random uniformly distributed numbers: for MNM
; for MLM
. Iteration stopping criteria are for MNM
,
; for MLM
.
The study indicates that: (1) both methods demonstrate strong convergence; (2) the number of iterations weakly depends on the proximity of the initial approximation to the solution; (3) MLM requires on average fewer iterations than MNM. Note also that the number of iterations weakly depends on the scheme dimension; however, as indicated, the computational costs for each iteration depend on the topology of a particular scheme.