Similarities and Differences in Optimization of Water-and Gas-Distribution Pipeline Networks

Accent is on determination of appropriate friction factor of the pipes and on selection of the representative equation for water or natural gas flow which is valuable for existing conditions in the looped network of pipelines. Note that in a municipal gas pipeline, natural gas can be treated as incompressible fluid (liquid) i.e. as water or oil. Even under this circumstance, calculation of water pipelines cannot be literary copied and applied for calculation of gas pipelines. Inappropriate friction factor, equally as e.g. inappropriate usage of water flow equations for calculation of gas networks can lead to inaccurate final results. Few iterative methods for determining the optimal hydraulic solution of water-and gas-looped pipeline networks, such as, Hardy Cross, modified Hardy Cross, node-loop method, node and M.M. Andrijashev method, will be shown. Speed of convergence will be compared and discussed using a simple network with three loops.


Similarities and Differences in Optimization of Water-and Gas-Distribution Pipeline Networks INTRODUCTION
Accent is on determination of appropriate friction factor of the pipes and on selection of the representative equation for water or natural gas flow which is valuable for existing conditions in the looped network of pipelines.Note that in a municipal gas pipeline, natural gas can be treated as incompressible fluid (liquid) i.e. as water or oil.Even under this circumstance, calculation of water pipelines cannot be literary copied and applied for calculation of gas pipelines.This means that inappropriate usage of friction factor, equally as e.g.inappropriate usage of water flow equations for calculation of gas networks can lead to inaccurate final results.Various equations have been proposed to determinate the head losses due to friction, including the Darcy-Weisbach, Fanning, Chezy, Manning, Hazen-Williams and Scobey formulas [1].These equations relate the friction losses to physical characteristics of the pipe and various flow parameters.Darcy friction factor (somewhere known as Moody factor) is the main parameter of the Darcy-Weisbach equation [2].The Fanning factor is not the same as the Darcy friction factor (which is 4 times greater than the Fanning Friction factor).The development of 'Moody Chart' [3] which enables engineers to plot the Darcy friction factor and the use of the personnel computer to calculate the Darcy Friction factor has led to a large reduction in the use of the Fanning friction factors.The Fanning formula is very similar to the Darcy-Weisbach formula but the hydraulic radius of the pipe work must used, not the pipe diameter.These two factors are for water or gas flow.But the Darcy-Weisbach and the Fanning also formulas in their basic form are only for water (liquid) flow.If we apply these equations for gas flow without modification, discharges i.e. calculated flows will be in relative correct range of accuracy but deviation of calculated pressure drops (head losses) from real values cannot be neglected.Note that the Darcy-Weisbach formulas are not synonym with Darcy friction factor, equally as the Fanning formula is not synonym with Fanning friction factor.Factors are main factors in related formulas.Darcy friction factor is recommended after different authors for different flow regimes such as laminar, smooth, turbulent, etc. Authors of these factors are e.g.Renourad, Blasius, Moody, Colebrook, Altshul, etc. Possible modification of the Darcy-Weisbach equation adjusted for gas lines will be shown in this paper.Also, should be noted that physical meaning of Darcy and Fanning friction factor are the same.First is in common use in Europe and in civil and petroleum engineering, while the second one is more common in America and in chemical engineering.
Finally, in this paper will be compared few iterative methods for determining the optimal hydraulic solution of water-and gas-pipeline networks which take form of ring-like, such as, Hardy Cross [4], modified Hardy Cross [5,6], node-loop method [7,8] and node method [9].In the group of the modified Hardy Cross method belongs Andrijashev method [10,11].Speed of convergence will be compared and discussed.This will be done for one simple network with three loops both, for water-or gas-network.For air ventilation system see paper of Aynsley [12].

HYDRAULICS FRICTIONS IN PIPES
Each pipe is connected to two nodes at its ends.In a pipe network system, pipes are the channels used to convey fluid from one location to another.The physical characteristics of a pipe include the length, inside diameter, roughness coefficient, and minor loss coefficient.The pipe roughness coefficient is associated with the pipe material and age.The minor loss coefficient is due to the fittings along the pipe.When fluid is conveyed through the pipe, hydraulic energy is lost due to the friction between the moving fluid and the stationary pipe surface.This friction loss is a major energy loss in pipe flow.Losses of energy, or head (pressure) losses depend on the shape, size and roughness of a channel, the velocity density and viscosity of a fluid, and they do not depend on the absolute pressure of the fluid.Experiments show that in many cases pressure drop for flow of liquids are approximately proportional to the square of the velocity (1).
Equation ( 1) is called the Darcy-Weisbach equation, named after Henry Darcy, a French engineer of the nineteenth century, and Julius Weisbach, a German mining engineer and the scientist of the same era.Weisbach first proposed the use of non-dimensional resistance coefficient (in USA more used coefficient after Fanning), and Darcy carried out numerous tests on water pipes.In eq (1) velocity can be replaced by flow (2): Note that the Darcy friction factor is defined in theory as λ=(8·τ)/(ρ·v 2 ) where τ is shear stress expressed in Pa.Reynolds (1883) found that the onset of turbulence in pipe was related to one non-dimensional parameter (3): When ε is very small compared to the pipe diameter Din i.e. ε/Din→ 0, λ depends only on Re.When ε/Din is of a significant value, at low Re, the flow can be considered as in smooth regime (there is no effect of roughness).As Re increases, the flow becomes transitionally rough, called as transition regime in which the friction factor rises above the smooth value and is a function of both ε and Re and as Re increases more and more, the flow eventually reaches a fully rough regime in which λ is independent of Re.In a smooth pipe flow, the viscous sub layer completely submerges the effect of k on the flow.So, the Darcy friction factor do not depend on a fluid type, or better to say on phase in which fluid exist at present conditions in pipe, which means that procedure for calculation of λ is the same for liquids and gases.In both cases λ is function of Re and/or k.But eq. ( 1) and subsequently eq. ( 2) have to be rearranged for flow of gaseous fluids as follows.A steady-state momentum balance on a differential control volume of pipe leads to equation which incorporates the friction factor (4): Where A is pressure force work term, B is energy dissipation by viscous friction, C is kinetic energy term and D is potential energy term.General equation for gas flow can be generated from eq. ( 4).Details of further transformation can be found in the paper of Coelho and Pinho [13].In the present practice in a calculation of gas networks, Renouard equation ( 5) is used by the engineers from Serbia and other countries, such as France, Spain, Portugal, etc.
Equation ( 5) is rearranged eq. ( 2) for gas flow according to previously shown transformation (4) with incorporated Renoaurd formulation for Darcy friction factor in hydraulically smooth region.This region of partially turbulence is most possible in conditions when gas is conveying through polyethylene (PVC) pipes.Renouard formulation of Darcy friction factor can be noted as λ=0.172·Re -0.18 .This value has been already included into eq.( 5).Subsequently, the Renouard relation for pressure drop for liquid flow is (6).But note, that for liquid flow is more convenient the Colebrook-White equation (7) for the Darcy friction factor.Under these consequences partially turbulent regime is rather occurred than hydraulically smooth regime.
To investigate influence of adopted equation i.e.Renouard relation adjusted for gas flow (5) and for liquid flow (6), here will be used pipe 8 from our example from Figure 1.To fell the influence of equation, relation (5) will be used for gas calculation and only for scientific reasons relation (6) will also be used for gaseous flow.Result with relation ( 5 Chezy, Manning, Hazen-Williams and Scobey formulas are only for water, i.e. for liquid flow and these factors cannot be used for gas pipeline calculation.Introduced in the early 1900s, the Hazen-Williams equation determines pipe friction head loss for water, requiring a single roughness coefficient.Unfortunately even for water it may produce errors as high as ±40% when applied outside a limited and somewhat controversial range of Reynolds numbers, pipe diameters and C coefficients.Not only inaccurate Hazen-Williams equation is conceptually incorrect [14,15].Valuable book for waterworks but with the Hazen-Williams equation is by Boulos et al [16].

LOOPED PIPELINE NETWORKS
Here will be compared five methods for calculation of looped networks.These methods are Hardy Cross [4], modified Hardy Cross [5,6], M.M. Andrijashev [10,11], node-loop method [7,8] and node method [9].Performance of convergence will be compared for all methods.Methods are applicable both, for gas and for water networks.Contemporary with Hardy Cross [4], soviet author V.G.Lobachev [10] developed very similar method compared to original Hardy Cross method.Method of M.M. Andrijashev [11] was very often being used in Russia during the soviet era.According to this method, contour and loop are not synonyms (contours for calculations has to be chosen to include few loops and only by exception one as in Hardy Cross or in modified Hardy Cross).So method of M.M. Andrijashev is some sort of Hardy Cross (or modified Hardy Cross).In Figure 1 is given an example of one pipeline network with three loops.

Figure 1. Example of pipeline network with loops
Hardy Cross method (Single contour adjustment method) Hardy Cross developed this method in 1936 [4].In Hardy Cross calculation, previously, it is necessary to determinate maximal consumption of water or gas per each node (Qoutput), and one or more inlet i.e. input nodes (Figure 1).These parameters are looked up.Now, initial guess of flow of gas or water per conduits has to be assigned.These flows must satisfy first Kirchhoff's law for all nodes in all iterations.Second Kirchhoff's law for all contours will be satisfied in the end of calculation.Second Kirchhoff's law, changed of flow per pipes or number of iterations can be used as stopping criterion.Network is in balance after that.Initial flow pattern can be locked up and then diameters of pipes have to be changed during the iteration process (optimization of diameters of pipes according to first assumed flows).Here will be shown another approach.Diameters of pipes are locked up, and flows per pipes will be changed in iterative procedure.The Hardy Cross calculation for gas pipeline network will be shown in Table 1 and for water network in Table 2.Only first iteration will be shown in details.Flow Q1 calculated in first iteration become initial flow Q for second iteration.The plus or minus preceding the flow, Q, indicates the direction of the conduit flow for the particular contour.A plus sign denotes clockwise flow in the conduit within the contour; a minus sign, counter-clockwise.A flow correction Δ1 as shown in Table 1 and 2 is computed for each contour.This correction must be subtracted algebraically from the assumed gas flow.Table 1.Hardy Cross calculation for gas network from Figure 1 Iteration 1  1; a using ( 5), b also using ( 8), c Δ2 is Δ1 from adjacent loop In presented example contour I coincides with loop starting and ending in node II via pipes 3, 4, and 7.
Table 2. Hardy Cross calculation for water network from Figure 1 Iteration 1  1; a using ( 2) and ( 7), b also using ( 8), c Δ2 is Δ1 from adjacent loop A conduit common to two loops receives two corrections.The upper plus or minus sign shown indicates direction of flow in that conduit in these two contours and is obtained from Q for previous iteration.The upper sign is the same as the sign in front of Q if the flow direction in each contour coincides with the assumed flow direction in the particular contour under consideration, and opposite if it does not.The lower sign is copied from the primary contour for this correction (sign from the contour where this correction is first, sign preceding the first iteration from adjacent contour for the conduit taken into consideration).The rules for sign of corrections Δ2 are: (1). the algebraic operation for correction 1 should be the opposite of its sign; i.e. add when the sign is minus.(2). the algebraic operation for corrections 2 should be the opposite of their lower signs when their upper signs are the same as the sign in front of Q, and as indicated by their lower signs when their upper signs are opposite to the sign in front of Q.For details of sing of corrections consult paper of Brkić [6] and Gas Engineers Handbook [17].These rules will be used also for modified Hardy Cross, M.M. Andrijashev, and node method.

Modified Hardy Cross method (Simultaneous contour equation solution)
In the original Hardy Cross method, each contour correction is determined independently of other contours.As seen in Figure 1, several contours have common pipes, so corrections to those contours will impact energy losses around more than one contour.In Figure 1, pipe 4 belongs to two contours (contour I and II), pipe 7 to contours I and III, and finally pipe 5 to II and III.Modified Hardy Cross method is a sort of Newton-Raphson method used to solve unknown flow correction in one iteration taking into consideration whole system simultaneously.Original Hardy Cross method is also a sort of Newton-Raphson method but used to solve each single contour equation solely, one by one.Epp and Fowler gave idea for this approach in 1970 [5].So, in matrix form original Hardy Cross approach from Table 1 can be noted as (8): i.e. using numerical values from Table 1 this became (9): Then [ΔI, ΔII, ΔIII] T are [-0.132677448,0.09721967, 0.008808991] T as in Table 1.Similar can be done for water network in Table 2. To increase efficiency of the Hardy Cross method zero from non-diagonal term will be replaced to include influence of pipes mutual with adjacent contours (10).Presented matrix is symmetric.(10) i.e. using numerical values from Table 1 this become (11):

Modified method M.M. Andrijashev
This method can be used in the formulation as in original Hardy Cross method and as in modified Hardy Cross method.Here will be given in notation as improved method because this approach shows better convergence performance (for gas in Table 3).It can be notified that some pipes in Table 1 or in Table 2 received only one correction per iteration (for example pipe 3 in contour I).This means that pipe 3 belongs only to one contour.Contours can be defined in other way and then each pipe in the network belongs to two networks (see illustration in the downright corner in Figure 1).This means that loop is not synonym with contour as in Hardy Cross approach.Now contour I' starting and ending in node I via pipes 4, 5. 6, 8, 3, contour II' starting and ending in referent node via pipes 1, 6, 8, 7, 4, 2, and finally contour III' starting and ending in referent node via pipes 1, 5, 7, -3, -2.Table 3. Method M.M. Andrijashev for gas network from Figure 1 Iteration 1  1; a using ( 5), b Δ1 after eq. ( 12) i.e. ( 13), c Δ2 is Δ1 from adjacent loop Here has to be very careful because non-diagonal terms are not always negative as in modified Hardy Cross method (13).For example term in first row, second column is 25862392143=4298435730+22897756035-1333799622.Same value has term in second row, first column, etc. Presented matrix is symmetric.Node-loop method Wood and Charles (1972) developed the flow adjustment method by coupling the loop equations with the node equations [7].Wood and Rayes later in 1981 improved this method [8].Rather than solve for loop corrections, in this method, conservation of energy around a loop is written directly in the terms of the pipe flow rates.Final result after this method is not flow correction, but even better flow itself.Node (14) and loop (15) equation for our example can be noted in matrix form.Note that node II is input node equal as referent node (sign -).

Node method
Pipe equations in previous text were expressed as Δp=f(Q) for waterworks, or Δ( for each pipe has to be assumed, not flows.These assumed pressures have to be chosen to satisfy second Kirchhoff's law (Figure 2).  3. Calculation after the node method for gas network from Figure 1 and 1; See Figure 2 for initial pattern a using (18

COMPARISONS OF THE RESULTS
Five methods for calculation of looped pipelines for gas or water distribution have been shown in previous text.Final flows are unique after all presented methods, and will be listed in Table 4, both for water and for gas network.Each method has advantages and shortcomings.Convergence performances will be compared for all presented methods (Figure 3).Note that the node method cannot be compared literary because initial values cannot be equalized.In all other methods initial patterns are given in the form of flows, while in the node method initial pattern is in the form of pressures.

CONCLUSION
Comparison between analyzed methods was carried out, taking as a criterion of comparison the number of iteration for achievement of accuracy of the results.The Modified Hardy Cross method, the modified Andrijahshev method and the node-loop method have equal performances according to above adopted criterion.But among these three methods, the node-loop method is superior because it does not required complex numerical scheme for algebraic addition of corrections in each of iterations.In the node-loop method final result after each of iterations is flow and these flows are being used for input in next iteration without any modification.The modified Andrijashev method are complicated than the modified Hardy Cross method but without improvement in speed of convergence.The node method has the worst performance of convergence, but this method is different in its approach compared to the all other shown method in this paper.The node method cannot be rejected based only on calculation shown in this paper.The Hardy Cross method has historical value and should be replaced with the modified Hardy Cross method, or even better with the node-loop method.
=f(Q) for gas networks.These relation can be rewritten in form as Q=f(Δp) for waterworks or Q=f( .After that, Renouard equation (5) can be rearranged (18):

Figure 2 .
Figure 2. Example of pipeline network with loops from Figure 1 adjusted for node method