You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the EPANET API, setting an emitter exponent greater than 1 and subsequently changing the node's emitter flow coefficient during the simulation results in -nan errors for flow and pressure outputs. However, defining the node in the [EMITTERS] section of the INP file with any coefficients allows the simulation to run correctly without producing NaN errors.
Change line 20 to make exponent less than 1 - simulation returns results
Update network.inp and uncomment nodes in [EMITTERS] and make exponent larger than 1 again - simulation returns results
I tired to look through the code but it wasn't immediately obvious what was going on, I'm sure a fresh more experienced set of eyes might be able to see what is causing this issue.
1 - Exponent 1.1 and Coeff. 2.2 when t > 7200
2 - Exponent 0.9 and Coeff. 2.2 when t > 7200
3 - Exponent 1.1 and Coeff. 2.2 when t > 7200 and Coeff defined in INP
case EN_EMITTER:
if (index > nJuncs) return 0;
if (value < 0.0) return 209;
if (value > 0.0) value = pow((Ucf[FLOW] / value), hyd->Qexp) / Ucf[PRESSURE];
Node[index].Ke = value;
if (hyd->EmitterFlow[index] == 0.0) hyd->EmitterFlow[index] = 1.0; //<---- new line
break;
When using the EPANET API, setting an emitter exponent greater than 1 and subsequently changing the node's emitter flow coefficient during the simulation results in -nan errors for flow and pressure outputs. However, defining the node in the [EMITTERS] section of the INP file with any coefficients allows the simulation to run correctly without producing NaN errors.
The code I’ve been working on can be found at the following Replit:
https://replit.com/@lbutler1/epanet-v22-vs-dev-Emitexpon-bug#main.c
Steps to reproduce:
I tired to look through the code but it wasn't immediately obvious what was going on, I'm sure a fresh more experienced set of eyes might be able to see what is causing this issue.
1 - Exponent 1.1 and Coeff. 2.2 when t > 7200
2 - Exponent 0.9 and Coeff. 2.2 when t > 7200
3 - Exponent 1.1 and Coeff. 2.2 when t > 7200 and Coeff defined in INP
Code and network also attached below
epanet-exponent-bug.zip
The text was updated successfully, but these errors were encountered: