EPANET in QGIS Framework: The QEPANET Plugin

You might also like

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

1 © IWA Publishing 2020 Journal of Water Supply: Research and Technology—AQUA | 69.

1 | 2020

EPANET in QGIS framework: the QEPANET plugin


Andrea Menapace, Giuseppe Roberto Pisaturo, Alberto De Luca,
Daniel Gerola and Maurizio Righetti

ABSTRACT

In the current era, the digitization of geographical data is a transverse need of several engineering Andrea Menapace (corresponding author)
Giuseppe Roberto Pisaturo
sectors, including the hydraulic networks management. Thus, water supply systems’ modelling Maurizio Righetti
Faculty of Science and Technology,
requires adequate tools in both the digitization and the simulation phases. This paper presents the Free University of Bozen-Bolzano,
Universitätsplatz 5, 39100 Bolzano,
QEPANET plugin, which aims at merging the flexibility of QGIS and the robustness of EPANET Italy
hydraulic simulations software. Several editing and graphical tools available with QEPANET are E-mail: anmenapace@unibz.it

introduced to model new and existing water distribution systems, to read and modify existing text- Alberto De Luca
Udine,
based EPANET files, to run simulations and visualize results in a geo-referenced framework. Piazza I Maggio 33, 33100 Udine,
Italy
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 Daniel Gerola
Department of Civil, Environmental and
the network drawing. The plugin is available via the official QGIS Python Plugins Repository and on Mechanical Engineering,
University of Trento,
the world-wide-web at https://gitlab.com/albertodeluca/qepanet. via Mesiano 77, 38123 Trento,
Italy
Key words | EPANET, hydraulic modelling, open source tool, QEPANET, QGIS, water supply system

INTRODUCTION

The growing necessity to improve the current water supply The new EPANET GUI allows additional functionalities to
systems (WSSs) due to water demand rising together with be easily increased through the plugins frameworks (Sela
increasing drought event recurrences in a climate change et al. ).
scenario has encouraged researchers and technicians to Based on EPANET software, several scientific algor-
face several issues such as designing new systems, refitting ithms and practical tools have been developed, such as a
deteriorated infrastructures and optimizing management. package that embeds EPANET solver in R environment
Moreover, the emergence of smart technologies has dramati- (Arandia & Eck ), a hydraulic solver improvement
cally increased the amount of information available for (Muranho et al. ; Menapace et al. ) and bindings for
analysing WSSs, making it even more necessary to develop Matlab (Eliades et al. ) and Python (Pathirana ). In
suitable analysis tools. The most widely used tool to simulate addition, also commercial software applications are usually
WSSs, for both scientific and technical purposes, is compatible with the input-output EPANET standards.
EPANET version 2 (Rossman ), which is a C coding US-EPA proposes four different products for WSSs
language program developed by the United States Environ- analysis at different levels. First, EPANET’s user interface
mental Protection Agency (US-EPA). Recently, the new allows the WSS model to be drawn, to perform the simulation
EPANET GUI, which has been developed in Python program- and to visualize the results. Second, the programmer’s toolkit
ming language on the base of PyQt designer tool, presents (Rossman ), which is a programming interface based on
an interesting flexible interface including both original dynamic link library (DLL) technology, makes it possible to
and new capabilities (SWMM-EPANET UI a, b). perform multiple extended period simulations, to modify

doi: 10.2166/aqua.2019.087

Downloaded from http://iwaponline.com/aqua/article-pdf/69/1/1/674260/jws0690001.pdf


by guest
2 A. Menapace et al. | EPANET in QGIS framework: the QEPANET plugin Journal of Water Supply: Research and Technology—AQUA | 69.1 | 2020

parameters and to read results through the over 50 functions network and for analysing the results inside the open-
available. Finally, EPANET-MSX and EPANET-RTX source QGIS framework. The remainder of the paper
increase the capabilities of EPANET with the ability to ana- describes in detail the features and the novelty of this
lyse multiple chemical reactions and perform real-time python plugin of QGIS as follows. The section immediately
hydraulic WSS simulations, respectively. below presents the structure of QEPANET and the novelty
Thus, several efforts have been made concerning introduced, such as proper dedicated editing and graphical
EPANET portability and bindings, but there is still work to tools. This is followed by a section showing the capabilities
be done to improve the modelling process with integrated of the plugin through practical examples. Then final remarks
network-modelling frameworks. However, the main draw- and conclusions are summarized.
back 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
design (CAD) application, e.g., WaterCAD (Agunwamba
QEPANET is a QGIS plugin (available both for the discon-
et al. ). However, the important geographical nature
tinued 2.x and for the new 3.x version) developed using the
(or the spatial component) of WSSs combined with the cur-
standard QGIS plugin Python framework. QEPANET pro-
rent increasing availability of digitized geo-referenced data
has increased the necessity to create links with geographical vides an interface to the EPANET functionalities inside

information systems (GIS). In fact, the advantages of a geo- QGIS, going from the design and drawing of the network

referenced framework are considerable from many aspects, to the analysis of the simulation results. Since it also

ranging from the network modelling to the system manage- includes compiled EPANET libraries for the main operating

ment. For example, a geo-referenced framework can allow systems (Linux, MacOS and Windows), it is virtually poss-

the modelling of a WSS directly on the base of GIS data pro- ible to complete a full simulation cycle without ever

vided by the utilities, allocation of hydraulic components leaving QGIS.

and water demand, arrange relational databases which are QEPANET uses the standard EPANET network text

the basis of management systems, and manage data format (the well-known ‘.inp’ file) to store its projects and

coming from sensors in the field. thus the entire network topology and simulation configuration,

QGIS (Quantum GIS ) is a leading free and open- but with two main advantages: first, there is no need to create

source GIS application capable of visualizing and analysing additional files to store the network data and second, it is poss-

geospatial data, whose functionalities can easily be extended ible to import into QGIS existing QEPANET networks. The

thanks to a robust plugin framework. For these reasons, .inp file used by QEPANET includes some additional propri-
eties that are not used in the standard EPANET (for
more than a thousand plugins are currently publicly avail-
example, pipe material, the elevation correction, etc.). The
able. Among these, there are also some EPANET-related
QEPANET .inp file can be used in standard EPANET without
ones, such as the ‘Import/EpanetInpFiles’ plugin (Kyriakou
compromising the model configuration, and it is ready to be
), which is suitable for moving files from EPANET to
QGIS and conversely, and the ‘GHydraulics’ plugin used for hydraulic simulations. An error appears when a

(Macke ), which is an out-of-date tool able to calculate QEPANET .inp file is loaded in EPANET, remembering that

economic diameters using the EPANET solver. it is not possible to read QEPANET additional in EPANET.

Therefore, the authors aim to close the gap of perform- With respect to existing QGIS tools dedicated to EPANET,

ing an entire modelling of hydraulic networks using QEPANET adds some previously unseen features:

EPANET in a geo-referenced framework through the devel- • a set of dedicated editing tools (in a dockable toolbar)
opment of a suitable tool, called QEPANET. QEPANET is facilitating the management of the hydraulic network.
able to support researchers and technicians in WSS model- These tools allow the creation, modification and deletion
ling with several useful functionalities for drawing the of the network elements, and enforce the topology of the

Downloaded from http://iwaponline.com/aqua/article-pdf/69/1/1/674260/jws0690001.pdf


by guest
3 A. Menapace et al. | EPANET in QGIS framework: the QEPANET plugin Journal of Water Supply: Research and Technology—AQUA | 69.1 | 2020

network. In addition, the creation of some elements is installation, all the functions are available, and to launch
automated (e.g., when a new pipe is drawn, nodes are the plugin it is simply necessary to click on the new blue
added to its ends, if not already present); icon in the toolbars. The window that appears allows the
• the option of using a raster DEM (digital elevation model) choice of whether to start a new EPANET project or to
(Hirt ) to easily extract the elevations of the network load an existing WSS network. The plugin works and
nodes. The DEM is a text file, organized as a matrix, that saves any network information in the .inp format file,
contains the elevation of each point of an area; which is the same as that used by EPANET. Therefore, an
• support for 3D pipe lengths: QEPANET takes into .inp project created in QEPANET can be imported without
account the elevation profile to automatically calculate compatibility problems in EPANET, and vice versa. Further-
the actual pipe length; more, in the .inp file generated by QEPANET, there is
• a graphical section editor to define and adjust the pos- additional information that may be necessary for a designer,
ition of the pipes in relation to the ground; for example, the pipe distance with respect to the ground
• definition of the maximum commercial pipe length elevation and the piping material.
inserting intermediate vertices along the pipeline. In
this way, in addition to having a better estimate of the Draw a WSS network and define attributes
overall pipe length and a better planimetric trend, it is
possible to determine the number of individual pipes’ sec- To design a new WSS network, the first step is to import a
tions that constitute the whole pipeline; DEM into QGIS, dragging the DEM file in the QGIS work-
• easy definition of pipe properties such as material and space and choosing the right coordinate system depending
roughness. It is, for instance, possible to choose the material, on the DEM origin. In this way, the WSS network will
and the plugin presents a range of realistic roughness values have a geo-referenced elevation layer as a reference.
to choose from. The properties are managed by the plugin The WSS design starts with the definition of the reser-
GUI, so that there are internal controls on their consistency voirs/tanks’ positions. The plugin acquires the spatial
(and there is support for both SI and imperial units); coordinates of the entered entity directly. It also assigns
• a tool to edit the curves and patterns used to define the automatically the elevation taking as input the previously
operation of pumps and junctions; loaded DEM. The elevation can be modified manually by
• a series of graphical tools to analyse the simulation the user and corrected, accounting for the real distance
results, that include thematic mapping of the network from the ground.
and graphs of the modelled entities through time. 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
EXAMPLE USAGE AND CAPABILITY
end node with the relative elevation. The pipe length is calcu-
lated automatically considering not only the planimetry but
The main functionality of the plugin is to draw and design a
also the altimetry. It is possible to assign a roughness value
WSS in a GIS environment easily. In this way, the physical
to the pipe by entering a known roughness value (as in
components of the system (junctions, pipes, reservoirs,
EPANET) or by assigning a material to the pipe (steel, cast
tanks, valves and pumps) are automatically geo-referenced
iron, PE, etc.) and then a roughness value from the database
in the 3D space.
in the standard range of roughness for that material (Moody
). Finally, in regards to the design of the pipes, it is possible
Installation and project start/load to choose to automatically insert intermediate vertices at a pre-
determined relative distance along the pipe.
In order to use the plugin in QGIS, it must be installed from To insert valves and pumps’ entities, once they are
the QGIS Plugins Installer (Thiede et al. ). After the selected, a single click is necessary on the point of the

Downloaded from http://iwaponline.com/aqua/article-pdf/69/1/1/674260/jws0690001.pdf


by guest
4 A. Menapace et al. | EPANET in QGIS framework: the QEPANET plugin Journal of Water Supply: Research and Technology—AQUA | 69.1 | 2020

pipeline at the insertion point. The plugin, since EPANET qepanet; in particular, in the README file there are indi-
treats valves and pumps like linking objects (e.g., pipes), cations to download the plugin documentation.
automatically inserts two new start and end nodes, breaking
the existing pipe.
CONCLUSION
Run a hydraulic simulation and display the results
In this paper, we have introduced the QEPANET plugin for
When the design of the WSS network is finished, and after endowing EPANET with a geo-referenced interface in QGIS
having defined the water demands at the nodes, it is possible environment. The proposed Python plugin allows modelling
to carry out the hydraulic simulation based on the EPANET of a WSS from the drawing to the results viewing through ad
solver. The definition of the simulation duration and of the hoc editing and graphical tools, without ever leaving QGIS.
numerical parameters can be set from inside the plugin New functionalities have been introduced suitable for
using the appropriate tab. supporting the entire WDSs modelling process, such as auto-
When a simulation is launched, the plugin invokes the matic elevations’ detection and 3D pipe lengths’ calculation.
EPANET libraries that save the simulation results as an It is to be noted that the current QEPANET version
output file, called ‘out’, that in turn can be loaded into covers most of the EPANET functionalities, but not all of
QGIS to display the results. them. In particular, support for emitters, controls and qual-
The results, similarly to what can also be done in ity is still missing. Any suggestions, bug reports or
EPANET, are divided into nodes’ values (pressures and contributions from external parties are appreciated and
head) and pipes’ values (velocity and flow rates). Figure 1 can be provided via the QEPANET project available on
shows a WSS modelled with QEPANET during the design GitLab under the GNU General Public License version 2.
phase, and the results display a phase on the left and right,
respectively. More information about the plugin is available Software availability
in the Supplementary material. The documentation consists
of a tutorial and the QEPANET file used as an example QEPANET is available on the world wide web at https://
in the presented work. You can always find the updates gitlab.com/albertodeluca/qepanet and http://plugins.qgis.
at the following link https://gitlab.com/albertodeluca/ org/plugins/qepanet.

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.

Downloaded from http://iwaponline.com/aqua/article-pdf/69/1/1/674260/jws0690001.pdf


by guest
5 A. Menapace et al. | EPANET in QGIS framework: the QEPANET plugin Journal of Water Supply: Research and Technology—AQUA | 69.1 | 2020

License: GNU General Public License version 2 Hirt, C.  Digital terrain models. In: Encyclopedia of Geodesy
System requirements: QGIS version 3.4.0 or higher for (E. Grafarend ed.). Springer, Cham, Switzerland, 1–6. https://
doi.org/10.1007/978-3-319-02370-0_31-1
the plugin version 2.4 (QGIS version 2.14.0 minimum Kyriakou, M. S.  IMPORT/EXPORT EPANET INP
and 2.99.0 maximum for the plugin version 0.94.1). Files. https://github.com/KIOS-Research/
Installation: using QGIS Plugins Installer. ImportEpanetInpFiles
Macke, S.  Hydraulic Analysis of Water Supply Networks
(Using EPANET). http://epanet.de/ghydraulics/
Menapace, A., Avesani, D., Righetti, M., Bellin, A. & Pisaturo, G.
ACKNOWLEDGEMENTS  Uniformly distributed demand EPANET extension.
Water Resour. Manage. 32, 2165–2180. https://doi.org/
This research was funded by the EFRE-FESR project: ‘Thermo https://doi.org/10.1007/s11269-018-1924-6.
Moody, L. F.  Friction factors for pipe flow. Trans. ASME 8,
Fluid Dynamics, infrastructures for applied research’ (ERDF 671–684.
2014-2020, CUP: I52F16000850005) and by the research Muranho, J., Ferreira, A., Sousa, J., Gomes, A. & Sá Marques,
project ‘AI-ALPEN: Supply of drinking water in alpine A.  Convergence issues in the EPANET solver. Proc.
Eng. 119, 700–709. https://doi.org/10.1016/j.proeng.2015.
regions’ (third call for Research projects funded by Autonomy
08.923.
Province of Bozen-341 Italy, CUP: B26J16000300003). Pathirana, A.  EPANETTOOLS 1.0.0. https://pypi.org/
project/EPANETTOOLS/
Quantum GIS  QGIS: A Free and Open Source Geographic
Information System. https://www.qgis.org/
SUPPLEMENTARY MATERIAL
Rossman, L. A.  EPANET 2: Users Manual. EPA/600/R-00/
057. United States Environmental Protection Agency,
The Supplementary Material for this paper is available Cincinnati, OH, USA.
online at https://dx.doi.org/10.2166/aqua.2019.087. Rossman, L. A.  Epanet 2 Programmer’s Toolkit Files.
https://www.epa.gov/sites/production/files/2014-06/
en2toolkit.zip
Sela, L., Salomons, E. & Housh, M.  Plugin prototyping for the
REFERENCES
EPANET software. Environ. Model. Softw. 119, 49–56.
https://doi.org/10.1016/j.envsoft.2019.05.010.
Agunwamba, J. C., Ekwule, O. R. & Nnaji, C. C.  Performance SWMM-EPANET UI a SWMM-EPANET_User_Interface.
evaluation of a municipal water distribution system using https://github.com/USEPA/SWMM-EPANET_User_
WaterCAD and Epanet. J. Water, Sanit. Hyg. Dev. 8, 459–467. Interface
Arandia, E. & Eck, B. J.  An R package for EPANET SWMM-EPANET UI b Application Features Requirements
simulations. Environ. Model. Softw. 107, 59–63. https://doi. Document: Re-Engineering SWMM/EPANET User Interface
org/10.1016/j.envsoft.2018.05.016. Application Software. https://github.com/USEPA/SWMM-
Eliades, D. G., Kyriakou, M., Vrachimis, S. & Polycarpou, M. M. EPANET_User_Interface
 EPANET-MATLAB toolkit: An open-source software for Thiede, R., Sutton, T., Dùster, H. & Sutton, M.  10.1 Lesson:
interfacing EPANET with MATLAB. In: Proceedings of the Installing and Managing Plugins [WWW Document]. https://
14th International Conference on Computing and Control for docs.qgis.org/2.8/en/docs/training_manual/qgis_plugins/
the Water Industry, CCWI. fetching_plugins.html

First received 12 June 2019; accepted in revised form 20 September 2019. Available online 31 October 2019

Downloaded from http://iwaponline.com/aqua/article-pdf/69/1/1/674260/jws0690001.pdf


by guest

You might also like