For Water Distribution Network: Golden Research Thoughts Impact Factor: 2.2052 (UIF) Volume-3 - Issue-11 - May-2014

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

Golden Research Thoughts

Impact Factor : 2.2052(UIF)


Volume-3 | Issue-11 | May-2014

DEVELOPMENT OF SOURCE CODE FOR HARDY CROSS METHOD IN C#.NET


FOR WATER DISTRIBUTION NETWORK

V.P. Patil , S. D. Gorantiwar


Assistant Professor of Mathematics, Department of Farm Structures and Electrification,
Dr.A.S. College of Agril.Engg.,Mahatma Phule Krishi Vidhyapeeth,Rahuri , Dist:
Ahmednagar (MS)
Professor of Irrigation and Drainage Engineering, Department of IDE, Dr.A.S. College of
Agril.Engg.,Mahatma Phule Krishi Vidhyapeeth,Rahuri , Dist: Ahmednagar (MS
ABSTACT

As water distribution networks have been a part of the modern living, it is


necessary to know the behavior of a water distribution network under different conditions.
There are different methods of pipe network analysis but most of the methods are very
complex and hence time consuming to find out the desired results manually. The Hardy
Cross method is simple, easy to apply, and therefore, suitable for hand calculation.
However, the Hardy Cross method converges slowly hence requires large number of
iterations. The number of iterations increases enormously as the size of the network
increases. Therefore, it is necessary to develop the source code for Hardy Cross method to
balance the pipe network. The source code was developed in C#.NET which has many
advantages over other languages such as Consistent Programming Model, Direct Support
for Security, Simplified Development Efforts, Easy Application Deployment and
Maintenance, .NET Framework and Languages and cross-language compatibility.
Keywords: Water distribution network, pipe network analysis.
Introduction
Next to air, water is the most essential commodity required to maintain life. The
present uses of water are varied and may be classified as domestic, public and industrial.
A modern water supply system includes facilities for collection and storage,
transportation, pumping, treatment and distribution of water. Distribution works include
distribution and equalizing reservoirs, pipes, valves, fire hydrants and other
appurtenances. Water distribution networks have been a part of the modern living.

Volume-3 | Issue-11 | May-2014

Page 1

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
Out of the total expenditure incurred on different facilities of water supply system,
major expenditure is incurred on the distribution network. Therefore, it is necessary to
know the behavior of a water distribution network to optimize and economize its
operations under different conditions such as variation in demand including fire flow
requirements, variation in reservoir water levels, partial or full valve openings, closure of
pipes during repairs or replacement. The behavior
of a water distribution network under different conditions is obtained by carrying out the
analysis of the water distribution networks.
In addition to these, analysis of the system is necessary to know whether the
capacity of the source or sources is adequate, whether the available storage capacity and
water levels in the service reservoirs at different points of time are satisfactory, whether
the system has adequate residuals heads at different locations.
There are different methods of pipe network analysis such as Hardy Cross method,
Newton Raphson method, Linear theory method and Minimum-Spanning-Tree Approach
but these methods are very complex and hence time consuming to find out the desired
results manually. The Hardy Cross method (1949) is simple, easy to apply, and therefore,
suitable for hand calculation, however, its greatest drawback is the presence of the
convergence problem. It is observed to converge slowly and therefore requires large
number of iterations. The number of iterations increases as the size of the network
increases. Therefore, it is necessary to develop the source code for Hardy Cross method to
balance the pipe network.
Review of related literature:
Volokh (2002) showed that the Hardy Cross moment-distribution method is Jacobi
iterative scheme applied to the standard displacement formulation of structural analysis.
He also showed that the stiffness matrix enjoys strict diagonal dominance and because of
it the iterations always converge for any loading conditions.
Jeng (2002) proposed a general model for an urban drainage system through the NewtonRaphson method, which allows users to calculate the pipe system with arbitrary pipe
network. Based on this proposed model, a design for pipe geometry (including length,
diameter, pipe materials) can be provided for given inlet and outlet flow conditions. This
will provide hydraulic engineers a simple guideline for the design of an urban drainage
system.
Lopes (2003) developed user-friendly software for the calculation of general piping
system networks composed of virtually any parallel and series pipe arrangement. Solution
of the network is made with recourse to the iterative method of Hardy Cross. Solution is
provided for pressure and flow-rate in each branch. Dimensioning problems, where pump
characteristics or a pipe diameter are sought for achieving a pre-specified flow-rate
condition, can also be tackled.
Ohtmer (2005) applied Newton-Raphson iteration procedure for the analysis of
nonlinear flow in pipe networks. Pipe networks are computed in an analogous manner to
frameworks in structural mechanics loaded only by moments. The mesh method (force
method) is applied. Due to the boundary layer effects in special pipe members, the flow
problem is in general nonlinear. Therefore, the Newton-Raphson iteration procedure is
used to solve the nonlinear system of equations. Using the computed flow rates in the
TREE structure (determined by graph theory) as initial values, the iteration procedure
converges rapidly to a user specified tolerance value. The loss coefficients of pressure for

Volume-3 | Issue-11 | May-2014

Page 2

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
different pipe members (Tube, Valve, Bow, Tee, Pump, Knee, Contr, Difsr) need only be
given in diagrams. These diagrams are used in digitalized form. In the back-substitution
phase with known flow rates in all members, the pressure at the joints is computed. The
main advantages of the analysis as outlined are that no initial values for the member flow
rates need be known, the iteration procedure converges rapidly, and within each iteration
step only small systems of linear equations need to be solved. Due to the fact that the loss
coefficients of pressure need only be given in diagrams, arbitrary nonlinear networks can
be analysed by the unchanged program system. A flow rate assumption may be specified
in the input for a member of a mesh.
Ormsbee (2006) presented a brief historical review of various methods for
computing flows and pressures in water distribution networks from the middle of the 19 th
century through the dawn of 21stcentury. According to him, this era has witnessed the
development of several innovative methods for network analysis, including such methods
as the Hardy Cross method, and the application of the Newton Raphson method to
various formulations of the conservation of mass and conservation of energy equations
associated with water distribution networks. With the advent of greater knowledge about
the physical, chemical, and biological characteristics of water distribution systems, as well
as the advent of new computer algorithms and associated computer technologies, the
future opportunities for even greater impacts remain bright.
Zyl et.al.( 2008) proposed a new method for snapshot analysis of water
distribution systems based on the commonly used gradient method. The proposed
method uses a secant (intersecting the head-loss function in two points) instead of a
tangent to approximate the pipe head-loss function. They developed a theoretical model
for the flow range in which the secant approximates the head-loss function without
exceeding a given allowable error. This scheme allows a tradeoff to be made between the
allowable error and the number of iterations required to achieve convergence. The
proposed method was applied to an example network to illustrate its application and
benefits. They argued that the number of iterations required to find a solution can be
reduced significantly in both snapshot and extended-period simulations. Thus, the
literature shows that Hardy-Cross method has been widely used. Many researchers have
modified the Hardy-Cross algorithm to improve its computational efficiency.
Materials and Method:
Hardy Cross Method:
Hardy Cross method is method of successive approximations and is used to
solve the pipe network problems. The procedure for the solution of pipe network
problems by Hardy Cross method is as follows;
1. Assume a most suitable distribution of flow that satisfies principle of continuity at each
junction.
2. With the assumed values of discharge (Q), compute the head losses for each pipe by
using Darcy-Weisbach equation.
3. Compute the net head loss around each loop considering the head loss in clockwise
flows as positive. And in anti-clockwise flows as negative. For a correct distribution of
flow, the net head loss around each loop should be equal to zero.
4. If the net head loss around the loop is not zero for the assumed distribution of flow,
the assumed flows are then corrected by introducing a correction Q for the flows till
the loop is balanced. The correction Q is given by

Volume-3 | Issue-11 | May-2014

Page 3

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
Q =

rQ Q
2r Q

5 With the correction factor Q, the new discharge in each pipe is calculated as follows:
New discharge (Q) = Old discharge (Q) + Q
6 With the corrected flows in all pipes, a second trial calculation is made for all the loops
and the process is repeated till the corrections become negligible.
Description of source code:
Source code in C#.NET for Hardy Cross method was developed for two loop pipe
network which can be applied for the pipe network containing any number of loops. The
C#.NET was preferred to develop the source code because it has the following Advantages
Consistent Programming Model
Direct Support for Security
Simplified Development Efforts
Easy Application Deployment and Maintenance
.NET Framework and Languages
Cross-language compatibility
The data type declarations
The C#.NET version has decimal keyword equal to 128-bit data type. The
approximate range and precision for the decimal type are -1.0 X 10-28 to 7.9 X 1028
whereas other languages have the 32-bit data type only. Because of 128-bit data type we
get the precise results in C#.NET for any type arithmetic and numeric calculations. The
flowchart for which the source code was developed, is shown in figure1.
Hardy-Cross Flow-Chart
START

Read input XML file of pipe data.


Read initial discharge, roughness factor, pipe diameter, length

Read pipe diameters for each loop.


Calculate R factor = (0.0826 * roughness factor * len)/ (diam)5

Check flow direction


Assign the ve of discharge of the
pipe in previous loop as initial
discharge in next loop

Is Common
Pipe?

N
Is loop
balanced?

Y
Set new discharge as initial discharge
Reassign pipe data for next loop

N
Volume-3 | Issue-11 | Calculate
May-2014
net error in discharge for each loop

Page 4

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014

Write all iterations results to output print file


Save file on current path.

Is next set
of input?

Fig.1 Flow chart of the Hardy Cross method


Results and Discussion
END
The two loop pipe network was considered to develop the source code in C#.NET for
Hardy Cross method. The source code was developed for the single set of diameters. The
results generated are presented below:
Iteration 1
Loop pipe

No

Q0

rQ0abs(Q0) 2rabs(Q0) Delta Q

New dis

AB
BE
EF
FA

1
2
3
4

253.75 0.120 3.65


60.90
0.1347
8260.00
0.010 0.83
165.20
0.0247
3263.21
-0.060 -11.75
391.59 0.0147 -0.0453
258.13 -0.100 -2.58
51.63
-0.0853
SUM =
-9.85
669.31

BC
CD
DE
EB

5
6
7
8

13056.79
3263.21
8260.00
33050.00

0.0500 32.64
1305.68
0.0100 0.33
65.26 -0.0028
-0.0200
-3.30
330.40
-0.0247
-20.16
1632.67

0.0472
0.0100
-0.0200
-

0.0247
SUM =

9.50

3334.01

Iteration 2
Loop pipe

No

1
2
3

253.75 0.1347 4.61


8260.00
0.0247 5.05
3263.21
-0.0453

AB
BE
EF

Q0

rQ0abs(Q0)

2rabs(Q0)

Delta Q

68.37

0.1334
408.29

-6.69

New dis

0.0234
295.55 -0.0013

0.0466

Volume-3 | Issue-11 | May-2014

Page 5

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
FA

BC
CD
DE
EB

258.13 -0.0853
SUM= 1.08

-1.88

44.03

-0.0866

816.24

5
6
7
8

13056.79
3263.21
8260.00
33050.00
SUM =

0.0472 29.03
615.63
0.0421
0.0100 0.33
32.63 -0.0050
0.0050
-0.0200
-3.30
165.20
-0.0250
-0.0234
-18.10
773.37
-0.0284
7.95
1586.83

Loop pipe

No

rQ0abs (Q0)

AB
BE
EF
FA

1
2
3
4

253.75 0.1334 4.51


67.69
0.1334
8260.00
0.0234 4.52
386.41
0.0234
3263.21
-0.0466
-7.09
304.19 0.0000 -0.0466
258.13 -0.0866
-1.94
44.71
-0.0866
SUM= 0.01
803.01

BC
CD
DE
EB

5
6
7
8

Iteration 3
Q0

2rabs(Q0)

Delta Q

New dis

13056.79
0.0421 23.18
550.20
0.0421
2
3263.21
0.0050 0.08
16.28 0.0000 0.0050
8260.00
-0.0250
-5.17
206.60
-0.0250
33050.00
-0.0234
-18.10
773.37
-0.0234
SUM = 0.00
1546.44
In above iterations, r is roughness factor of the pipe, Q0 is initial discharge in the pipe
(m3/s). It was observed that the Hardy Cross method converged in iteration 3.
Conclusion
The source code for the Hardy Cross method was developed for the single set of
diameters in the two loop network. The source code can be generated for more than one
set of diameters when the cost of the network is to be optimized by using the
optimization techniques such as genetic algorithm where the population of all possible
solutions needs to be generated.
References
1. Cross, Hardy. (1949). Analysis of Continuous Frames by Distributing Fixed-End
Moments. In
i. Numerical Methods of Analysis in Engineering. Successive Corrections. L B.
ii. Grinter, ed. New York.
2. Lindell E. Ormsbee (2006)8th Annual Water Distribution Systems Analysis Symposium,
i. Cincinnati, Ohio, USA, August 27-30, 2006
3. Lopes. A. M. G. (2004) Computer Applications in Engineering and Education, 12: 117i. 125, Published online in Wiley Inter Science
4. Jeng D. S. (2004)Proceedings of the third international conference on Engineering
i. computational technology Stirling, Scotland Pages: 11 - 12 Year of
ii. Publication: ISBN:0-948749-84-9
5. Jakobus E. Zy.l (2008 ) Journal of Hydrolog, Volume 134, Issue 8, pp. 1176-1179

Volume-3 | Issue-11 | May-2014

Page 6

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
6. Ohtmer. O. (2005) International Journal for Numerical Methods in Engineering
Volume 19
7. Issue 3, Pages 373 392 Published Online
8. Volokh. K.Yu. (2002) International Journal of Solids and Structures39, 41974200

Brief biodada

Name: PATIL VIKRAM PANDURANG


Designation: Assistant Professor of Mathematics
Official Address: Dept. of F.S.R.E., Dr. A.s. College of Agril.Engg.,M.P.K.V.,Rahuri
Residential Address: E-50, Gulmohor Colony, M.P.K.V.,Rahuri.-413722
Phone: Office (02426)243211 Residence:Mobile:9420639636

Volume-3 | Issue-11 | May-2014

Page 7

Golden Research Thoughts


Impact Factor : 2.2052(UIF)
Volume-3 | Issue-11 | May-2014
Fax:(02426)243326
Email:[email protected],[email protected]
Educational Qualification: M.Sc.(Maths), M.C.M. M.Ed.
Experience: Working as Asstt. Professor of Mathematics since Sept.2001 to till date in
Dr. A.S. College of Agril.Engg., M.P.K.V., Rahuri
Attended 5 trainings at various places and 3 National/Internationa Conferences
Published 2 Full length papers in the proceedings of Conferences/ Seminar
Guided 8 UG/PG students in the research projects

Volume-3 | Issue-11 | May-2014

Page 8

You might also like