• InfoWorks WS Pro

UPC Scripts for Pump Station Control in InfoWorks WS Pro

Applying a UPC script to a pump station and visualize the results.


Tutorial resources

These downloadable resources will be used to complete this tutorial:

iwsp2023M21U02_Pmp_Sttn_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. This example uses a UPC script to set two different types of pump controls, depending on the time of day.

  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.

It is best practice to test UPC scripts in a scenario first, before altering a base model. To create a new scenario:

  1. In the Scenarios toolbar, click Create scenario.
  2. In the Create New Scenario dialog box, in the New Scenario Name field, type “Pump UPC”.
  3. Enable Create matching scenario in the Control.
  4. Click OK.

In the InfoWorks WS Pro interface, the Create New Scenario dialog box with options configured for the Pump UPC scenario; and in the GeoPlan, the UPC Network and UPC Control open.

In the Scenarios toolbar, the Pump UPC scenario now appears selected in the drop-down.

  1. From the Model Group, drag the Pump Station selection list and drop it onto the GeoPlan to identify the pump station with asset ID 595311.
  2. In the Tools toolbar, click the Properties tool.
  3. On the GeoPlan, select asset ID 595311 to open the Properties window.

In the Scenarios toolbar, Pump UPC appears and is highlighted, the Properties tool is highlighted, and on the GeoPlan, the pump station is being selected.

Next, create a UPC script that sets two rules for this pump—one to turn the pump on and off to maintain a pressure between 31 and 33 meters at the hospital between 06:00 and 22:00; and another to maintain a pressure of 27 m at the furthest node in the network (END) between 22:00 and 06:00.

  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 of the pump station, the UPC script menu is expanded, and More is highlighted.

  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.

The UPC script dialog box with the lines of code added, and the Test button called out.

  1. When the message reports no warnings or errors, click OK.
  2. Click OK again to close the UPC Script window.
  3. Commit the changes to the database.

To run both scenarios:

  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 “Pump UPC”.
  3. Enable 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. Enable the Base and Pump UPC scenarios.
  7. Click Save.
  8. Click Run.

In the Schedule Hydraulic Run dialog box, the Base and Pump UPC scenarios are enabled, Run is selected, and a notification popup appears.

  1. In the notification, click Yes.
  2. When it finishes, from the Model Group drag the Base simulation into the GeoPlan.

To create a graph to visualize the results:

  1. In the Model Group, right-click the Pump UPC simulation and select Open as.
  2. In the Select Results popup, select As Alternate Results For Comparison.
  3. Click OK.
  4. On the Operations toolbar, click Graph selected objects.
  5. In the GeoPlan, zoom in and select the pump station.
  6. In the dialog box, select State.
  7. Enable Graph alternate results.
  8. Click OK.

In the Results window, State is selected and Graph alternate results is enabled.

A graph window opens, showing the state of the pump in the different scenarios.

A graph window showing the state of the pump in the two scenarios over a 24-hour period.

The base simulation pump remains on for the whole simulation, since its state is continuously set to 1. In the Pump UPC scenario, the pump turns on (1) and off (0) as the pressure at the specified control points change. Also note that a pump turning on and off with this frequency in reality could damage the distribution infrastructure, so the scheduling in this UPC might need to be refined.