• InfoWorks WS Pro

UPC Scripts for Valve Operations in InfoWorks WS Pro

Applying a UPC script to a valve and visualize the results.


Tutorial resources

These downloadable resources will be used to complete this tutorial:

iwsp2023M21U03_Vlv_UPC.zip

Step-by-step guide

UPC scripts allow you to represent the valves and pump stations within a water supply system that may be controlled by a more complex set of rules with multiple conditions. In this example, a UPC script sets a valve control to perform a rezone exercise following a pipe rupture.

  1. From the Model Group window, expand the UPC Model group.
  2. Double-click the UPC Network to open the UPC Network and UPC Control in the GeoPlan.
  3. In the Scenarios toolbar, expand the Select scenario drop-down and select Pipe break.

The InfoWorks WS Pro interface with the UPC Network and UPC Control open in the GeoPlan and in the Select scenarios drop-down, the Pipe break scenario selected.

For this example, Pipe 109755 has been set to rupture between 08:00 and 12:00. When this rupture occurs and leaves the downstream network without water supply, the mitigation method is to rezone the DMA using valve 234298.

  1. From the Model Group, drag the Rezone Valve selection list and drop it onto the GeoPlan to identify valve 234298.
  2. In the Tools toolbar, click the Properties tool.

In the Tools toolbar, the Properties tool selected and called out, and in the GeoPlan, the Rezone Valve selection loaded with the rezone valve selected.

  1. On the GeoPlan, select valve 234298 to open the Properties window.

The Valve Control option is currently set to an Opening percentage of zero, meaning the valve is closed.

Now, create a UPC script that instructs the valve to open when there is a supply incident in the network, and then close when the network behavior returns to normal.

  1. In the Properties window, expand UPC script.
  2. In the UPC Script field, click the More () button to open the UPC Script Window.

In the Properties window, the Valve Control Opening (%) set to 0 and highlighted, and next to UPC Script, the More (…) button selected and called out.

  1. From the dataset provided for this tutorial, open the Pump UPC.txt file.
  2. Copy the lines of code provided.
  3. In the UPC script dialog box, Paste the code into the text field.
  4. Click Test to check for errors or syntax warnings.
  5. When the message reports no warnings or errors, click OK.

The UPC Script dialog box with lines of code added to the text box, and the notification reporting no errors or warnings with OK selected.

  1. Click OK again to close the UPC Script window.
  2. Commit the changes to the database.

To run the Pipe break scenario:

  1. In the Model Group, right-click the Run Group and select New > Run.
  2. In the Schedule Hydraulic Run dialog box, in the Title field, enter “Valve UPC”.
  3. Select Experimental.
  4. From the Model Group, drag the UPC Network into the Schedule Hydraulic Run dialog box and drop it into the Network group box.
  5. Click the Scenarios tab.
  6. Deselect the Base scenario.
  7. Enable the Pipe break scenario.
  8. Click Save.
  9. Click Run.

The Schedule Hydraulic Run dialog box with options configured for the Pipe break scenario and Run selected.

  1. When it finishes, from the Model Group, drag the Base simulation and drop it onto the GeoPlan.
  2. To identify and select the pressure control point and the valve, drag the Rezone selection list and drop it onto the GeoPlan.

Now, graph the results:

  1. In the Operations toolbar, select Graph selected objects.
  2. In the Graph Selection dialog box, from the Left group box, select Opening (%).
  3. From the Right group box, select Pressure (m).
  4. Click OK.

In the Graph Selection dialog box, the Left and Right attributes are set to Opening (%) and Pressure (m).

In the resulting graph, you can see that as the pressure drops at the control points, the rezone valve opens to allow water to bypass the rupture. Once the pipe is mended and the flow is restored, the rezone valve closes.

A graph window displaying opening (%) over time of the rezone valve and control points, showing the rezone valve opening as pressure drops at the control points, and then closing once flow is restored.