• InfoWorks ICM

Using SQL to narrow 1D simulation results

Use result grid windows and create queries to narrow simulation results to your selected criteria. 


Tutorial resources

These downloadable resources will be used to complete this tutorial:

SQL_Sim_Rslts.icmt

Step-by-step guide

In InfoWorks ICM, all objects or a selection of objects can be viewed in a results grid window. SQL queries can also be used to create selections to narrow simulation results, or to generate custom tables containing specific object and results fields. For example, a query can select only the nodes that are flooding into a table with the ground level and maximum water level.

To use a results grid to tabulate all the result information for individual objects:

  1. Double-click the Design Run simulation to open it in a GeoPlan window.
  2. In the toolbar, from the Window menu, select Grid windows, and then select New node results window.

The Window menu with Grid windows selected, and in the flyout, New node results window highlighted.

In the node results grid, the green column headings represent time-varying results for the current timestep, while black column headings represent the maximum results. The layout can be customized, sorted, and the results filtered by right-clicking in the grid.

In the node results grid window, green column headings represent time-varying results for the current timestep, while black column headings represent the maximum results.

  1. Right-click the Max Flood depth column header and select Sort Descending.

Now the nodes with the highest flood depths appear at the top of the grid.

It can be useful to narrow the results down to a custom selection. For example, to see a selection of only the nodes that are flooding, use an SQL query to make this selection with specific criteria:

  1. In the Database, right-click the 1D Sewer Model group and select New InfoWorks > Stored query.
  2. In the New Name popup, enter "Flooding Nodes".
  3. Click OK.
  4. In the Database, double-click Flooding Nodes to open the SQL window.

To set up a query to select only nodes that are flooding:

  1. On the SQL tab, in the Object Type drop-down, select All Nodes.

In the SQL dialog box, Object Type drop-down, All Nodes selected and highlighted in red.

  1. Type the following query directly into the text box:

SELECT WHERE sim.max_floodvolume > 1 OR sim.max_flvol > 1;

The SQL dialog box with the Flooding Nodes query for this example entered in the text box.

This query identifies all nodes with a flood volume, stored or lost, greater than the tolerance of 1 m3.

  1. Enable Open Selection in Grid View.
  2. Click Test.

A notification appears to show if the query is valid and displays the number of items selected.

  1. Click OK.
  2. Click Save to save the query for later use, if needed.
  3. Click Run to run the query.

A grid appears, containing both the object properties and the simulation results based on the query.

  1. Scroll the grid to view the various properties for the selected nodes.
  2. Select all the rows in the grid.
  3. Switch to the model view to see the locations where flooding is occurring highlighted.
  4. Right-click anywhere in the GeoPlan and select Zoom to selection.

In the GeoPlan, simulation results are highlighted in red, and the shortcut menu is expanded with Zoom to selection highlighted.

Further narrow the results with another query to select exactly what information appears in the grid. For this example, the query will select the nodes where the maximum flood depth is between 0 and -0.200m, and display only the node_id, ground_level, and max_flooddepth information.

  1. In the database, right-click the 1D Sewer Model group and select New InfoWorks > Stored query.
  2. In the New Name popup, enter the name "Risk of Flooding".
  3. Click OK.
  4. Double-click Risk of Flooding to open the SQL window.
  5. On the SQL tab, in the Object Type drop-down, select All Nodes.
  6. Use the Builder to help construct the query, or type the query directly into the text box:

SELECT node_id, ground_level, sim.max_flooddepth WHERE sim.max_flooddepth <= 0 AND sim.max_flooddepth >-0.200 ORDER BY sim.max_flooddepth DESC ;

The SQL window dialog box with the Risk of Flooding query for this example entered in the text box.

  1. Enable Open Selection in Grid View.
  2. Click Test to validate the query.
  3. Click OK.
  4. Click Save.
  5. Click Run.

The grid appears with the results and displays only the columns built into the query.

A results grid displaying only the columns built into the query.

  1. Select all the rows in the grid.
  2. Switch to the model view to see the locations where there is a risk of flooding highlighted.
  3. Right-click the GeoPlan and select Zoom to selection.

In the GeoPlan, results for the Risk of Flooding query highlighted in red, and the shortcut menu with Zoom to selection called out.