Optimization of Pipe Sizes
for Distribution Gas Network
Andrzej J. Osiadacz
Warsaw University of Technology
Regional Gas Dispatching Center, Warsaw
Historically, most interest in pipe networks has focused on the development of efficient algorithms
for the analysis of flow, and there are now very useful and efficient computer packages available
for simulation of existing and proposed new schemes. SimNet , for example, is widely used in
Poland for analysis and simulation of gas distribution systems.
In contrast, there has been comparatively little research interest into the development of
methodologies aimed at optimising the design of pipe networks. There are very few computer
packages available for commercial use that help the designer to produce truly optimal pipe
network designs. The current available methods for designing networks can be divided into three
- heuristic methods
- methods which assume a continuous range of diameters is available
- discrete optimisation methods
2. Heuristic methods
Although, these methods have developed through the years from an appreciation of what usually
constitutes a good and economic design, there is no guarantee that the designs produced will in
any sense be optimal. Even for a simple tree-like network there are a very large number of
possible designs that provide feasible solutions. It can be seen that the chances of hitting on the
best solution are very small.
In PILOT method [lo] the pipes are ordered for the tree definition according to the shortest
distance from the source. The program then proceeds in the usual way up to the point of balancing
the flows. The pipe resistances are evaluated, then recalculated using flows obtained by Hardy-
Cross loop balancing method and corresponding diameters are selected. Another Hardy-Cross to
balance the network is performed determining flows and pressures through the system. The
process of scaling resistances and performing Hardy-Cross is repeated until none of the pressures
falls below the minimum design pressure. Once the basic solution has been found the program
aims at further economic improvements.
In FP6 method , after all pipes have been set to minimum diameter the loops are defined and
initial flows assigned Hardy-Cross balancing flows. Pipes are then upgraded on maximum
flowpath from source outwards the criterion being the cost benefit. Several flowpaths are
Areas of influence are assigned to each governor in CONGAS method [lo].
The tree system is designed for each area with minimum pressure at ends and even pressure drop
loop closing pipes are sized to a minimum and Hardy-Cross flow balancing performed. The
theoretical diameters are substituted by actual diameters and network is rebalanced.
3. Continuous methods
One way of solving the design problem is to initially suppose that any size of diameter is possible.
Doing this allows continuous optimization methods to be employed. The result of such
optimization will be a set of diameters which needs to be corrected to available diameter sizes.
SUMT is an algorithm for sequential unconstrained minimization technique and is a method
devised and programmed by G. Boyne in .
In this method the cost is assumed to be given by a function of the form :
D- is the vector of pipe diameters
L - is the pipe length
a, b, p - are cost parameters
The program minimizes a sequence of functions, where the minimum of one is used as the starting
point in the research for the minimum of the next. The functions to be minimized are:
F, = c(a+bD”)L+R,, c ’
nodes (Pi -Pimu)
Pi, Pimin - are th e pressure and allowed pressure at node i and pi depends on D
R, - is a weight such that R,+I = R, /I 0
The sequential method works asfollows.
First the diametersD,, minimising Fo are found. Then D, is used as a starting point in the search__ -
for the minimum of Fl. More generally, D. is used as a starting point in the minimization of Fi+l.1
Each of these minimizations is carried out using the conjugate gradient method. The procedure
stops when Di+,is sufficiently close toD, . (Note that R, decreases rapidly with n so the last
solutions are effectively minimising cost).
This process yields a local optimum. The program now randomly generates a new set of diameters
and uses these to begin the whole procedure again and locates another local minimum. This
continues until a “sufficient” number of local optima are found and the cheapest of these is the
In addition this program uses the parametric technique to ,,round” up each local optimum.
Watanatada [l l] has used augmented Lagrangian methods to obtain optimised designs of water
distribution systems. The model he used is asfollows:
Di - diameter of the i - th pipe i E[1,NP]
pj - pressure atj - th node j E [~,NN]
Qk- flow out of the k - th source k E[l,NS]
&tin i, pmirti - the corresponding minimum allowed pressures
The flow equation, relating pressure drop and flow is used to eliminate pipe flows as independent
New variables are now introduced:
D; = Dmin,+ X; i=l,NP
Pi = Pmini+ ‘Z i=NP+l,NN+NP
Qi = X” i=NN+NP+l,NN+NP+NS
- this last equation means that the total flow from each source must be non-negative
The problem can now be formulated as one of minimizing the cost C(X) subject to the total flow
at each node being zero -
T(X)= CQ-d, =0 i=I,NN (3)
- di is the demand at each node, except for sources where it is the total flow Qi
The method used in [ 1l] to solve this problem is to use the augmented Lagrangian function
This function is successively minimized with r = 0,I,2,. ... Initially, EF) = 0, the value of .!,“I
is found from that of Ef) and the corresponding minimising x value, x”‘, by the relationship:
The value xtr) should then converge to a local minimum.
In  the use of the generalised reduced gradient method (GRG) in the design of expansion in
water distribution networks is described. In the optimization model the objective function includes
capital cost of pipelines and operating cost of pumping stations. The main constraints are a set of
non-linear hydraulic equations, upper and low bounds of diameters, and a minimum requirement
of pressure head at nodes. A modified Newton - Raphson technique is use in the hydraulic
simulation to accelerate calculation and the convergence and consistency of the algorithm is
For the expansion of an existing water distribution network, consisting of m branches and ~2nodes
the objective function is asfollows:
min COST= K,xLiDe +K2xQiHi (6)
g@&,B) = Q
(7)0, 2 Dmini, i Ey,,
Q - vector of diameters, Q = [D, ,D, ,...D,,,]’
Q - vector ofloads, Q = [Q,,Q,...Q,]'- -
H - vector of pressure heads at nodes, H = [H, ,H, ...HnIT
Dmin- permissible minimum diameter
Hm, - permissible minimum nodal head
s(LL QZ) - vector of functions used in simulation- -
L - length of pipe
b, - the set of new branches
p,s - the set of source nodes with pumping station
Kl - a constant related to cost of pipe (weighting factor)
e - exponent related to pipe constant, e E [I,21
Kz - a constant dependent on the unit cost of energy
In the optimization model, the decision variables are the diameters of new pipes Di, i Ebn, the
pressure head H will be solved in the simulation (eq.(7)) if the diameter Q and loads e are
known. H can be called state variable.
There are two problems associated with these methods. The first is how to correct from the ideal
diameter to available diameter sizes. The figures given in  suggest that the effects of such
,,rounding” can be made acceptably small. The second problem is that of local optima. A local
optimum is an acceptable network such that a small perturbation of the diameters either causes the
pressure to fall below the minimum or leads to an increased cost. Continuous design methods try
to find local optima because it is known that one of these will be the cheapest design.
4. Discrete methods
Rothfarb at al  give a simple and effective method for finding the cheapest design when the
network has no loops.
This method is based on the fact that when a diameter is assigned to a pipe then pressure drop
across that pipe and the cost of the pipe is determined because in a tree the flows are known. Pipes
may be joined in a tree network in one of the two ways - either in series or in a “V”.
If two pipes are linked in series (Fig. 1) then the list of possible diameter assignments can be
reduced considerably simply by eliminating any pair of diameters of there is another pair which
produces a lower pressure drop at lower cost. This is because if the diameters with the higher
pressure drop are part of a feasible network then they can always be replaced by the pair with
lower pressure drop thereby reducing costs.
Pipes may also be joined in a “V” (see Fig.2).
This situation differs from the first only in the way the pressure drop is calculated. For any
diameter assignment to these pipes the pressure drop across the pair may be taken as a maximum
of the individual pressure drops. Therefore, provided these pipes are at the downstream end of a
network, any pair of diameters can be eliminated if there is another pair of diameters which, when
assigned to these pipes, produces a lower pressure drop at lower cost. If there are n possible
diameters for each pipe then this “V” elimination will produce at most 2n acceptable pairs. These
methods can be easily extended to networks of pipes. If we have a list of pressure drops and their
costs for arbitrary networks A and B which are joined at node 1 (Fig. 3) then the maximum
pressure drop across the combined system is the maximum of the pressure drop across A and the
pressure drop across B. Again any pressure drop across the combined system can be eliminated if
there is another pressure drop both lower and cheaper .
Likewise pipe C may be joined to network D (Fig. 4). Again, a list of the system pressures could
be drawn up consisting of pressures which are the obtained by summing one from the C list with
one from the D list. Then these pressures for which there is a lower and cheaper system pressure
would be removed from this list to give a list of pressures (and costs) for the C-D system. This
process ends when a list of acceptable pressures has been built up for the whole system. The
cheapest pressure on this list consistent with the design requirements is then chosen and the
associated diameters found.
Beale [l] gives a method of optimization which removes non-linearities in the constraints by
introducing piecewise linear approximations. However, the problem as formulated by Beale can
give as solutions designs which are infeasible.
The trouble with his method is the assumption that in the optimization procedure the flow
can be replaced by the inequality
If, when the problem is solved, there is strict inequality in this expression then the values ofp and
e have no physical significance since they do not satis@ the flow equations. If the diameters we
allowed to be continuous then this problem would not arise because there would always be
equality (inequality implies that k(D) can be increased by a small amount while retaining the
values of e and y thereby giving a cheaper but still feasible solution). In the case of discrete
diameters strict inequality can occur, and as the example shows (see [l]) this produces a set of
pipes satisfying Beales conditions but in some casesdoes violate the true pressure requirements.
5. Proposed method
In order to optimize a network design it is first necessary to formulate a completely defined
mathematical model of the system. The system has to be optimised from a cost view point and thus
a relationship between the pipe cost and the system variable (i.e. diameter) must be specified. The
objective function which links pipeline cost to diameter for distribution gas network is:
f(Q) = 2.05.[4 L, K LmlT. Di (21) (8)
L - length of the pipe,
D - diameter of the pipe,
m - number of pipes.
The network optimization problem involves minimizing the cost function expressed by above
equation subject to certain operating constraints.
For any network Kirchhoff s laws must apply.
I-st Kirchhoff s Law:
A - nodal-branch incidence matrix, dim _A= (n x m):
aj 7 if branch j entersnode i
aij = -aj , if branch j leavesnodei
0 , if branch j is not connected to node i
d - vector of loads, dim d = (m x 1).
II-nd Kirchhoff s Law:
I$ - loop-branch incidence matrix, dim B = (u x m), u - the number of independent
p j , if branch j has the samedirection as loop i
bij = -pi , if branch j hasopposite direction to loop i
0 > if branch j is not in loop i
y - flow equation exponent
In addition, the pressure at all nodes of the system must not fall below a given minimum working
Pi - Pimin’ O (11)
pi - is the nodal pressure value
Another constraint was imposed on the gas velocity at each branch. It was assumed that
VminI v < vmax (12)
for all branches i.
The above problem has been formulated as a nonlinear programming one with nonlinear
constraints in the form:
min f(z) (13)
subject to equality and inequality constraints:
ci(g)= 0 , i = 1,2,K ,m’
c&20 , i=m’+l,K ,m1
and the functions f(z) and c;(z), i=1,2,... ,m are real and differentiable. To solve this problem, an
iterative method is used at each iteration which minimizes a quadratic approximation to the
Lagrangian function subject to sequentially linearized approximations to the constraints (). To
begin the calculation a starting point 50 has to be chosen together with positive definite matrix ISo.
The iterations generate a sequence of points B (k=1,2,...) that usually converges to the required
vector of variables and also the generate a sequence of positive definite matrices & (k= 1,2,. ..).
At the beginning of the k-th iteration both a and & are known. The vector d=& is obtained by
minimizing the quadratic function:
subject to linear constraints:
ci(g,)+cf 4%,(x,) = 0 , i = 1,2,K ,m’
c~(~,)+~_~~VC~(X~)>O , i=m’+l,K ,m
The vector a+1 has the form:
ak - is a positive step-length
The calculation of & is a quadratic programming problem having the property that, if all
constraints are linear and if f(z) is a quadratic function whose second derivative matrix is E& then
a+& is the required vector of variables. Given that & is the m-component vector of Lagrange
multipliers at the solution of the quadratic programming problem which defines 4, the definition
of &+I must depend on & in order to take account of any constraint curvature.
6. Results of investigations
To prove the correctness of the stated algorithm a non-trivial examples have been solved. We
will show the results for two networks.
The low pressure gas network shown in Fig.5 comprises 108 pipes, 83 nodes and 2 sources. List
of pipes and list of nodes are given in Table 1 and Table 2 respectively.
To calculate flow through each pipe, Pole’s equation [S] has been used:
Ap - drop pressure along a pipe [Lb/in2],
Q - flow through pipe under standard conditions [cu.ft./h],
D - diameter of pipe [A]
The results of simulation presented in Table 3 and Table 4 have shown that, network was badly
designed. The gas velocity in many pipes does not exceed lmls (heavy lines in Fig. 5).
The aim of optimization is to minimize objective function (eq.(8)) subject to constraints.
For this case:
Qi = a, .Di2 [CU$/h] (1%
OT,i= 19.6354 X Vi,
Api =P, .Q-’ [Lb/in21
pi = 1.391X1O-6 X Li X Vi*,
y = I in equation (10)
It was assumed that:
16.4 ft / s I vi 2 32.8 ft / s
for each pipe,
pj 2 0.261 Lb / in2
for each node.
Results of optimization are given in Table 5.
The medium pressure gas network shown in Fig. 6 comprises 39 pipes, 36 nodes and 1 source.
List of pipes and list of nodes are given in Table 6 and Table 7 respectively.
For this case Renouard’s equation  has been used:
AP = p,! - p,?= 5.01I39 *I o-” *Ps
pS- density of gas (the subscript s refers to quantities at standard conditions
pS= 14.5 Lb/in2 and temperature T, = 32 “F).
The results of simulation are presented in Table 8 and Table 9.
Branches for which
vi 13.38 fth
vi 2 65.4ft / s
are marked by heavy lines in Fig. 6.
For the purpose of optimization:
Q = aj -Q2 [cxjm]
CXi= 1.751 X p&s X Vi,
p&s - average absolute pressure in the pipe [psia],
Api = pi . &‘.I8 [(Lb / in2)l]
pi = 7.051 X 10m6X Li X p:by X Vii’**,
y = 1.18 in equation (10)
It was assumed that:
32.8 ft / s s vi s45.8 ft / s
for each pipe,
pi 2 14.5 Lb / in2
for each node.
Results of optimization are given in Table 10.
In both cases, diameter of pipes were corrected to the closest available diameter sizes.
Investigations have shown, that developed algorithm works properly. Optimization of pipe
diameters for the first network (Fig. 5) gives total profit equal 44603.00 USD. Second case gives
less savings, only 2900.00 USD, because much smaller network was much better designed.
Beale, E.M. Some Uses of Mathematical Programming Systems to Solve Problems that are
not Linear”. Operational Research Quarterly. 1975, Vol. 26,3. pp. 609-618
Boyne, G.G. ,,The Optimum Design of Fluid Distribution Networks with Particular
Reference to Low Pressure Gas Distribution Networks”. International Journal for Numerical
Methods in Engineering, Vol. 5, 253-270, 1972
Chamberlain, R.M., et al, ,,The Watchdog Technique for Forcing Convergence in Algorithms
for Constrained Optimization”, Report DATMP 80/NA9, University of Cambridge
Guoping Yu and Powell R. ,,A Generalized Reduced Gradient Approach to Expansion of
Water Distribution Networks”. International Conference on Pipeline Systems, 1992,
Osiadacz, A.J. Simulation and Analysis of Gas Networks”. E&FN Spon Ltd., London 1987
Osiadacz A.J., Zelman H. and Krawczynski T. ,,SimNet SSV - Package for Steady-state
Simulation of any Gas Network” (In Polish), GWiTS, Nr 6, 1995
Powell, M.J.D. ,,Extensions to subroutine VFO2AD”. In System Modelling and Optimization,
Lecture Notes in Control and Information Sciences 38, eds. R.F. Drenick and F. Kozin,
Springer Verlag, 1982
Rothfarb B., Frank M., Rosenbaum D.M., Steiglitz K. and Kleitman D.J. ,,Optimal Design of
Offshore Natural Gas Pipeline Systems”. Operational Research 1980, Vol. 18, Part 6
Stubbs C.W. and Thompson P.D. ,,Designing Gas Distribution Networks by Computer”.
Manchester District Junior Gas Association, April 1979
[lo] Ward E. ,,Design of Gas Distribution Networks Using PILOT”, LRS T195, October 1974
[l l] Watanada T. ,,Least Cost Design of Water Distribution Systems”. Journal of Hydraulics
Division, ASCE, September 1973, HY9