HEC-RAS 2D Mesh Generation Errors & Corrections

Creating a HEC-RAS 2D mesh that correctly represents the flow area being modelled can take some time to add the appropriate details to the model to represent the components and terrain data to be included.

When working with complex meshes, there may be times when the mesh generation fails to run. When this situation occurs, it will require the user to review the data that has been assigned to construct the mesh.

For example, the below 2D mesh fails to correctly generate an adaptive mesh.

HEC-RAS 2D Mesh Error

However, upon review of the polygon boundary used to define the mesh, the upper boundary contains a large number of unnecessary and redundant vertices.

HEC-RAS 2D Mesh Generation Errors

In this situation, the Map Edit > Simplify Elements command can be used to correct this issue by removing the redundant vertices along the 2D mesh boundary.

The following sections describe how to perform this task.

Export 2D Flow Area Mesh as Shapefile

To be able to simplify the 2D flow area mesh boundary, it needs to be exported as a shapefile. Follow these steps:

  1. From the Input ribbon menu, click the Export Data menu item, and then select the Export HEC-RAS to Shapefiles command.
    Export HEC-RAS to Shapefiles command
  1. The Export HEC-RAS to Shapefiles dialog box will be displayed.
    Export HEC-RAS to Shapefiles dialog boxThe Export HEC-RAS to Shapefiles dialog box is used to export a HEC-RAS model to GIS shapefiles allowing the HEC-RAS model data to be shared with GIS software. For further discussion on how to export the HEC-RAS elements, see this Knowledge Base article.
  1. Click the […] button adjacent to the HEC-RAS shapefiles folder entry and then choose the directory to save the exported shapefiles.
  2. Under the HEC-RAS Input Data section, turn off all the HEC-RAS element checkboxes except for the 2D flow area boundaries check box.
    HEC-RAS 2D flow area boundaries check box
  1. Click the [Export] button.
    Export the 2D flow area mesh boundary
  1. The software will export the 2D flow area mesh boundary as a polygon shapefile.

Import Polygon Shapefile

Next, we need to import the polygon shapefile that was exported. Follow these steps:

  1. Right-click on the Map Data Layers panel and then select Add Layers from the displayed context menu.Import Polygon Shapefile
  2. Browse and select the exported polygon shapefile, and then click the [Open] button.
    Browse and select the exported polygon shapefile
  3. The selected shapefile should be loaded and correctly overlay the HEC-RAS model area.

Polygon Simplification

The imported polygon shapefile will be used to recreate the 2D flow area for the HEC-RAS model. However, the number of vertices that define the shapefile polygon first needs to be simplified. Follow these steps:

  1. From the Map Edit ribbon menu, select the Simplify Elements command.
    HEC-RAS Simplify Elements command
  1. The Simplify Elements dialog box will be displayed.
    HEC-RAS Simplify Elements dialog box
  1. Click the [Pick] button adjacent to the Select polylines/polygons entry.
    Select Polylines/Polygons Entry
  1. The Simplify Elements dialog box will temporarily disappear, and a prompt will be displayed on the status line describing what to do next.
  2. From the Map View, select the imported polygon. Then, right-click and choose Done from the displayed context menu.
  3. The Simplify Elements dialog box will reappear.
  4. The software uses the Douglas-Peucker algorithm to reduce the number of redundant vertices that define polylines and polygons, thereby simplifying the geometry. The threshold value represents the amount of displacement a vertex can have from the adjacent vertices. A larger threshold value results in fewer vertices used to define the polyline or polygon. An illustration of how the Douglas-Peucker algorithm iteratively simplifies a polyline is shown below. The threshold value is depicted as the radius of the green circle. Critical vertices are first identified, which define the representative shape of the element. Then, redundant vertices are discarded.
    Douglas Peucker Algorithm
    A reasonable starting value use would be 10 feet (3 meters). This value can be increased to remove additional vertices. Some engineering judgement should be used when deciding on a final value.
  1. Click the [OK] button.
    Simplify Elements

The polygon will be simplified, reducing the number of redundant vertices used to describe the polygon boundary.
HEC-RAS 2D Mesh Generation Corrections

Assigning Polygon as 2D Flow Area Mesh

After simplifying the polygon, it can used be to define the 2D mesh. Follow these steps:

  1. From the Input ribbon menu, select the 2D Flow Areas menu item and then choose the Assign 2D Flow Areas command.
    Define the HEC-RAS 2D Mesh
  1. The Assign 2D Flow Areas dialog box will be displayed.
    Assign 2D Flow Areas dialog box
  1. Click the [Pick] button adjacent to the 2D flow area polyline/polygon entry.
    HEC-RAS 2D flow area polyline/polygon entry
  1. The Assign 2D Flow Areas dialog box will temporarily disappear, and a prompt will be displayed on the status line describing what to do next.
  2. From the Map View, select the polygon that was simplified.
  3. The Assign 2D Flow Areas dialog box will reappear.
  4. From the 2D Flow Area General Specifications section, define the 2D flow area ID.
  5. From the 2D meshing scheme dropdown combo box, select the mesh type to use.
    2D meshing scheme dropdown combo box
  1. Click the [Apply] button, and the software will assign the polygon as a 2D flow area.
    assign the polygon as a 2D flow area
  1. Double-click on the 2D mesh on the Map View to display the 2D Flow Area Data dialog box.
    HEC-RAS 2D Flow Area Data dialog box
  1. Click the [Update] button.
    Assign Polygon as 2D Flow Area Mesh
  2. The software will generate the 2D mesh without the previously reported error.HEC-RAS 2D mesh without the previously reported error

About the Author Chris Maeder

Related Articles