),
)
Archives ofMining Sciences 49,2 (2004) 151174
STANISLAW NAGY'. ANDRZEJ OLAJOSSY", JAKUB SIEMEK'
ANALYSIS OF USEFULNESS OF SOME ALGORITHMS FOR STEADY STATE SIMULATION
IN THE LOOP GAS NETWORKS
ANALIZA PRZYDATNOSCI NIEKTORYCH ALGORYTMOW SYMULACJI
PRZEPL YWOW USTALONYCH W SIECIACH PIERSCIENIOWYCH
This paper is devoted to the analysis of classical methods in the steadystate gas flow in a network
and to the linear version of a system of equations based on known IT and Q algorithms with the reduction
of rank of matrices and with random initial parameters. The presented algorithms may be alternative for
the classical gradient type numerical scheme, when any convergence problems may occur.
Classes of problems in the steady state gas network simulation have been presented. The stability,
robustness and simplicity are analyzed as well as numerical implementation. The NetwonRaphson (NR)
methods (algorithm I and 2) have better convergence, and number of iteration is a rather weak function of
the desired accuracy of solution, the proposed algorithms have much stronger relation between the num
ber of iterations and accuracy of solution. The error of initial approximation of the solution is the main
disadvantage of NR methods (Zhou Adewumi 1998; Stoner 1969; Szilas 1986; Osiadacz 2001). The
authors propose a hybrid algorithm: start using algorithm 3 and 4; after achieving of good approximation
of final solution to switch to the NR method. Three simulations of gas network are shown in the paper
(lowpressure (Szilas 1986) medium and highpressure variants (Stoner 1969)). The real gas network
(Stoner 1969) geometry shown in the Fig. 4 a solution given by proposed hybrid algorithm 7 which
takes into consideration the real natural gas properties employing DranchukPurvisRobinson EOS and
by linear resistance of each branch of the net in each iteration step is shown in table 8. The average error
of computation of pressure in the nodes of network is below 1.3%, which is equivalent to 1 bar and may
be sufficient for industry requirements. The results of computation confirm the usefulness of the propo
sed computation schemes with iterative calculation of properties of gas and friction coefficients. Other
results of computation of medium and low case are shown in tables 6 and 10. The proposed robust algo
rithm 7, which is a hybrid of algorithm 3 (or 4) with algorithm 1 makes it possible to combine the advan
tage of algorithm 3 (or 4) low sensitivity for initial start solution with the main advantages ofNR
schemes  high convergence and speed.
Key words: gas network, simulation, algorithm, pipeline
* WYDZIAL WIERTNICTWA, NAFTY I GAZU, AKADEMIA GORNICZOHUTNICZA, AL MICKIEWICZA 30, 30059 KRAKOW,
POLAND; email: nagy@;agh.edu.pl; siemek@agh.edu.pl
** WYDZIAL GORNICTWA I GEOINZYNIERII, AKADEMIA GORNICZOHUTNICZA, AL MICKIEWICZA 30, 30059 KRA
KOW, POLAND; email: olajossy@agh.edu.pl
152
Niniejsza praca dotyczy analizy przydatnosci metod klasycznych w rozwi'(zywaniu nieliniowych
uklad6w r6wnan przy symulacji stacjonarnych przeplyw6w gazu w sieciach przeplywowych i zlineary
zowanych uklad6w r6wnan z redukcj'( rzl(du macierzy dla algorytm6w II oraz Q z nieznanymi zadanymi
warunkami startowymi. Przedstawione algorytmy mog'( bye alternatyw'( dla klasycznych algorytm6w
gradientowych w przypadku problem6w z osi'(gllil(ciem zbieznosci rozwi<(zania. Przedstawiono klasy
zagadnien rozwi<(zywanych metod'( symulacji statycznej. Przedstawiono najwazniejsze schematy obli
czeniowe dla przeplyw6w ustalonych w sieci. Przeanalizowano stabilnos6, pewnos6 i latwos6 numerycz
nej implementacji algorytm6w i ich rozwi<(zan. Wskazano na znacz<(przewagl( algorytm6w I i 2 (newto
nowskich). Pokazano, ze liczba krok6w iteracyjnych nie zalezy istotnie od zlozonosci sieci, ale od do
kladnosci przyblizenia startowego. Z kolei czas trwania kazdego kroku iteracyjnego, pozostaje w silnej
zaleznosci od stopnia zlozonosci sieci. Poniewai bl<td w wyznaczeniu przyblizenia startowego natl(zenia
przeplyw6w lub spadk6w cisnien w gall(ziach ogranicza mozliwosci stosowania algorytm6w I i 2 (Zhou
Adewumi 1998; Stoner 1969; Szilas 1986) autorzy sugeruj'(stosowanie altematywnych algorytm6w (36).
Proponowany autorski hybrydowy algorytm 7 uzywa na starcie algorytmu 3 lub 4, a nastl(pnie  po
osi<tgnil(ciu zadawalaj'(cej aproksymacji w koncowym etapie obliczen stosuje algorytm I lub 2. Poka
zano obliczenia dla trzech sieci pierscieniowej (niskocisnieniowej (Szilas I 986), wysokocisnieniowej
(Stoner 1969) i sredniocisnieniowej). Przyklad obliczen dla sieci rzeczywistej  wysokocisnieniowej
przedstawionej na rys. 4, rozwi<(zany przy zastosowaniu algorytmu 7 z uwzgll(dnieniem wlasnosci gazu
ziemnego oraz zmiennosci wsp6lczynnika oporu liniowego w procesie linearyzacji wskazuje na popraw
nos6 numeryczn'l zaproponowanego schematu obliczeniowego. Sredni bl<td obliczania cisnienia w Wl(
zlach w odniesieniu do danych pomiarowych (Stoner 1969) nie przekracza 1,3% cow zupelnosci jest
wystarczaj'(ce w praktyce przemyslowej. Maksymalny bl<td obliczen cisnienia nie przekroczyl w oma
wianym przykladzie 1 bar. Wyniki obliczen potwierdzaj<(przydatnosc zlinearyzowanej metody wedl:ug
algorytmu 3 (lub 4) z wykorzystaniem iteracyjnego obliczania wsp6lczynnika opor6w liniowych oraz
wsp6lczynnika scisliwosci Z w funkcji cisnienia. Inne wyniki obliczen zamieszono w tablicach 610.
Rozwi<(zanie opisane hybrydowym algorytmem 7 pozwala wykorzystac cechy algorytmu 3 (lub 4)
nieczulosc na przyblizenie startowe i szybkosc obliczen, po osi'(gllil(ciu wystarczaj'(cego przyblizenia
startowego d1a algorytmu newtonowskiego.
Slowa kluczowe: gaz ziemny , sieci, symulacja, algorytm, ruroci<tgi
1. Introduction
This paper is devoted to the methods of calculation of loop gas network parameters
for the steady state conditions. The authors of the paper aim at presenting a numerical
simulator of such a network. It should be efficient with regard to the algorithm comple
xity and the required time of computation, solid and adequate to the real network con
ditions. Attempts were made to more precisely determine gas flow rates in the sections
and gas pressure distribution in the nodes of the network.
With such an approach, negative effects of erroneous assumption of flow rates in the
network, i.e. start values for equations of flow in the nodes and loops, can be limited.
The way in which these start values are generated resembles a method known from
literature (Wood, Charles 1972) and (Zhou, Adewumi 1998). These values are a result
of computations made on the assumption that gas flow has a laminar character in its
initial phase. Start values for flow rates are ascribed to a linearized system of equations.
Therefore, the successive values of its coefficients of pressure losses can be iterated and
gas flow rates calculated with the use of a suitable procedure.
ych
,ry
'ffii
6w
>sy
J!i
cz
to
lo
1ej
1ia
ou
6).
po
:a
·ej
ej
zu
.v
t(
:st
a
Jg
lZ
ta
s
1
153
In natural conditions of gas networks, consumers usually take gas in the transient or
turbulent state of flow. Therefore, the consumption and supply values in nodes should
be set as start values for the calculation model. A method for assessing gas consump
tion by groups of customers was used at the stage of network design and reconstruction
(Zajda 2002).
Designing and reconstruction of gas networks require some knowledge of topology,
in that cutting the network graph. One of useful criteria for such cutting is minimization
of values to sums of pressure losses in the connected sections of the network (Olajossy,
Zajda 2002). Further on, the identified tree may undergo the discussed procedure (Fe
dorowicz et al. 2002) of optimum selection of network diameters close to those of the
produced pipes. However, neither the pipe diameter selection problem nor genetic algo
rithms will be discussed in this paper. Examples of how to make and analyze genetic
algorithms can be found in the work by Montoya0. et al. (2000).
It follows from the above considerations that methods for calculating network para
meters in relation to the real network conditions should take employ cutting of network
graphs. This has been discounted below in the iterative procedure of solving a system
of equations valid for nodes and sections of the network (this system has been lineari
zed earlier.) For this purpose, an algorithm for a linear system of equations for network
nodes and sections has been used, employing a tree, presented in (Krstic 1991 ). This
algorithm helps solve matrix systems of equations, especially for a network consisting
of a large number of ranks of matrices, which may have an advantageous influence on
the realization of the algorithm.
Examples of some fragments of gas networks, in that mainly real ones, are given in
the paper. Calculated and actual measured parameters have been compared.
2. Objective of simulation of steady state gas flows in the network
The aim of the socalled static simulation is assessing pressure values in nodes
and flow rates in the individual branches of the network, at the set input pressure and
load in nodes. Static simulation usually refers to steady state loop networks. The
former division into low, medium and high pressure networks has been changed by
the Minister of Economy in the Regulation of 30 July 2001 about technical condi
tions to be met by gas networks (Official Journal No. 97/2001, item 1055). This Regula
tion substituted the earlier Regulation of the Minister of Industry and Trade of 14 No
vember 1995 about technical conditions to be met by gas networks (Official Journal
No. 13911995, item 686).
The most important change lies in the new classification of gas pipelines with regards
to the working pressure. Accordingly, pipelines have been divided into four groups:
1. low pressure pipelines  to 10 kPa inclusive;
2. medium pressure pipelines over 10 kPa to 0.5 MPa inclusive;
154
3. increased pressure pipelines over 0.5 MPa to 1.6 MPa inclusive;
4. high pressure pipelines over 1.6 MPa to 10 MPa inclusive.
By low pressure network we understand pipelines of the first group; medium pressu
re network  pipelines of the second group; high pressure networks  pipelines of the
third and fourth groups. Table 1 gives basic properties of networks in view of construc
ting models and computation properties.
TABLE 1
The characteristic of low medium and highpressure gas network
(modified after Szilas (1986)
TABLICA 1
Charakterystyka sieci nisko, srednio i wysokopr((znych (zmodyfikowana
na podstawie pracy Szilas 1986)
Network
increased pressure
Modeling features
pipelines over 0.5
mediumpressure
MPa to 1.6 MPa
(p > 10kPap < 0,5
lowpressure
inclusive, (p < 10 kPa)
and highpressure
MPa)
(p > 1,6 MPa)
Characteristics of input data:
1. accuracy of input data in the high accuracy medium accuracy low accuracy
nodes
2. variation of altitude in the negligible negligible important
area
Computation features:
1. compressibility factor Z Z=Z(p,T,s) Z=1 Z=1
2. friction factor A= A(NReokfd) A = A(N Re•kl d) approximation A
3. depression pressure
P1
2
 Pz
2
= f(qn
2
) P1
2
 Pz
2
= f(qn
2
) PI P2 =J(qn
2
)
Characteristics of outcomes:
1. maximum accuracy of 0,1 bar 0,1 bar 1 Pa
pressure calculation in nodes
2. flow velocity calculation not necessarily always always
3. calculation of pressure negligible important important
gradients in graph arches
Non stationary problems:
1. transient to steady state time hours minutes seconds
2. gas storage amount in the net important unimportant unimportant
3. fraction of nonstationary important unimportant unimportant
flows related to the whole net
;u
he
lC
E I
lc I
155
3. Classification of problems related with gas loop network modeling
==e issue of stationary flow is a superposition of such partial tasks as making of
:. trrematical model, system of nonlinear algebraic equations or a linearized system
:m algorithm for solving a system of equations. From the mathematical point of
_:;;.'..the steady state gas flow in a pipeline can be described with the use of an algebra
quation defining a function of gas stream, drop of pressure, geometry of pipeline
PVT properties of natural gas.
Gas volume rate in the pipeline can be determined on the basis of an equation of
defined for isothermal gas flow, by linking equation of continuity and momentum
·: a.lance. The below equation (Zhou, Adewumi 1998) can be used for calculating pres
s·Jre drops for a onephase flow:
\vhere:
F  cross sectional area [m
2
],
p  gas density in normal conditions [kg/mn
3
J,
p
1
 pressure at the inlet to the pipeline [Pa],
p
2
 pressure at the outlet of the pipeline [Pa],
Q  flow rate of the pipeline in normal conditions [mn
3
/s],
A  linear pressure loss coefficient [],
c = .J ZRT  velocity of sound in gas [ m/s ],
Z  compressibility coefficient [],
R  individual gas constant [J/(kg K)],
T  gas temperature in the pipeline [K],
D  pipeline diameter [m].
(1)
For small intervals of Reynolds number and roughness (often met in gas transport
practice) the value of pressure loss A can be determined as an exponential function in
the following form
(2)
(3)
l
k l
1  5 0452 1 k 1.1°
98
5 8506
2lo _d __ ' lo  + '
J"i g 3,7065 N.., g[ 2,8257 (d) N:;;''"' l
(4)
156
where:
a, b  constants determined experimentally for a given interval of relative ro
ughness values [],
£ = !5._  relative roughness [],
d
k  absolute roughness [m ],
d  pipeline diameter [m],
NRe  Reynolds number [].
Equation (4) is generally recommended for turbulent flows (Chen 1979)
Another form of equation of flow is IGE3 formula (British IGE Standard):
where
sg  relative gas density [],
E  efficiency factor [].
(5)
Another generalized form of equation of flow has been proposed by ( Osiadacz 2001):
!1p = rp (Q)  for loop methods (6)
Q = If/ (.Lip)  for node methods (7)
\here:
1
i = 1, ... m (8)
If/; =(1/ K;)m
1
·sign(!1pJ·I11P;Imt
m
1
 exponent in equation of flow,
Ki  coefficient depending on the form of the assumed equation, e.g. according
to table 3.
A description of some equations is given in tables 2 and 3. Other equations of flow
(twophase flow) can be found in (Siemek, Nagy 2000). A generalized equation of flow
is given below (9).
ro
l):
6)
7)
g
v
v
157
TABLE 2
Some formulas for steady state gas flow in the horizontal pipelines for mediumpressure (2 group)
TABLICA 2
Author
Weymuth
Niekt6re wzory do obliczen przeplywu gazu w poziomych dla sieci
0 srednim cisnieniu (grupa 2)
Formula Source
2
2 2 5 L· Q
Pi p
2
=9,5231·10 · D
5
,
33 Szilas 1986
where p [kPa], L [m], D [m], Q [mn
3
!h]
L Qi,875
2 2 .
BielLumert
Pi p
2
=45808·
5
D
Osiadacz 200 1
where p [ata], L [km], D [mm], Q [mn
3
!h]
 = 1, 0 1 7 6 . 10
9
.
L·Qi,82
Renuard D4,82 Szilas 1986
where p [kPa], L [m], D [m], Q [mn%]
' ( J"
2 2
_
9995610
_
4
L·Q k 1922v100D
Osiadacz et al.
Altszul
P  P2  · · ·  +
1 ' Ds D Q
1994
where p [kPa], L [m], D [m], Q [mn
3
1h]
L Ql.848
Gas Engineers 2 2 3 .
Polyflo
P1  P2 = 1,18 ·10 . 4 854
Handbook
E·D ·
where p [kPa], L [m], D [m], Q [mn
3
1h]
1966
6
Fig. 1. The example of gas network described using graph theory.
Graph and spinning tree (Osiadacz 2001)
Rys. 1. Przyklad sieci gazowej modelowanej przy uZj'ciu teorii graf6w.
Grafijego drzewo (Osiadacz 2001)
158
Some formulas for steady state gas flow in the horizontal pipelines for increased
and highpressure (3 and 4 group)
TABLE 3
TABLICA 3
Niekt6re wzory semiempiryczne do obliczen przeplywu gazu w poziomych
dla sieci o podwyzszonym i wysokim cisnieniu (grupa 3 i 4) (p > 0,5 MPa)
Author Formula Source
r r , ,r,
Weymouth
Q = 0,54933 Tn Pl  Pz D2,667 E
Martinez 2002
Pn sgZTL
r r , ,r
Q = 0, 7972 Tn PI  Pz D2,538 E
Gas Engineers
AGA
Pn sgZTL Handbook 1966
Panhandle B
[ •m( ' ' J"
Q = 0,93935 Tn ) PI  Pz D2,53 E
Pn
Campbe111976
IGT
Q = 0,39825[ Tn )[
1
)( pf Pi J'" D''"' E
IGE Standard
Pn ,U
0
'
11
I
IGEffD/3
r x r( , , r
Gas Behavior, . ,
IGE3
Q = 0,04915 Tn _!_ PI  Pz D2,5 E
p A s
0
·
8
zn
1967
n g
4. Review of most important algorithms for static simulation
Static simulation algorithms (steady state simulation) are based on Kirchhoff equ
ations and equation of flow. Pressures in the nodes and flows in the branches must
fulfill the equation of flow; similar to loads in nodes and source of supply, they must
also meet the first and the second Kirchhoff law. Therefore, Kirchhoff laws and equ
ations of flow are a foundation, on which all static simulation algorithms are built.
Equation of flow can assume the following generalized form:
i = l, ... ,nb (9)
where:
·Hi drop of square of pressure in the ith branch (for medium and high pressu
re networks) and a drop of pressure in the ith branch (for low pressure
networks),
lLE 3
CA3
1
st
st
I
t.
e
Q;  flow rate in the ith branch,
R;  resistance in the ith branch.
Resistance R; is calculated from the formula:
where:
L;  length of the ith branch,
d;  diameter of the ith branch,
A;  area of a crosssection of the ith branch,
p  actual gas density,
A  linear flow loss coefficient,
~  local loss coefficient.
159
(10)
Taking into account a varying gas density (through equation PVT), the formula (10)
can be used in the increased and high pressure (0.5 MPa to 10 MPa) areas (Table 4).
Graph theory is a convenient medium for creating mathematical models of gas flows
in networks (figs.l and 2) (Osiadacz 2001). The first Kirchhofflaw assumes the follo
wing form in the graph theory:
(11)
where:
EQ  reduced matrix of nodes and branches incidence (12)
Q = [Q
1
... Qn ] r  vector of flow in branches ( 13)
b
(14)
Incidence matrix and reduced matrix of nodes and branches incidence have been
defined in the graph theory (Szilas 1986, Osiadacz 2001 ). Interconnection in the ne
twork can be described by means of a matrix of nodes and branches incidence A= [ aij]nxm·
This is a rectangular matrix of nlines, corresponding to the number of nodes (reference
node including), and m columns, corresponding to the number of branches in the ne
twork. Element a!i in the ith line and jth column of matrix A corresponds to the i ~ t
node and jth branch, and its value can be calculated from:
+ 1. ifjth branch enters ith node
1. ifjth branch leaves ith node
0. ifjth branch does not coincide with ith node
(15)
160
TABLE 4
The PVT equation of state (EOS) used for gas network simulation in the highpressure case
TABLICA 4
R6wnania PVT stosowane do obliczen w sieciach gazowych wysokoprt<znych
Name ofEOS Formula Source
Z=
1
Societe ... ,
Simplified French model
l+k· p
Manuel1968
(up 60 bar)
where k = 2,65x10
8
1/bar for ooc
[in: Szilas 1986]
Simplified French model
(up 60 bar at soc Z = 1 2x 10
8
p Szilas 1986
temperature)
0 3 Ppr
Wilkinson (1964) (known Z =0+0,257ppr ,53 
Szilas 1986
as Pappay eq)
Tpr
for Ppr < 1,5 (below 60 bar)
RT a
Redlich, Kwong
RedlichKwong p=
Jiv(v +b)
1949
vb
RT a(T)
Peng, Robinson
PengRobinson p=
v(v +b)+ b(v +b)
1976
vb
[ A, A, } ( A, }' Z=l+ At+
3
r+ A4+ r+
Dranchuk,
DPR (DranchukPurvis
Tpr Tpr Tpr
PurvisRobinson
Robinson)
AsAt; p
5
+A (1 +A p
2
)P? exp( A p
2
)
1974
T r 7 8 r y3 8 r
pr pr
l Lz
4
2
5
4
c;
3
D
zasilajqcy
lL1
0
Fig. 2. Gas network as a graph with one source node (Osiadacz 2001)
Rys. 2. Grafsieci gazowej (Osiadacz 2001)
TABLE4
.se
58
1986]
lSOll
mson

161
A reduced incidence matrix can be created by discarding the line which represents
the reference node (highlit node, e.g. supply node in Fig. 2). This is a reduced matrix of
nodes and branches incidence A
1
= [aif]nlxm' where n1 is a number of nodes (reference
node including). Element aii of matrix A
1
is defined in the same way as in matrix A.
The second Kirchhoff law assumes the below form:
(16)
where:
EH matrix of loops and branches incidence (17)
H = [H
1
••• Hnb ]r vector ofpressure drops in branches or square pressures (18)
Loops of the network (Fig. 2) are described by means of matrices of loops and
branches incidence B = [ bifhxm· This is a rectangular matrix of k lines, corresponding to
the number of independent loops, and m columns, corresponding to the number of
branches in the network. Element bii in the ith line andjth column of matrix B corre
sponds to the ith loop andjth branch, and the value of the element can be calculated
from the below formula:
+ 1. ifjth branch is in the ith loop, and their directions are congruent
bif = 1. if jth branch is in the ith loop, and their directions are opposite (19)
0. ifjth branch is not in the ith loop
A set of equations of flow (9) can assume a compact form. By introducing matrices:
(20)
(21)
the system of equations (9) can be expressed by means of a matrix in the form (Krstic
1991):
H=R·(?·Q (22)
IfiTi denotes pressure in the ith node, then the drop of the square pressure (or drop
of pressure) between the highlit (reference) node and an arbitrary node can be written as
(Krstic 1991):
i = 1, ... ,nn 1 (23)
The vector of pressure drops between the reference node and a given node is descri
bed by the following formula:
(24)
162
A relation between vector P and vector of pressure drops in branches (H) is the
following:
H = E ~ ·P (25)
which leads to:
(26)
If the branches of the network are so enumerated that the first nb nn + 1 are chords
(index L), and the last nn 1 branches of the tree (index T), then:
where:
Q = [ ~ l
QL = [QJ•• .Q(nbnn+l)]T
QT = [Q(nbnn+2)···Qnb ]T
As a consequence, the following can be assumed (Krstic 1991):
Qc=Qr
where Qc is a vector of a loop flow rate.
(27)
(28)
(29)
Relation (27) introduces a division of a reduced matrix of nodes and branches inci
dence into blocks:
(30)
A relation between the vector of flow of rate, vector of load in nodes and vector of
flow in branches is expressed by the below formula:
(31)
where Qc = QL .
Matrix relations (25) and (31) with equation (11), (16) and (22) make up a basic
system in the model describing the network:
H=Rc?Q (32)
(33)
the
25)
26)
rds
:8)
9)
:i
l)
c
:)
)
163
5. Algorithms basing on NewtonRaphson method
Loop and node methods belong to this group of algorithms. Computation of flow or
pressure values is reduced to the solution of a system of m nonlinear algebraic equ
ations with n unknowns, employing the Newton (NewtonRaphson) method.
Algorithm 1. (Krstic 1991; Szilas 1986; Osiadacz 2001). Loop method
1. Input data: Q
0
3. If maxiQt+l Qt I> E for nb graph edges, then go to step no. 2.
Pressure values are obtained from equations (26) and (32) as:
When using this method, tree identification is redundant. The matrix of loops and
branches incidence E H is necessary, whereas reduced matrix of nodes and branches
incidence EQ is needed only when pressure values in the nodes are to be known.
Algorithm 2. (Krstic 1991, Szilas 1986, Osiadacz 2001). Node method
1. Input data: EQ, QN, JfJ
2. Qi ·IHii·sgnHi
1{£
3. =2·
i = 1, ... ,nb
i=1, ... ,nb
4
Hk+l·_HkEr·rE .yk.Er]l.[E ·QkQ]
•  Q lQ Q Q N
5. Jezeli max1Ht+
1
 Hik I> E, go to step 2.
Pressure values are from equation (26):
When using this method, tree identification is redundant. Only reduced matrix of
nodes and branches EQ is required.
164
6. Methods basing on double/single linearization of equation of flow
(Szilas 1986, Krstic 1991)
Linearization of equation of flow for medium and high pressure gas networks takes
place in two stages:
1. by introducing a vector of squares of pressures in the place of pressures in nodes;
2. by linearization of a part of equation of flow, where gas volume rate occurs.
Among methods basing on linearization of equation of flow, two methods can be
distinguished:
• method Q (gas volume rate data), and
• method IT (pressure data).
Each method has two variants, depending on the type of input data (Q or H). More
over, method Q occurs in two subversions, depending on whether the tree is identified
or not. In the first case, the number of equations in the system is reduced from nb to
nb nn 1. This is the main advantage of these solutions. Method Q with tree identifi
cation (algorithm 3 and algorithm 4) has additional advantages related with the possibi
lity of identification of the main flows in the network.
6.1. Method Q
Instead of equation (9) the equation in the below form is used:
(34)
where:
(35)
R; resistance in a quasilinear branch.
Hence, instead of equation (9) a vector equation in the following form is used:
(36)
where matrixR' is defined as:
(37)
and has a diagonal form, i.e.:
(38)
After some transformations of the above matrix equations based on the equation
(16), algorithm 3 can be obtained.
v
ks takes
1 nodes;
lrS.
can be
. More
n nb to
jentifi
IOssibi
(34)
(35)
i:
(36)
(37)
(38)
lation
6.1.1 Al2orithm 3. Method Q (Q input data)
1. Input data: EH, EQ, QN, Q
0
2. Qk = ! . (Qk + Qk1)
2
' Dk
3. R =R·Q
or
Qk+J = [ . [EH . R'. ]]. EHT . +I J. . QN
5. Hk+l = R, · Qk+J
6. If max!Qt+J  Q
1
k I > £ , go to step 2.
6.1.2 AlJlorithm 4. Method Q (H data)
1. Input data: EH, EQ, QN, If
2. Hk = 1·(Hk +Hk1)
2
3. R'
·[H
1
[ i= 1, ... ,nb
without tree
with tree
4. Qk+I [ \ Rr without ITee
k+J [ T [ ' T ]1 ' J I
Q
=  E · E · R · E · E · R +I · E · Q
H H H Hr T . QT N
with tree
6. If max!Ht+J H/1 > s, go to step 2.
6.2. Method IT
165
Instead of algorithm 2, applied in the second step, the equation of flow of the follo
wing form is used:
(39)
where:
166
(40)
' 1
Gi = conductivity of quasilinear branch.
Ri
Sometimes a vector form of this equation is employed:
Q=d·H (41)
where:
G' =diag[G; ...
Using equations (41) and equations (33), algorithms 5 and 6 can be constructed.
6.2.1. Algorithm 5. Method pi (Q data)
1. Input data: EQ, QN, Q
0
2. Qk = _!_. (Qk + Qk1)
2
, G
3. Gi =
i = 1, ... ,nb
4.
5. Qk =d ·Hk
6. If maxiQ,k+l  Qik I > E , then go to step 2.
6.2.2. Algorithm 6. Method pi (H data)
1. Input data: EQ, QN, sO
2. Hk =L(sk +Hkl)
2
5. Qk =G' ·Hk
i = 1, ... ,nb
6. If maxiHt+l Ht I> E , then go to step 2
167
6.3. Algorithm 7. Hybrid method  algorithms 3 and 4 together with algorithm 1
Basing on numerical experiments, the Authors propose a hybrid model, combining
advantages of the solution 3 (or 4) and classical (Newtonian) algorithms. Simulation is
started with algorithm 3 (or 4) for poor start approximations; after a series of prelimina
ry iterations, when an approximation defined by a standard is obtained,
max[(x (n+l) X (n) ); X (n) ]< 0.1
(42)
a faster and more efficient classical algorithm is used. The proposed calculation method
helps avoid a number of mishaps when initiating computations for larger loop networks
(over 1000 customers).
7. Start approximation and pseudolinearization
of resistane in branches (edges) R/
All the presented algorithms require a preassumption of initial values for iterative
computations. Beside the formulation of the matrix equations, this is the most impor
tant issue. The problem of initial approximations in algorithms 3 to 7 has been solved in
this paper with the use of a method by Wood, Charles (1972), who proposed assump
tion of start parameters in a laminar flow area and through iterative corrections of the
quasilinear resistance coefficient R/ for a branch of the network (edge of graph). For a
high pressure network (over 0.5 MPa) this solution has one more advantage, i.e. com
pressibility factor Z can be iteratively determined in the function of pressure (if average
pressure in a branch (edge) changes by more than 0.2 MPa in the successive iterations).
This also refers to the linear resistance coefficient A, which depends on the relative
roughness and on Reynolds number in a turbulent area Equation (4). In this solution,
the resistance coefficient R;' can be almost automatically corrected during iterations
Assumption of initial values in the laminar area can be easily done by defining maxi
mum rates (for laminar flow), and then efficiency in the branches (graph edges) or drops
of squared of pressure values (for medium arid high pressure networks). An alternative
here is to arbitrarily assume a small value of velocity in the branches (graph edges), on
this basis, flow rate of flow in branches (edges) or drops of squared of pressure values.
8. Convergence, accuracy and uniquess of solutions for algorithms 1 to 7
Various convergence of algorithms and various accuracy (related with numerical
errors) for the group of algorithms 1 to 2, 3 and 5, 5 and 6 and 7 can be expected. This
is mainly connected with the degree of complexity of matrix equations and the number
of elements in the matrix equations. A precise analysis of convergence of Newtonian
168
methods was provided by Osiadacz (200 1 ), who showed to a much poorer convergence
of method 2 than 1. This was due to, among others, the form of the function of error.
Generally, methods 3 to 6 are much slower as far as their convergence is concerned.
Methods 4 and 6 are slightly less convergent than methods 3 and 5. Despite the reduc
tion ofthe rank of matrix (for the tree version) the number of iterations in algorithms
3 to 6 remains high and depends on the required accuracy of computation (tab. 5).
Table 5 gives a course of convergence in the function of error tolerance defined as
maxiQ;k+l  Q;k I > £ for algorithms 1 and 3. Bearing this in mind, the Authors propose
a mixed solution, employing properties of algorithms 3 to 6 and 1 to 2 (searching start
solutions with the use of methods 3 to 6). After reaching a standard (42) accuracy, an
accurate solution is proposed with the use of a classical NewtonRaphson method. This
approach is recommended for large networks (over 1000 nodes); in the case of small
and medium networks it is not necessary to use the hybrid algorithm 7. The uniquesss
of solution is guaranteed by coherent data required for solving linear equations. Rios
Mercado et al. (2002) show to the uniquesss of solution of a system of nonlinear equ
ations corresponding to the systems of equations (32) and (33). Uniquesss of solution
results from, among others, the convexity of the function in the whole domain.
The comparison of convergence of algorithms 1 and 3 for network presented
in the Fig. 3 (tolerance defined as maxiQt+I  Q;k I > E )
Por6wnanie zbieznosci algorytm6w 1 i 3 dla obliczeil sieci pierscieniowej
przestawionej na rys. 3 (tolerancja jest zdefiniowana jako max1Qt+
1
 Qt I > E )
Tolerance
No. of iteration No. of iteration
in algorithm 1 in algorithm 3
w4
7 32
w6
7 39
ws
8 46
10
1o
8 53
10
12
8 58
9. Examples of calculations
TABLE 5
TABLICA 5
Two loop networks were analyzed for the applicability of algorithms. One of them is
presented in Fig. 3, the other one in Fig. 4. The results of calculations are listed in tables
rgence
o error.
erne d.
reduc
lb. 5).
1ed as
opose
s start
an
. This
small
uesss
Rios
equ
uti on
\.BLE 5
a is
1les
3
5
8
7
Fig. 3. Example of mediumpressure loop gas network
Rys. 3. Przyklad sieci pierscieniowej
17
6
7
8
4
Fig. 4. The gas network used for comparison of calculation (Stoner 1969)
Rys. 4. Siec u:lyta do obliczen por6wnawczych (Stoner 1969)
169
6 to 8. The network presented in Fig. 4 comes from the work by Stoner (1969); it was
also analyzed by Zhou, Adewumi (1998). The correctness of the calculation scheme is
presented on the example of computations for a real high pressure network (Fig. 4)
solved with the use of algorithm 7, taking into account natural gas properties and varia
oility of linear pressure loss coefficient in the linearization process. The average error
of calculation in nodes, as referred to measurement data (Stoner 1969), does not exceed
1.3%, which satisfies requirements set by industry. The maximum error of calculation
for pressure was less than 1 bar in the analyzed example. The results of calculations
170
prove the usability of the linearized method according to algorithm 3 (or 4) with the use
of an iterative calculation of linear pressure loss and compressibility Z coefficients in
the function of pressure. A low pressure network is presented in Fig. 5 (Szilas 1986).
Data for simulation of this network are listed in table 9, whereas the results of compu
tation as compared with source calculations (Szilas 1986) are given in table 10. The
results prove a high congruence of results of calculations  below l.lPa (025 Pa on
average). The low pressure Renuard equation has been used in calculations (Szilas 1986).
200
r
Fig. 5. The low pressure loop gas network (Szilas 1986). Input pressure 330 Pa, number related to
consumer demand [mn
3
/h]
Rys. 5. Fragment niskocisnieniowej sieci pierscieniowej (Szilas, 1986). Cisnienie zasilania 3300 Pa,
liczby gazu przez odbiorc(( [mn
3
/h]
10. Conclusions
1. Algorithms 1 and 2 belong to a family of gradient algorithms; they are very fast
and convergent. The number of iterations does not depend on the complexity of ne
twork, but on the accuracy of start approximation. Otherwise, is the case with the dura
tion of each step. Owing the fastness and convergence, algorithms 1 and 2 are generally
better than the remaining ones.
2. Error in assuming the start flow rate or pressure drops in branches limits the
applicability of algorithms 1 and 2. In such cases algorithms 3 to 6 are more useful.
Further selection of the algorithm can be made on the basis of a number of branches and
nodes in the network. If the inequality nb nn + 1 < nn 1 holds, then algorithms 1, 3 or
4 are recommended; in the opposite case  2, 5 or 6.
ith the use
ficients in
las 1986).
Jfcompu
e 10. The
l25 Pa on
las 1986).
ated to
!300 Pa,
\·ery fast
y ofne
he dura
enerally
mits the
useful.
:hes and
s 1, 3 or
171
TABLE 6
The results of simulation of network presented in the fin. 3 for method "3" (medium pressure)
TABLICA 6
Wyniki obliczer\. symulacji sieci przedstawionej na rys. 3 dla metody 3 (siec sredniego cisnienia)
Branch item
Pressure depression Flow rate Velocity
[k:Pa] [m
3
nlh] [m/s]
1 1.0791 359.7 4.7
2 0.7586 901.8 5.28
3 1.1359 238.4 4.11
4 0.3773 12.70 0.67
5 0.3205 34.26 1.80
6 1.6078 273.9 4.73
7 0.822 42.10 2.22
8 0.9564 46.07 2.43
9 1.7785 81.63 4.30
10 1.1063 504.8 5.26
11 1.7392 151.1 3.54
12 1.0102 81.14 4.28
13 0.7682 72.28 2.44
The comparison of pressure solution steady state network (in the node points) for Newton
method and quasilinear method ,3" for medium pressure case
TABLE 7
TABLICA 7
Por6wnanie rozwi11czar\. ( cisnier\. w punktach wttzlowych) dla metody Newtona
i metody linearyzacji 3 (przypadek sieci sredniego cisnienia)
Node
Pressure in the node [k:Pa] Pressure in the node [k:Pa]
(NR) (NR) (algorithm 3)
1 3.8208 3.8218
2 2.1465 2.1227
3 1.3677 1.3154
4 4.2363 4.1641
5 2.8851 2.8301
6 3.9679 3.9529
7 2.1781 2.1425
172
TABLE 8
The comparison of pressures solution of steady state network (in the nodal points)
for Stoner net (Stoner 1969) for Zhou, Adewuni (1998) example using Weymouth flow equation.
Computation with DranchukPurvisRobinson (1974) EOS using algorithm 7
TABLICA 8
Por6wnanie wynik6w obliczen cisnien w stanie ustalonym dla przesylowej sieci Stonera
(Stoner 1969) dla rozwiqzania Zhou, Adewumi (1998) w modelu r6wnania przeplywu Weymoutha.
Nowe obliczenia z wykorzystaniem r6wnania stanu Dranchuka, Purvisa, Robinsona (1974)
metoda wg algorytmu 7
Results of Zhou, Adewumi This work Meas. data Dev% (Zhou,
Dev% (%)
[bar] [bar] [bar] Adewumi 1998)
37.72 37.72 37.72 0
37.20 36.65 37.24 0.109 1.585
37.13 37.69
37.14 37.66 36.55 1.620 3.042
37.33 37.77 36.90 1.163 2.377
38.50 39.23
42.39 41.54 40.69 4.185 2.101
36.23 36.78
36.74 36.01
36.13 35.41 35.86 0.747 1.268
35.54 36.07 35.86 0.908 0.578
35.30 35.65
35.36 35.89
36.28 35.73
36.24 36.78 35.52 2.022
I
3.552
37.24 36.13 1.585
AAD (%) 1.245 1.256
3. An example of computations for a real highpressure network, presented in Fig. 4,
solved with the use of algorithm 7, taking into account natural gas properties and varia
bility of linear pressure loss coefficient in the linearization process exhibits numerical
correctness of the proposed computation scheme.
4. Average error of calculation of gas pressure in nodes with respect to measure
ment data (Stoner 1969) does not exceed 1.3%, which is sufficient for industrial condi
tions. The maximum calculation error was less than 1 bar in the discussed example.
5. The results of calculations prove the applicability of the method linearized accor
ding to algorithm 3 (or 4) employing iterative calculation of linear pressure loss and
compressibility Z coefficient in the function of pressure.
BLE 8
L
XA8
1a.
g. 4,
:tria
rical
ure
ndi
e.
cor
and
I
I
'
I
!
I
Data for simulation of net presented in the fig. 5 (Szilas 1986)
Dane do obliczen sieci przedstawionej na rys. 5 (Szilas 1986)
Initial node item Final node item
Length Internal diameter
[m] [mm]
1 2 307.1 450
2 3 154.1 420
3 4 154.1 370
5 9 102.3 290
5 6 102.3 240
3 5 102.3 290
3 7 154.1 480
7 8 102.3 480
5 8 102.3 220
3 7 154.1 480
2 9 307.1 180
7 9 205.1 500
The comparison of pressure solution stedy state network (in the node points)
for low pressure case presented in the fig. 5 (Szilas 1986)
Node
item
1
2
3
4
5
6
7
8
9
Por6wnanie wynik6w obliczen cisnien w stanie ustalonym
dla niskocisnieniowej sieci  rys. 5 (Szilas 1986)
Demand Szilas, 1986 This work Diff. press.
[m
3
nlh p[Pa] p [Pa] b.p [Pa]
1200 3300 3300.0
60 3246 3247.1 1.1
160 3152 3152.3 .0.3
140 3273 3273.1 0.1
80 2619 2619.0 0
40 2702 2703.1 1.1
200 3144 3143.2 0.8
300 2278 2278.1 0.1
220 3235 3235.1 0.1
Av. abs.
0.25
err.[Pa]
173
TABLE 9
TABLICA 9
TABLEIO
TABLICA 10
174
6. By using the solution described by a hybrid algorithm 7, the following properties
of algorithm 3 (or 4) can be used: unsusceptibility to start assumption and fastness of
calculation, after reaching a sufficient start approximation for the Newtonian algorithm.
7. Algorithm 7 with tree identification offers additional advantages related with the
possibility to identify main network flows and evaluation of supply contours in the
analysed loop network.
REFERENCES
Campbell J.M., 1976: Gas Conditioning and Processing, Campbell Petroleum Series, Norman, Oklahoma.
Chen N.H., 1979: An Explicit Equation for Friction Factor in Pipe, Ind., & Eng. Chern. Fundam, Vol. 15, p. 296297.
Dranchuk P.M., Purvis R.A., Robinson D.B., 1974: Computer calculation of natural gas compressibility factors
using the StandingKatz correlation, Institute of Petroleum Technical Sieries, No. IP74008, 113.
Fedorowicz R., Kolodzinski E., Komarec R., Olajossy A., Solarz L., 2003: Optyma1ny dob6r srednic
odcink6w sieci rozdzielczej, Zagadnienia Eksploatacji Maszyn PAN, vol. 133, z. I.
Gas Engineers Handbook, 1966: The Industrial Press, Ia Edition, New York.
Gas Behavior in Distribution Systems, 1967: Gas Age Magazine (May 1967).
Institute of Gas Engineering Standard IGE/TD/3 (British).
Krstic M.R., 1991: Analysis of Gas Distribution Networks Topological Framework and Algorithms, paper SPE
22218.
Martinez Romero N., OstrioPeralta 0., Santamaria Vite I., 2002: Natural Gas Network Optimization and
Sensibility Analysis, SPE 74386.
Montoya0. S.J., J ovel  T. W.A., HernandezR. J.A., GonzalezR. C., 2000: Genetic Algorithms Applied to
the Optimum Design of the Gas Transmission Network, paper SPE 59030, 2000 SPE International Petroleum
Conference and Exhibition in Mexico held in Villahermosa, Mexico (13 Feb).
Olaj ossy A., Zaj da R., 2002: Gas Pipeline Diameter Selection Method with Reference to the Pipe Manufacturing
Standards, Archives of Mining Sciences, Vol. 47, No.4.
Osiadacz A., Zelman H., Krawczynski T., 1994: Pakiet do symulacji statycznej sieci gazowych o dowolnej
konfiguracji. Gaz, Woda i Technika Sanitarna nr 10/94.
Osiadacz A., 2001: Statyczna symulacja sieci gazowych, Wyd. Fluid System, Warszawa.
Peng D.Y., Robinson D.B., 1976: A New Two Constant Equation of State, Ind. & Eng. Chern. Fund. Vol. 15,
No.I, p. 5964.
Redlich 0., Kwong J., !949: On the thermodynamics of solutions. An Equation of state, Chern. Reviews, Vol. 44,
p. 233247.
RiosMercado R.Z., Wu S., Scott L.R., Boyd E.A., 2002: A reduction technique for natural gas transmission
network optimization problems. Annals of Operations Research, Vol. 117, p. 217234.
Siemek J., Nagy S., 2000: Transport gazu kondensatowego dwufazowymi, Nowoczesne Gazownic
two, nr I, s. 2329.
Stoner M.A., 1969 SteadyState Analysis for Gas Production, Transmission and Distribution System, SPE nr 2554.
Szilas A.P., 1986: Production and Transport of Oil and Gas, Part B, Ch. 8, Ed. Elsevier.
Wood, D.J., Charles C.O.A., 1972: Hydraulic Network Analysis Using Linear Theory, ASCE (July 1972), Vol. 98,
No. HY7, pp. 11571170.
Zaj da R., 2002: Metoda oszacowania zu:lycia gazu przez grupy odbiorc6w z sieci rozdzielczych, NaftaGaz, LVIII,
No.12.
Zhou J., Adewumi M.A., 1998: Gas Pipeline Network Analysis using an Analytical SteadyState Flow Equation,
SPE 51044 presented at 1998 SPE Eastern Regional Meeting held In Pittsburg, Pa, 911 Nov.
Paper carried out within grant of Committee for Scientific Researches no. 8 Tl2A 019 20.
REVIEW BY: PROF. DR HAB. INZ. WACLAW TRUTWIN, KRAKOW
Received: 29 December 2003