Control Rules
Control Rules determine how pumps and regulators in the conveyance system will be adjusted over the course of a simulation. Control rules can have an effect on any combination of velocity, flow and water level at nodes, conduits, pumps, weirs or orifices in the network. Control rules can be applied to various hydro objects. The Control Rule Editor window in GeoSWMM looks like the following Fig. 123.
** **
Rule Format/Boolean logic structure (AND, OR, ELSE, PRIORITY)
Each control rule is a series of statements of the form:
RULE RuleID
IF condition_1
AND condition_2
OR condition_3
AND condition_4
etc.
THEN action_1
AND action_2
etc.
ELSE action_3
AND action_4
etc.
PRIORITY value

Fig 123: Control Rule Editor Window
Where keywords are shown in boldface and ruleID is an ID label assigned to the rule, condition is a Condition Clause, action is an Action Clause, and value is a priority value (e.g., a number from 1 to 5). Each rule clause must begin with one of the boldface keywords shown above, and only one clause per line is allowed. Only the RULE, IF and THEN portions of a rule are required; the ELSE and PRIORITY portions are optional. Blank lines between clauses are permitted and any text to the right of a semicolon is considered a comment.
When mixing AND and OR clauses, the OR operator has higher precedence than AND, such as:
IF A or B and C is equivalent to
IF (A or B) and C.
If the interpretation was meant to be
IF A or (B and C)
then it can be expressed using two rules as in
IF A THEN...
IF B and C THEN ...
The PRIORITY value is used to determine which rule applies when two or more rules require that conflicting actions be taken on a link. A rule without a priority value always has a lower priority than one with a value. For two rules with the same priority value, the rule that appears first is given the higher priority.
** **
Condition Clause
A Condition Clause of a Control Rule has the following format.
object id attribute relation value
* *
-
Object (a category of object)
-
Id (the object's ID label)
-
Attribute (an attribute or property of the object)
-
Relation (a relational operator (=, <>, <, ≤, >, >=))
-
Value (an attribute value)
Some examples of condition clauses are:
NODE J4 DEPTH > 8
PUMP P5 STATUS = ON
SIMULATION CLOCKTIME = 18:30:00
The objects and attributes that can appear in a condition clause are as follows:
Table 15: List of Condition Clause Attributes
Object | Attributes | Value |
---|---|---|
NODE | Depth | Numerical Value |
Head | Numerical Value | |
Inflow | Numerical Value | |
LINK | Flow | Numerical Value |
Depth | Numerical Value | |
PUMP | Status | ON Or OFF |
Setting | Pump Curve Multiplier | |
ORIFICE WEIR | Setting | Fraction Open |
OUTLET | Setting | Rating Curve Multiplier |
SIMULATION | Time | Elapsed Time In Decimal Hours or hr:min:sec |
Date | Month/Day/Year | |
Month | Month of Year (January - December). January = 1 | |
Day | Day of Week (Sunday - Saturday). Sunday = 1 | |
Clock time | Time Of Day in hr:min:sec |
Action Clause
An Action Clause of a Control Rule can have one of the following formats.
PUMP id STATUS = ON/OFF
PUMP/ORIFICE/WEIR/OUTLET id SETTING = value
The meaning of SETTING depends on the object being controlled:
-
For Pumps, it is a multiplier applied to the flow computed from the pump curve
-
For Orifices, it is the fractional amount that the orifice is fully open (orifice control is accomplished by lowering or raising a horizontal gate from the top of the orifice)
-
For Weirs, it is the fractional amount of the original freeboard that exists (i.e., weir control is accomplished by moving the crest height up or down)
-
For Outlets, it is a multiplier applied to the flow computed from the outlet's rating curve
Some examples of action clauses are:
PUMP P7 STATUS = OFF
ORIFICE O2 SETTING = 0.5
** **
Pump on/off Control
RULE R3A
IF NODE N1 DEPTH > 5
THEN PUMP N1A STATUS = ON
* *
RULE R3B
IF NODE N1 DEPTH > 7
THEN PUMP P1B STATUS = ON
RULE R3C
IF NODE N1 DEPTH ≤ 11
THEN PUMP P1A STATUS = OFF
AND PUMP P1B STATUS = OFF
** **
Orifice Size Control
RULE R2A
IF NODE J2 DEPTH > 12
AND LINK C16 FLOW> 100
THEN ORIFICE R55 SETTING = 0.5
RULE R2B
IF NODE J13 DEPTH > 12
AND LINK C1FLOW> 200
THEN ORIFICE R55 SETTING = 1.0
RULE R2C
IF NODE J23 DEPTH ≤ 12
OR LINK C65 FLOW ≤ 100
THEN ORIFICE R55 SETTING = 0
** **
Weir Crest Elevation Control
RULE R4
IF NODE N2 DEPTH >= 0
THEN WEIR W25 SETTING = CURVE C25
** **
Simulation Time Based Rules
RULE R1
IF SIMULATION TIME > 8
THEN PUMP P8 STATUS = ON
ELSE PUMP P12 STATUS = OFF
** **
Modulated controls
Modulated Controls are control rules that provide for a continuous degree of control applied to a pump or flow regulator as determined by the value of some controller variable, such as water depth at a node or by time. The functional relation between the control setting and the controller variable can be specified by using a Control Curve, a Time Series, or a PID controller. Some examples of modulated control rules are:
RULE MC1
IF NODE N2 DEPTH >= 0
THEN WEIR W25 SETTING = CURVE C25
RULE MC2
IF SIMULATION TIME > 0
THEN PUMP P12 SETTING = TIMESERIES TS101
RULE MC3
IF LINK L33 FLOW <> 1.6
THEN ORIFICE O12 SETTING = PID 0.1 0.0 0.0
A modified form of the action clause is used to specify the name of the control curve, time series, or PID parameter set. that defines the degree of control. A PID parameter set contains three values: a proportional gain coefficient, an integral time (in minutes), and a derivative time (in minutes). Also, by convention, the controller variable used in a Control Curve or PID Controller will always be the object and attribute named in the last condition clause of the rule. In rule MC1 above Curve, for example, C25 would define how the fractional setting at Weir W25 varied with the water depth at Node N2. In rule MC3, the PID controller adjusts the opening height of Orifice O12 to maintain a flow of 1.6 in Link L33.
Proportional Integral Derivative (PID) controllers
A PID (Proportional-Integral-Derivative) Controller is a generic closed-loop control scheme that tries to maintain a desired set-point on a process variable by computing and applying a corrective action that adjusts the process accordingly. In the context of a hydraulic conveyance system, a PID controller might be used to adjust the opening on a gated orifice to maintain a target flow rate in a specific conduit or to adjust a variable speed pump to maintain a desired depth in a storage unit. The classical PID controller has the form:
Where, = controller output; =Proportional coefficient (gain); =Integral time (minutes); = Derivatinve time (minutes); = Error (difference between set point and observed variable value); t= Time.
The controller output has the same meaning as a link setting used in a rule's Action Clause while is the current flow routing time step in minutes. Because link settings are relative values (with respect to either a pump's standard operating curve or to the full opening height of an orifice or weir), the error used by the controller is also a relative value. It is defined as the difference between the control variable set point and its value at timet,, normalized to the set point value:
Note that for direct action control, where an increase in the link setting causes an increase in the controlled variable, the sign of must be positive. For reverse action control, where the controlled variable decreases as the link setting increases, the sign of must be negative. The user must recognize whether the control is direct or reverse action and use the proper sign on accordingly. For example, adjusting an orifice opening to maintain a desired downstream flow or downstream water level is direct action. Adjusting it to maintain an upstream water level is reverse action. Controlling a pump to maintain a fixed wet well water level would be reverse action while using it to maintain a fixed downstream flow is direct action.