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
I have a need to use an external process to explicitly set water age at a Tank during a water quality simulation. While setting a WQ "Source" may work for non-age simulations, it appears that I can only force a Reservoir to have a specific age.
To force the Tank to have the "proper" age, I have previously addressed this need by adding special handling to the EN_setnodevalue function:
case EN_INITQUAL:
if (value < 0.0)
return (202);
node->C0 = value / m->Ucf[QUALITY];
if (isTank) {
tank->C = node->C0;
}
break;
I suppose the question is, does this rub anyone the wrong way? Is this a misuse of the toolkit on a philosophical level? And if I open a PR for this change, what discussion would anyone like to have about this?
The text was updated successfully, but these errors were encountered:
It rubs me the wrong way since it would be violating conservation of mass by not considering how age in the tank gets mixed with the age of the inflow during a filling period. This would show up in the reported mass balance listing.
Another way to simulate age is by treating it as a chemical with a zero-order reaction whose rate coefficient is +1 in all pipes. To keep the age in the tank constant at some specified initial value you would set its rate coefficient to 0. Then to make sure that water entering or leaving stays at that value you place a Set Point booster source at a node directly connected to the tank with its quality value the same as used for the tank. I tried this with Net1.inp, setting the age in its Tank 2 to 24 hrs, and it seemed to work (see the figure below -- Junction 1, which contains the source, is a node added directly below the tank).
P.S. @samhatchett out of curiosity, where did the code snippet you showed come from. It's quite different from that in the EN_setnodevalue function in epanet.c.
@LRossman the snippet came from an outdated private branch of epanet that I used to "get the job done" - just going through all that and trying to clean up and/or atone for my transgressions ;)
The approach makes sense, and I completely agree that my suggestion is a blatant abuse of power w/r/t/ water quality modeling.
I have a need to use an external process to explicitly set water age at a Tank during a water quality simulation. While setting a WQ "Source" may work for non-age simulations, it appears that I can only force a Reservoir to have a specific age.
To force the Tank to have the "proper" age, I have previously addressed this need by adding special handling to the
EN_setnodevalue
function:I suppose the question is, does this rub anyone the wrong way? Is this a misuse of the toolkit on a philosophical level? And if I open a PR for this change, what discussion would anyone like to have about this?
The text was updated successfully, but these errors were encountered: