• 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:


00:03

UPC scripts allow you to represent the valves and pump stations within a water supply system

00:09

that may be controlled by a more complex set of rules with multiple conditions.

00:14

This UPC script example sets two different types of pump controls, depending on the time of day.

00:21

You cannot do this with the in-built control, since with that method, you are limited to only one control mode.

00:28

From the Model Group window, expand the UPC Model model group.

00:33

To open the UPC Network and UPC Control, double-click the UPC Network or drag and drop it onto the workspace.

00:41

It is best practice when experimenting with UPC scripts to test them in a scenario first, before altering a base model.

00:49

In the Scenario toolbar, click Create scenario; or, from the ribbon, Scenarios tab, pick Create scenario.

00:58

In the Create New Scenario dialog, type “Pump UPC” in the New Scenario Name field.

01:05

Enable the option Create matching scenario in the Control.

01:09

Click OK.

01:12

The Pump UPC scenario now appears in the drop-down in the toolbar.

01:16

Ensure that the Pump UPC scenario is selected.

01:21

Drag and drop the “Pump Station” selection list on the Geoplan to identify the pump station with the asset ID “595311”.

01:31

Using the Properties tool, review its current control strategy.

01:35

For this tutorial, your task is to change this pump to turn on and off

01:40

to maintain a pressure between 31 and 33 meters at the hospital between 06:00 and 22:00;

01:48

and then to maintain a pressure of 27 m at the furthest node in the network (END) between 22:00 and 06:00.

01:57

In the Properties window of the pump station, expand the UPC script menu.

02:03

In the UPC Script options, click More (…) to open the UPC Script Window.

02:08

Here, you will set two rules: one for daytime operation between 6 AM and 10 PM,

02:15

and one for night time operation between 10 PM and 6 AM.

02:19

From the dataset provided for this tutorial, add the lines of code provided in the Pump UPC.txt file.

02:27

Once you have populated the code, click Test to check if there are any errors or syntax warnings.

02:34

When the message reads no warnings or errors to report, click OK to close the warning message,

02:39

and OK to close the UPC Script window.

02:43

Commit all the changes to the database.

02:47

Run both scenarios by right-clicking the Run Group, then select New > Run.

02:53

In the Schedule Hydraulic Run dialog, in the Title field, enter “Pump UPC”, and then enable Experimental.

03:03

Then, drag and drop the UPC Network from the Model Group window into the Network group box.

03:09

Now, click the Scenarios tab and enable the Base and Pump UPC options.

03:14

Then, click Save and Run.

03:18

A notification appears, telling you that this run will perform two simulations and may take a long time.

03:24

Click Yes.

03:26

When it has finished, you can click and drag the base simulation into the open Geoplan to visualize the results.

03:35

Now, right-click the Pump UPC simulation and select Open as....

03:40

In the dialog, select As Alternate Results For Comparison, and then click OK.

03:46

In the toolbar, click the Graph tool.

03:49

Then, in the Results window, zoom in and select the pump station.

03:53

In the dialog, select State, and then enable Graph alternate results.

03:58

Click OK.

04:00

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

04:06

You can see that, in the base simulation, the pump remains on for the whole simulation, since its State is continuously set to 1.

04:15

But, in the Pump UPC scenario, the pump turns on (1) and off (0) as the pressure at the specified control points change.

04:24

In this case, the frequency of the pump turning on and off might not be feasible in reality,

04:29

as it could cause damage to the distribution infrastructure.

04:32

Therefore, this UPC might need to be revisited to refine the scheduling.

Video transcript

00:03

UPC scripts allow you to represent the valves and pump stations within a water supply system

00:09

that may be controlled by a more complex set of rules with multiple conditions.

00:14

This UPC script example sets two different types of pump controls, depending on the time of day.

00:21

You cannot do this with the in-built control, since with that method, you are limited to only one control mode.

00:28

From the Model Group window, expand the UPC Model model group.

00:33

To open the UPC Network and UPC Control, double-click the UPC Network or drag and drop it onto the workspace.

00:41

It is best practice when experimenting with UPC scripts to test them in a scenario first, before altering a base model.

00:49

In the Scenario toolbar, click Create scenario; or, from the ribbon, Scenarios tab, pick Create scenario.

00:58

In the Create New Scenario dialog, type “Pump UPC” in the New Scenario Name field.

01:05

Enable the option Create matching scenario in the Control.

01:09

Click OK.

01:12

The Pump UPC scenario now appears in the drop-down in the toolbar.

01:16

Ensure that the Pump UPC scenario is selected.

01:21

Drag and drop the “Pump Station” selection list on the Geoplan to identify the pump station with the asset ID “595311”.

01:31

Using the Properties tool, review its current control strategy.

01:35

For this tutorial, your task is to change this pump to turn on and off

01:40

to maintain a pressure between 31 and 33 meters at the hospital between 06:00 and 22:00;

01:48

and then to maintain a pressure of 27 m at the furthest node in the network (END) between 22:00 and 06:00.

01:57

In the Properties window of the pump station, expand the UPC script menu.

02:03

In the UPC Script options, click More (…) to open the UPC Script Window.

02:08

Here, you will set two rules: one for daytime operation between 6 AM and 10 PM,

02:15

and one for night time operation between 10 PM and 6 AM.

02:19

From the dataset provided for this tutorial, add the lines of code provided in the Pump UPC.txt file.

02:27

Once you have populated the code, click Test to check if there are any errors or syntax warnings.

02:34

When the message reads no warnings or errors to report, click OK to close the warning message,

02:39

and OK to close the UPC Script window.

02:43

Commit all the changes to the database.

02:47

Run both scenarios by right-clicking the Run Group, then select New > Run.

02:53

In the Schedule Hydraulic Run dialog, in the Title field, enter “Pump UPC”, and then enable Experimental.

03:03

Then, drag and drop the UPC Network from the Model Group window into the Network group box.

03:09

Now, click the Scenarios tab and enable the Base and Pump UPC options.

03:14

Then, click Save and Run.

03:18

A notification appears, telling you that this run will perform two simulations and may take a long time.

03:24

Click Yes.

03:26

When it has finished, you can click and drag the base simulation into the open Geoplan to visualize the results.

03:35

Now, right-click the Pump UPC simulation and select Open as....

03:40

In the dialog, select As Alternate Results For Comparison, and then click OK.

03:46

In the toolbar, click the Graph tool.

03:49

Then, in the Results window, zoom in and select the pump station.

03:53

In the dialog, select State, and then enable Graph alternate results.

03:58

Click OK.

04:00

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

04:06

You can see that, in the base simulation, the pump remains on for the whole simulation, since its State is continuously set to 1.

04:15

But, in the Pump UPC scenario, the pump turns on (1) and off (0) as the pressure at the specified control points change.

04:24

In this case, the frequency of the pump turning on and off might not be feasible in reality,

04:29

as it could cause damage to the distribution infrastructure.

04:32

Therefore, this UPC might need to be revisited to refine the scheduling.

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.

Was this information helpful?