Skip to content

Control rules

A network without control rules is a passive one: pumps run on their own start and stop levels, gates never move. Control rules are how a model represents an operated system, and they are the difference between simulating the pipes and simulating the utility.

Open them at Model data ▸ Control Rules.

RULE PUMP1_ON
IF NODE WW1 DEPTH > 2.5
THEN PUMP P1 STATUS = ON
PRIORITY 1

Every rule is RULE name, one or more IF conditions, one or more THEN actions, and optionally ELSE actions and a PRIORITY. Conditions join with AND and OR.

Conditions can test a node (DEPTH, MAXDEPTH, HEAD, VOLUME, INFLOW), a link (FLOW, DEPTH, STATUS, SETTING, VELOCITY), or the simulation clock itself (SIMULATION TIME, CLOCKTIME, DAYOFYEAR), which is how a time-of-day rule such as off-peak pumping is written.

When two rules fire at the same step and act on the same object, the higher PRIORITY number wins. Without priorities the outcome is the order the rules happen to be written in, which is not something to rely on.

The usual pattern is a pair of rules per pump, one to start and one to stop, with the stop rule at the higher priority so a pump cannot be held on by a stale condition.

Keep the control of one object in one place

Section titled “Keep the control of one object in one place”

Splitting a pump’s operation between its own start and stop levels and a set of rules makes behaviour very hard to reason about, because the two can disagree and the engine resolves the disagreement quietly. Pick one. If rules drive the pump, set its own levels wide enough that they never bind.

Rules that never fire are the common failure, and they are silent. Set Control Actions to YES on the Report tab of Calculation options, re-run, and the report lists every action taken. No entries means no rule ever matched.