Ribasim icon indicating copy to clipboard operation
Ribasim copied to clipboard

Document how to make `Pump` and `Outlet` nodes allocation controlled

Open SouthEndMusic opened this issue 3 months ago • 4 comments

They become allocation controlled by giving them the control state "Ribasim.allocation".

SouthEndMusic avatar Aug 12 '25 12:08 SouthEndMusic

Will discuss with @visr @simulutions on this magic value.

evetion avatar Nov 04 '25 15:11 evetion

Here it is: https://ribasim.org/concept/allocation.html#control-by-allocation

simulutions avatar Nov 06 '25 10:11 simulutions

I think my main concern (and something I already find very ugly in that control has to parse magic values like level/flow/concentration.X/concentration_external.X) is the "magic" of these values. They have a clear goal, but in very specific cases they do something completely different? Beside, having to put a specific value for a control state implies that we can trigger allocation control, and switch to other (non allocation) states as well. Not sure if that is what's intended. If not, I rather have a boolean field controlling this feature.

evetion avatar Nov 06 '25 14:11 evetion

It is intended that we can have control switch between Ribasim.allocation or other control states. An example is a reservoir that can release water based on downstream demand, but then switch to flood operation without any allocation when needed. I'm not sure this currently works, but it would be great to work out and document such an example.

You are right that it is a bit magic, but at the same time it aligns well in the existing concept of control_state. Having to introduce a separate concept can possibly also make things more difficult to grasp. We add the Ribasim. prefix to signify that this value has special meaning to Ribasim. If we don't do it already, we should error on any control states with that prefix that we don't know, to reserve it for our use.

visr avatar Nov 06 '25 15:11 visr