Evaluation of Flow Rate Correction in Water Pipeline Distribution Network by Two Numerical Methods of Solution

This study evaluates flow rate correction and approximate flow rates in loops for three different case studies of closed looped pipe distribution network systems using Hardy Cross and Newton Raphson. Darcy Weisbach head loss equation was also used to account for major losses. Manual calculation was initially done for each case study followed by a C-Sharp programming software which was developed to affirm the manual calculation. For one looped network, head loss around the loop converged from 25.60 m to 0.13 m at the third iteration. The two looped network head loss around each loop converged from 170.97 m and 8.92 m to 0.05 and 0.06 m for Hardy Cross at the sixth iteration while the head loss are 0.88 m and 0.24 m at the fourth iteration for both Hardy Cross and Newton Raphson method while for the three looped network, it has head losses around the three loops converged after the fourth iteration from 0.26, 1.36 and 18.32 m to 0.13, 0.11 and 0.10 m respectively for Hardy Cross at third iteration while the head losses are 0.03, 0.00 and 0.05 m for Newton Raphson method. Newton Raphson method was found to have a better convergence pattern because it convergences in a uniform manner unlike Hardy Cross method. Also, the program developed gave almost but more accurate results as compared to that of manual calculations with the agreement between them rated at 98%. Some slight differences encountered in the mathematical terms calculated were as a result of some accumulated approximation errors. DOI: https://dx.doi.org/10.4314/jasem.v23i1.26 Copyright: Copyright © 2019 Lasisi et al. This is an open access article distributed under the Creative Commons Attribution License (CCL), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Dates: Received: 31 December 2018; Revised: 25 January 2019; Accepted 30 January 2019

Water Distribution Networks (WDNs) are composed of a large number of interconnected pipes, reservoirs, pumps, valves and other hydraulic elements.The primary purpose of a WDNs is to deliver water from sources such as reservoirs, rivers, lakes, and tanks to the consumers for different purposes (Abareshi, 2017).Water distribution networks play an important role in modern societies because its proper operation is directly related to the population's well-being.However, water supply activities are prone to monopolization and in other to guarantee good service levels in a sustainable way, the water supply systems performance must be estimated.It is also crucial to provide water to the consumers as effective water supply is of paramount importance in designing a new water distribution network or in expanding the existing one.It is essential to investigate and establish a reliable network that will ensure adequate head (Saminu et al., 2013).The purpose of a system of pipes is to supply water at adequate pressure and flow.However, pressure is lost by the action of friction at the pipe wall.The pressure loss is also dependent on the water demand, pipe type, pipe length, gradient and diameter (Webber, 1971;Adeniran et al, 2013).The analysis of pipe networks has long been one of the most computationally complex problems which hydraulic engineers have to contend with.The basic hydraulic equations describing the phenomena are non-linear algebraic equations which cannot be solved directly.All current numerical methods of solution are iterative, that is they start with an assumed, approximate solution which is further improved upon.These equations are usually written in terms of the unknown flow rates in the pipes, often referred to as LOOP equations.Alternatively, they are expressed in terms of unknown heads at junctions throughout the pipe system (Henshaw and Nwaogazie, 2015).Huddleston (2004) stated that the water flow in a pipe network must satisfy two basic principles; the conservation of mass at nodes and the conservation of energy around the hydraulic loops.Mun-Fong (1983) concluded his study in this field of research with a new approach which employs optimization techniques to solve the pipe network problems and more versatile alternative to the widely used iterative methods.Lopes (2003) developed a user-friendly software for the calculation of general piping system networks composed of virtually any parallel and series pipe arrangement.He used the iterative method of Hardy-Cross for the solution provided for pressure and flow-rate in each branch.Abdulateef (2007) made use of Microsoft Visual Basic 6.0 to analyze water distribution network of a single, two and three closed looped using Hardy-Cross method with the Darcy-Weisbach factors.He concluded that the closed looped networks system reached the optimum flow in pipe with 4-5 iterations in the adjustment of the flow rates.This research therefore compares two numerical methods of solution (Hardy Cross and Newton Raphson) via manual and programming source code computation using flow rate correction to determine the level of accuracy between the two methods.

MATERIALS AND METHODS
The materials used include hydraulic calculation sheets, scientific calculator and C-Sharp programming language software.The step by step methods employed are summarized into three stages which include (1) Identification of problems.(2) Utilization of the existing mathematical expressions (i.e.Hardy Cross and Newton Raphson methods) for solving pipe flow network problems identified manually and (3) Development of computer program to be used for the pipe flow network problems.
Three problems of pipe distribution network were identified and termed case study 1 which is a single closed loop, case study 2; a two closed loop and case study 3; a three closed loop.These network problems with their relevant information were extracted from different texts.For single closed loop, the text titled 'Water Pipe Networks' was used while for two closed loop and three closed loop, texts titled 'Looped Water Distribution Network' and 'Pipe Network Analysis' were used respectively.The case studies are shown in Figure 1 with their parameters set out in Table 1.Where is the head loss, is the flow rate, new is the new flow rate, i is the initial flow rate, ∆ is the flow rate correction.

Newton Raphson Formula
L ∆ = (m-1) (2) Where (m-1) is vector of pipe flow, ∆ is vector of loop flow corrections and (m-1) is the vector of residuals of loop conservation of energy equations evaluated at (m-1) .L is the first derivatives of the loop equations evaluated at (m-1) .L = !/ !∆ In matrix form, the equation 2 above becomes equation 3 Once the above matrices are formed, it is solved linearly for ∆ and pipe flows are updated by the loop corrections as m = m+1 +/-∆ .Where m is the new vector of pipe flow User Interface Design: C # sharp programming software was used to write source code for solving all the three case studies identified.Microsoft Visual Studio 2013 was used to design the user Interface.There are two major buttons named Hardy Cross and Newton Raphson based on the problem to be solved, the user will have to click on any of the two buttons depending on the method to be used.Just below them appear another three buttons namely 'one loop', 'two loops', and 'three loops'.The user will need to click one of the three available loops which then provide guide on where to input the pipe characteristics which include the pipe length, pipe diameter, pipe frictional coefficient and the guessed flow rate at each pipe.The number of the maximum iterations to be executed is required to be inserted before clicking on the 'Run Simulation' button.Finally, the results calculated would appear on the display output interface where it can be saved, generated, opened, cleared or exited.After writing the source code with C # in the Visual studio integrated development environment, the initiation phase began which is the phase that initiates the program developed and test also for the ease and simplicity of the program.

RESULT AND DISCUSSIONS
The results of the manual calculations were computed and the desired tolerances were set in line with network sizes and complexities.For each case study, one iteration calculation is shown but the results of the other iterations are included in the result table.
Hardy Cross for Case Study One: From Table 1,  Calculating the Head loss, h for each pipe in the loop which is equal to 2 Assuming Discharge (i.e.flow along the pipe) in the clockwise direction is positive and in the anticlockwise direction to be negative.
Therefore, 1 = 1 ( 1o) 2 = 338.51× 0.30 = 30.473 Repeating same step to calculate the head loss for 2, 3, and 4 to give 0.07 3, 4.87 3 and 0.07 3 respectively.Hence, cumulative head loss for the first iteration is The absolute value of the head loss divided by the flow rate for each of the pipes was calculated using to get 101.56, 3.50, 40.58 and 3.50 for pipes 1 to 4 respectively.Hence, the cumulative for first iteration is ∑ = 101.56+ 3.50 + 40.58 + 3.50 = 149.14 Calculating the flow rate corrections, ∆, we have The new flow rates ( new) for pipe 1 to 4 using new = i + ∆ was calculated for first iteration with the results given in Table 2.The above procedures are repeated for other iterations until the head loss and the flow rate correction around the loop are negligible or equals zero.Newton Raphson for Case Study One: From Equation 2L ∆ = (m-1) Therefore, to find the flow rate correction ∆ , it will be To find (m-1) i.e. the cumulative head loss for the loop  Tables 2 and 3 show the result calculations for each iteration as they iterate to the third iteration where their head losses were found to be negligible and their flow rate corrections converged to zero.It was observed that, for this case study (i.e. a single loop network system), both numerical methods followed the same trend at each iteration level.This is due to the fact that the Newton Raphson method otherwise known as the simultaneous loop flow adjustment can only be effectively utilized for analyzing two or more loops network system.

Hardy Cross for Case Study Two:
The same equations used in case study one was employed to get results for K-value for all the pipes in the loops 1 and 2. Also, considering each loop separately to calculate for the head loss around the loop and the absolute value of the head loss divided by the flow rate (i.e. ) assuming discharge (i.e.flow along the pipe) in the clockwise direction is positive and in the anticlockwise direction to be negative.Therefore, For Loop 1: The cumulative head loss gives The new flow rates ( new) for pipe 1 to 7 was calculated for first iteration using new = i + ∆ which was in turn used to get new as presented in Table 4.The above procedures are repeated for other iterations until the head loss around each loop is negligible.
Therefore, to find the flow rate correction ∆ , it will be The cumulative head loss for each of the two loops is gotten as To calculate for the coefficient matrix, JL Hence, the inverse of JL i.e.L -1 is determined
Subsequently, new flow rates are calculated by repeating the above iterative steps until the head loss and the flow rate correction around each loop becomes negligible.The result summary after the final iteration is shown in Table 5.The application of Hardy Cross method shows that case study two converged at sixth iteration where the flow rate correction was negligible and the head loss around each loop is approximately zero.Likewise, Newton Raphson method was found to converge to solution at the fourth iteration.It was also observed that there was a change in the assumed direction of flow in both pipes 2 and 6.

Hardy Cross Method for Case Study Three:
Following the same sequence of calculation as in case study two, results were gotten for K-value for all the pipes in loop 1, 2 and 3. Also, considering each loop separately to calculate for the head loss around the loop and the absolute value of the head loss divided by the flow rate (i.e. ) assuming discharge (i.e.flow along the pipe) in the clockwise direction is positive and in the anticlockwise direction to be negative.Therefore, The flow rate corrections, ∆1 (for the 1 st iteration) is The new flow rates ( new) for pipe 1 to 10 was calculated for first iteration using new = i + ∆ which was in turn used to get final as presented in Table 6.Pipes 3, 6 and 8 are common pipes shared between two loops.The above procedures are repeated for other iterations until the head losses and the flow rate corrections around the loops are negligible.

Newton Raphson for Case Study Three
L ∆ = ℎ( (m-1) ) Considering two looped pipe network system, in matrix form, the formula becomes Therefore, to find the flow rate correction ∆ , it will be The cumulative head loss for each of the loop is gotten as ℎ( (m-1) ) = O−6.+ ∆ .Subsequently, new flow rates are calculated by repeating the above iterative steps until the head loss and the flow rate correction around each loop becomes negligible.The result summary after the final iteration is shown in Table 7.
The application of Hardy Cross method show that case study three converged to solution at fourth iteration whereas, the solution using Newton Raphson method was found to converge at third iteration.As established by Abareshi (2017) that the complexity of the network system determine the level of iterative processes to achieving convergence.Therefore, convergence was achieved with little iteration process being a three closed loop network system.It was observed that the guessed (i.e.initial) flow rates were found to be closer to the final flow rates where convergence was achieved.
Computer Programming Analysis: C Sharp programming software was developed to analyze for one, two and three closed looped pipe network.The results generated form the computer program iteration analysis using both the Hardy Cross and Newton Raphson methods are the same for with the manual calculations carried out and with more accuracy.Some of the source codes generated for the case studies are provided in Appendix A in text format.

Conclusion:
The comparison of the solution methods from the study shows that the Newton Raphson method converges faster in fewer numbers of iterations as both solutions reached the desired tolerance level set.The convergence pattern of the head loss as well as the flow rate correction of each case studies using the Newton Raphson method of solution is uniform whereas difficulty in convergence was observed when Hardy Cross method is used which was perceived to have made it requiring more numbers of iterations before converging to solution Evaluation of Flow Rate Correction in Water Pipeline….. 182 LASISI, OH; ADEWUMI JR; LASISI, KH .Although, the degree of convergence between the two methods is not that significant (which is between 0.5% -1%) based on the case studies considered.However, in more complex network systems, it might be higher.From this study, it is therefore concluded that Hardy Cross method is best used for analyzing a simple network as oppose to the Newton Raphson method which is better suited for analyzing complex network systems.

Fig 1 :
Fig 1: Case Study 1, 2 and 3 showing a Single, Double and Triple Closed Loop Pipe Networks .56 I 3.50 I 40.68I 3.50 JL 5 O298.28QJL -1 5 B .To calculate the flow rate correction, ∆Q ∆ 5 JL -1 H 2143 D /E For pipe 2, 0.02 I 0.086 5 0.1063 D /E For pipe 3, 0.12 I 0.086 5 0.2063 D /E For pipe 4, 0.02 I 0.086 5 0.0663 D /E (Change in the assumed direction of flow) Evaluation of Flow Rate Correction in Water Pipeline….. 180 LASISI, OH; ADEWUMI JR; LASISI, KH The above procedures are repeated for other iterations until the head loss and the flow rate correction around the loop are negligible or equals zero.

Table 1 :
Pipe Network Parameters for the Case study

Table 2 :
Results of the manual calculation for the case study 1 using the Hardy Cross method

Table 3 :
Results of Manual Calculation for Case Study 1 using Newton Raphson Method

Table 4 :
Summary of Result of Case Study Two using Hardy Cross The same Newton Raphson equations used in case study one was employed to get results.Considering two looped pipe network system, in matrix form, the formula becomes

Table 5 :
Summary of Result of Case Study Two using Newton Raphson Method

Table 6 :
Summary of Result of Case Study Three using Hardy

Table 7 :
Summary of Result of Case Study Three using Newton-Raphson Method