DyEHS: An Integrated Dynamo–EPANET–Harmony Search Framework for the Optimal Design of Water Distribution Networks
Abstract
:1. Introduction
- To develop a BIM-integrated workflow for WDN optimization using Harmony Search;
- To validate the framework through a real-world case study and quantify the cost savings;
- To assess the effectiveness of DyEHS in streamlining the design-to-documentation process.
2. Literature Review
3. Research Methodology
3.1. DyEHS Framework and Software Integration
- *.inp file: the EPANET network input file (generated as described above), containing all nodes, pipes, demands, and initial pipe diameters (which can be nominal or all set to a maximum available size to start);
- *.dat file: a pipe cost data file that lists the available pipe diameters and their unit costs. This file begins with the number of available diameter options and the unit (e.g., millimeter), followed by each diameter and its cost per unit length;
- *.para file: a parameter file for the Harmony Search algorithm, specifying the values of the HS parameters and certain problem-specific settings.
- HMS (Harmony Memory Size): We used a memory size of 30 solution vectors (this is a typical value; smaller networks <10 nodes could use HMS = 20, and very large networks >100 nodes might use HMS = 50);
- HMCR (Harmony Memory Considering Rate): This is set to 0.95, meaning that there is a 95% chance that each decision variable in a new harmony is chosen from historically good values in the Harmony Memory rather than at random. A slightly lower HMCR like 0.90 is sometimes used for very small problems, and slightly higher one, up to 0.99, for very large problems;
- PAR (Pitch Adjustment Rate): This is set to 0.05, indicating a 5% chance of fine-tuning a chosen value (this is a standard default for HS);
- Flag_Skip and ECR: These are two parameters related to ensemble consideration in some HS variants; we set Flag_Skip to 1.0 and ECR to 0.0 as commonly recommended (effectively not using ensemble consideration);
- App_Cost: An approximate cost of an initial or typical design. In our case, this was estimated from a “normal” design (e.g., using a uniform pipe diameter that meets the minimum pressure) to scale the optimization (though this value is not critical for the HS algorithm, it can be used as a reference);
- MaxIter: The maximum number of iterations (HS improvisations) to perform. We chose a value (for example, 5000 hydraulic evaluations) that was high enough to allow for the convergence of the solution for the case study;
- MinHead: The minimum allowable head (pressure) at each node, which is a constraint in the design. For the case study, this was 25 m (meaning that each node must have at least 25 m of head, equivalent to roughly 2.5 bar pressure in the system).
3.2. Harmony Search Optimization Procedure for WDN Design
- Define Decision Variables: In WDN design, the decision variables are the diameters of the pipes. We considered a discrete set of commercially available pipe diameters (e.g., 50 mm, 75 mm, 100 mm, … up to 300 mm, etc.). Each pipe in the network can take one of these standard diameters. If there are N pipes, then a candidate design can be represented by an N-dimensional vector, where each element is an index corresponding to one of the available diameters. In our case study, for example, we had a set of diameter options for all pipes (ranging from 90 mm to 200 mm in ductile iron, as per the local standards) and the network comprised a certain number of pipes (decision variables equal to that number);
- Formulate the Objective Function: The objective is to minimize the total cost of the network. The cost has two main components: the capital cost of pipes and the operational cost (primarily pumping energy, if pumps are present). In our formulation for a gravity-fed network, the operational costs are minimal or zero, so the objective function simplifies to the sum of the pipe costs. Each pipe’s cost is the unit cost (from the .dat file) times its length. If pumps or energy were involved, we would include the annualized energy costs as well. Mathematically, we define the following:
- Impose Hydraulic Constraints: Any candidate design must meet the hydraulic feasibility. The primary constraint is that the pressure at all demand nodes must be ≥25 m (as specified by the design requirements). Other constraints include continuity of flow at nodes (the flow into each junction equals the flow out plus demand) and the headloss relationships (Hazen–Williams or Darcy–Weisbach equations) along pipes. When evaluating a design, EPANET is used to compute the node pressures and verify these constraints. Designs that violate the minimum pressure (25 m) at any node are considered unfeasible. In the HS algorithm, we handle this by penalizing such solutions heavily in the objective function (or by discarding them outright). In practice, during optimization, most randomly generated initial solutions will use large diameters to satisfy pressures, and then the algorithm tries to reduce the diameters to cut cost. The continuity and headloss constraints are inherently handled by EPANET’s hydraulic solver for each simulation;
- Initialize Harmony Memory: We randomly generate a set of HMS solutions (harmonies) that satisfy the constraints. To ensure feasibility, we may initially generate solutions biased towards larger diameters (so the pressures are likely met) and then use EPANET to check. Any unfeasible solution (with pressure < 25 m) is discarded and regenerated. The Harmony Memory is a matrix containing, say, 30 solution vectors, each with an associated cost. We then identify the best (lowest cost) and worst solutions in this memory;
- Improvise a New Harmony: This is the core of HS iteration. To create a new solution, for each pipe i (each decision variable), we decide whether to take a value from the Harmony Memory or to choose a new random value. This decision is governed by the Harmony Memory Considering Rate (HMCR). With probability (HMCR 0.95 in our case), we pick the pipe diameter from one of the existing solutions in the memory (i.e., we exploit known good designs). With probability (1–HMCR = 0.05), we choose a random diameter from the allowed set (exploration). If we chose from memory, we may then adjust it (with probability PAR = 0.05) to a neighboring diameter size (this mimics musical pitch adjustment, adding slight variation). For example, if the chosen memory value for a pipe is diameter 150 mm, a pitch adjustment might try 125 mm or 175 mm (the next lower or higher size in the list) with some small probability. This process is repeated for all pipes, resulting in a completely new design vector. We then run EPANET to evaluate the new design’s pressures and compute its cost;
- Update Harmony Memory: If the new harmony (design) is feasible and has a lower total cost than the worst solution in the current memory, it replaces the worst solution in the Harmony Memory. This ensures that the population of remembered solutions continuously improves or at least does not degrade. If the new solution is worse than the worst in memory, we may discard it (or in some implementations, there is a small chance to accept worse solutions to maintain diversity);
- Check for Convergence: Steps 5–6 are repeated iteratively. The process can terminate when a preset number of iterations (improvisations) is reached, or when the improvement in cost becomes negligible over several iterations (i.e., the algorithm has converged to a stable solution). In our implementation, we used a fixed number of iterations (MaxIter in the parameter file) as the stopping criterion. By that point, typically the improvements had leveled off.
4. Results and Discussion
5. Limitations of the Study
- The current implementation of DyEHS optimizes only the initial construction cost (with a pressure constraint). It does not explicitly account for other objectives such as system resilience, water quality, or life-cycle cost. As a result, the optimized design is cost-effective, but may have limited redundancy or adaptability. In practice, engineers might prefer a slightly more robust design than the absolute minimum-cost solution. Future extensions could incorporate multi-objective optimization to address these aspects;
- Related to the above, environmental and long-term maintenance costs were not included in the optimization model. Factors like energy consumption (for pumped systems), pipe corrosion rates, leakage, and eventual replacement costs are important for sustainability. Our study optimized for present cost only, which could lead to higher expenses over the network’s lifespan. Integrating a life-cycle cost assessment (LCC) would allow DyEHS to suggest designs that are optimal in the long run, not just at installation;
- The DyEHS framework is built around Autodesk Civil 3D, Dynamo, and EPANET. This means the toolchain currently works only for users who have access to these software. This could limit accessibility for some practitioners. Additionally, there may be a learning curve associated with using Dynamo and custom scripts. While BIM integration is advantageous, it ties the solution to a particular platform. In the future, developing a more platform-agnostic or open-source version (e.g., using FreeCAD/Revit with open EPANET libraries) would broaden usability;
- Although we used standard HS parameters and the algorithm performed well, metaheuristic algorithms do carry some sensitivity to parameter choices and random seed. There is no guarantee that the chosen HS parameters are optimal for every network. If applied to a very different case (e.g., a much larger network or one with pumps and tanks), HS might require retuning, or even a different algorithm. Moreover, as with any heuristic algorithm, there is a small chance that it could converge to a local minimum, especially if the search space is extremely complex. We mitigated this via multiple runs and found consistent results, but this might not hold universally;
- The demonstration was on a medium-sized network (two-loop system). The performance of DyEHS on very large networks (hundreds of pipes or multiple sources) remains to be tested. Computational time could become a limiting factor in larger problems, and integration within a BIM environment might face challenges with very large datasets (e.g., Civil 3D handling hundreds of pipe objects dynamically). The methodology is sound for larger cases, but practical runtime and software memory limits could pose challenges;
- DyEHS automates much of the design, but the quality of the outcome still depends on the user providing reasonable inputs—such as accurate demand estimates, appropriate constraints, and realistic cost data. Garbage-in, garbage-out applies; if any input is off (say, costs are not accurate or a demand is grossly underestimated), the optimized design could be misleading. Thus, a knowledgeable engineer must supervise the process, interpret the results, and possibly override the pure optimization outcome if it conflicts with practical considerations (e.g., standard practice or safety factors);
- The workflow was tailored to gravity-fed distribution networks. If one introduces pumps, valves, or complex controls, the optimization problem becomes more complicated (optimizing pump operations or control settings in tandem with pipe sizing). DyEHS in its current form handles pipe sizing. Additional decision variables like pump scheduling or valve placement would require expanding the optimization algorithm and integration (the references show initial work by the authors on using HS for valve placement, which could be integrated in the future). So, the present study is limited to the pipe sizing aspect of WDN design.
6. Conclusions
- Integrating multi-objective optimization (cost, resilience, and environmental impact);
- Enhancing algorithmic performance via parallel processing or hybrid metaheuristics;
- Developing a platform-agnostic version to increase accessibility beyond Autodesk users;
- Extending DyEHS to handle pumped systems, storage tanks, and dynamic demand scenarios for broader application.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Zhao, L.; Liu, Z.; Mbachu, J. An Integrated BIM–GIS Method for Planning of Water Distribution System. ISPRS Int. J. Geo-Inf. 2019, 8, 331. [Google Scholar] [CrossRef]
- Ramani, K.; Rudraswamy, G.K.; Umamahesh, N.V. Optimal Design of Intermittent Water Distribution Network Considering Network Resilience and Equity in Water Supply. Water 2023, 15, 3265. [Google Scholar] [CrossRef]
- Wu, Y.; Ma, W.; Miao, Q.; Wang, S. Multimodal continuous ant colony optimization for multisensor remote sensing image registration with local search. Swarm Evol. Comput. 2019, 47, 89–95. [Google Scholar] [CrossRef]
- Morley, M.; Tricarico, C. Hybrid Evolutionary Optimization/Heuristic Technique for Water System Expansion and Operation. J. Water Resour. Plan. Manag. 2015, 142, C4015006. [Google Scholar] [CrossRef]
- Vertommen, I.; van Laarhoven, K.; Cunha, M.D.C. Robust Design of a Real-Life Water Distribution Network under Different Demand Scenarios. Water 2021, 13, 753. [Google Scholar] [CrossRef]
- Alperovits, E.; Shamir, U. Design of optimal water distribution systems. Water Resour. Res. 1977, 13, 885–900. [Google Scholar] [CrossRef]
- Quindry, G.E.; Brill, E.D.; Liebman, J.C. Optimization of Looped Water Distribution Systems. J. Environ. Eng. Div. 1981, 107, 665–679. [Google Scholar] [CrossRef]
- Simpson, A.R.; Dandy, G.C.; Murphy, L.J. Genetic Algorithms Compared to Other Techniques for Pipe Optimization. J. Water Resour. Plan. Manage. 1994, 120, 423–443. [Google Scholar] [CrossRef]
- Gessler, J. Pipe network optimization by enumeration. In Computer Applications in Water Resources; ASCE: Fort Collins, CO, USA, 1985; pp. 572–581. [Google Scholar]
- Loubser, B.F.; Gessler, J. Computer-aided optimization of water distribution networks. Civ. Engr. S. Afr. 1990, 32, 413–422. [Google Scholar]
- Loganathan, G.V.; Greene, J.J.; Ahn, T.J. Design Heuristic for Globally Minimum Cost Water-Distribution Systems. J. Water Resour. Plan. Manage. 1995, 121, 182–192. [Google Scholar] [CrossRef]
- da Conceicao Cunha, M.; Ribeiro, L. Tabu search algorithms for water network optimization. Eur. J. Oper. Res. 2004, 157, 746–758. [Google Scholar] [CrossRef]
- Murphy, L.J.; Simpson, A.R. Genetic algorithms In Pipe Network Optimization; Research Report R93; University of Adelaide: Adelaide, Australia, 1993. [Google Scholar]
- Dandy, G.C.; Simpson, A.R.; Murphy, L.J. An Improved Genetic Algorithm for Pipe Network Optimization. Water Resour. Res. 1996, 32, 449–458. [Google Scholar] [CrossRef]
- Savic, D.A.; Walters, G.A. Genetic Algorithms for Least-Cost Design of Water Distribution Networks. J. Water Resour. Plan. Manage. 1997, 123, 67–77. [Google Scholar] [CrossRef]
- Storn, R.; Price, K. Differential evolution—A simple and efficient heuristic for global optimization over continuous spaces. J. Glob. Optim. 1997, 11, 341–359. [Google Scholar] [CrossRef]
- Maier, H.R.; Simpson, A.R.; Zecchin, A.C.; Foong, W.K.; Phang, K.Y.; Seah, H.Y.; Tan, C.L. Ant Colony Optimization for Design of Water Distribution Systems. J. Water Resour. Plan. Manage. 2003, 129, 200–209. [Google Scholar] [CrossRef]
- Geem, Z.W.; Kim, J.H.; Loganathan, G.V. A new heuristic optimization algorithm: Harmony Search. Simulation 2001, 76, 60–68. [Google Scholar] [CrossRef]
- De Paola, F.; Galdiero, E.; Giugni, M. Location and Setting of Valves in Water Distribution Networks Using a Harmony Search Approach. J. Water Resour. Plan. Manage. 2017, 143, 04017015. [Google Scholar] [CrossRef]
- Fujiwara, O.; Khang, D.B. A two-phase decomposition method for optimal design of looped water distribution networks. Water Resour. Res. 1990, 26, 539–549. [Google Scholar] [CrossRef]
- Gupta, I.; Gupta, A.; Khanna, P. Genetic algorithm for optimization of water distribution systems. Environ. Model. Softw. 1999, 14, 437–446. [Google Scholar] [CrossRef]
- Eusuff, M.M.; Lansey, K.E. Optimization of Water Distribution Network Design Using the Shuffled Frog Leaping Algorithm. J. Water Resour. Plan. Manage. 2003, 129, 210–225. [Google Scholar] [CrossRef]
- Geem, Z.W. Optimal cost design of water distribution networks using harmony search. Eng. Optim. 2006, 38, 259–277. [Google Scholar] [CrossRef]
- Sirsant, S.; Reddy, M.J. Improved MOSADE algorithm incorporating Sobol sequences for multi-objective design of Water Distribution Networks. Appl. Soft Comput. 2022, 120, 108682. [Google Scholar] [CrossRef]
- Todini, E. Looped water distribution networks design using a resilience index based heuristic approach. Urban Water 2000, 2, 115–122. [Google Scholar] [CrossRef]
- Alvisi, S.; Franchini, M. A heuristic procedure for the automatic creation of district metered areas in water distribution systems. Urban Water J. 2014, 11, 137–159. [Google Scholar] [CrossRef]
- Ayala-Cabrera, D.; Piller, O.; Deurlein, J.; Herrera, P. Key performance indicators to enhance water distribution network resilience in three-stages. Water Util. J. 2018, 19, 79–90. [Google Scholar]
Author(s) | Year | Method Used | Key Findings | Identified Gaps |
---|---|---|---|---|
Alvisi and Franchini [26] | 2013 | GA, PSO | Improved WDN design accuracy | No integration with BIM tools |
Wu et al. [3] | 2019 | ACO | Effective cost optimization | Static data exchange with models |
Morley and Tricarico [4] | 2015 | BIM workflows | Enhanced data visualization | Lack of hydraulic feedback |
Geem [23] | 2006 | Harmony Search | Effective for WDN cost optimization | Not embedded in BIM environments |
Zhao et al. [1] | 2019 | BIM–Hydraulic coupling | Streamlined spatial and hydraulic planning | Limited to planning phase |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
De Paola, F.; Speranza, G.; Ascione, G.; Marrone, N. DyEHS: An Integrated Dynamo–EPANET–Harmony Search Framework for the Optimal Design of Water Distribution Networks. Buildings 2025, 15, 1694. https://doi.org/10.3390/buildings15101694
De Paola F, Speranza G, Ascione G, Marrone N. DyEHS: An Integrated Dynamo–EPANET–Harmony Search Framework for the Optimal Design of Water Distribution Networks. Buildings. 2025; 15(10):1694. https://doi.org/10.3390/buildings15101694
Chicago/Turabian StyleDe Paola, Francesco, Giuseppe Speranza, Giuseppe Ascione, and Nunzio Marrone. 2025. "DyEHS: An Integrated Dynamo–EPANET–Harmony Search Framework for the Optimal Design of Water Distribution Networks" Buildings 15, no. 10: 1694. https://doi.org/10.3390/buildings15101694
APA StyleDe Paola, F., Speranza, G., Ascione, G., & Marrone, N. (2025). DyEHS: An Integrated Dynamo–EPANET–Harmony Search Framework for the Optimal Design of Water Distribution Networks. Buildings, 15(10), 1694. https://doi.org/10.3390/buildings15101694