You are on page 1of 11

What does it take to make automated calibration find closed valves and leaks?

Thomas Walski1
Paul Sage2
Zheng Wu3

1
Senior Product Manager, Bentley Systems, 3 Brian’s Place, Nanticoke, PA 18634, 1-
570-735-1368, tom.walski@bentley.com
2
Managing Director, Witsconsult Limited, 21 Milton Rough, Action Bridge,
Northwich, Cheshire CW8 2RF, U.K. E-mail: pvsage@btinternet.com
3
Research Director, Bentley Systems, 27 Siemon Company Dr., Watertown, CT 06785,
1-203-805-0562, Zheng.wu@bentley.com

ABSTRACT

A genetic algorithm (GA) model can be helpful in locating leaks and incorrectly closed
valves in a water system in addition to calibrating for pipe roughness. This paper
provides some practical suggestions to help users collect the right quality and quantity
of data, manage the GA runs and interpret the results.

Optimization techniques work by adjusting demands, locating leakage hotspots,


changing pipe roughness or valve status so that the model matches the field
observations for flow and pressure. However, all field data is inaccurate to some extent.
The first key to success is that it is necessary to have head loss in the system that is
significantly greater than the error in measurement. Otherwise, adjustments to the
model are essentially random.

In many water distribution systems, the head loss from the boundary nodes to the
measurement points is small and, thus, extra head loss must be generated. The easiest
way to accomplish this is by opening one or more hydrants such that the flow increases
by a known amount. This magnifies the discrepancies between the model and field data
and makes the model much more sensitive to changes in parameters. Even with these
high flows, it is important to measure the resulting pressure and the elevation of the
pressure gage to a high degree of accuracy (and remember that the elevation of the gage
is not necessarily the elevation of the model node).

INTRODUCTION

The idea behind using optimal model calibration models to find leaks and closed valves
in a distribution system is pretty simple. Build a model assuming the user knows all the
demands and all the valves are in their correct position. Collect some pressure readings
and flow measurements which don’t agree with the model. Then let a genetic algorithm
places leaks and close valves throughout the system until the model agrees with the
field readings. While the idea is simple, in practice, conditions need to line up right to
make this process work.

Finding leaks and closed valves in a water system can be done manually and is usually
part of any good model calibration exercise. However, there are limitations in
performing this work manually. Using optimization, it is possible to test many more
trial solutions than can be done manually.

The authors have experience in testing the use of optimization for leak detection and
location of closed valves. Through many runs, they have tested the sensitivity of results
to variations in field data and optimization parameters. In this paper, the existing
literature for this type of model calibration is discussed, an example application is
presented and the body of the paper consists of practical tips for making these methods
work in practice.

LITERATURE

The most reliable way to detect leaks which have not surfaced in a water distribution
system is use of sonic leak detection equipment (Farley, 2011; Farley, Trow, 2003;
Lambert, 2002). This is very labor intensive and the equipment can be expensive. With
more plastic pipe being installed in recent years, the effectiveness of sonic leak
detection has decreased. Developing methods that use hydraulic analysis models is
promising as a way to focus on the areas with leaks (Wu, 2011) and use sonic leak
detection only for pinpointing the leak. Puust et al. (2010) provided an overview of leak
management.

Much of the research on hydraulic detection of leaks has focused on use of transient
analysis. While these methods work well in pipelines, their use in distribution grids is
limited (Beck, Curren, Sims, Stanway, 2005; Brunone, 1999, Covas, Ramos, de
Almeida, 2005; Covas, Ramos, 2010; Kapelan, Savic, Walters, 2004; Lee, Vítkovský,
Lambert, Simpson, Liggett, 2005; Liggett, Chen, 1994; Vítkovský, Simpson, Lambert,
2000; Wang, Lambert, Simpson, Liggett, Vítkovský, 2002).

Wu and Sage (2006), Wu, Sage and Turtle (2010), Wu (2011) and Powell (2013) have
demonstrated that steady state hydraulic models coupled with optimization can be used
to detect leaks or closed valves without relying transients using Bentley’s Darwin
Calibrator (Bentley Systems, 2013). The Darwin Calibrator uses a genetic algorithm to
search the distribution system for the combination of closed valves and emitter flows
representing leaks such that observed flows and pressures match field observations.
While the methods work, they need high quality data or else the results are little more
than random numbers. This paper describes some issues with the quantity and quality of
data required to get good results.

Walski, Wu and Hartell (2004) showed that to be successful, Darwin Calibrator needed
good quality data and that relying on a single flow test or providing even one bad data
point made it difficult to obtain good results. But that paper was for a problem involving
Hazen-Williams C-factor as the calibration parameter. Locating leaks and closed valves
can be even more challenging because they can hide behind other anomalies in the
system.

As Walski pointed out, it is important to have significant head loss to make model
calibration work (1986, 2000) and flowing hydrants was a good way to achieve that
head loss (Walski, 1983), since in many cases the hydraulic grade in distribution
systems under normal conditions is relatively flat.

Incorrectly closed valves are regularly found when performing water distribution model
calibration (Roberts and Widderich, 2009). Walski (2009) demonstrated how Darwin
Calibrator could find closed valves and reported on a successful application by a model
user. The challenge is to identify the unknown valves among hundreds or even
thousands of the valves. An efficient method has been developed and presented by Wu
and Song (2012a) to effectively locate the known valves and identify not only their
status (open or close) but also the settings (the level of opening or close). The method
was tested and validated with a real case system.

EXAMPLE APPLICATION

The use of GA calibration to locate leaks and closed valves can be illustrated using a
model based on the Micropolis system developed by Brumbelow et al. (2007) as shown
in Figure 1.

A 30 gpm (2 L/s) leak was placed at the node called “Leak”. Two flow tests were
conducted with flowed hydrants at nodes Flow1 and Flow 2 and residual pressures were
recorded at nodes Pressure 1, Pressure 2 and Pressure 3. Pipe flow out of the main pump
station was also used. The GA essentially searches for candidate leakage nodes and
emitter coefficients until the recorded pressures and flows match the model.
Figure 1. Example System

The objective function to be minimized sought to minimize the fitness of the solution
according to a least squares formula.

1 1
F= ∑ (H mod − H obs ) +
2
∑ (Q
mod − Qobs )
2

wH wQ

where F = objective function fitness; wH = weighting factor for head; Hmod = head
predicted by model, m; Hobs = head observed in field, m; wQ = weighting factor for
flow; Qmod = model predicted flow, L/s; Qobs = flow observed in field, L/s

In the tests conducted for this paper, the GA used a maximum number of trials of one
million, one thousand generations with no improvement and a fitness function value of
0.0001 as the stopping criteria. The GA starts with a user specified “Representative
scenario” which characterizes what the demand in the system should be at the time of
the testing with no leaks. It can use multiple data snapshots and can determine, not only
the best solution, but can also report on a user specified set of other good solution with
second, third, fourth best fitness. In this study, the best five solutions were saved. The
GA, not only locates the most likely leak node(s), but assigns emitter coefficients for
the leak.

A variety of tests were conducted with the model. Assuming that the hydraulic grade
line (HGL) was measured to a precision of +/- 0.01, 0.1 and 1 ft, the GA was able to
locate the leak. However, when the precision was changed to 10 ft, it could not reliably
find the leak. But even then, the top five solutions were in the general vicinity of the
leak node. Similarly, the set of candidate nodes which were possible be leaks could be
varied significantly and the GA was still able to locate the leak node.

With such good performance, one would expect that among the top five solutions would
be several with the same leak node varying only in the value of the emitter coefficient.
However, the results would include non-leak nodes before including the correct leak
node with a different emitter coefficient among the top five solutions. In some cases,
only one of the top five solutions included the leak node while in other, as many as
three of the top five solutions included the leak node. The implication is that the user
should look for trends in the solution and not necessarily pick a single node from the
best solution. Remember that the leak will not occur directly on a node but somewhere
on a pipe near the node. The goal is to send field crews to an area where they are likely
to pinpoint a leak with their sonic equipment rather than having them randomly search
or sweep through the system.

AUTOMATED CALIBRATION IN PRACTICE

Given that with sufficient quantity and quality of data, a genetic algorithm (GA)
calibrator can find leaks and closed valves. Whether it works in practice depends on
how much data are provided and how good the data are. The authors have tested GA
calibration and have arrived at some guidelines for using this type of tool in practice.
They are listed below:

Head loss caused by leak or closed valve must be significantly greater than error in
measurement. Head loss across a pressure zone or district metered area (DMA) in a
distribution system may only be on the order of a few feet. Head loss measured is based
on the different in hydraulic grade line (HGL) across that distance and is based on the
sum of elevation of the pressure sensor and the pressure converted into head units. If,
for example, the head loss is 12 ft +/- 5 ft (4 m +/- 1.5 m) and the extra head loss caused
by the leak or valve is 2 ft (0.6 m), then the GA can’t distinguish between the leak and
background noise.

Heads used as input to the GA need to be measured as accurately as possible which


means that all pressures should be measured to an accuracy of one foot with elevations
(of the gage, not the model node) measured to one foot. This means that high quality
gages are needed and elevations may need to be measured by surveying, highly accurate
digital elevation models or using a global positioning system with sub-meter accuracy.
Head loss can be improved by increasing flows. Head loss in pipes is a non-linear
function of flow as shown by the exponents in the Darcy-Weisbach or Hazen-Williams
equations. A 10 gpm leak (0.6 L/s) on top of a normal flow of 5 gpm (0.3 L/s) will not
cause much head loss in a 6 in. pipe. However, a 10 gpm (0.6 L/s) leak added to a 100
gpm (6 L/s) background flow can be significant.

To obtain these higher head losses, it may be necessary to open a hydrant or blowoff
and accurately measure the flow. Wu and Song (2013) presented the method for
optimizing the selection of hydrants for fire flow test. It helps engineers to determine
which hydrants are flowing to ensure that the increased flow will have the effective
impact on the head loss changes of as many pipes as possible. Once the flowing
hydrants are selected, the procedure for hydrant flow tests (preferably with multiple
residual hydrants) is useful for this situation. With hydrant flow data, the noise in the
measurement caused by uncertainty in nodal demands becomes less significant.
Portable data loggers can be helpful for obtaining pressures with the need for a great
deal of manpower.

Background water use needs to be estimated well. Because the GA starts with a
model with typical demand for that time of day and leaks are added and moved around
until the model matches the field data in the GA, the testing should be done at a time
when flows can be estimated accurately in comparison to leaks. This is usually late at
night. However, it must be done in a location where there are no wild swings in water
use during testing. A large industry with batch water use operations can easily mask the
effect of leakage. Monitoring the flow into the study area can be used to detect if any
flow anomalies are occurring. When a hydrant is open, the increase in inflow should
correspond to the hydrant discharge.

Model needs correct connectivity and boundary conditions. While the starting
model need not be perfectly calibrated (in fact it can’t be if there are unknown leaks and
closed valves), it cannot have serious errors in connectivity. In addition boundary
conditions (e.g. tank levels, valve settings), roughness of pipes and pump curves need to
be in reasonably good condition or else they can mask the effect of closed valves or
leaks.

Leaks can only be found in small pipes. For hydraulic leak detection to work, the leak
needs to be sufficiently large that it causes significant additional head loss. This can be
achieved in small pipes but not in large pipes. For a leak to cause a significant head loss
in a large pipe, the leak would most likely cause flooding in the neighborhood and there
would be no need to search for it.

Closed valves can be found in any size pipe. In contrast with leaks, closed valves can
be detected when they cause significant additional head loss in any size pipe. The
criteria for success here is that the alternate path that the water flows when a valve is
closed should have less hydraulic capacity than the path that is closed. Consider a
parallel 6 in. (152 mm) and 24 in. (608 mm) pipe. When a valve is closed on the 6 in.
(152 mm), the water would flow through the 24 in. (608 mm) and very little additional
head loss will occur. If a valve is closed on the 24 in. (608 mm), the head loss through
the 6 in (152 mm) would dramatically increase as it tries to handle the additional flow.
When larger pipes are involved, the GA is more successful in finding closed valves than
leaks. Usually, it is good practice to run the GA to find closed valves first and then try
to find leaks if the pipes are small enough.

More measuring points increase the likelihood of success. Pressure and flow are
usually measured at the entrance to the DMA or pressure zone. The GA requires at least
one additional pressure measurement to work but the chance of success increases as the
number of pressure measurements increases. Wu and Song (2012b) demonstrated a
pressure logger placement method that has been successfully applied to optimize the
number of pressure loggers and their placement so that a system can be covered by the
data loggers with the maximum likelihood of detecting the leaks. In addition, the better
the quality of data is, the more reliable the leakage detection results are.

Pressure monitoring much less expensive than flow monitoring. Flow data are more
useful for finding leaks than pressure data. However, installing flow meters in a system
is much more expensive than pressure monitoring in that flow monitoring involves
excavation, installation of a value and meter and related backfilling and paving work.
On the other hand, a pressure logger can be placed on any hydrant or blowoff in
minutes and can easily be moved from one location to another without the need for a
construction project or interruption of service.

Focus on portion of system. Having a reasonable size for the GA solution space is
essential. Don’t attack a huge system with tens of thousands of pipes in one GA run.
Work on individual pressure zones or DMA’s, one at a time, to have any hope for
success. Otherwise the solution space is too large and the GA won’t be able to zero in
on a problem.

Use a reasonable size solution space. A study area within a large system may contain
hundreds of nodes and pipes. If a user simply allows the GA to search any node for a
leak and any pipe for a closed valve, the number of combinations of solutions becomes
impractical. This can result in extremely long run times and difficulty in ever finding
the correct solution. (A “solution space” can be thought of as the set of all possible
solutions. The smaller it is, the easier to find the optimal solution.)

Usually a better work flow is to search for closed valves first. Then once they are
located look through a relatively small set of dispersed possible leak nodes (say less
than 50) spread throughout the study area. When some nodes show potential as leak
locations, eliminate those that don’t look promising and place a denser set of candidate
leak locations where leaks seemed more likely.

It is not necessary to make every node a candidate leak node. The GA may point out a
likely leak node but the actual leak may be a block or two away. The error in
measurement means that the solution points to an area of possible leak rather than an
exact street address.
Give the GA time to find the solution. The GA needs some kind of stopping criteria.
This can be in the form of

1. Maximum number of trials or generations


2. Maximum number of generations without improvement
3. Stopping level for the objective function

At first, while setting up the GA, the number can be low and the stopping level can be
high (goal is zero). However, for production runs, the maximum number of trials and
generations should be set very high to allow the GA to adequately search from the huge
number of possible solutions; not get hung up on a local minima and not quit before it
has adequately searched the solution space. While the model should be an “all-pipe”
model in the area of the suspect leak, the model far from the testing may be
skeletonized to help the solution run faster.

Combining this tip with the previous one to use a reasonable solution space means that
it is good to limit the solution space but search it very thoroughly.

Results may be meaningless where there are no data. Especially in the case of
searching for closed valves, if there are no flow tests or measuring points in a portion of
the system, the GA has no way to discriminate between open or closed valves as long as
there is a path to each node. (If closed valves isolated a portion of the system, customers
would have complained.) With no data, the GA has no way to set valve position so the
status of a valve is more or less random. This can result in some “false positives” in
terms of potential closed valves.

This can be prevented by not including pipes/valves that are not impacted by flow tests
from the list of candidate valves or understanding that even if the GA points out such
valves as shut, the GA is essentially guessing.

“Leaks” aren’t necessarily leaks. When the GA reports a possible “leak”, what it is
really reporting is that the actual demand at a node is significantly different from what
was expected from the model. It may be a leak, an unmetered user, theft of water, or
simply an unusual water use event (e.g. washing down equipment at an industry, filling
a tanker truck) at the time the field data were collected. It should probably be referred to
as an “unexpected water use”. Before the utility digs up a street, the operators need to
confirm that the leak is real, usually with sonic leak detection equipment. The
optimization model is saying “something is wrong with demands here” and some follow
up is needed. Finding an unmetered consumer is better than finding a leak in that this
leads to future revenue and no repair cost.

Need to consider discolored water. In some distribution systems, flowing hydrants to


increase head loss can lead to discolored water (Boxall and Saul, 2010). The flows need
to be planned to minimize this problem, which can include flowing at night when the
discoloration is less likely to be noticed. The flow should be kept low enough as not to
suspend sediment in problem areas. It may be possible to coordinate the hydrant
operation used for flow testing with normal flushing operation to minimize disturbance.

Safety considerations. Since this work is likely to be performed at night, it is important


to equip personnel with adequate lighting and reflective gear. Flow tests should not be
conducted when temperatures are in a range where ice can form.

SUMMARY

A genetic algorithm solution can help a water utility identify closed valves or leaks
(unexpected water use). However, the quantity and quality of data to drive the solution
must be very good; the user needs to manage the GA solution to get the best results and
the user needs to understand how to interpret the results.

REFERENCES

Beck, S. B. M., Curren, M. D., Sims, N. D., and Stanway, R., 2005 “Pipeline network
features and leak detection by cross-correlation analysis of reflected waves.” J.
Hydraul. Eng., 131:8, 715–723.

Bentley Systems, Incorporated, 2013. WaterGEMS V8 XM users’ manual, Watertown,


Conn.

Boxall, J.B., and Saul, A.J. (2005) “Modelling discolouration in potable water
distribution systems”, J. Env. Eng.. 131:5, 716-725

Brumbelow, K., J. Torres, S. Guikema, E. Bristow, and L. Kanta. 2007, “Virtual cities
for water distribution and infrastructure system research.” Proc. World Environmental
and Water Resources Congress 2007: Restoring Our Natural Habitat, ASCE, Reston,
VA.

Brunone, B. 1999. “Transient test-based technique for leak detection in outfall pipes.” J.
Water Resour. Plann. Manage., 125:5, 302–306.

Covas, D., Ramos, H., and de Almeida, A. B. 2005. “Standing wave difference method
for leak detection in pipeline systems.” J. Hydraul.Eng., 131:12, 1106–1116.

Covas, D. and Ramos, H, 2010, “Case Studies of Leak Detection and Location in Water
Pipe Systems by Inverse Transient Analysis,” J. Water Resour. Plan. Manage, 136:2,
248-257.

Farley, M., 2011, “Active leakage control” in Wu, Z., Water Loss Reduction, Bentley
Institute Press, Exton, Pa.

Farley, M. and Trow, S., 2003, Losses in Water Distribution Networks, IWA
Publishing, London.
Kapelan, Z., Savic, D., and Walters, G. A. 2004. “Incorporation of prior information on
parameters in inverse transient analysis for leak detection and roughness calibration.”
Urban Water, 1:2, 129–143.

Lambert, A. O. 2002. “International report on water losses management techniques.”


Water Sci. Technol.: Water Supply, 2:4, 1–20.

Lee, P. J., Vítkovský, J. P., Lambert, M. F., Simpson, A. R., and Liggett, J. A. 2005.
“Frequency domain analysis for detecting pipeline leaks.” J. Hydraul. Eng., 131:7, 596–
604.

Liggett, J. A. and Chen, L. C., 1994. “Inverse transient analysis in pipe networks.” J.
Hydraul. Eng., 120:8, 934–955.

Powell, J., 2013, “WaterGEMS Leakage Hotspot Leak Detection?” Clean Water
Modeleing Advisory Group, Nottingham, UK, November.

Puust, R., Kapelan, Z., Savic, D. and Koppel, T., 2010, “A Review of Methods for
Leakage Management in Pipe Networks,” Urban Water Journal, 7:1, p. 25-45.
February.

Roberst, M. and Widderich, K., 2009, “Field Testing and Hydraulic Modeling Located
Closed Valves in Distribution System,” AWWA DSS Converence, Reno, NV.

Vítkovský, J. P., Simpson, A. R., and Lambert, M. F. 2000. “Leak detection and
calibration using transients and genetic algorithms.” J. Water Resour. Plann. Manage.,
126-4, 262–265.

Walski, T., “A Technique for Calibrating Water Network Models,” 1983, J. Water
Resour. Plan..Manage., 109:4, 360.

Walski, T., 1986, “Case Study: Pipe Network Model Calibration,” J. Water Resour.
Plan. Manage., 112:2, 238.

Walski, T., 2000, “Model Calibration Data: The good, the bad and the useless,” Journal
AWWA, 92:1, 94.

Walski, T., 2009, “Finding Closed Valves in your Water Distribution System,”
AWWA-DSS Conference, Reno, Nev. Sept. 2009.

Walski, T., Wu, Z. and Hartell, W. 2004, “The performance of automated calibration
for water distribution systems,” EWRI Conference, ASCE, Reston, Va.
Wang, X.-J., Lambert, M. F., Simpson, A. R., Liggett, J. A., and Vítkovský, J. P. 2002.
“Leak detection in pipelines using the damping of fluid transients.” J. Hydrol. Eng.,
128:7, 697–711.

Wu, Z. (2011) “Leakage detection by hydraulic model calibration,” in Wu, Z., Water
Loss Reduction, Bentley Institute Press, Exton, Pa

Wu, Z. Y., and Sage, P. _2006_. “Water loss detection via genetic algorithm
optimization-based model calibration.” Proc., Water Distribution System Analysis
Symp., ASCE, Reston, Va.

Wu, A., Sage, P. and Turtle, D., 2010, “Pressure-Dependent leak detection model and
its application to a district water system”, J. Water Resour. Plan. Manage, 136: 1, 116-
128.
Wu, Z. Y. and Song, Y. (2013) “Optimizing Selection of Fire Hydrants for Flow Tests
in Water Distribution Systems.” The 12th International Conference on Computing and
Control for the Water Industry, Sept. 7-9, 2013, Perugia, Italy.
Wu, Z. Y. and Song, Y. (2012a) "Optimization Model for Identifying Unknown Valve
Statuses and Settings", WDSA2012, Sept. 22-27, Adelaide, Australia.
Wu, Z. Y. and Song, Y. (2012b) "Optimizing Pressure Logger Placement for Leakage
Detection And Model Calibration", WDSA2012, Sept. 22-27, Adelaide, Australia.

You might also like