Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018

Modified Newton-Raphson Technique for Integrated Object-Oriented


Water Pipe Network Analysis
Kailash Jha1, Manish Kumar Mishra2
1, 2
Indian Institute of Technology(ISM), Dhanbad, Dept. of Mechanical Engineering, IIT(ISM), Dhanbad-
826004, Jharkhand, India
1
kailash0403@gmail.com

Abstract
In the proposed research, modified Newton-Raphson technique is developed for integrated object-
oriented analysis of water pipe network. An object-oriented concept is used for the integrated
simulation model of water pipe distribution network analysis for efficient data handling. This is
achieved by treating first the pipe network as a graph data structure with its nodes as the graph's
nodes and the pipes as the edges. The algorithm for cycle (real or pseudo cycles) extraction has been
developed using Nested Breadth First Search (NBFS) to give cycles in clockwise order. Pseudo loops
are found out using shortest path algorithm between two adjacent supply nodes. Pipes in cycles are
initialized using conservation of mass at nodes. Friction factor is updated for every change in
discharge in pipes. Modified Newton-Raphson technique is developed to obtain solution of the non-
linear equation for analyzing the water pipe network considering third order convergence in next step.
This technique is more efficient and takes less time to converge the final solution than the traditional
Newton-Raphson method. The pressure calculation has been done at last by using balanced
discharges and input parameters of pipe network. Balanced discharges and nodal pressure in the pipe
network are compared with simultaneous loop flow adjustment method and are found more efficient
for complex network. Results have been validated with the results obtained by EPANET software.
Keywords: Simultaneous loop flow adjustment method, Hydraulic analysis, Loop detection, NBFS,
Modified Newton-Raphson technique.

1 Introduction
Flow analysis of the water pipe network is done in the proposed work using modified Newton-
Raphon method in which non-linear equation is solved considering third order convergence. All
processes involved in flow analysis are integrated. Proposed analysis is necessary for water
resource management. Looped pipe network has been considered in proposed work for reliable pipe
distribution network analysis. To know details of pipes diameter, reservoir and pumps are necessary
for design analysis of water pipe network to provide required demand at suitable nodal pressure.
Continuity equation at nodes and energy conservation equation within the loops are two basic
equations for pipe network analysis. Energy equation gives the nonlinear system in which flow
adjustment in loops (∆Q) are the fundamental unknowns. For given network parameters (roughness,
length, diameters of pipes and elevation at nodes), solution for the unknowns mentioned above will
be obtained by the help of known initial pipe discharges using numerical techniques such as Linear
theory method [1], Newton- Raphson [2, 3], and Gradient global algorithm [4] . These techniques
are meant to solve linear and non-linear equations. H-Newton-Raphson method has been improved
by Spiliotis and Tsakiris [5] by evaluating the discharge in each branch of pipe network using
Swamee and Jain equation [6]. Several Newton-Raphson based algorithms have been developed by
Todini [7, 8] which have linearized the global algorithm [4]. Several new algorithms based on linear
theory have been developed by Todini and Rossman [9] which are an extension of the work [7, 8].
Lumped junction demand based technique has been developed by Giustolisi [10] which is not using
head loss equation. Gudin˜o-Mendoza et al. [11] have developed Hybrid Petri Nets based technique
for analysis of water pipe distribution network. Arsene et al. [12] have given loop-equations based
technique which uses DFS and works in real-time by improving numerical algorithms. Cerna and
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018
Pelanek [13] have detected the explicit fair cycle by a new distributed scalable algorithm using set
based approach which takes less time and detect the cycle’s on-the–fly. Nested Depth First Search
technique cannot use the parallelism, due to the successive nature and cannot be worked with many
processors. Brim et al. [14] have presented a Nested Depth First Search method, which locates the
directed graph with negative length. Verification of Temporal properties has been achieved in
Courcoubetis et al. [15] by developing efficient nested DFS algorithms which is sequential in nature
hence cannot be parallelized. Barnat et al. [16] have checked enumerative Linear Sequential Logic
model by practical parallel on-the-fly algorithm. To detect the loop, Breadth First Search is used to
obtain the signature edges and checked simultaneously by Depth First Search to confirm the
availability of a loop. Decomposition of the graph is done using a static partition function. The
graph is divided into sub graphs in that case where all cycle cannot be successfully extracted. Ivetic
et al. [17] have used ∆Q method for design optimization of water distribution network. BFS
propagation algorithm is used to identify the basis loops. In the next step number of loops having
smaller number of pipes are obtained by transformation of spanning tree. ∆Q method proposed is
more efficient than the GGA integrated in EPANET2. Singh et al. [18] have solved Hardy Cross
based iteration problem of reservoir and pipe network by finding the starting point of iteration using
topological similarity. Moosavian and Jaefarzadeh [19] have proposed a modified Hardy-Cross
method which implements an algorithm for initial discharge that is close to final discharge. The
mass conservation is obtained automatically. Multi-reservoir problems and nodal pressure
calculation are missing in this work which has been successfully done in the proposed work. Tabesh
et al. [20] have developed an algorithm for the relationship between nodal outflow pressure and
consecutive set of non-linear equations for the analysis of pipe network. A third-order convergence
Newton-Raphson technique is stated in [21] which has been used in [19] to solve water pipe
network problem. The present work also uses the third order convergence Newton-Raphson
technique [21].
Loops are extracted in the proposed work by NBFS traversal method without subdividing the pipe
network graph [22]. The proposed work is an extension of the previous work [23] and uses the
modified Newton-Raphson technique.
Order of Initialization of pipes in loop is done in reverse of the extraction. Initialization is done in
both the directions of loop to ensure that the unbalanced discharge in loop will be passed to the
uninitialized adjacent pipe of the loop. Continuity equation is used to initialize uninitialized pipes in
term of known pipe discharges and nodal demand. Balanced discharge in pipes is obtained by
modified Newton-Raphson method which converges faster than traditional Newton-Raphson
technique [1] and the simultaneous loop adjustment method [2, 3, and 23]. Friction factor is
calculated for all three cases of flow in pipes and updated for any change in pipe discharge. Finally,
nodal pressure is calculated at all nodes in terms of pressure at a reference (supply) node, balanced
discharge in pipes and network parameters using energy equation between the reference nodes and
the node where pressure will be calculated. Network parameters involved between the nodes are
obtained by shortest path traversal. Object-oriented concepts are used for efficient data handling.
Different classes are designed in the proposed water pipe network analysis whose objects interact
with each other for efficient data handling. The common classes are node, pipe, loop and pipe
network. Maintenance and modification of code can be done very easily to suit other requirements.
OpenGL and C++ language have been used for graphical user interface (GUI). Required accuracy
has been considered in development of GUI to control the complexity which is not available in
EPANET software. Finally, the pressure and discharge obtained by proposed work are compared
with traditional N-R Method and EPANET software. The proposed technique is efficient and takes
less time to converge the final solution.
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018
2 Methodology
Proposed work has been performed in four simultaneous steps. Pipe and node data are the prime
inputs to construct graph network, and cycles (closed and pseudo) are extracted by the (NBFS).
NBFS traversal is proposed to determine minimal loops and BFS traversal is used to extract pseudo
loops from graph network. First BFS searches the signature edges and for each signature the second
BFS is called for shortest cycle. In the present work graph is represented by adjacency list. Edges
are searched systematically to find each vertex approachable from the starting node. Initialization of
pipes in loop is performed next from the extracted cycles using continuity equation at each node.
During initialization, the mass conservation equation is used at all junctions and unknown pipe
discharge is calculated in terms of known discharges and nodal demand. If not a single value of
discharge or demand at the nodes of the loop is known than the initialization is performed assuming
an initial discharge in a pipe of any arbitrary node of the loop. If all the nodes cannot be initialized
successfully then it is performed by reordering the extracted loops. Pipe containing the supply node
is initialized at end to compensate the total unbalanced discharge. The network is analyzed using the
modified Newton-Raphson technique [19]. Pressure at network nodes are calculated in last step.
The computed data is compared with traditional Newton-Raphson technique which shows that the
proposed work converges faster. Validation of results has been performed with the similar results
obtained by EPANET software.

2.1. Automatic Minimal Loop Extraction


A new NBFS algorithm is proposed to obtain the minimal cycles in the graph. The signature edge
of loop is determined by the first BFS traversal and loop is extracted by second BFS traversal. The
signature edge has two corresponding vertices. First BFS finds the signature edge and second BFS
extracts the cycle between the signature vertices. If loop is successfully extracted, it will give list of
all vertices to complete the cycle. The signature edge is not traversed during the loop extraction.
Number of cycles formed by an edge depends on a constant integer value (Cycled-Edge-Tag value)
which is initialized to zero. The value is incremented by one for every extraction of cycle. If the
value of Cycled-Edge-Tag is one for boundary edge, it cannot take part in further cycle

Fig 1. Flow chart of automatic minimal loop extraction Fig. 2. Dependent and independent loop
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018

extractions, because a boundary edge makes only one cycle. Cycle is formed by the edges which are
marked travelled by the first BFS. The starting node defines the order of cycle extraction. The other
vertices are not attempted, if starting node gives all the extracted cycle. In the proposed work, all
the nodes of the graph are recalled in a for-loop for successfully starting node. If every attempt of
starting vertices fails to extract all the loops in graph network, then the program will not execute
and will show a message that the graph network needs to be decomposed before applying current
algorithm. Minimal cycles are obtained using BFS. Queue is implemented for both the traversals.
The bounding edges are only the part of single cycle. An edge may be part of more than one loop. A
flow chart is shown in Figure. 1 to understand Automatic Minimal Loop Extraction algorithm

2.2. Automatic Initialization


In this algorithm, the pipes in the loops have been initialized in terms of known discharges and
demand. In initialization conservation of mass is applied at the vertices of extracted cycles. The
conservation of mass means that the summation of input and output discharge should be equal to
zero. Total count of initialized and uninitialized pipes is performed at each node, and the continuity
equation initializes uninitialized pipes at the node in terms of known demands and the number
counts. Initialization of the loop can be performed only when there is at least one adjacent
uninitialized pipe for the node of the loop. Initialization of pipes in loop can be started with any
node (start-node). If a discharge in pipes of node or demand at the node is not available then an
arbitrary discharge is assumed for a pipe and initialization will be continued in forward direction of
the loop before a node (stop-node) having uninitialized adjacent pipe is not encountering. This node
(stop-node) is initialized at last. Once stop-node comes in path of initialization then initialization
will be done in backward direction and stop-node is initialized at last to throw all the unbalanced
discharge in the uninitialized adjacent pipe of the stop-node. This process continues for every cycle.
The supply pipe is initialized at end to adjust the final unbalanced discharge. Node containing the
supply pipe will be the last stop-node for a single reservoir network. For multi-reservoir problem
any node containing the supply pipe will be the last stop-node to be initialized. Re-ordering of loops
is needed when the availability of uninitialized adjacent pipe in not available in the loop.
Figure 2 shows independent and dependent loops. If initialization of independent loop is performed
first then the dependent loop cannot be initialized because node number 3 does not have an
uninitialized pipe which can balance the discharge. In this case reordering of loop is needed which
solves this problem. If the initialization is done in reverse order then this situation will not occur
and initialization will be done without reordering. The proposed automatic initialization algorithms
always give successful initialization of pipes. Flow chart of the implemented algorithm is given in
Figure 3.

2.3. Water Pipe Network Analysis


Flow analysis in the current research is done for pipe network using modified Newton-Raphson
technique considering third order convergence which convergences faster than conventional
Newton-Raphson’s techniques [1, 2, 3, 23]. In the proposed technique initial discharge in the pipes
are converted into balanced discharge in pipes using iteration which will be continued till all the
incremental value in loops are greater than the given input value. Analysis of water distribution
network has been reported with different techniques: (1) Nodal technique, (2) Loop flow technique
and (3) simultaneous loop flow adjustment method. The number of equations in the nodal technique
is same as the number of nodes present in the network. The solution becomes critical when these
two numbers are not same. The number of equation drastically reduces in the loop equation method.
In the early days, this technique was used manually for its simplicity. The proposed loop based
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018

Figure 3. Flow chart of automatic initialization


technique integrates different algorithms of the proposed work and object-oriented concepts have
been formulated which handles the pipe network data efficiently. Friction factor is calculated for all
type of flows (laminar, transition and turbulent flow). For the laminar flow (Reynolds No. <=2100),
friction depends only on Reynolds No. which is obtained by Hagen–Poiseuille equation. For
transitional flow (2100 < Reynolds No.>4000), friction is calculated using Swamee and Jain [6].
Friction for the turbulent flow (Reynolds No.>=4000) is calculated using Colebrook-White
equation. Friction factor are updated once discharge in the pipe is updated.
Total head loss in a loop will be zero in the loop-based techniques. The total head loss is given by
Darcy- Weisbach equation:
H L  KQ n (1)

Where K  8 fL /( 2 gD 5 ) , L and D are length and diameter of pipe, g and f are acceleration due to
gravity and the friction coefficient, K is the pipe constant and n=2.
Minor losses are not considered in present work. Energy equation in loop is:
 H L (Q)   KQ n (2)

In any pipe Q  Q0  Q
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018
Q is the update discharge, Q0 is the initial discharge and ∆Q is the corrective discharge.
Putting Q in equation 2
H L (Q)   K (Q0  Q) n  0

H (Q)   K (Q0n  nQ0n1Q  n(n  1) 2!Q0


n2
Q 2 .........)  0 (3)
L
By Taylor’s Expansion

Q   ( KQ0n  KQ* ) /(  KnQ0n1 )


n
(4)

Q*  Q0   KQ0n /  nKQ0n1 (5)


Above iterative solutions have been taken from [21] and same has been used in [22].
Q  ( H L /  ( H L / Q0 ))(1 (1  (1 / n)) n ) (6)

Q modified = Q0 + ∆Q (7)
Iteration will be stopped if the incremental discharge (∆Q) is less than (0.0000001m3/s) for all
loops, which may be lowered further if needed.

2.4. Nodal Pressure Calculation


Pressure at node in the proposed technique is calculated using equation-8 which is given below:
PK  PK 1   H L (Q)  Z K  Z K 1 (8)
Where Pk is pressure at junction k,
∑HL (Q) is total head losses in pipes between junctions (k and k-1),
Zk and Zk-1 are elevation at junction (k, k-1).
Graph traversal is used to trace the nodes and pipes involved in pressure calculation. Nodal pressure
at any node is obtained with the help of a known starting nodal pressure, network parameters and
balanced discharged in pipes between nodes. Verification of nodal pressure is based on the fact that
the nodal pressure at all the reference vertices are at atmospheric pressure. Node pressure
calculation is validated by EPANET software for the same network.
Object-oriented environment has been used to integrate different modules for efficient data
handling. The proposed network analysis technique is more efficient than [1, 2, 3, 23] because of
considering third order convergence.

3 Results and Discussions


Several networks have been analyzed successfully. Different test results are displayed graphically.
The proposed work is implemented on Intel CORE i3 processor machine with Windows XP
operating system. C++ programming language is used for current simulation. Figure 4 shows a test
result (TR-1) for a pipe network indicating pipe number and node number. Extracted loops and
pseudo loop from TR-1 are shown in Figure 5 and Figure 6 respectively. Arrows shown in Figures
5 and 6 indicate loop direction. Green dots and lines indicate nodes and pipes for the network.
Thickness of pipes shown in Figure 7 indicates the order of magnitude of initial discharge and
arrows show their directions, which are evaluated through the proposed initialization technique. In
initialization, continuity equation will be satisfied at all nodes. The balance discharges are shown in
Figure 8 which is proportional to the thickness of pipes. The balance discharge in the pipes of the
test result is obtained after 55 number of iterations and 10 number of iterations through the
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018
proposed method and the simultaneous loop adjustment method respectively. Convergence time for
proposed method and simultaneous loop adjustment method are 203 milliseconds and 250
milliseconds respectively. Time and number of iterations for the same test result in case of the
traditional Newton-Raphson method [1] are 313 milliseconds and 84 respectively. The time taken
per iteration by the proposed method is less than the simultaneous loop flow adjustment method [2,
3, 4, 23]. Figure 9 shows the nodal pressure obtained by the proposed method.

Figure 4. Pipe network Figure 5. Extracted real loops Figure 6. Extracted psuedo loop

Figure 7. Initial discharge Figure 8. Balance discharge Figure 9. Nodal pressure

4 Conclusions
Modified Newton-Raphson technique has been formulated for integrated water pipe network
analysis. The proposed technique is more efficient than the Newton-Raphson technique [1] and
Simultaneous loop adjustment technique [2, 3, 23]. Third order convergence has been adopted in
the proposed research. Algorithms of automatic minimal loop extraction and initialization have
been implemented successfully for several graph networks (pipe network). Minimal loops are
extracted based on NBFS traversal. Heuristics are formulated to get proper loops. Friction factor is
calculated for every updated discharge for all type of flows. Present technique is simpler and takes
less time per iteration than technique adopted in [1, 2, 3, 23]. The present work uses object-oriented
concepts which are efficient in data handling and also handles multi reservoir problems which are
missing in [19]. Leak detection and monitoring of water pipe network for cities can be performed
by the proposed method.
1st International WDSA / CCWI 2018 Joint Conference, Kingston, Ontario, Canada – July 23-25, 2018
5 References
[1] Cross, Hardy. Analysis of flow in networks of conduits or conductors. University of Illinois at Urbana
Champaign, College of Engineering. Engineering Experiment Station. 1936.
[2] Shamir, Uri Y., and Charles DD Howard. "Water distribution systems analysis." Journal of the
Hydraulics Division 94, No. 1 (1968): 219-234.
[3] Wood, Don J., and Carl OA Charles. "Hydraulic network analysis using linear theory." Journal of the
Hydraulics division 98, No. 7 (1972): 1157-1170.
[4] Todini, E., and S. Pilati. “A gradient algorithm for the analysis of pipe networks”. In Computer
applications in water supply: vol. 1(1988):1-20.
[5] Spiliotis, M., and G. Tsakiris. "Water distribution system analysis: Newton-Raphson method revisited."
Journal of Hydraulic Engineering 137, No. 8 (2010): 852-855.
[6] Swamee, P. K., and Jain, A. K. (1976). “Explicit equations for pipe-flow problems.” J. Hydraul. Div.,
102(5), 657–664.
[7] Todini, Ezio. "On the convergence properties of the different pipe network algorithms." In Water
Distribution Systems Analysis Symposium (2006):1-16.
[8] Todini E. “A unifying view on the different looped pipe network analysis algorithms”. Computing and
Control for the Water Industry.—Baldock, UK, Research Studies Press Ltd(1999): 63-80,
[9] Todini, Ezio, and Lewis A. Rossman. "Unified framework for deriving simultaneous equation algorithms
for water distribution networks." Journal of Hydraulic Engineering 139, No. 5 (2012): 511-526.
[10] Giustolisi, Orazio. "Considering actual pipe connections in water distribution network analysis."
Journal of Hydraulic Engineering 136, No. 11 (2010): 889-900.
[11] Gudiño-Mendoza, Berenice, Ernesto López-Mellado, and Hassane Alla. "Modeling and simulation
of water distribution systems using timed hybrid Petri nets." Simulation 88, No. 3 (2012): 329-347.
[12] Arsene, C. T. C., A. Bargiela, and D. Al-Dabass. "Modelling and simulation of water systems based
on loop equations." IJ of Simulation 5, No. 1–2 (2004): 61-72.
[13] Cerna, Ivana, and Radek Pelanck. "Distributed explicit fair cycle detection.10th International Spin
Workshop 2003; 2648: 49-73. (2003).
[14] Brim, Lubos, Ivana Cerna, Pavel Krcál, and Radek Pelánek. "Distributed LTL model checking based
on negative cycle detection." In FSTTCS, Vol. 1(2001): 96-107.
[15] Courcoubetis, Costas, Moshe Vardi, Pierre Wolper, and Mihalis Yannakakis. "Memory-efficient
algorithms for the verification of temporal properties." Formal methods in system design 1, No. 2-3
(1992): 275-288.
[16] Barnat, Jiri, Lubos Brim, and Jakub Chaloupka. "Parallel breadth-first search LTL model-checking."
In Automated Software Engineering, 2003. Proceedings. 18th IEEE International Conference on, 106-
115. IEEE, 2003.
[17] Ivetić, Damjan, Željko Vasilić, Miloš Stanić, and Dušan Prodanović. "Speeding up the water
distribution network design optimization using the ΔQ method." Journal of Hydroinformatics 18, No. 1
(2016): 33-48.
[18] Singh, Mahavir, Suraj Krishan Kheer, and I. K. Pandita. "Improvement of water distribution
networks analysis by topological similarity." Alexandria Engineering Journal 55, No. 2 (2016): 1375-
1383.
[19] Moosavian, Seyed Abdolnaser, and Mohammad Reza Jaefarzadeh. "Hydraulic analysis of water
supply networks using a Modified Hardy Cross method." International Journal of Engineering 27 (2014):
1331-1338.
[20] Tabesh, M., T. T. Tanyimboh, and R. Burrows. "Head-driven simulation of water supply networks."
International Journal of Engineering 15, No. 1 (2002): 11-22.
[21] Darvishi, M. T., and Ali Barati. "A third-order Newton-type method to solve systems of nonlinear
equations." Applied Mathematics and Computation 187, no. 2 (2007): 630-635.
[22] Rahimi, Mohammad, and Ali Haghighi. "A graph portioning approach for hydraulic analysis-design
of looped pipe networks." Water resources management 29, No. 14 (2015): 5339-5352.
[23] Mishra M K and Jha K, “Graph-based loop extraction for automatic analysis of a water pipe
distribution network and comparison with EPANET”, Simulation, 93, No. 11, (2017), 921-933.

You might also like