Abstract

In the current era, the digitization of geographical data is a transverse need of several engineering sectors, including the hydraulic networks management. Thus, water supply systems' modelling requires adequate tools in both the digitization and the simulation phases. This paper presents the QEPANET plugin, which aims at merging the flexibility of QGIS and the robustness of EPANET hydraulic simulations software. Several editing and graphical tools available with QEPANET are introduced to model new and existing water distribution systems, to read and modify existing text-based EPANET files, to run simulations and visualize results in a geo-referenced framework. In addition, an application is illustrated to underline the novelty and the practical functionality of the presented tool, such as 3D pipe lengths' automatic calculation and the supporting functionalities for the network drawing. The plugin is available via the official QGIS Python Plugins Repository and on the world-wide-web at https://gitlab.com/albertodeluca/qepanet.

INTRODUCTION

The growing necessity to improve the current water supply systems (WSSs) due to water demand rising together with increasing drought event recurrences in a climate change scenario has encouraged researchers and technicians to face several issues such as designing new systems, refitting deteriorated infrastructures and optimizing management. Moreover, the emergence of smart technologies has dramatically increased the amount of information available for analysing WSSs, making it even more necessary to develop suitable analysis tools. The most widely used tool to simulate WSSs, for both scientific and technical purposes, is EPANET version 2 (Rossman 2000), which is a C coding language program developed by the United States Environmental Protection Agency (US-EPA). Recently, the new EPANET GUI, which has been developed in Python programming language on the base of PyQt designer tool, presents an interesting flexible interface including both original and new capabilities (SWMM-EPANET UI 2019a, 2019b). The new EPANET GUI allows additional functionalities to be easily increased through the plugins frameworks (Sela et al. 2019).

Based on EPANET software, several scientific algorithms and practical tools have been developed, such as a package that embeds EPANET solver in R environment (Arandia & Eck 2018), a hydraulic solver improvement (Muranho et al. 2015; Menapace et al. 2018) and bindings for Matlab (Eliades et al. 2016) and Python (Pathirana 2018). In addition, also commercial software applications are usually compatible with the input-output EPANET standards.

US-EPA proposes four different products for WSSs analysis at different levels. First, EPANET's user interface allows the WSS model to be drawn, to perform the simulation and to visualize the results. Second, the programmer's toolkit (Rossman 2008), which is a programming interface based on dynamic link library (DLL) technology, makes it possible to perform multiple extended period simulations, to modify parameters and to read results through the over 50 functions available. Finally, EPANET-MSX and EPANET-RTX increase the capabilities of EPANET with the ability to analyse multiple chemical reactions and perform real-time hydraulic WSS simulations, respectively.

Thus, several efforts have been made concerning EPANET portability and bindings, but there is still work to be done to improve the modelling process with integrated network-modelling frameworks. However, the main drawback of the current EPANET versions is the rare support for the models' drawing and for the definition of their characteristics. Thanks to the EPANET architecture, it is possible to add such capabilities through a computer-aided design (CAD) application, e.g., WaterCAD (Agunwamba et al. 2018). However, the important geographical nature (or the spatial component) of WSSs combined with the current increasing availability of digitized geo-referenced data has increased the necessity to create links with geographical information systems (GIS). In fact, the advantages of a geo-referenced framework are considerable from many aspects, ranging from the network modelling to the system management. For example, a geo-referenced framework can allow the modelling of a WSS directly on the base of GIS data provided by the utilities, allocation of hydraulic components and water demand, arrange relational databases which are the basis of management systems, and manage data coming from sensors in the field.

QGIS (Quantum GIS 2019) is a leading free and open-source GIS application capable of visualizing and analysing geospatial data, whose functionalities can easily be extended thanks to a robust plugin framework. For these reasons, more than a thousand plugins are currently publicly available. Among these, there are also some EPANET-related ones, such as the ‘Import/EpanetInpFiles’ plugin (Kyriakou 2019), which is suitable for moving files from EPANET to QGIS and conversely, and the ‘GHydraulics’ plugin (Macke 2014), which is an out-of-date tool able to calculate economic diameters using the EPANET solver.

Therefore, the authors aim to close the gap of performing an entire modelling of hydraulic networks using EPANET in a geo-referenced framework through the development of a suitable tool, called QEPANET. QEPANET is able to support researchers and technicians in WSS modelling with several useful functionalities for drawing the network and for analysing the results inside the open-source QGIS framework. The remainder of the paper describes in detail the features and the novelty of this python plugin of QGIS as follows. The section immediately below presents the structure of QEPANET and the novelty introduced, such as proper dedicated editing and graphical tools. This is followed by a section showing the capabilities of the plugin through practical examples. Then final remarks and conclusions are summarized.

DESIGN

QEPANET is a QGIS plugin (available both for the discontinued 2.x and for the new 3.x version) developed using the standard QGIS plugin Python framework. QEPANET provides an interface to the EPANET functionalities inside QGIS, going from the design and drawing of the network to the analysis of the simulation results. Since it also includes compiled EPANET libraries for the main operating systems (Linux, MacOS and Windows), it is virtually possible to complete a full simulation cycle without ever leaving QGIS.

QEPANET uses the standard EPANET network text format (the well-known ‘.inp’ file) to store its projects and thus the entire network topology and simulation configuration, but with two main advantages: first, there is no need to create additional files to store the network data and second, it is possible to import into QGIS existing QEPANET networks. The .inp file used by QEPANET includes some additional proprieties that are not used in the standard EPANET (for example, pipe material, the elevation correction, etc.). The QEPANET .inp file can be used in standard EPANET without compromising the model configuration, and it is ready to be used for hydraulic simulations. An error appears when a QEPANET .inp file is loaded in EPANET, remembering that it is not possible to read QEPANET additional in EPANET. With respect to existing QGIS tools dedicated to EPANET, QEPANET adds some previously unseen features:

  • a set of dedicated editing tools (in a dockable toolbar) facilitating the management of the hydraulic network. These tools allow the creation, modification and deletion of the network elements, and enforce the topology of the network. In addition, the creation of some elements is automated (e.g., when a new pipe is drawn, nodes are added to its ends, if not already present);

  • the option of using a raster DEM (digital elevation model) (Hirt 2014) to easily extract the elevations of the network nodes. The DEM is a text file, organized as a matrix, that contains the elevation of each point of an area;

  • support for 3D pipe lengths: QEPANET takes into account the elevation profile to automatically calculate the actual pipe length;

  • a graphical section editor to define and adjust the position of the pipes in relation to the ground;

  • definition of the maximum commercial pipe length inserting intermediate vertices along the pipeline. In this way, in addition to having a better estimate of the overall pipe length and a better planimetric trend, it is possible to determine the number of individual pipes' sections that constitute the whole pipeline;

  • easy definition of pipe properties such as material and roughness. It is, for instance, possible to choose the material, and the plugin presents a range of realistic roughness values to choose from. The properties are managed by the plugin GUI, so that there are internal controls on their consistency (and there is support for both SI and imperial units);

  • a tool to edit the curves and patterns used to define the operation of pumps and junctions;

  • a series of graphical tools to analyse the simulation results, that include thematic mapping of the network and graphs of the modelled entities through time.

EXAMPLE USAGE AND CAPABILITY

The main functionality of the plugin is to draw and design a WSS in a GIS environment easily. In this way, the physical components of the system (junctions, pipes, reservoirs, tanks, valves and pumps) are automatically geo-referenced in the 3D space.

Installation and project start/load

In order to use the plugin in QGIS, it must be installed from the QGIS Plugins Installer (Thiede et al. 2012). After the installation, all the functions are available, and to launch the plugin it is simply necessary to click on the new blue icon in the toolbars. The window that appears allows the choice of whether to start a new EPANET project or to load an existing WSS network. The plugin works and saves any network information in the .inp format file, which is the same as that used by EPANET. Therefore, an .inp project created in QEPANET can be imported without compatibility problems in EPANET, and vice versa. Furthermore, in the .inp file generated by QEPANET, there is additional information that may be necessary for a designer, for example, the pipe distance with respect to the ground elevation and the piping material.

Draw a WSS network and define attributes

To design a new WSS network, the first step is to import a DEM into QGIS, dragging the DEM file in the QGIS workspace and choosing the right coordinate system depending on the DEM origin. In this way, the WSS network will have a geo-referenced elevation layer as a reference.

The WSS design starts with the definition of the reservoirs/tanks' positions. The plugin acquires the spatial coordinates of the entered entity directly. It also assigns automatically the elevation taking as input the previously loaded DEM. The elevation can be modified manually by the user and corrected, accounting for the real distance from the ground.

Then, it is possible to draw the junctions and the pipes. The pipes are simply broken lines connecting junctions. For this reason, unlike EPANET, it is possible to draw a pipe directly, and the plugin will automatically assign a start node and an end node with the relative elevation. The pipe length is calculated automatically considering not only the planimetry but also the altimetry. It is possible to assign a roughness value to the pipe by entering a known roughness value (as in EPANET) or by assigning a material to the pipe (steel, cast iron, PE, etc.) and then a roughness value from the database in the standard range of roughness for that material (Moody 1944). Finally, in regards to the design of the pipes, it is possible to choose to automatically insert intermediate vertices at a predetermined relative distance along the pipe.

To insert valves and pumps' entities, once they are selected, a single click is necessary on the point of the pipeline at the insertion point. The plugin, since EPANET treats valves and pumps like linking objects (e.g., pipes), automatically inserts two new start and end nodes, breaking the existing pipe.

Run a hydraulic simulation and display the results

When the design of the WSS network is finished, and after having defined the water demands at the nodes, it is possible to carry out the hydraulic simulation based on the EPANET solver. The definition of the simulation duration and of the numerical parameters can be set from inside the plugin using the appropriate tab.

When a simulation is launched, the plugin invokes the EPANET libraries that save the simulation results as an output file, called ‘out’, that in turn can be loaded into QGIS to display the results.

The results, similarly to what can also be done in EPANET, are divided into nodes' values (pressures and head) and pipes' values (velocity and flow rates). Figure 1 shows a WSS modelled with QEPANET during the design phase, and the results display a phase on the left and right, respectively. More information about the plugin is available in the Supplementary material. The documentation consists of a tutorial and the QEPANET file used as an example in the presented work. You can always find the updates at the following link https://gitlab.com/albertodeluca/qepanet; in particular, in the README file there are indications to download the plugin documentation.

Figure 1

Interface of the QEPANET plugin with the dedicated toolbars in the drawing phase on the left and the results displayed on the right. The results show the pressure in the junctions and the velocity along the pipes.

Figure 1

Interface of the QEPANET plugin with the dedicated toolbars in the drawing phase on the left and the results displayed on the right. The results show the pressure in the junctions and the velocity along the pipes.

CONCLUSION

In this paper, we have introduced the QEPANET plugin for endowing EPANET with a geo-referenced interface in QGIS environment. The proposed Python plugin allows modelling of a WSS from the drawing to the results viewing through ad hoc editing and graphical tools, without ever leaving QGIS. New functionalities have been introduced suitable for supporting the entire WDSs modelling process, such as automatic elevations' detection and 3D pipe lengths' calculation.

It is to be noted that the current QEPANET version covers most of the EPANET functionalities, but not all of them. In particular, support for emitters, controls and quality is still missing. Any suggestions, bug reports or contributions from external parties are appreciated and can be provided via the QEPANET project available on GitLab under the GNU General Public License version 2.

Software availability

QEPANET is available on the world wide web at https://gitlab.com/albertodeluca/qepanet and http://plugins.qgis.org/plugins/qepanet.

License: GNU General Public License version 2

System requirements: QGIS version 3.4.0 or higher for the plugin version 2.4 (QGIS version 2.14.0 minimum and 2.99.0 maximum for the plugin version 0.94.1).

Installation: using QGIS Plugins Installer.

ACKNOWLEDGEMENTS

This research was funded by the EFRE-FESR project: ‘Thermo Fluid Dynamics, infrastructures for applied research’ (ERDF 2014-2020, CUP: I52F16000850005) and by the research project ‘AI-ALPEN: Supply of drinking water in alpine regions’ (third call for Research projects funded by Autonomy Province of Bozen-341 Italy, CUP: B26J16000300003).

SUPPLEMENTARY MATERIAL

The Supplementary Material for this paper is available online at https://dx.doi.org/10.2166/aqua.2019.087.

REFERENCES

REFERENCES
Agunwamba
J. C.
Ekwule
O. R.
Nnaji
C. C.
2018
Performance evaluation of a municipal water distribution system using WaterCAD and Epanet
.
J. Water, Sanit. Hyg. Dev.
8
,
459
467
.
Arandia
E.
Eck
B. J.
2018
An R package for EPANET simulations
.
Environ. Model. Softw.
107
,
59
63
.
https://doi.org/10.1016/j.envsoft.2018.05.016
.
Eliades
D. G.
Kyriakou
M.
Vrachimis
S.
Polycarpou
M. M.
2016
EPANET-MATLAB toolkit: An open-source software for interfacing EPANET with MATLAB
. In:
Proceedings of the 14th International Conference on Computing and Control for the Water Industry, CCWI
.
Hirt
C.
2014
Digital terrain models
. In:
Encyclopedia of Geodesy
(
Grafarend
E.
ed.).
Springer
,
Cham
,
Switzerland
,
1
6
.
https://doi.org/10.1007/978-3-319-02370-0_31-1
Kyriakou
M. S.
2019
IMPORT/EXPORT EPANET INP Files
.
Macke
S.
2014
Hydraulic Analysis of Water Supply Networks (Using EPANET)
.
Menapace
A.
Avesani
D.
Righetti
M.
Bellin
A.
Pisaturo
G.
2018
Uniformly distributed demand EPANET extension
.
Water Resour. Manage.
32
,
2165
2180
.
https://doi.org/https://doi.org/10.1007/s11269-018-1924-6
.
Moody
L. F.
1944
Friction factors for pipe flow
.
Trans. ASME
8
,
671
684
.
Muranho
J.
Ferreira
A.
Sousa
J.
Gomes
A.
Sá Marques
A.
2015
Convergence issues in the EPANET solver
.
Proc. Eng.
119
,
700
709
.
https://doi.org/10.1016/j.proeng.2015.08.923
.
Pathirana
A.
2018
EPANETTOOLS 1.0.0
.
Quantum GIS
2019
QGIS: A Free and Open Source Geographic Information System
.
Rossman
L. A.
2000
EPANET 2: Users Manual
.
EPA/600/R-00/057
.
United States Environmental Protection Agency
,
Cincinnati, OH
,
USA
.
Rossman
L. A.
2008
Epanet 2 Programmer's Toolkit Files
.
Sela
L.
Salomons
E.
Housh
M.
2019
Plugin prototyping for the EPANET software
.
Environ. Model. Softw.
119
,
49
56
.
https://doi.org/10.1016/j.envsoft.2019.05.010
.
SWMM-EPANET UI
2019a
SWMM-EPANET_User_Interface
.
SWMM-EPANET UI
2019b
Application Features Requirements Document: Re-Engineering SWMM/EPANET User Interface Application Software
.
Thiede
R.
Sutton
T.
Dùster
H.
Sutton
M.
2012
10.1 Lesson: Installing and Managing Plugins [WWW Document]
.