Calibration of the computer model describing flows in the water supply system ; example of the application of a genetic algorithm

The paper discusses some relevant aspects of the calibration of a computer model describing flows in the water supply system. The authors described an exemplary water supply system and used it as a practical illustration of calibration. A range of measures was discussed and applied, which improve the convergence and effective use of calculations in the calibration process and also the effect of such calibration which is the validity of the results obtained. Drawing up results of performed measurements, i.e. estimating pipe roughnesses, the authors performed using the genetic algorithm implementation of which is a software developed by Resan Labs company from Brazil.


Introduction
The calibration process is characterized by indeterminacy which results from the fact of rarely distributed measurement points and also from the fact that there are not known neither searched characteristics of the system components (especially the roughness of pipes) nor water partitions occurring during performing these measurements.
The aim of each of the different known calibration method is removing (reducing the magnitude) aforementioned indeterminacy of the task.Each method requires performing a variety of measurements used in the calibration.The efficiency of the calibration depends, among others, on the number and location of measurement points.Moreover, frequently used method of reducing the number of unknown roughnesses and partitions [1] is grouping of pipes of virtually identical roughness coefficients and grouping of junction nodes with virtually identical timing patterns of water partitions.
The efficiency of the calibration also depends on the method of optimal use of the above mentioned measurements (intuitive method, methods/algorithms implemented numerically) when estimating characteristics (parameters appearing in the analytical descriptions of these characteristics) of the system components.
Among the above-mentioned calibration methods, the most popular is the one which can be called "direct"; this method uses measurements of pressure and flow at selected places (nodes) of the system.In small and medium-sized systems the nodes for measuring are selected intuitively (see an expert selection in agreement with the water company's employees, in the way described later in this paper, in the description of the calibration carried out for the exemplary water distribution system).For the larger systems, it is reasonable to optimize the number and location of junction nodes at which we perform the measurements (see e.g. the theoretical basis of sampling design [2]).
Drawing up the results of performed measurements, i.e. estimating pipe roughnesses, the author performed using the genetic algorithm [1, [3][4][5][6] implementation of which is a software developed by Resan Labs company from Brazil.

The modelled exemplary water distribution system
An exemplary system of water transport and distribution supports the following four places in Wejherowo commune: Sopieszyno, Ustarbowo, Gowino and Pętkowice.Water is taken from quaternary forms by water intakes located in Sopieszyno and Pętkowice (Fig. 1).

The scope and the manner of key data collection
The computer model of flows in the exemplary water transport and distribution system, presented in the article, was created with the use of the EPANET software.The data 2 E3S Web of Conferences 22, 00128 (2017) DOI: 10.1051/e3sconf/20172200128 ASEE17 describing the current condition of the system include, i.a.system geometry, diameters, material and the age of pipes, technological schemes and methods of the regulation of the operation of objects and fittings which work with the water supply system, current water partitions [7] and current character of water demand in the individual towns supplied by the system as well as parameters characterising the quality of water supplied to consumers.In the process of collecting such data obtained from the water supply company some restrictions appeared concerning these data assortment and accuracy.In such conditions, it was attempted to use the information obtained maximally in terms of the required credibility of the model coming into existence.
The system structure and the pipe materials are typical for municipal systems built in Poland in the 90's of the 20 th c. [8].A substantial part of the network is made of PVC.These are older pipes.On the second place there are pipes the age of which does not exceed ten years.These pipes are made of PE.
The numerous measurements of flow rate and pressure were carried out at the water in-takes in Sopieszyno and Pętkowice and also at selected nodes of the water distribution system (see chap. 4).The measurements were recorded every hour [7,9].Due to the impossibility of obtaining exact data on water demands in respective nodes, they were determined on the basis of the average water consumptions by individual households, obtained from the several years' quarterly readings of water meters.Thus, the weight distribution of base consumptions in the water supply system could be determined.
The time patterns of inequality of hourly water consumption for individual nodes were determined with taking into consideration some specific information about water consumption of individual objects, their sizes etc.

Calibration of the computer model
Taking into account the assortment of measurements, the applied method of the calibration of model can be classified as the direct method, described in chapter 1, i.e. the method which uses the measurements of pressure and flows at selected nodes of the water distribution system.
The drawing up of the results of above-mentioned measurements, i.e. estimation of roughness of pipes forming a water distribution network as well as emitter coefficients, was carried out using a genetic algorithm.It was applied EPANET Calibrator software, developed by Resan Labs from Brazil [3,6,10].
The authors of the EPANET Calibrator software give the form of the objective function in optimization task of calibration of model of water transport and distribution system.The criterion of the optimization task is to minimize the said objective function [10] where: P'i -set of pressure values, Q'i -set of flow values, ΔPi -difference of pressure between simulated and observed data, ΔQi -difference of flow between simulated and observed data, N -number of monitored nodes, M -number of monitored pipes.
The coordinates of the decision vector can be roughnesses of pipes and emitter coefficients, which in the objective function occur in the implicit form.In turn, implicit restrictions in this optimization task are conservation equations describing the flows in the system.Due to formal reasons, mentioned coordinates of the decision vector are under restrictions with explicit character.The optimal solution is the decision vector meeting the above criterion.
The consumption of water in time and space of the supplied area and also the initial roughnesses of pipes have been determined as precisely as possible due to their high importance for the convergence and the stability of the calculations algorithm.Localization of measuring points was made following the selection of sites with the highest pressure fluctuations (primarily terminal nodes of the network branches) and in the areas with the largest water consumptions (around the "centre of gravity of the system").
During calibration, in subsequent simulations, pipe roughnesses are corrected and emitter coefficients are determined which affect the flows calculated in the course of the simulations because the flows are taking into account the differences between initially assumed and estimated partitions involving leakages.In the software used with the EPANET Calibrator plug, emitter coefficients constitute the basis for estimating outflows q from the water supply system.Thus, the author of the said software plug provides the following dependence [11]: where A is an orifice area, Cd is a discharge coefficient and g is gravitational acceleration.It must be underlined here that the analogous dependences of a similar nature and form may be found in the various examples of source literature [12][13][14][15][16][17].
As we recalled in chapter 1, we are creating the groups of pipes of similar roughness in order to reduce the number of unknowns / searched roughnesses.
The rule of the automatic calculations control during calibration consists in it, that in subsequent iterations, the said coordinates of a decisive vector are determined according to the genetic algorithm which provides for searching for a final solution satisfying a criterion in the form (1).
Calibration may be conducted independently of the number of measurement points and generally there is even no obligation of measuring the flow rates of intakes supplying the system with water, because the discharges of intakes and water partitions are balanced during the fulfilment of the estimation algorithm, during the simulations of flows.These are the important assets of the process under discussion because they facilitate model calibration and the calibration accuracy depends on our decision concerning number and locations of the measurement points.Some more essential findings and remarks about calibration are given in the last chapter devoted to conclusions.Only brief calibration results are provided in this chapter, which ensure that the model adequately describes the operation of the water supply system.Fig. 2 and fig. 3 show the comparisons of observed 24 h flows and pressures with simulated ones before and after calibration, at two exemplary pipes (comparisons of flows) and nodes (comparisons of pressures).The pipes and nodes are located close to both water intakes (practically at their outlets) Pętkowice (fig.2) and Sopieszyno (fig.3).The results of performed calibration, i.e. estimation of the pipes roughnesses and the determination of the emitters coefficients and so the accuracy of the system operation simulation are very good what was not possible to be stated with the reference to not-calibrated model, although starting values of the roughnesses of pipes and the partitions of water were assumed with the great care.Differences between pressures and flows simulated with the help of calibrated model and ones that were measured do not exceed permissible values given at the work [18], and they even are definitely smaller.As can be seen (fig.4), calculations conducted with the EPANET Calibrator software were not only stable, but also were characterized by a very good convergence.In contrast with often applied "manual" roughnesses adjustments while making the calibration, these calculations are proceeding automatically and quickly, not requiring the interference of the engineer drawing the computer model up.It also helps to avoid the tendency of setting the local minimum of the objective function.

Conclusions
Calculations conducted with the genetic algorithms are not only stable, but also are characterized by a very good convergence of the optimization process of calibration.The graph presented in the fig. 4 is demonstrating a very good convergence which is even better than assumed while starting the calibration.
Significant elements affecting the convergence of the calibration process of the model are: applying presently standard methods of reducing the number of unknown roughnesses, carefully prepared starting data recalled in chapter 3 as well as the advantages of the genetic algorithm.
The calibration of the model, using measurements of pressure and flow in selected locations of the system, turned out to be completely sufficient.
The method of locating measuring points described in the article was sufficient.It was based on the expert selection in agreement with the water company's employees.Namely, the localization of measuring points was made following the selection of sites with the highest pressure fluctuations (primarily terminal nodes of the network branches) and in the areas with the largest water consumptions (around the "centre of gravity of the system").More sophisticated methods of sampling design are desirable only for very large and complex water supply systems.
In the course of the calibration there are calculated the emitter coefficients which affect calculated flows; the flows are taking into account the differences between initially assumed and estimated partitions involving leakages.
The leakages determined by means of the software with the EPANET Calibrator plug depend on pressures in the respective pipelines of water supply network and their diameters, as well as other characteristic data included by means of relevant coefficients in the formulas describing emitter coefficients.There are very similar approaches to this question in the source literature.

Fig. 1 .
Fig. 1.Scheme of the water supply network.

Fig. 2 .
Fig. 2. Comparison of observed flows and pressures with simulated ones before and after calibration, respectively at exemplary pipe and node in Pętkowice village; Initial population: 200, Generations: 400, Mutation probability: 0.01, Crossover probability: 0.95.

Fig. 3 .
Fig. 3. Comparison of observed flows and pressures with simulated ones before and after calibration, respectively at exemplary pipe and node in Sopieszyno village; Initial population: 200, Generations: 400, Mutation probability: 0.01, Crossover probability: 0.95.

E3SFig. 4 .
Fig. 4. Characteristics of the convergence of the applied genetic algorithm.