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

Bug fix in roughness unit conversion when using D-W #450

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kaklise
Copy link
Collaborator

@kaklise kaklise commented Oct 1, 2024

Summary

The following PR addresses #443 regarding unit conversion of the roughness coefficient when using D-W headloss formula. This update only impacts the EpanetSimulator which requires the unit conversion when reading/writing the INP file. The WNTRSimulator does not support D-W headloss formula.

The original code did not convert roughness in _read_pipes and _write_pipes. The to_si and from_si conversion functions for roughness were also incorrect and updated.

If wn.options.hydraulic.headloss is changed from ['H-W', 'C-M'] to/from 'D-W', a UserWarning is printed to the screen. The units of headloss cannot be converted from unitless to/from length.

Tests and documentation

Tests were added to test_epanet_io.py. The mean absolute error in pressure values for Net3 is within 0.55 m when using H-W, C-M, and D-W with GPM and LPS.

Acknowledgement

By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.

@kaklise kaklise requested a review from kbonney October 1, 2024 17:05
@coveralls
Copy link

coveralls commented Oct 1, 2024

Coverage Status

coverage: 84.333% (+0.1%) from 84.227%
when pulling 9a05834 on kaklise:dw_units
into 576dc01 on USEPA:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants