OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

How can we get/set the reaction option values? #678

Closed softempire closed 2 years ago

softempire commented 2 years ago

Like Global Bulk Coeff?

LRossman commented 2 years ago

You can't get/set the global reaction option values using the Toolkit. The global option is only a convenience used in the input file to save having to include a line of input for each individual pipe in the [REACTIONS] section of the file. If the Toolkit included the ability to set a "global" reaction coefficient then it is not clear which pipes should be assigned the global value -- only those that were assigned the previous global value or all pipes (in which case their previously assigned non-global value would be overwritten).

You can use the EN_getlinkvalueand EN_setlinkvaluefunctions to get and set an individual pipe's bulk (EN_KBULK) and wall (EN_KWALL) coefficients. For a tank, you would use EN_getnodevalueand EN_setnodevaluefunctions to get or set its bulk reaction coefficient (EN_TANK_KBULK).

softempire commented 2 years ago

Thank you for the explanation!