In 2D models, HEC-RAS simulates how water flows across a surface by dividing the terrain into a computational mesh (grid). Each cell in the grid represents a portion of the ground surface and stores hydraulic information, including water depth, flow velocity, and water surface elevation. Since these values depend on the terrain within each cell, the software uses a combination of 2D grid and subgrid bathymetry to improve accuracy. This approach allows finer terrain details to be represented within each grid cell.
At larger scales of river flow modeling, grid cells often simplify subgrid-scale boundary structures by representing them as uniform roughness values. These structures are treated as equivalent to grid cells, leading to a loss of spatial variation in surface roughness due to limitations in turbulence modeling. As a result, grid-scale representations focus on capturing the overall flow behavior across broad areas.
At smaller scales of river flow modeling, e.g., when analyzing flow around buildings, the user can simulate flow patterns around individual structural elements. However, modeling every boundary structure at such a fine resolution is often impractical.
This article explains how HEC-RAS performs 2D grid and subgrid computations to efficiently model floods while capturing detailed terrain features.
Grid and Dual Grid
In 2D flow areas, the grid is a network of rectangular or square cells laid over the terrain. The boundaries between cells are known as cell faces. These faces act as the connection points through which water flows from one cell to another. During the simulation, the software calculates flow across each face by comparing the water surface elevations of the two adjacent cells. The greater the difference, the more water tends to flow in that direction.
To support accurate and efficient hydraulic calculations, HEC-RAS uses a dual grid system:
- The primary grid consists of user-defined mesh cells.
- The dual grid is formed along the cell faces.
Each cell face in the dual grid serves as a virtual cross section, where the software applies subgrid terrain data to compute flow area, wetted perimeter, hydraulic radius, and conveyance. This dual-grid framework allows the software to simulate the hydraulic connectivity of the terrain more realistically than models relying solely on uniform or planar cells.
In the image below, grid nodes and edges are represented by dots and solid lines, while dual grid nodes and edges are shown as crosses and dashed lines.
From the mathematical point of view, sometimes the primary grid is extended with a cell “at infinity” and similarly, the dual grid is extended with a node “at infinity.” With these extra additions, the grid and its dual have some interesting properties. For example, the dual edges intersect the regular edges, and the two groups are in a one-to-one correspondence. Similarly, the dual cells are in one-to-one correspondence with the grid nodes, and the dual nodes are in one-to-one correspondence with the grid cells.
However, in the context of a numerical simulation, extending the grid to infinity is impractical. Therefore, the dual grid is truncated by adding dual nodes at the center of the boundary edges and dual edges along the boundary joining the boundary dual nodes. The one-to-one correspondences of the infinite model do not carry over to the truncated model, but some slightly more complex relations can be obtained. For example, the dual nodes are now in one-to-one correspondence with the set of grid cells and grid boundary edges. For this reason, the boundary edges are set up as a sort of topological artificial cell with no area, which are extremely useful when setting up boundary conditions.
Subgrid Bathymetry
Modern advances in the field of airborne remote sensing can provide very high-resolution topographic data. In many cases, the data are too dense to be practically used directly as a grid for the numerical model. This situation presents a dilemma whereby a coarse computational grid must be used to produce a water simulation, but the fine topographic features should be incorporated into the computation.
The solution to this problem is the use of a subgrid bathymetry approach. Each computational grid cell contains additional pre-computed information, such as hydraulic radius, volume, and cross sectional area from the fine bathymetry. Though the high-resolution details are lost, there is enough information available so that the numerical method can account for the fine bathymetry through mass conservation. This approach is effective for many applications because the water surface is smoother than the bathymetry. Therefore, a coarser grid can effectively be used to compute spatial variability in free surface elevation.
In the image below, the fine grid is represented by the Cartesian grid in gray, and the computational grid is shown in blue.
Subgrid Bathymetric Approach to Terrain Surface Discretization
HEC-RAS, like many 2D hydraulic models, performs the calculation from cell center to cell center (i.e., from cell computation point to cell computation point). However, momentum is determined at the cell faces, which are defined by cutting from the terrain with irregular geometry at the cell face based on the underlying terrain. Each cell also contains a detailed elevation–volume relationship, created directly from the underlying terrain.
This means that flow entering or leaving a cell along with its momentum is shaped by both the internal volume of the cell and the specific terrain where the flow crosses the cell boundaries. The irregular geometry at these faces affects how velocity, pressure gradients, and momentum are computed, leading to a more realistic simulation of hydraulic behavior.
By incorporating these terrain details, the software can identify preferential flow paths across the grid and apply wetting only to portions of a cell that falls below the calculated water surface at a given time step. These subgrid details help guide the flow more precisely, influence the direction and magnitude of velocity vectors, and improve the accuracy of intercell momentum transfer based on features like cell face shape and the effective distance between cells, as shown in the example below.
Many 2D models simplify the terrain representation by assigning each cell a single average elevation or as a sloped triangular or rectangular surface, and the cell faces are flat or sloped surfaces. This simplification means that finer grids with smaller cells are required to capture the same level of detail, volume variation, and face velocity that HEC-RAS can achieve using subgrid terrain data. Additionally, when a model represents a cell with a single elevation, the cell is considered either fully wet or fully dry at any given time, which reduces the accuracy of partial cell wetting and flow routing through complex terrain.
The use of detailed terrain data in hydraulic computations allows for a more accurate momentum solution, as it avoids oversimplifying conditions at the cell faces and can capture preferential flow paths into and out of each cell. This approach makes it possible to use larger cells while still producing results comparable to models that represent each cell with a single elevation or a simplified planar surface.
Comparing two models using the same number of cells is only meaningful when evaluating computational speed, not when assessing how accurate the simulation is. A fair comparison should focus on how effectively each model represents terrain in its hydraulic calculations. If HEC-RAS can produce an equal or more accurate result with fewer cells, then performance comparisons should be based on equivalent terrain representation in the hydraulic computations, not simply on the number of cells or their nominal size. Focusing solely on running time with a limited number of elements can be misleading and ignores the advantages provided by incorporating subgrid terrain detail into both cells and cell faces.
Why Subgrid Computation Is Important
Without subgrid bathymetry, important terrain details can be lost within a coarse grid. For example, a 100 ft wide road embankment might disappear in the average elevation of a large cell, causing the model to incorrectly allow water to pass through it.
Subgrid modeling helps preserve terrain details by:
- Maintaining the effect of narrow features such as ditches, berms, or levees.
- Producing more accurate water surface elevations and flow velocities.
- Reducing the need for overly fine meshes that increase simulation time.
