-
Notifications
You must be signed in to change notification settings - Fork 176
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
Constants precision nits #70
Comments
Those 32.2 values have something to do with SWMM4 and SWMM3 - here is how it is defined in SWMM4
|
@cbuahin SWMM users place a high value on consistency of results. This change is going to affect results for every model out in the wild. Seems like a lot for a patch release. I recommend holding off on this until the next minor update. |
Technical Detail: The constant The friction slope is one of the two most dominant terms in the dynamic wave solution of hydraulic models. Even a slight alteration in the value of Careful consideration should be given when defining the value of |
While I try to avoid excessive precision in reports, I like detail in my calcs. I suppose the ultimate change would be to change the code from frumpy US units to SI and conform with the rest of the world, whereby PHI would be relegated to the dustbin. But we seem to have bigger cultural fish to fry than metrification. Although NIST and NOAA are inching forward and retiring the US Survey foot (0.304801 m) in favor of the international foot (0.3048 m): https://oceanservice.noaa.gov/geodesy/international-foot.html |
Since we have decided to go with a minor update release, I think it is good to tackle this issue now. |
Reopening this issue ... Benchmarks are sensitive to numerical precision of constants |
Very minor stuff: a few constants are applied inconsistently and/or could easily be resolved to higher precision. The gravity adjustment is less than 0.1%; the Manning's N coefficient adjustment is close to 0.3%
//consts.h
#define GRAVITY 32.2 // add precision to 32.174
#define SI_GRAVITY 9.81 // never used
#define PHI 1.486 // resolve to 1.4859 or exact representation as 0.3048^(-1/3)
//lid.c
LidProcs[j].surface.alpha =1.49 * sqrt(LidProcs[j].surface.surfSlope) / LidProcs[j].surface.roughness; // use PHI
//statsrpt.c
if (UnitSystem == US) Vcf = 7.48 / 1.0e6; // resolve to 7.4805
//subcatch.c
const double MCOEFF = 1.49; // use PHI
//transect.c
else Transect[j].hradTbl[i] = pow(qSum * Nchannel / 1.49 / aSum, 1.5); // use PHI
//link.c
aa = Conduit[k].beta / sqrt(32.2) * pow(Link[j].xsect.yFull, 0.1666667) * 0.3; // use GRAVITY
The text was updated successfully, but these errors were encountered: