Pysewer is a network generator for sewer networks originally + designed for rural settlements in emerging countries with little or no + wastewater infrastructure. The network generation prioritises gravity + flow in order to avoid pumping – which can be a source of failure and + high maintenance – where possible. The network dimensioning is based + on dry-weather flow.
+Based on a few data sources, pysewer generates a complete network + based on roads, building locations, and elevation data. Global water + consumption and population assumptions are included to dimension the + sewer diameters. Results are fully-connected sewer networks that + connect all buildings to one or several predefined wastewater + treatment plant (WWTP) locations. By default, the lowest point in the + elevation data is set as the WWTP location. The resulting network + contains sewer diameters, building connections, as well as lifting or + pumping stations with pressurised pipes where necessary.
+The sustainable management of water and sanitation has been defined
+ as one of the UN’s sustainable development goals: SDG 6
+ (
The core principle behind pysewer’s development is based on
+ numerical optimization methods. These methods have been used for sewer
+ network design since the 1960s
+ (
Pysewer is designed for data-scarce environments, utilizing only
+ minimal data and global assumptions – thus enabling transferability to
+ a wide range of different regions. At the same time,
Pysewer’s concept is built upon network science, where we combine + algorithmic optimisation using graph theory with sewer network + engineering design to generate a sewer network layout. In the desired + layout, all buildings are connected to a wastewater treatment plant + (WWTP) through a sewer network, which utilises the terrain to + prioritise gravity flow in order to minimise the use of pressure + sewers. Addressing the intricate challenge of generating sewer network + layouts, particularly in data-scarce environments, is at the forefront + of our objectives. Our approach, therefore, leans heavily towards + utilising data that can be easily acquired for a specific area of + interest. Thus, we deploy the following data as input to autonomously + generate a sewer network, with a distinct prioritisation towards + gravity flow.
+-
+
Digital Elevation Model (DEM) – to derive the elevation profile + and understand topographic details such as the lowest point + (sinks) within the area of interest.
+Existing road network data – Preferred vector data format in
+ the form of
Building locations – defined by x, y coordinate points, these + points represent service requirement locations and identify the + connection to the network.
+Site-specific water consumption and population data – to + plan/size hydraulic elements of the sewer network and estimate the + sewage flow.
+The core functionalities of pysewer include transforming the
+ minimal inputs into an initial network graph—the foundation for the
+ ensuing design and optimisation process; the generation of a gravity
+ flow-prioritised sewer network—identifying the most efficient network
+ paths and positions of the pump and lift stations where required; and
+ the visualisation and exporting of the generated network—allowing
+ visual inspection of the sewer network attributes and export of the
+ generated sewer network.
+
Pysewer’s modular
+ workflow
In the preprocessing module, the roads, buildings, and the DEM
+ must all be projected into the same coordinate reference system
+ (CRS). The road and building data input must be in the form of
+ either a geopandas
+ (
-
+
“Connecting” buildings to the street network using the + connect buildings method. This method adds nodes to the graph to + connect the buildings in the network using the building + points.
+Creation of “virtual roads”. Buildings which are not directly + connected to the road network are connected by finding the + closest edge to the building, which is then marked as the + closest edge. The nodes are then disconnected from the edges and + are added to the initial connection graph network.
+Simplifying the street network for more efficient graph + traversal.
+Setting of the collection point or Wastewater Treatment Plant
+ (WWTP). By default, the lowest elevation point in the region of
+ interest is set as the location(s) of the WWTP. Users can
+ manually define the location of the WWTP by using the
+
After preprocessing, all relevant data is stored as a
+
Pysewer preprocessing. Topographic map with the
+ connection graph resulting from the instantiation of the
+
Within the computational framework of pysewer, the routing and
+ optimisation modules function as the principal mechanisms for
+ synthesising the sewer network. The objective of the routing module
+ is to identify the paths through the network, starting from the
+ sink. The algorithm approximates the directed Steiner tree (the
+ Steiner arborescence)
+ (
-
+
The RSPH solver iteratively connects the nearest unconnected + node (regarding distance and pump penalty) to the closest + connected network node. The solver can account for multiple + sinks and is well-suited to generate decentralised network + scenarios.
+The RSPH Fast solver derives the network by combining all + shortest paths to a single sink. It is faster but only allows + for a single sink.
+In a nutshell, these solvers work by navigating through the
+ connection graph (created using the
+
Subsequently, the optimisation module takes the preliminary + network generated by the routing module and refines it by assessing + and incorporating the hydraulic elements of the sewer network. Here, + the hydraulic parameters of the sewer network are calculated. The + calculation focuses on the placement of pump or lifting stations on + linear sections between road junctions. It considers the following + three cases:
+-
+
Terrain does not allow for gravity flow to the downstream
+ node (this check uses the
Terrain does not require a pump, but the lowest inflow trench + depth is too low for gravitational flow—placement of a lift + station is required.
+Gravity flow is possible within given constraints—the minimum + slope is achieved, no pump or lifting station is required.
+As our tool strongly focuses on prioritising gravity flow, a high
+ pump penalty is applied to minimise the length of the pressure
+ sewers. The pumping penalty expressed as the edge weight is relative
+ to the trench depth required to achieve minimum slope to achieve
+ self-cleaning velocities in a gravity sewer. The maximum trench
+ depth
The optimisation module also facilitates the selection of the
+ diameters to be used in the network and peak flow estimation, as
+ well as the key sewer attributes such as the number of pump or
+ lifting stations, the length of pressure and gravity sewers, which
+ can be visualised and exported for further analysis.
+
Pysewer optimisation. Final layout of the sewer
+ network.
The plotting and exporting module generates visual and geodata
+ outputs. It renders the optimised network design onto a visual map,
+ offering users an intuitive insight into the proposed
+ infrastructure. Sewer network attributes such as the estimated peak
+ flow, the selected pipe diameter (exemplified in
+
Pysewer visualisation. Attributes of the sewer network
+ layout. Peak flow estimation (A), Pipe diameters selected
+ (B)
M.S. and J.F. were supported by the MULTISOURCE project, which + received funding from the European Union’s Horizon 2020 program under + grant agreement 101003527. G.K. and D.D. were supported by the WATERUN + project, which was funded from the European Union’s Horizon 2020 + program under grant agreement 101060922. We thank Ronny Gey from the + UFZ Research Data Management (RDM) group for reviewing the Git + repository.
+Pysewer was written in Python 3.10.6 and used a suite of + open-source software packages that aided the development process:
+-
+
Geopandas 0.8.1
+ (
NetworkX 3.1
+ (
Rasterio 1.2.10
+ (
Numpy 1.25.2
+ (
Matplotlib 3.7.1
+ (
Scikit-learn 1.0.2
+ (
GDAL 3.0.2
+ (
Conceptualisation: J.F., G.K., and M.v.A.; methodology: J.F., M.S., + and D.D.; software development: M.S. and D.D.; writing – original + draft: D.D.; writing – review & editing: D.D, J.F., M.S., G.K., + and M.v.A.
+