*3.2. Function Validation*

Along its diverse history, SWMM has experienced numerous changes. The idea of the development team has always been that of maintaining reliability of the calculation, and this has been done through the implementation of a rigorous quality assurance testing program [18]. In this case, the validation process has followed a similar philosophy to that used in the aforementioned quality assurance program, thereby guaranteeing the perfect coincidence of the results obtained with the Toolkit. This way, and just like it was done during the SWMM 4-SWMM 5 transition, three tests have been performed [19]. These tests are based on two ideas.

First, in order to ensure the compatibility of the Toolkit with EPA SWMM, a series of tests have been carried out to compare the results of both tools. The tests were conducted using the example network suggested in the SWMM 5 User's Manual [14]. This network is presented in Figure 4, in which control sections S1, S2 and S3 have been established.

Second, a much simpler network was used to study specific control structures, as is the case of weirs, orifices and pumps. The reason for using a specific network for control structures derives from the way EPA SWMM calculates these types of devices. This way, different situations may be simulated (normal behavior, orifices behaving as a weir or weirs behaving as an orifice for surcharge conditions). Figure 5 shows a sketch of this network, which consists of a storage unit with a constant direct inflow so that a steady flow regime may be reached. Likewise, the outfall is simulated as a free discharge. Conduits are long enough to allow them to reach the uniform flow in their middle points. Direct numerical calculations can thus be done, and they can be contrasted with those obtained with both EPA SWMM and Toolkit.

**Figure 4.** Network used for the study of the Toolkit's functions.

**Figure 5.** Network used for the exhaustive study of weirs and orifices.

The tests could be grouped in two phases, depending on the functions that each of these tested. In the first phase, only the Get functions were tested, and only section S1 in Figure 4 was used. The tests in this phase consisted of checking that the results obtained with EPA SWMM and the Toolkit are exactly coincidental without the need to manipulate information. The employed network was the one shown in Figure 4 with a one-hour long rainfall and duration of the simulation of 12 h. The results corresponding to both nodes and pipes were consulted. During the first test, it could be observed that the Toolkit collected all the calculation instants. EPA SWMM, instead, only collected those results corresponding to the report time step. This way, a 10-s hydraulic calculation and report time step was employed in order to ensure equality of conditions. Likewise, in order to ensure the precision of the results, EPA SWMM preferences were modified, so that the reported results were always presented with a numerical precision of four decimals. Regarding the nodes, all the variables that could be read with the Get functions were processed, except for those related to quality water parameters. The same procedure was applied for pipes.

In the second phase, two sets of tests were carried out involving Set functions. These functions allow the integration of EPA SWMM with any other external applications including more complex algorithms of iterative character, such as design, control, or calibration algorithms. Because of this, tests have been more elaborate for this group of functions. Next, a brief description of each one will be done. The first set was carried out in section S3 of Figure 4, and it included the basic elements such as storage units, junctions and conduits. The following parameters were modified:

' Storage Units: invert level, height (maximum depth) y and volume. Regarding the volume, it is defined by a function which relates depth and surface area through three parameters: A, B and C. The surface area of the storage unit varies with water depth following the function shown below:

$$S = A \cdot y^B + C \tag{1}$$


This set's testing protocol will be briefly described. For each case within the set, three tests were carried out. The first included the analysis of the results obtained using EPA SWMM with a series of values of the analyzed parameter (10 different values ranging between a minimum and a maximum). Next, these same cases have been processed using the Toolkit and without parameter modification, that is, reading each of the 10 prepared archives. Finally, the obtained results have been analyzed by performing 10 calculations in one single process that used Set functions in order to modify parameters. As an example, Figure 6 compares the results obtained when modifying storage capacity. The data collected for each of the storage volume include maximum discharges at entrance and exit pipes as well as total flood values for the initial and the final nodes. The results obtained through the use of the library have been represented on the horizontal axis. In the vertical axis, instead, those results directly obtained using EPA SWMM are represented. As expected, the results are 100% coincidental.

**Figure 6.** Flooding results comparison between EPA SWMM and a Toolkit-based application.

The second set was done for the exclusive study of control structures (orifices and weirs). Two networks were used on this occasion. Because it was important to use a section that would present discharge derivation, section S2 of Figure 4 was used. The characteristics of these elements were modified by using the developed functions. This way, the performance of both elements was proven to be the same regardless of whether EPA SWMM or the Toolkit was used. The same behavior was seen in both cases.

Considering that control structures may become very important for applications such as real time control, a more exhaustive analysis was performed. In the case of orifices, EPA SWMM discriminates the case of flooding conditions (behavior as orifice) from that of not-flooding conditions (behavior as weir). Therefore, all the plausible situations contemplated by EPA SWMM were processed as a function of depths upstream and downstream of control element. The transition between the two performance modes is produced from a specific depth denominated critical height. Depending on the case, EPA SWMM implements a different coefficient and exponent. The network shown in Figure 5 was used for this test. The detailed study that has been carried out helped to understand and perfectly reproduce the behavior shown by these control structures. As a conclusion, both EPA SWMM and the Toolkit presented the same results in all the cases that were analyzed.
