xpswmm/xpstorm Resource Center xps

River models employ the same link-node scheme that is used for pipe networks. In river models, links are typically trapezoidal or natural cross-sections representing river reaches. The cross sections representing each reach can be derived from topographic data.

You can use the tools in the application for automating the process of constructing a river model from topographic data. Invert elevations, cross section shapes, and conduit lengths may all be obtained and adjusted in the user interface.

In order to access topographic data, it must be in the form of digital terrain model (DTM). The application uses a Triangular Irregular Network (TIN) format. The data is stored in file with name filename.xptin – filename. An embedded tool in the software will generate the DTM from xyz data.

In this tutorial, a 1D hydraulic model of river is created using a background image for the layout and a DTM to assign elevations.

Part 1 – Adding a Background Image and Creating a DTM

Georeferenced image files (.bmp, .jpg, .tif, .ecw, .sid, and others) are used as background images to layout a network. A DTM is created from survey data and used to assign inverts and create shapes of cross sections for a river model.

  • Add a background image to the xp model 
  • Create a digital terrain model (DTM) from survey data
  • Adjust the display of the DTM
  • Use DTM to cut cross sections
Time0.5 hour
Data files
  • River_sitem.bmp (background image file)
  • River_sitem.bpw (world file)
  • River­_site.txt (topographic data in text format)

  1. Launch the program. 
    1. At the opening dialog, create a new file called DTM_and_River_m.xp
    2. Set the units to Metric
    3. Click Continue.
  2. Load the background image file:
    1. Right-click the Background Images line in the Layers Control Panel. 
    2. Select Add Background Image from the menu. 
    3. In the Windows Explorer dialog, navigate to the file River sitem.bmp, and then click Open. The coordinates of the Destination Rectangle are filled in from the world file (River sitem.bpw) that is associated with image file. Click OK

    4. Explore the image with the mouse. Note that the x and y coordinates are displayed in the status bar at the bottom of the network window. Use the mouse wheel to zone in and out. Right-click and the cursor will display the hand (Pan tool). Use the Pan tool to drag the image around the network viewing panel.

  3. Create the TIN:

    1. In the Layers Control Panel, right-click the DTM layers line and select DTM Builder.

    2. Click the Read XYZ File button. 

    3. In the Windows Explorer dialog, navigate to the file River_site.txt and then click Open.


    4. Review the survey data. Column S is used to designate break lines. The consecutive rows with the same tag in column S are ridges or gullies.

      Note: Data may be edited in this dialog prior to creating the DTM.
    5. Click the Create DTM button. 

    6. Enter DTM_and_River in the file name box. Click Save. The network view should now include the DTM. Make sure the visible check box is on for the DTM line in the Layers Control Panel.

      Note: The DTM covers only a portion of the background image.


    7. Move the cursor over the contours and note that the x, y, and z values are displayed in the status bar at the bottom of the network view.

  4. Adjust the DTM display properties: 

    1. Right-click the DTM line in the Layers Control Panel and select Properties from the menu.

    2. Click the Display Properties tab. 

    3. Clear the box next to Fill Color on Height Range

    4. Select the boxes next Show Major Contour at and Show Minor Contour at

    5. Set the Major interval to 5 m and Minor to 1 m. Make sure the Show and Display Legend buttons are selected. 


    6. Click the Color buttonThis dialog is used to adjust the color scaling of the elevations. Click OK to use the default settings.


    7. Click the Edit Legend button. Enter Elevation, m in the title box. Click OK twice to return to the network view.


    8. Review the study area. Locate the highest and lowest points.


  5. Construct a cross-section: 

    1. Click the Section Profile  icon. A moving polyline will appear below the cursor. 

    2. Layout a cross section by clicking once at each vertex. 


    3. Double-click to end. The cross section shape will appear showing elevation (in m) vs. distance (in m). 


    4. Click Close to hide the shape graph.

  6. Save your files as DTM_and_River_m01.xp



What are the elevations of the highest _________m, and lowest _________m points on the area covered by the DTM surface?

What is the length within the DTM_________m, and the slope_______ft/ft of the river bed?

Part 2 – Creating the RIVER model using a TIN

A 1D river model will be constructed using the background image and DTM developed in Part 1.

ObjectivesCreate a model of the river using the TIN created in DTM Building
Time1 hour
Data files
  • DTM_and_River_m01.xp (from Part 1) 
  • River_site.bmp (background image file)
  • River_site.bpw (world file)
  • DTM_and_River.xptin (developed in Part 1)

  1. Open file DTM_and_River_m01.xp and save your file as DTM_and_River_m02.xp.
  2. Set defaults for node and link display:
    1. In the File menu, select Properties
    2. In the left panel of the File Properties and Options dialog, select Node Drawing
    3. Set the Node Label > Display Size to 4.0 mm and the Node Size > Display Size to 4.0 mm Width by 4.0 mm Height.

    4. In the left panel, select Link Drawing
    5. Set the Link Label Display Size to 4.0 mm, and the Line Size > Display Size to 0.8 mm
    6. Set the Colour to red. Click OK to return to the network view.

  3. Using the TIN color and contours as a guide, digitize a 4-link, 5-node network as shown below. Adjust the zoom and toggle the display on/off of the DTM and background image to aid in visibility.

    1. Add the River Reach: 
      1. From the tool strip, select the River tool. A vertical pipe will appear next to the cursor indicating Reach objects can be drawn.
      2. Click once to add a River Node and hold Ctrl while clicking along the centerline of the channel to add the River Link.
      3. Unselect the Ctrl key and single click the mouse to add another River Node.
      4. Repeat this process, holding Ctrl again and click along the centerline of the channel, unselecting the Ctrl key and clicking once to add another node.
      5. Double-click to add the final River Node and end the drawing.
    2. Upon ending the River Link a River Properties dialog will appear. Enter the name River Channel for the river reach and click OK

    3. Adjust the locations of any of the River Nodes:
      1. Select the pointer tool.
      2. Click a node. The cursor will appear as a 4-arrowed cross.
      3. Hold the left button down and drag to the new location.
    4. Edit River Link vertices:
      1. Select a link and right-click.
      2. Select Edit Vertices from the menu.
      3. To move the location of a vertex, position the cursor over a vertex. It will appear as a cross with moving arrows.
      4. With the left button, drag the vertex to a new location and release.
    5. Move the cursor along the link and click once to add a vertex. Add as many vertices as necessary to approximate the alignment of the river channel as defined by the background image or contours.


  4. Define a cross-section layout with the graphical interface:

    1. Select Link1

    2. Right-click and select Define Cross Section Layout from the menu. A small “x” will appear next to the cursor. 

    3. Begin on the 161 m contour at a location approximately equidistant from Node1 and Node2 that appears to represent the typical cross section shape between the two nodes. Click once to add a vertex. 

    4. Click each minor contour moving perpendicular through the contours. Continue across the midpoint of Link 1 to contour 161 m on the opposite side.

    5. Double-click to end. The Link Cross-section dialog will appear.

    6. Click OK to accept. If you wish to re-draw, click Cancel and repeat Step 4.

  5. Adjust the cross section display properties:

    1. Right-click the Cross-sections line in the Layer Control Panel.

    2. Select Properties from the menu.

    3. Select the Drawing Attributes tab.

    4. Set the line color to brown and size to 2

    5. Select the Draw Vertices box and set the Vertex size to 3.

    6. Go to the Data tab. 

    7. Select the box next to Show Left and Right Banks.

    8. Click OK to return to the network view. Review the display of the cross-section.


  6. Automatically generate cross sections. 
    1. Select links Link 2 through Link 4
    2. In the Tools menu, select Calculate Conduit > Cross-sections
    3. In the Generate Cross-section Layout/Shape dialog, set Apply To as Selected Links and Create to Layout then Shape from DTM
    4. Create the cross sections offset 50% from the Upstream Node 30 m to the left and 30 m to the right. Click OK.

    5. The application reports the Natural Section Shapes that have been created. These shapes are stored in the Global Database. Click OK to close.

    6. In the network view, the new cross-sections are displayed. Note that the new cross-sections are straight lines bisecting the links.

    7. The automatically generated cross-sections might not be good representations of the topography. If you open and review the newly created cross sections, you will see that the Link 3 cross section does not represent the topography well. From Link 2 through Link 4, right-click each link and select Delete Cross-section Layout from the menu. 

  7. Manually define the cross section layouts. 

    1. For links Link 2 through Link 4, right-click and select Define Cross-section Layout from the menu. 

    2. Use the same method described in Step 5 to layout the cross sections from elevation 161 m on the left bank to 161 m on the right bank.


  8. Generate shapes: 

    1. Click the Select All Links tool. 

    2. In the Tools menu, select Calculate Conduit > Cross-sections

    3. In the dialog, set Apply To to Selected Links and Create to Shape using Layout and DTM

    4. Click OK.

    5. In the next dialog, click the Yes to all button.


  9. Edit the cross section shapes:
    1. In the Configuration menu, select Global Data
    2. In the Data Base Type, select (H) Natural Section Shapes.
    3. In the right panel, select Link 1_shp and then click Edit.

    4. Use the LB and RB buttons to identify the left and right banks. 

    5. For the Roughness (Manning's n), set to 0.1 for the Left and Right Overbanks, and 0.045 for the Center Channel. Click OK

    6. Review the Natural Section Shape. If it contains irregularities, ideally adjust the layout and regenerate as per Step 8 or simply override the terrain and edit the data in the table or the graphing window.

    7. Repeat for Link 2 and Link 4.

    8. Click OK twice to return to the network view.

  10. Modify node inverts:

    1. Select All Nodes and select All Links

    2. In the Tools menu, select Modify Elevations

    3. Click the Read Inverts from Tin Files radio button. 

    4. Check all three boxes in the lower section: Regenerate SlopesSet Node Inverts and Set Link Inverts

    5. Click OK to close.

  11. Set the outfall properties:
    1. Double-click Node 5 (or the most downstream node in your model) to open the node data dialog. 
    2. Click the Outfall button. 
    3. In the Outlet Control dialog, select the Type 1, Free Outfall radio button. 

    4. Set the depth to Use minimum of Yc_Yn as the depth criterion. 
    5. Click OK three times to return to the network view.

  12. Calculate the conduit lengths and slopes:
    1. Click the Select All Links tool
    2. In the Tools menu, select Calculate Conduit > Lengths
    3. Select the All button and then click Calculate.

    4. Review the new lengths that have been calculated. 
    5. Click OK to return to the network view.


    6. In the Tools menu, select Calculate Conduit > Slopes
    7. Select the All button and then click Calculate.
    8. Review the new slopes that have been calculated. 
    9. Click OK to return to the network view.

  13. Save your file as DTM and River 02.xp.


Use the Ruler tool to measure the straight line distance between Node 1 and Node 2. Compare the distance to the model length of Link 1.

  1. What is the impact of adding vertices to links on the hydraulic calculations?
  2. Do the link slopes account for the elevation of the vertices?

Part 3 – Solving the Hydraulic Model

A hydraulic load is applied to the 1d river model constructed in Part 2. The model is solved and the Dynamic Section Views window is used to examine model results.

ObjectivesAdd hydraulic loads and Job Control parameters and solve the river model
Time0.25 hour
Data files
  • DTM and River_m02.xp (from Part 2) 
  • River site.bmp (background image file)
  • River site.bpw (world file)
  • DTM and River.xptin (developed in Part 1)

  1. Open the file DTM_and_River02.xp.
  2. Add flows:
    1. Double-click Node 1
    2. In the Node Data dialog, click the User Inflow button. 
    3. Click the Insert button four times to add four blank data rows. 
    4. Enter the flow time series data as shown in the figure below. 
    5. Click OK twice to return to the network view.

  3. Set the Job Control parameters:
    1. In the Configuration menu, select Job Control Hydraulics
    2. Set the Start and Stop Times such that the simulation period is 5 hours
    3. Enter the simulation Time Step as 5 Seconds
    4. Click OK to return to the network view.

  4. Solve the model. If no model configuration errors are present, after selecting Solve the XPS 1D/2D Simulation dialog will appear. This dialog presents the status during the calculation. The engine may be paused to adjust calculation parameters. Click Continue to resume the calculation. When Don’t Show Model Status is checked, the calculation is faster.

  5. Review the simulation results:
    1. Select Node 1
    2. Right-click and select Select Downstream Objects from the menu. 
    3. In the Results menu, select the Dynamic Section Views tool.

      The Dynamic Section Views window contains three panels. The top panel is a profile of the selected network segment. It displays the river bottom, top of bank, and the magenta line represents the maximum HGL occurring during the simulation. The lower left panel displays the HGL in the cross section of the downstream end of each link. The lower right panel displays the hydrograph of each link.

      The DVR buttons located on the left end of the toolbar are used to control animations of simulations results. The water levels are displayed at the time step indicated in the title bar.

    4. Save your file as DTM and River.03.xp.


  1. In the River Profile, note the sag between Node 2 and Node 5. At what time is the sag filled such that flow occurs in Link 5?
  2. Explain why the peak flow decreases at each successive downstream link? 

Part 4 – Additional Base Flow Using Scenario Manager

Alternative hydraulic loads are added to the 1d river model constructed in Part 3 using the Scenario Manager.

ObjectivesUse the Scenario Manager to examine alternative hydraulic loads to a river model
Time0.25 hour
Data files
  • DTM and River_m03.xp (from Part 1) 
  • River site.bmp (background image file)
  • River site.bpw (world file)
  • DTM and River.xptin (developed in Part 1)

  1. Open file DTM and River_m03.xp.
  2. Add scenario:
    1. In the main toolbar, click Edit next to the Scenario drop list. 
    2. Click New and add a new scenario with the name Base Flow. Make sure that the Base Scenario and the Base Flow boxes are checked. 
    3. Click OK to close Scenario Manager.

    4. Make sure that the active scenario is set to Base Flow.

  3. Add a constant base flow. 

    1. Select Node 1. Double-click to open the Node Data dialog.

    2. Enter 0.7 cms in the Constant Inflow field.

  4. Solve model. In the Analyze menu, select Solve

    Note in the XPS 1D/2D Simulation dialog the two progress bars tract the progress of each scenario and the total batch of solutions.

  5. Review Results:

    1. Select Link 4

    2. Right-click and select Review Results from the menu.

      Note that both flow results are shown on the same graph. Drop lists are used to change the variable and the scenarios that are displayed.

  6. Add additional scenario:

    1. Use the methods described in Step 2 to create a new scenario that is a daughter to the Base Flow and titled Larger Storm.


    2. Make sure that the active scenario is set to Larger Storm.

    3. Double-click Node 1 to open the Node Data dialog. 

    4. Click the User Inflow button and edit the data to the values shown below.

      Time (hr)

      Flow (cms)










    5. Click OK twice to return to the network view. 

  7. Solve the model and use the result to answer the questions in this part.

  8. Save your file as DTM_and_River04.xp


Compare the HGL at the outfall at the end of the three scenarios. Explain why they are different.

How long does it take for the peak flow to travel from Node 1 to Node 8 in each scenario? (Hint: See Table E10 in the output file).


Part 5 – Additional Tools for Displaying Results

The results of the 1D river model constructed in Part 4 are analyzed with Review Results tool and XP Tables.

For additional information about the use of XP Tables, consult Tutorial 12 - XP Tables.

ObjectivesCompare scenario results with Review Results graphs and XP Tables
Time0.25 hour
Data files
  • DTM and River04.xp (from Part 4) 
  • River_siteUS.bmp (background image file)
  • River_siteUS.bpw (world file)
  • DTM and River.xptin (developed in Part 1)

  1. Open the file DTM_and_River04.xp.

  2. Plot the cross section:
    1. Set the active scenario to Larger Storm
    2. Select the entire network and launch the Dynamic Section Views window. 
    3. Move the panel dividers to maximize the view of the cross section panel.

    4. Double-click the Link4 graph to launch the Customization dialog. Click the Maximize button.

    5. Right-click the graph to open the Customization menu. Follow the Export Dialog to export the cross section to a graphics file.

  3. Create the XP Table:
    1. In the network view, click the XP Tables icon to open the XP Table List dialog. 
    2. Highlight Node Tables and click Add
    3. In the Add Table dialog, enter HGL as the name of the table, and then click OK.

    4. In the Variable Selection dialog, select Max Water Elevation in the left panel and click Insert (Node Data and Results > Hydraulics Node > Hydraulic Node Results > Max Water Elevation). 

    5. Click OK then View to display the table in a new window.


    6. In the XP Tables window, select All Scenarios from the drop list. Note that each node appears in three rows with a separate value reported for each scenario.


  4. Save your file as DTM_and_River05.xp.


  1. Does the water level exceed the left or right banks of any cross section in the Larger Storm scenario? Circle Yes or No.

  2. How can the precision of the cross sections be increased?
  3. What is the total volume of water left in the river at the end of the Larger Storm scenario?