Analysis of a Water Distribution Network by Newton-Raphson Multivariable Method: A Case of Negligible Minor Losses

A logical, analytical evaluation of a water supply network is a daunting engineer’s task. Amongst other concerns, concentrated effort is directed at forestalling huge, avoidable installation and operation costs. This paper examines the water supply network for a two-wing student hostel, consisting of 20 rooms per block and 10 blocks per hostel wing. The plumbing fixtures per block were noted as 6 shower faucets, 8 lavatory sinks, 6 water closets and 2 hose bibs. A water supply pipe network consisting of 13 pipe sections was proffered. Solution sets of the network were generated through a computer implementation of a Newton-Raphson multivariate procedure and a pipe-sizing algorithm. Each solution set is a data collection of a possible mix of 13 pipe sizes and their respective flow rates that satisfy the fluid dynamics conditions and the acceptable velocity range of 0.5m/s to 2.44m/s. An optimal solution set is further selected as one with the least head loss at the first index node. This work is a viable tool for analyses of networks with similar scope. Keywords: Head Loss Optimization, Pipe Network Analysis, Newton-Raphson Method, Velocity Constraints. DOI: 10.7176/ISDE/11-2-03 Publication date: March 31 st 2020

to its ready availability, low installation and maintenance cost, suitability for conveyance of cold water aground and underground, and other favourable attributes. From these data, fluid dynamics equations, mathematical methods and a pipe-sizing algorithm were employed to obtain other relevant network parameters for the assessment of the network.

2.2: Methods
The analysis and assessment of the network were done with the use of relevant fluid dynamics concepts, principles, models and equations, which were further treated by suitable mathematical methods. 2.2.1: Layout and Description of Proffered Distribution Network The proffered distribution network is shown schematically in Fig. 1.

LEGEND [ ]
Pipe Section 1,2,3,…, 11 Nodes Fig. 1. Schematic diagram of the proposed water distribution network The proposed network follows from the architectural layouts of the hostels. On-field measurements were taken and the pipe lengths connecting discharge/delivery points were estimated. Each discharging node supplies a block's toilets and bathrooms. The nodes numbered 2 to 6 are delivery points to one wing of the hostel and those numbered 7 to 11 are delivery points to the other wings. The pipes are designated by the nodes of their ends. The pipe lengths (inter-nodal distances) are presented in Table 1.

2.2.2: Pipe Size Catalogue
The schedule 40 PVC pipe is manufactured in various sizes. A catalogue of the sizes of (sch.40) PVC pipes manufactured for practical plumbing is given by Table 2.   Table 4 gives conversion of the total fixture units to flow rates As water flows through pipes of the network, undesirable noise would be produced if the velocity of the flow is high. Water hammer, cavitation and erosion of the pipe internal surface are also associated with high velocity of flow (Kocyigit et al, 2015). In order to reduce these negative effects, the maximum velocity of flow is limited according to the plumbing code employed. According to Uniform Plumbing Code (2016), the (maximum) pipe flow velocity should be no more than 2.44m/s (i.e. 8 ft/s). Also, a minimum flow velocity sufficient to prevent possible flow stagnation, associated growth of sediments and pipe blockage, is required. In the work of Kocyigit et al (2015), a minimum velocity (known as flushing velocity) was set at 0.5m/s. This is adopted as the lower limit for the pipe flow velocities in this work. Thus, the velocity limiting constraints is summarized as: Lower velocity limit = 0.5 m s ⁄ ≤ v ≤ 2.44 m s ⁄ = Upper velocity limit where = velocity of flow in pipe ; for each j = 1,2, …, NP and NP = number of pipes in the network.

2.2.5: Nodal Pressure Limit
It is important to have sufficient discharge pressures at the delivery units, as this would allow for further interior plumbing extensions. If the pressure is not sufficient, the flow to indoor fixtures will be delivered at weak pressures. Also, water may not have sufficient pressure to rise through vertical pipes en route to fixtures. Hence, a minimum residual pressure is ensured at the delivery nodes of the network. This value is set at the node having the highest head loss (relative to source node). This node is known as the first index node. Uniform Plumbing Code (2016) stipulates a minimum residual pressure of 124.106 kPa (12.6553 mH2O or 18.0psi).
where ( = density of water. ) = dynamic viscosity of fluid. * = kinematic viscosity of fluid += % " , 2.2.7: Major Losses In this paper, major losses, which are losses due to friction, are computed using Darcy-Weisbach equation (Ideriah, 2017) given as ℎ = . where 2.2.9: Continuity Equation Continuity equation is the fluid dynamics expression of the law of conservation of mass. It states that mass (or mass flow rate) is conserved. For a distribution network, the principle is applied to the nodes. For a steady state, incompressible fluid, at a given node i, the algebraic sum of the flow rates leaving and entering the node, with due regard to sign (+/-), is zero: ∑ = 0| K (8) where j is the pipe connected to the node i and j Q is the flow rate in pipe j. This equation is applied on all nodes, except Node 1. By reason of assigning signs (+/-) to each , the flow rates in the pipes can be estimated to be positive or negative, and these signs only depict direction of flow. The (initial) directions of the flow in the pipes are assumed before the computation. This initial assumption of direction facilitates the use of the continuity equation. Nevertheless, the signs (+/-) of the computed flow rates approve or disapprove the initial directions assumed. Thus, a positive (+) value endorses the assumed direction and a negative (-) value indicates a reverse direction.

2.2.10: Principle of Head Balance
The principle of head balance is a corollary of the principle of head identity, which states that the pressure of a fluid in a steady flow, at any fixed point, is constant, and independent of the path to the given point. Hence, the pressure difference between any two points (more interestingly, nodes) in a steady flow is constant. The head balance principle follows thus: The algebraic sum of head losses, with due regard to sign, around any closed loop L in a flow network, is zero: where is a pipe with flow direction along the path of the closed loop L and j h is the total head loss through pipe . This principle is applied on the "irreducible" loops and complements the continuity equations. Considering any two points 1 and 2 in the network, let L and L represent the respective (absolute) heads at those points; then, head loss between points 1 and 2, ℎ = ∆L :, = L : − L (10) In application of the head balance principle, points 1 and 2 coincide with immediate neighbour nodes, and the head Innovative Systems Design and Engineering www.iiste.org ISSN 2222-1727 (Paper) ISSN 2222-2871 (Online) Vol. 11, No.2, 2020 20 loss between the nodes is the resulting head loss in the connecting pipe.

2.2.13: Newton-Raphson Multivariable Method
The algorithm of Newton-Raphson multivariable technique is used to solve the generated system of non-linear equations for values of flow rates and then, by extension, head losses, frictional factors (4 5 ) and other parameters. It is noteworthy that this algorithm is executed at fixed diameters of the pipes. So the algorithm is not used to size pipes, and as such does not, per se, resolve the velocity limiting problem. This algorithm is thus embedded in a broader algorithm for pipe-sizing. The sequence of steps which constitute the Newton-Raphson algorithm follows thus: Step1 : Obtain the system of equations by applying continuity Eqn. 8 on all nodes except Node 1, where NN = number of nodes and i indexes each node. This yields the following equations for the respective nodes: where Qd Ÿ = delivery (consumption) rate at Node i. Here, in the case of same delivery rates, Qd Ÿ = Qd for all i & k (i ≠ 1 ≠ k); i, k = 2,3, … ,11 (that is, except the source Node 1). Now applying the head balance principle Eq. 9 on all "irreducible" loops: where NL = No. of "irreducible" loops, i indexes each such loop. Here, "irreducible" implies not containing a smaller loop within. So, (NN-1) + NL = NP for consistency of system of equations; where NP=No of pipes in the loop with unknown flow rates. Since The incorporation of these equations constitutes a non-linear system of equations. From the three loops (head balance principle): Loop 1: Nodes 1-2-3-8-7-1, Loop 2: Nodes 3-4-5-10-9-8-3, and Loop 3: Nodes 5-6-11-10-5 we have Step The Jacobian matrix ª is thus defined as : J = «ª K ¬,´ℎ!µ! ª K = ¶5 n ¶& ² = element of at the °T ± row and T± column, °, = 1,2,3, …, 13.
The function vector F is defined as: b = ®q K¯:0-: , where q K =°T ± function defined in the system of equations as the °T ± row element in b, such that elements of vector F are the introduced functions, while elements of the Jacobian matrix J are obtained by differentiation.
where Q  is the column vector, ®∆ K¯|K-:, ,0,…,™¨ is the flow correction vector for each pipe flow rate, and the vector = ® K¯|K-:, ,0,…,™¨ is a column vector of the flow rates.
Step 4: Take an initial guess for Q (i.e. initial guesses for all flow rates) and substitute into J and -F of Eqn. 14.
Step 5: Solve the linear system resulting from Step 4 for the Q  s Step 6: Modify each flow rate (initial guess) by adding the computed correction flow rates. The modified flow rates which are to be used in the next iteration are obtained as Modified flow rate j = ∆ + q?µ !'Îℎ = 1,2,3, … , ¿Á (15) Step 7: Replace previous flow rates (initial guesses) with j in Step 4 and follow through to Step 6. Repeat until convergence or desired degree of accuracy is obtained. 2.2.14: Algorithm for Pipe Size Selection in the Distribution Network The principle of pipe sizing in distribution network rests on the velocity limiting constraints (and/or available head constraint). Thus, an algorithm for tackling the velocity constraint, which also satisfies the system equations, is required. a) The pipe-sizing model The incorporation of the non-linear equations of the network and the velocity limiting constraints re-formulates the network problem. Thus, q K ( : , , 0 , … , :0 , : , , 0 , … :0 ) = 0;°= 1, 2, 3, … ,13 where a and b are constants defining the acceptable lower and upper flow velocity limits, the expression 2 is the magnitude of the fluid velocity in pipe j, and Ò = set of standard pipe sizes for each = 1, 2, 3, …,13. The equations q K = 0; °= 1,2,3, …, 13 constitute the system of equations obtained from the network as generated by applying continuity and head balance principles. b) Initial guess variation The solution set obtained by iterative methods usually depends on the initial guesses made. Knowledge of this instructs that if several sets of solutions are to be obtained, the iterative algorithm is to be repeated at different initial guesses. The pipe-sizing algorithm created in this work utilizes the idea of varying initial values of diameters for producing many possible solution sets. The values of the diameters are restricted to standard stock values, both in initial guesses and in the corrective steps. Pipe size correction technique This pipe-sizing algorithm utilizes the principle that when a pipe flow fails to meet the velocity constraints, the pipe size is adjusted, and not its flow rate. The pipe re-sizing procedure is as follows: 1) If velocity meets constraint (i.e. velocity is within range), the diameter is unaltered. 2) If velocity is greater than the upper limit (velocity is "too high"), diameter is increased to the next larger standard stock size. 3) If velocity is lower than the lower limit (velocity is "too low"), diameter is reduced to next smaller size. 4) If a pipe in case (2) already has the largest pipe size, or a pipe in case (3) already has the smallest pipe size, the pipe size is left unaltered. 5) If scenario (4) plays out to exactly the same pipes in two (or more) subsequent re-sizing iterations, "degeneracy" can be said to have occurred. The algorithm proceeds thereafter by using a different set of initial values for the diameters. Thus, for any set of initial diameters used, either a solution (to the pipe sizing problem) or degeneracy results. When the diameters have been decided or adjusted, then Newton-Raphson method is employed to deduce the corresponding flow rates in the pipes. The algorithm for pipe-sizing the network is as demonstrated in the flow chart of Fig. 2. Fig. 2: Pipe sizing algorithm The network solution (with its pipe selection) with the least pressure loss at its first index node is selected (for tank elevation, and subsequently, pump power optimization).

2.2.15: Adopted Technique/Algorithm for Initializing Pipe Diameters
The initialization of the diameters can be done arbitrarily. Nevertheless, the following steps are adopted in this work: 1) Arrange the standard pipe sizes in ascending order as set S (1) , and descending order as set S (2) . Also arrange the set of network pipes in ascending order of their numbering, and say set P. 2) For each value of r = 1 and 2, in turns (beginning with 1  r ), let Ò K Ó represent the °T ± entry of the ordered set Ò (Ó) , and ¿ = cardinality of set Ò (Ó) . Let Â represent the T± entry of set P and ¿ Ô = cardinality of set P 3) With a given r, set k = 1,2,3…,¿ Ô (beginning with Ö =1), and for a given Ö, where ≡ j (Ã?" Ö) '"" 0 < j ≤ Ö and mod k interpretes as modulus of k.

Results and Discussions
The polyvinyl chloride pipe used in the study has an absolute roughness, !̅ = 0.0015mm (Engineering Encyclopedia, 2011). The hydraulic load (water demand) per delivery node (block) of the network is estimated in Tables 6 using data from Tables 3 and 4. ∴ total flow rate supplied from tank to network (through supply Node 1) is Qin = Qd = 0.01 655m 3 /s. Two typical sets of results from over 255 network solutions of flow rates and pipe sizes obtained by the developed algorithm (executed in MATLAB codes) are displayed: The optimal network solution set is selected as the network solution with the least first index node pressure. It is worthwhile to note that the first index node varies from one solution set to another. Tables 7(a) and 7(b) show the optimal results.  0.040386 1 ½ 0.00182839 10-11 turbulent The head losses at the nodes relative to Node 1 (source node) and the least nodal pressures in line with Uniform Plumbing Code (UPC) (2016) are given in Table 8. 0.540061 13.6234 Now, the distance of network source node from tank installation point, à Ý = 50 Ã. The optimal tank elevation is obtained as the least tank elevation using Eqn. 25, with a corresponding transmission line diameter for the optimal distribution network. H ò is evaluated at each diameter (D) from the standard stock of Table 2. The least, but positive, H ò value yields the optimal elevation. Innovative Systems Design and Engineering www.iiste.org ISSN 2222-1727 (Paper) ISSN 2222-2871 (Online) Vol. 11, No.2, 2020 28 Hence, optimal tank elevation, H ò = 19.0936 m and corresponding transmission pipe size, D = 0.0519938 m (50mm (2") nominal pipe size, from Table 2).

Conclusion
A proposed water supply distribution network for a two-wing hostel with 10 blocks per wing and 20 rooms per block was analyzed by the Newton-Raphson Method. The need for compliance with velocity requirements of plumbing codes and the utilization of standard stock of industrially produced pipe sizes led to a pipe selectionadjustment algorithm for the sections of the network. The implementation of the algorithm generated the needed network parameters (e.g. Results Sets 1and 2) within a feasible computation time.
Tables 7(a) and 7(b) show the optimal ("best-of-the-rest") solution generated in yielding the least nodal head loss (pressure difference) relative to the source node (Node 1), which is the node having the highest pressure. It also reveals the pipe-set selection that goes along with the network. The corrected directions of flow in each pipe were also indicated. All flow types were found to be turbulent. Table 8 presents the nodal head loss relative to Node 1, and the absolute nodal (residual) pressures, when the first index node of the optimal solution set is set at the least pressure stipulated by the plumbing code (UPC). This mode of computation yields the optimal network in terms of pressure losses, in view of optimizing tank elevation.
Further results with the necessary transmission/main line size, and the optimal tank elevations at a distance of 50 m from the network source node (which are in line with the velocity requirements) were recorded by this analysis. It is recommended that analytical models dealing with distribution systems which incorporate minor losses should be the subject of further research.