Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various bug fixes and minor enhancements #138

Merged
merged 7 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Before reg test
env:
NRTESTS_URL: https://github.com/USEPA/swmm-nrtestsuite
BENCHMARK_TAG: v2.4.0
BENCHMARK_TAG: v2.5.0-dev
run: before-nrtest.cmd ${{ env.BENCHMARK_TAG }}

- name: Run reg test
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Stormwater Management Model (aka "SWMM") solver only


## Build Status
[![Build and Test](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/USEPA/Stormwater-Management-Model/actions/workflows/build-and-test.yml)
[![Build and Test](../../actions/workflows/build-and-test.yml/badge.svg)](../../actions/workflows/build-and-test.yml)

## Disclaimer
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.
Expand All @@ -18,4 +18,4 @@ SWMM is a dynamic hydrology-hydraulic water quality simulation model. It is used


## Find Out More
The source code distributed here is identical to the code found at the official [SWMM Website](http://www2.epa.gov/water-research/storm-water-management-model-swmm).
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).
5 changes: 4 additions & 1 deletion src/solver/hotstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
// - Link control setting bug when reading a hot start file fixed.
// Build 5.1.015:
// - Support added for multiple infiltration methods within a project.
// Build 5.2.5:
// - Fixed bug in fwrite count argument when writing catchment landuse pollutant
// build-up.
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -416,7 +419,7 @@ void saveRunoff(void)
for (j=0; j<Nobjects[POLLUT]; j++)
{
x[0] = Subcatch[i].landFactor[k].buildup[j];
fwrite(x, sizeof(double), Nobjects[POLLUT], f);
fwrite(x, sizeof(double), 1, f);
}
x[0] = Subcatch[i].landFactor[k].lastSwept;
fwrite(x, sizeof(double), 1, f);
Expand Down
7 changes: 5 additions & 2 deletions src/solver/statsrpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
// Build 5.2.2
// - Calculation of % Evaporation and % Exfiltration losses for storage
// units was corrected.
// Build 5.2.5
// - Changed flow format to scientific to prevent the merging of extremely
// large flows that make it difficult to interpret results.
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -89,8 +92,8 @@ void statsrpt_writeReport()
//
{
// --- set number of decimal places for reporting flow values
if ( FlowUnits == MGD || FlowUnits == CMS ) sstrncpy(FlowFmt, "%9.3f", 5);
else sstrncpy(FlowFmt, "%9.2f", 5);
if ( FlowUnits == MGD || FlowUnits == CMS ) sstrncpy(FlowFmt, "%9.3g", 5);
else sstrncpy(FlowFmt, "%9.2g", 5);

// --- conversion factor from cu. ft. to mil. gallons or megaliters
if (UnitSystem == US) Vcf = 7.48 / 1.0e6;
Expand Down
12 changes: 8 additions & 4 deletions src/solver/xsect.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
// - Support added for Street cross sections.
// Build 5.2.2:
// - Feasibility check added to Mod. Baskethandle & Rect.-Round shapes.
// Build 5.2.5:
// - Addressing inconsistent results for custom sized elliptical pipes.
// Stems from inccorect equations for pipe full area and hydraulic radius
// for elliptical pipes from SWMM 4.4.
//-----------------------------------------------------------------------------
#define _CRT_SECURE_NO_DEPRECATE

Expand Down Expand Up @@ -569,8 +573,8 @@ int xsect_setParams(TXsect *xsect, int type, double p[], double ucf)
// --- length of major axis
if ( p[1] < 0.0 ) return FALSE;
xsect->wMax = p[1]/ucf;
xsect->aFull = 1.2692 * xsect->yFull * xsect->yFull;
xsect->rFull = 0.3061 * xsect->yFull;
xsect->aFull = 0.8117 * xsect->yFull * xsect->wMax;
xsect->rFull = 0.2448 * sqrt(xsect->yFull * xsect->wMax);
}
xsect->sFull = xsect->aFull * pow(xsect->rFull, 2./3.);
xsect->sMax = xsect->sFull;
Expand All @@ -597,8 +601,8 @@ int xsect_setParams(TXsect *xsect, int type, double p[], double ucf)
// --- length of minor axis
xsect->yFull = p[0]/ucf;
xsect->wMax = p[1]/ucf;
xsect->aFull = 1.2692 * xsect->wMax * xsect->wMax;
xsect->rFull = 0.3061 * xsect->wMax;
xsect->aFull = 0.8117 * xsect->yFull * xsect->wMax;
xsect->rFull = 0.2448 * sqrt(xsect->yFull * xsect->wMax);
}
xsect->sFull = xsect->aFull * pow(xsect->rFull, 2./3.);
xsect->sMax = xsect->sFull;
Expand Down