**5. Conclusions**

The EPA SWMM program is a sewerage network hydraulic simulator that is widespread. However, its integration with other programs is quite limited [5]. Because of this fact, a function library (known as a Toolkit) that allows the use of EPA SWMM algorithm in more complex calculation programs has been presented.

The principal objective of the present study is the development, testing and application of a functions library that allows the execution of multiple simulations with the EPA SWMM. This library must allow data modification and results querying without reading or writing files.

The library is made up of three different groups of functions. First, the project managemen<sup>t</sup> functions will be enclosed in the group of interfacing functions provided by the USEPA within the program. The second group consists of those functions that are associated with data and result gathering. These functions can be referred to as Get functions. Finally, a data modification functions (denominated as Set functions) were included in order to give the library a greater degree of flexibility.

This library has been tested in order to show an improvement in simulation times. With it, one can avoid the writing of the data archive for every simulation. Likewise, the functions that are included in this library allow the incorporation of the hydrologic calculation's results into the project's data, and the writing of the binary archive as well as the results report has been avoided. In exchange, the results are kept in the memory with the resulting savings in the calculation times. All this has led to saving in calculations times, which in some cases has exceeded 75%.

Finally, the library has been subjected to a result validation protocol that proves the obtained results are 100% similar to those obtained with the original program. The functions that are included in the library have been directly contrasted with the results obtained with the original program, thus obtaining a perfect adjustment for every case. Furthermore, because the library allows the reading of results directly from the calculating tool, a rounding error is avoided as result precision increases. This

way, results obtained from the validation process confirm 100% compatibility between those results obtained using EPA SWMM and those obtained by the external programs using the Toolkit.

Once validated, the library has been applied to the design of a sewerage network in which the diameter calculation and the slope adjustment have been combined. This is done by using a cost function expression that takes into account not only pipe acquisition costs but also the costs associated with pipeline installation as well (excavation, trenching and backfilling). For the development of the cost function associated with each diameter, a parameterized-type trench has been defined, one that can be used in other applications. The principal conclusion that can be drawn from this study case is that it is possible to combine the Toolkit with an optimization program that modifies the network data based on the results obtained from the simulation without the need to deal with files, thereby allowing time savings during the simulation.

In this comparison, two different evolution algorithms have been used: one for solving discrete problems (PGA) and another for continuous problems (PSO). This application was meant to contrast the Toolkit utility in more complex problems that were based on repetitive successions of a single simulation. As an additional result, it has been proved that the PSO algorithm (conceived for continuous variable problems) produces better solutions compared to those produced by PGA. However, PGA gets the best solutions with a lower number of simulations, that is, in a smaller time and more frequently. This conclusion confirms what has already been observed with other authors in continuous optimization problems [29].

There is some field for future research regarding this work. The work was done in response to the problem of the design of a storm water network. Because of that, all the functions presented in this paper are related to hydraulic objects, that is, elements involved with hydraulic calculation. Hydrologic objects such as subcatchments or rain gages were not considered. Since the rainfall runoff process is another important part of the hydrological cycle, it would be interesting to extend the scope of this work to hydrological simulation. Finally, there is a growing interest in Sustainable Urban Drainage Systems (SUDS). EPA SWMM includes these systems and their design might be boosted with the help of similar functions for such a systems.

As a final conclusion, it can be said that the connection library with EPA SWMM represents a powerful tool for applications based on changing network parameters, as is the case of the formulation of sewerage network design. Besides, it allows saving of computational costs. All the aforementioned results allows the possibility of applying this library to other applications of different natures, which is precisely the case of the studies that are currently being implemented for sewerage network adaption to climate change.

**Acknowledgments:** The authors would like to thank the Colombian company PAVCO-MEXICHEM and the Colombian Administrative Department for Science, Technology and Innovation COLCIENCIAS, for financing the "Drenaje Urbano y Cambio Climático: Hacia los Sistemas de Drenaje Urbano del Futuro" investigation, under which the present paper was conceived. Likewise, the development of this paper has been possible thanks to the Spanish Ministry for Science and Innovation, who covered the "DPI2009-13674 OPERAGUA: Mejora de las técnicas de llenado y operación de redes de abastecimiento de agua" research project.

**Author Contributions:** All authors contributed extensively to the work presented in this paper. F.J. Martínez-Solano and Pedro L. Iglesias-Rey contributed to the subject of research, the development and the writing of the paper. Juan G. Saldarriaga and Daniel Vallejo contributed to the Toolkit debugging, supplied the simplified Bogotá sewer network and made the final revision of the manuscript.

**Conflicts of Interest:** The authors declare no conflict of interest.
