|
1 |
| -ORD Stormwater-Management-Model Solver |
2 |
| -================================== |
3 |
| - |
4 |
| -Stormwater Management Model (SWMM) computational engine |
| 1 | +EPA ORD Stormwater Management Model (SWMM) |
| 2 | +========================================== |
5 | 3 |
|
| 4 | +Stormwater Management Model (SWMM) computational engine and output post-processing codebase |
6 | 5 |
|
7 | 6 | ## Build Status
|
8 |
| -[](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml) |
9 |
| - |
10 |
| -## Disclaimer |
11 |
| -The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. |
12 |
| - |
| 7 | +[](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml) |
| 8 | +[](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml) |
| 9 | +[](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml) |
| 10 | +[](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml) |
| 11 | +[](https://pypi.org/project/epaswmm) |
| 12 | +[](https://pypi.org/project/epaswmm) |
13 | 13 |
|
14 | 14 | ## Introduction
|
15 | 15 | This is the official SWMM source code repository maintained by US EPA Office of Research and Development, Center For Environmental Solutions & Emergency Response, Water Infrastructure Division located in Cincinnati, Ohio.
|
16 | 16 |
|
17 | 17 | SWMM is a dynamic hydrology-hydraulic water quality simulation model. It is used for single event or long-term (continuous) simulation of runoff quantity and quality from primarily urban areas. SWMM source code is written in the C Programming Language and released in the Public Domain.
|
18 | 18 |
|
| 19 | +## Build Instructions |
| 20 | + |
| 21 | +The 'src' folder of this repository contains the C source code for |
| 22 | +version of Storm Water Management Model's computational |
| 23 | +engine. Consult the included 'Roadmap.txt' file for an overview of |
| 24 | +the various code modules. The code can be compiled into both a shared |
| 25 | +object library and a command line executable. Under Windows, the |
| 26 | +library file (swmm5.dll) is used to power SWMM's graphical user |
| 27 | +interface. |
| 28 | + |
| 29 | +Also included is a python interface for the SWMM computational engine and output |
| 30 | +post-processing application programming interfaces located in the python folder. |
| 31 | + |
| 32 | +The 'CMakeLists.txt' file is a script used by CMake (https://cmake.org/) |
| 33 | +to build the SWMM binaries. CMake is a cross-platform build tool |
| 34 | +that generates platform native build systems for many compilers. To |
| 35 | +check if the required version is installed on your system, enter from |
| 36 | +a console window and check that the version is 3.5 or higher. |
| 37 | + |
| 38 | +```bash |
| 39 | +cmake --version |
| 40 | +``` |
| 41 | + |
| 42 | +To build the SWMM engine library and its command line executable |
| 43 | +using CMake and the Microsoft Visual Studio C compiler on Windows: |
| 44 | + |
| 45 | +1. Open a console window and navigate to the directory where this |
| 46 | + Readme file resides (which should have 'src' as a sub-directory |
| 47 | + underneath it). |
| 48 | + |
| 49 | +2. Issue the following commands: |
| 50 | + |
| 51 | +```bash |
| 52 | +mkdir build |
| 53 | +cd build |
| 54 | +``` |
| 55 | + |
| 56 | +3. Then enter the following CMake commands: |
| 57 | + |
| 58 | +``` bash |
| 59 | +cmake -G <compiler> .. -A <platform> |
| 60 | +cmake --build . --config Release |
| 61 | +``` |
| 62 | + |
| 63 | +where `<compiler>` is the name of the Visual Studio compiler being used |
| 64 | +in double quotes (e.g., "Visual Studio 15 2017", "Visual Studio 16 2019", |
| 65 | +or "Visual Studio 17 2022") and `<platform>` is Win32 for a 32-bit build |
| 66 | +or x64 for a 64-bit build. The resulting engine DLL (swmm5.dll), command |
| 67 | +line executable (runswmm.exe), and output processing libraries (swmm-output.dll) |
| 68 | +will appear in the build\Release directory. |
| 69 | + |
| 70 | +For other platforms, such as Linux or MacOS, Step 3 can be replaced with: |
| 71 | + |
| 72 | +```bash |
| 73 | +cmake .. |
| 74 | +cmake --build . |
| 75 | +``` |
| 76 | + |
| 77 | +The resulting shared object library (libswmm5.so or libswmm5.dylib) and |
| 78 | +command line executable (runswmm) will appear in the build directory. |
| 79 | + |
| 80 | +The exprimental python bindings can be built and installed locally using the following command. |
| 81 | + |
| 82 | +```bash |
| 83 | +cd python |
| 84 | +python -m pip install -r requirements.txt |
| 85 | +python -m pip install . |
| 86 | +``` |
| 87 | +Users may also build python wheels for installation or distribution. Once the python bindings |
| 88 | +have been validated and cleared through EPA'S clearance process, they will be available for installation |
| 89 | +via ropsitories such as pypi. |
| 90 | + |
| 91 | +## Unit and Regression Testing |
| 92 | + |
| 93 | +Unit tests and regression tests have been developed for both the natively compiled SWMM computational engine and output toolkit as |
| 94 | +well as their respective python bindings. Unit tests for the natively compiled toolkits use the Boost 1.67.0 library and can be |
| 95 | +compiled by adding DBUILD_TESTS=ON flag during the cmake build phase as shown below: |
| 96 | + |
| 97 | +```bash |
| 98 | +ctest --test-dir . -DBUILD_TESTS=ON --config Debug --output-on-failure |
| 99 | +``` |
| 100 | + |
| 101 | +Unit testing on the python bindings may be executed using the following command after installation. |
| 102 | + |
| 103 | +```bash |
| 104 | +cd python\tests |
| 105 | +pytest . |
| 106 | +``` |
| 107 | + |
| 108 | +Regression tests are executed using the python bindings using the pytest and pytest-regressions extension using the following commands. |
| 109 | + |
| 110 | +```bash |
| 111 | +cd ci |
| 112 | +pytest --data-dir <path-to-regression-testing-files> --atol <absolute-tolerance> --rtol <relative-tolerance> --benchmark-compare --benchmark-json=PATH |
| 113 | +``` |
| 114 | + |
19 | 115 | ## Find Out More
|
20 |
| -The source code distributed here is identical to the code found at the official [SWMM Website](https://www.epa.gov/water-research/storm-water-management-model-swmm). |
| 116 | +The source code distributed here is identical to the code found at the official [SWMM website](https://www.epa.gov/water-research/storm-water-management-model-swmm). |
| 117 | +The SWMM website also hosts the official manuals and installation binaries for the SWMM software. |
| 118 | + |
| 119 | +A live web version of the SWMM documentation of the API and user manuals can be found on the [SWMM GitHub Pages website](https://usepa.github.io/Stormwater-Management-Model). Note that this is an alpha version that is still under development and has yet to go through EPA'S official QAQC review process. |
| 120 | + |
| 121 | +## Disclaimer |
| 122 | +The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. |
| 123 | + |
0 commit comments