Skip to content

Convert wall reaction parameters in EN_setflowunits - #935

Merged
LRossman merged 1 commit into
OpenWaterAnalytics:devfrom
aowis-org:fix-wall-reaction-unit-conversion
Aug 27, 2026
Merged

Convert wall reaction parameters in EN_setflowunits#935
LRossman merged 1 commit into
OpenWaterAnalytics:devfrom
aowis-org:fix-wall-reaction-unit-conversion

Conversation

@aowis-becker

Copy link
Copy Markdown

EN_setflowunits() updates a project's unit system and already converts
unit-dependent hydraulic data, but wall reaction parameters are currently
left unchanged.

This changes the physical meaning of wall reactions when switching between
US customary and SI flow units. For example, a first-order wall coefficient
of -1 ft/day becomes -1 m/day instead of the equivalent -0.3048 m/day.

This change converts wall reaction parameters whenever the unit system
changes:

  • first-order wall coefficients as length/time,
  • zero-order wall coefficients as mass/area/time,
  • the global wall reaction coefficient,
  • per-pipe wall reaction coefficients, and
  • the roughness/reaction correlation factor.

Two regression tests cover first-order and zero-order wall reactions. They
verify both the converted coefficient values and preservation of the
resulting water-quality solution across a US-to-SI unit change and back.

@LRossman
LRossman merged commit 83e25bb into OpenWaterAnalytics:dev Aug 27, 2026
5 checks passed
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