2D Modeling in HEC-RAS, A Quick Start Guide

One of the most significant improvements to the United States Army Corps of Engineers River Analysis System (HEC-RAS) program is the addition of two-dimensional modeling functions. Many engineers are accustomed to preparing one-dimensional (1D) models. Therefore, 2D modeling can be a little daunting at first. However, 2D modeling is not any more difficult than 1D modeling. In fact, it can be simpler in some ways. There are just some things to keep in mind when preparing a 2D hydraulic model.

A 2D model prepared in HEC-RAS must include terrain data and a 2D Flow Area. The user can designate the size and shape of the cells that comprise the 2D Flow Area. HEC-RAS also allows the user to add hydraulic structures and 1D elements such as storage areas to a 2D model. All 2D hydraulic models must be run as unsteady. When preparing a 2D model, it is also important to keep in mind that 2D models have much longer run times than 1D models.

This article is to provide you with the information you need to start developing your own 2D model in HEC-RAS. Because many engineers have some experience with 1D modeling, I will also discuss some of the differences between 1D and 2D hydraulic models.

What is a Hydraulic 2D Model?

There are several options for modeling a river. Back when calculations were done by hand, 0D (not spatially dependent) modeling was common. This is called level-pool routing. Today, people most engineers use 1D models to represent the flow through a river or channel. A 1D model involves laying out cross-sections along the river or channel. In addition, 2D modeling is becoming more popular as data retrieval becomes more practical and computers become more powerful. A 2D hydraulic model simply lays a mesh over the terrain data. The 2D hydraulic computations and the terrain representation determine where the water goes.

Although 2D modeling has grown in popularity recently, it has actually been around for a couple of decades. In the past, it was not widely used because it was very computationally intensive. Due to improvements in technology, this is no longer the case. It is still true that 2D hydraulic models will take much longer to run than 1D models, but the run times are much more reasonable than they were in the past.

Differences Between 1D and 2D Hydraulic Models

The images below illustrate the difference between 1D and 2D modeling. In both 1D and 2D models, the vertical direction (z) is assumed to be constant. While water levels in the “y” direction are assumed to be constant in 1D modeling, flow velocities and water depths can vary across channel widths in 2D models.

HEC-RAS performs 1D and 2D computations using the St. Venenat equations of Conservation of Mass and Conservation of Momentum. While 1D models solve the St. Venant equations along one dimension, a 2D model solves the St. Venant equations along two dimensions. For 2D modeling, HEC-RAS uses the diffusion wave equation by default because this simplification helps the model run faster. However, the user can force the program to use the full dynamic conservation of momentum equations. The difference between the two will be discussed in further detail in the Flow Data section.

Geometric Data Required for 1D and 2D Hydraulic Models

Similar to 1D models, 2D models require elevation data and data associated with hydraulic structures. However, this data takes different forms. The table below summarizes the geometric data required for 1D and 2D hydraulic models.

Data/Structure1D Models2D Models
Terrain DataSurveyed Station-Elevation Points for Cross-SectionsDigital Terrain Model
Terrain DiscretizationCross-Sections2D Mesh
BridgesYesYes
CulvertsYesYes
Inline Structures with GatesYesYes

Assumptions For 1D and 2D Hydraulic Models

The following table summarizes some of the assumptions used in 1D and 2D modeling. This table is a summary of information found in Chapter 12, Section 6 of the Colorado Floodplain and Stormwater Criteria Manual.

Property or Factor1D Models2D Models
Flow DirectionPrescribed (streamwise)Computed
Transverse Velocity and Momentum (“y” direction)Assumed to be constantComputed
Vertical Velocity and Momentum (“z” direction)Assumed to be constantAssumed to be constant
Velocity averaged over…Cross-SectionDepth at a point
Transverse Velocity DistributionAssumed to be proportional to conveyance Computed
Transverse Variations in Water SurfaceAssumed to be constantComputed
Vertical Variations in Water SurfaceAssumed to be constantAssumed to be constant
Eddy ViscosityNeeds to be included in the friction parameterModeled separately from friction parameter

When Should You Use a 2D Model?

Now that 2D modeling software is more widely available, you may be wondering when it is appropriate to build a 2D model. Like almost everything in engineering (and life), it depends.

Everything should be as simple as it can be, but not simpler.

Albert Einstein

When to Use a 1D Model

The following list describes some situations that warrant a 1D hydraulic model.

  • Streams/channels that have uni-directional flow and defined overbanks (e.g., canals or mountain streams).
  • If you have limited access to good terrain data, it may be better to use a 1D model for your project. Although 1D and 2D models depend on terrain data, you can more easily remove anomalies from 1D cross-sections.
  • Another important thing to keep in mind is time. It can take a long time (several hours) to run a 2D model. If your client needs a model quickly, it may be better to prepare a 1D model (especially if you have never done a 2D model).

When to Use a 2D Model

There are some topographic and hydraulic features that make 1D modeling difficult. Some of these features include an undefined boundary between channels and overbanks, unclear flow directions, high-gradient flow in off-channel storage areas, a flow direction that changes significantly with different stages, and river bends. Therefore, you should try to use 2D modeling for the applications listed below.

  • Urban areas
  • Wide floodplains
  • Areas where flow spreads such as in an alluvial fan
  • Dam-break studies
  • Areas near narrow bridges that cause significant expansion and contraction can be more accurately represented with a 2D model.

The lists above are just guidelines. Every project is different, and you will ultimately have to use your engineering judgment to determine what type of model is most appropriate. Also, remember that you can combine 1D and 2D elements into a 1D/2D HEC-RAS model.

HEC-RAS 2D Elements

Like a 1D model, a 2D model is HEC-RAS is comprised of various elements. Some of these elements are different from a 1D model (as discussed above). A 2D model must contain terrain data, 2D flow areas, and unsteady flow data. Unlike a 1D model, you must run the model as unsteady. There is no such thing as a steady 2D model. Like a 1D model, you can add hydraulic structures to a 2D model.

Terrain Data

The foundation of any hydraulic model is the terrain data. If your terrain data does not accurately represent the ground surface, it will not be an accurate model. In other words, “garbage in, garbage out.”

You can import your terrain data using RAS Mapper. The RAS Mapper supports many different formats. However, you have to convert the terrain layer to GeoTiff file using RAS Mapper. This is because the GeoTiff file format supports compression and pyramiding of the data which allows for smaller file sizes and faster visualizations. The image below shows the dialog box used to add terrain data. To add a terrain dataset, click the + button and navigate to the folder holding the terrain data. Then click “Create.”

HEC-RAS also allows you to combine multiple terrain models into one layer by specifying each dataset’s priority in the dialog box shown above. The terrain data with the highest priority should be listed first.

2D Flow Areas

Another important aspect of a 2D model is a computational mesh. A computational mesh can be structured or unstructured. The HEC-RAS program can handle a structured mesh or an unstructured mesh. A structured mesh is comprised of rectangular cells, and an unstructured mesh is comprised of cells that have an irregular shape. In HEC-RAS, the cells can be any shape, but each cell is limited to eight sides.

In HEC-RAS, the computational mesh is created using 2D Flow Areas. You define a 2D mesh by drawing a polygon to represent the outer boundary of the computational mesh. Then you specify the cell size.

Cell Size

The resolution of the 2D model grid will impact the results in that it will determine the scale of physical features and flow behavior. Cell size depends on a variety of factors including:

  • The spatial resolution of the topographic data;
  • The level of detail needed in the model outputs;
  • Run time; and,
  • Size of the study area.

I recommend starting out with larger cell size. This will help you identify issues quickly rather than running the model for eight hours before discovering a problem.

Table 10-2 of the Australian Rainfall-Runoff Project 15: Two Dimensional Modelling in Urban and Rural Floodplains document provides some guidance on cell size. This table is paraphrased below.

Modeling CaseTypical 2D Element Resolution
Flow in a channelIn order to adequately represent flow in a channel, you should orient at least 5 cells laterally across the channel.
Urban overland flowModels that represent urban flow should have smaller cell sizes/mesh resolutions. Table 10-2 recommends cell sizes between 2 m (6.6 ft) to 5 m (16.4 ft). In some cases, cell sizes up to 10 m (32.8 ft) are acceptable.
Rural floodplain flowModels depicting rural floodplains can have larger cell sizes than models representing urban areas. Cell sizes should be between 10 m (32.8 ft) and 50 m (164.0 ft). However, meshes can have a spatial resolution up to 200 m (656.2 ft) depending on the size of the study area and desired detail of the output data.
Lakes and EstuariesSituations that include open water often require less detail along the water boundary. In these cases, you can use a larger cell size and refine areas of interest. This is because the cell size for these models depends on the project requirements.
Flow over an embankmentEmbankments effectively function as weirs. Many 2D modeling packages have automatic or manually activated corrections that compensate for the error in head loss typically associated with modeling broad-crested weir flow with a shallow-wave 2D scheme. For practical purposes, a single 2D element is generally adequate to represent the impact of a levee, road, or railway embankment. In HEC-RAS, I recommend modeling weirs using a SA/2D Connection. Refine your mesh in such a way that the area around weirs/embankments has a small cell size.

It is important to note that when modeling areas where water surface and velocity change, you should use a small cell size. An example of this situation is a dam breach. Because flow changes quickly during a dam break, it can be difficult to prepare a stable model. A smaller cell size will minimize errors. It is important to note that you should transition from larger cell sizes to smaller cell sizes gradually in order to improve computational accuracy.

Common Mesh Error

HEC-RAS will show you mesh errors. Typically, these errors are associated with boundary cells having more than eight sides. You can correct these issues by moving cell centers, adding points, or deleting points. Do this by navigating to the Geometric Data Editor and clicking Edit. This will show the options to Move Points/Objects, Add Points, or Remove Points.

It is important to note that any edits you make to points will go away when you regenerate the mesh.

Breaklines

Breaklines are used to refine your computational mesh and force the cell faces to align along a specified line. They are a critical part of realistically representing flow through an area. You should put breaklines along with features such as roads, streams, and levees.

HEC-RAS allows you to draw breaklines by hand in the RAS Mapper. The image below shows illustrates how to draw a breakline in RAS Mapper.

You can also import breaklines as shapefiles using the RAS Mapper. This is particularly useful if you have GIS data for levees, roads, or streams in your study area. Just make sure your GIS data lines up with your terrain data.

HEC-RAS automatically tries to snap cell faces to the breakline when generating the mesh. However, this does not always work well. It is better to enforce the breaklines to the mesh using the “Enforce Selected Breakline” option which is shown below. Even after enforcing the breakline, you may still want to move the cells around to make sure the cells will be perpendicular to flow.

The last thing to note about breaklines is that you can specify a different cell sizing for breaklines. This allows you to refine the mesh in areas where you might need a smaller cell size.

Manning’s n

Like a 1D model, you account for roughness by assigning Manning’s n to different land cover types. However, it is important to understand that Manning’s n values used for 2D models should be different than the Manning’s n used for 1D models. In a 1D model, Manning’s n accounts for the following:

  • Friction losses associated with the bed material of the channel and/or floodplain;
  • Bend losses in a channel;
  • Variations in geometry; and,
  • Losses due to turbulence in a channel and/or floodplain due to cross-section geometry.

In a 2D model, some of the losses discussed above are accounted for by the numerical scheme.

The table below lists some typical Manning’s n values for 2D modeling. These values came from the Australian Rainfall and Runoff Revision Projects, Project 15: Two-Dimensional Modelling in Urban and Rural Floodplains (November 2012). Note that really high Manning’s n values can be used to simulate the lack of water conveyance at individual buildings.

Land Use TypeManning’s n Range
High-Density Residential0.2 – 0.5
Low-Density Residential0.1 – 0.2
Industrial/Commercial0.2 – 0.5
Open Pervious Areas, Minimal Vegetation (Grassed)0.03 – 0.05
Open Pervious Areas, Moderate Vegetation (Shrubs)0.05 – 0.07
Open Pervious Areas, Thick Vegetation (Trees)0.07 – 0.12
Waterways/Channels (Minimal Vegetation)0.02 – 0.04
Waterways/Channels (Vegetated)0.04 – 0.1
Concrete-Lined Channels0.015 – 0.02
Paved Roads/Parking Lots/Driveways0.02 -0.03
Lakes0.015 – 0.35
Wetlands0.05 – 0.08
Estuaries/Oceans0.02 – 0.04

You can assign a single Manning’s n value to each 2D area. However, you can assign Manning’s n values by land classification. This requires importing a shapefile into HEC-RAS.

Finally, you can assign Manning’s n regions directly in the Geometric Data Editor. These are used as an override of the base Manning’s n values and are convenient for calibration purposes. This is a quick way to test different Manning’s n values.

Hydraulic Structures

New versions of HEC-RAS now allow you to add hydraulic structures to your model. This can be accomplished using the SA/2D Connection element. The video below is a webinar from the Australian Water School that describes how to add hydraulic structures to a 2D model.

I also wrote this blog post which describes how to add a bridge or culvert to an HEC-RAS 2D model.

Flow Data

Once you have entered the geometric and unsteady flow date, you can begin compiling the unsteady flow calculation data. The unsteady flow computations in HEC-RAS are performed by a modified version of the UNET (Unsteady Network model) program. The unsteady flow simulation is a three-step process. First, the program reads the flow file. Then the unsteady program runs. HEC-RAS reads hydraulic property tables created by the geometric pre-processor as well as the boundary conditions. Finally, the program takes the flow and stages from the unsteady flow run and writes them to an HEC-DSS file.

An Unsteady Flow Analysis requires that you define the plan, select the relevant geometry file and unsteady flow file, enter a starting and ending date/time, and enter computation settings.

In your Unsteady Flow File, you will establish your boundary conditions and initial conditions. To create the Unsteady Flow File.

Boundary Conditions

Add boundary conditions by drawing lines in RAS Mapper as shown below. It is important to note that you can have multiple boundary condition lines for a given 2D Flow Area, but they cannot overlap with other boundary condition lines.

Boundary conditions are required at the upstream and downstream ends of the 2D Flow Area. You can enter a Flow Hydrograph, Stage Hydrograph, Rating Curve, or Normal Depth. Some boundary conditions can only be applied to the upstream end of the model. HEC-RAS will only highlight boundary conditions that you are allowed to use. The Unsteady Flow Data – Flow Boundary Conditions dialog box.

Initial Conditions

In addition to setting the appropriate boundary conditions, you must establish your initial conditions. The initial elevation for a 2D Flow Area can be left blank to simulate the area “starting dry.” You can also start with a constant water surface elevation by entering a value in the Initial Conditions Elevation box.

Alternatively, you can use a restart file to establish your initial water surface elevations. A restart file helps with instabilities that occur when transitioning from the automatically created initial conditions file to the first computed time step.

Diffusion Wave Equation vs. Full Momentum Equation

The calculations performed for 2D modeling are based on the shallow water equations. The shallow water equations are derived from the conservation of mass equations as well as the conservation of momentum equations. This is also known as the Navier-Stokes equations.

HEC-RAS allows the user to choose between two 2D equation options. The Diffusion Wave Equation is the default option because it allows for faster run times. However, the Diffusion Wave Equation is a simplified version of the Full Momentum Equation. Many situations can be accurately modeled with the 2D Diffusion Wave equation. Because users can easily switch between equation sets, each can be tried for any given problem to see if using the Full Momentum Equation is warranted.

The Full Momentum Equation is shown below which is based on Newton’s Second Law of Physics (conservation of momentum). Conservation of momentum can be simply described as the change in momentum (velocity) equal to the change in hydrostatic pressure gradient. The assumptions for this equation include incompressible flow, uniform density, and hydrostatic pressure.

For the Diffusion Wave Equation, the bottom friction is equal to the pressure gradient. The water surface slope is balanced by the friction slope. This means the local acceleration, advective acceleration, viscosity (turbulence), and Coriolis effect are not considered.

The Diffusion Wave approximation can be used to describe gradually varying flows in reaches with moderate to steep slopes. It accounts for backwater effects, but it does not appropriately simulate flow separations and eddies. The Diffusion Wave Equation should NOT used for the following:

  • Highly dynamic flood waves (i.e., dam breach/flash floods);
  • Abrupt contractions and/or expansions;
  • Tidally influenced conditions;
  • Wave run-up;
  • Superelevation around bends;
  • Detailed velocities and stages at structures;
  • Mixed flow regime simulations; and,
  • Main channel to overbank momentum transfer.

Time Step

The appropriate time step for your 2D model depends largely on the application. For example, many dam breach inundation models have a time step under one second. To estimate the appropriate time step, calculate the Courant Number.

As a rule of thumb, you calculated Courant Number should be under 3.0 when applying the Full Momentum Equation and under 5.0 when applying the Diffusion Wave Equation. If the modeled wave changes rapidly (like a dam breach), you should use a time step that results in a Courant Number closer to 1.0.

As you might expect, a smaller time step will result in longer run times. Similar to picking an appropriate cell size, choosing the right time step is a balance between accuracy and minimizing run time. Finding the right time step may take several iterations.

Steps to Creating a 2D HEC-RAS Model

Now that I have discussed the various components of a 2D hydraulic model, I will outline the basic steps for creating a 2D model. The steps for building a 2D Hydraulic Model in HEC-RAS are as follows:

  1. Set projection (RAS Mapper)
  2. Add background image if desired
  3. Create terrain data (RAS Mapper)
  4. Define boundary conditions and initial conditions
  5. Run Model
  6. View and Interpret the Results

Related Questions

What software has 2D modeling capabilities?

Other software programs that have 2D modeling capabilities include HEC-RAS, Flo-2D, TUFLOW, and MIKE.

What is the advantage of using HEC-RAS over other 2D modeling programs?

The advantage of using HEC-RAS over other 2D modeling programs is that HEC-RAS uses a sub-grid modeling approach. This means that HEC-RAS uses the underlying terrain to create hydraulic properties tables for cells and cell faces. Other 2D modeling programs assign each cell a flat bottom or single depth. In HEC-RAS, a stage-storage volume is calculated during pre-processing. In addition, graphics are drawn based on the underlying terrain data. This makes the data appear less “choppy.”

Leave a Comment