Coupling HEC RAS and MODFLOW Using OpenM
Coupling HEC RAS and MODFLOW Using OpenM
Coupling HEC RAS and MODFLOW Using OpenM
1 2 1 3 4
Jon Fenske , Edward R. Banta , Steven Piper , Gennadii Donchyts , E.J. Wexler
1
USACE Hydrologic Engineering Center, jon.p.fenske@usace.army.mil, steven.piper@usace.army.mil
Davis CA, USA
2
U.S. Geological Survey, erbanta@usgs.gov, Denver CO, USA
3
Deltares, gennadii.donchyts@deltares.nl, Delft, Netherlands
4
Earthfx Inc, ejw@earthfx.com, Toronto Ontario, Canada
ABSTRACT
Efficient coupling of the river hydraulics model HEC-RAS and the groundwater flow model MODFLOW in
conjunction with a graphical interface provides a much needed, non-proprietary tool for simulating
surface-water/groundwater interaction. RAS-MODFLOW provides a set of physically based simulation
capabilities not available in either stand-alone model. The open-source OpenMI library was used to
facilitate data exchange between HEC-RAS and MODFLOW. Data represented on different geometries
(such as lines and polygons) are mapped and exchanged at the time-step level. Two formulation options
were developed for simulating water exchange. The linked system supports iteration over one or more
time steps, moderating and monitoring exchanged data until a tolerance criterion is satisfied. HEC-RAS
and MODFLOW were enhanced to save and restore model states (hydraulic heads and stresses) as
needed for iteration.
INTRODUCTION
Past integrated surface water and groundwater models vary greatly in their level of complexity, ranging
from research-level, fully coupled models that simultaneously solve the surface water/unsaturated and
saturated flow equations (e.g. HydroGeoSphere, Therrien, et al., 2004) to models that treat one of the
systems in an oversimplified manner. An intermediate approach is to couple two widely-accepted
surface-water and groundwater models and thereby benefit from user familiarity. For example,
MODBRANCH (Swain and Wexler, 1993) couples the U.S. Geological Survey river hydraulics model
BRANCH (Schaffranek et al., 1981) with the 1988 version of MODFLOW (McDonald and Harbaugh,
1988). MODNET (Walton et al., 1999) couples the U.S. Army Corps of Engineers unsteady river
hydraulics model UNET (Barkau, 1995) with the 1996 version of MODFLOW (Harbaugh and McDonald,
1996).
Both MODBRANCH and MODNET use river-hydraulics and groundwater models that were developed in
the 1980’s or mid-1990’s. The goal of the current study is to couple the U.S. Army Corps of Engineers
River Analysis System, HEC-RAS (U.S. Army Corps of Engineers Hydrologic Engineering Center, 2010)
and MODFLOW-2005 (Harbaugh, 2005). In developing the linkage between HEC-RAS and MODFLOW,
a number of specific technical and operational issues were addressed. These included: (1) facilitating
data exchange in a manner that allows for the independent evolution of codes; (2) formulating leakage
terms using numerical schemes that will be stable, will conserve mass, and will be widely applicable; (3)
allowing for flexible time stepping in both the hydraulics and groundwater-flow models; and (4) spatial and
mapping issues.
OPENMI AND RAS-MODFLOW
OpenMI is open-source, non-proprietary software that can be used to develop integrated models in a
spatio-temporal domain. Model components that comply with OpenMI can be configured to exchange
data on a time-step basis. OpenMI can be used to perform various data-exchange and transformation
tasks required during model execution. OpenMI allows for variable time steps and provides algorithms for
mapping exchange of data associated with lines and polygons over a grid.
Surface-water/groundwater (SW/GW) exchange rates are calculated using average channel stage
between cross-sections determined by HEC-RAS and length-weighted groundwater heads in underlying
cells calculated by MODFLOW. RAS-MODFLOW provides two options for formulating exchange of water
between a HEC-RAS model and a MODFLOW model. The underlying difference between the two
options is the selection of which model is to compute the surface water-groundwater exchange. Both
models calculate this exchange in the same way, based on stage in the river, hydraulic head in the part of
the groundwater system underlying the river, river bed bottom elevation, and hydraulic conductance of the
river bed. The exchange flow rate is calculated as represented in either equation 1a or 1b, depending on
elevation of the calculated head relative to the river bed bottom elevation:
Q = C(S-H) when H ≥ RBOT (1a)
Q = C(S-RBOT) when H < RBOT (1b)
where Q is the exchange flow for the reach, C is the hydraulic conductance of the river bed of the reach,
S is the stage in the river reach, H is the hydraulic head in the groundwater system underlying the river
reach, and RBOT is the elevation of the river bed bottom. Hydraulic conductance of the river bed for a
given reach typically is conceptualized as:
C = KLW/M (2)
where K is the hydraulic conductivity of the river bed material, L is the length of the reach, W is the width
of the reach, and M is the thickness of the low-permeability river bed.
In the first option, the heads are passed from MODFLOW to HEC-RAS, HEC-RAS calculates the time-
averaged SW/GW exchange flow rates, the flow rates are passed to MODFLOW, and MODFLOW adds
the exchange flows as source or sink terms to the groundwater flow equation. In the second option, river
stages, conductances, and bed bottom elevations are passed from HEC-RAS to MODFLOW, MODFLOW
calculates the time-averaged SW/GW exchange flow rates, and the flow rates are passed back to HEC-
RAS.
To support linking by OpenMI, a model needs to be structured such that the simulation can be executed
one time step at a time, where the execution of each time step is externally invoked. MODFLOW’s main
program unit was restructured into several functions to support this requirement, including:
Initialize, which calls subroutines that read data that apply to the entire simulation.
PerformTimeStep, which calls subroutines that need to be invoked at each time step; these
subroutines include those that iteratively formulate and solve the finite-difference equation of
groundwater flow. If a time step is the first time step in a new stress period,
PrepareNextStressPeriod is invoked.
PrepareNextStressPeriod, which calls subroutines for all packages that read data for each
stress period.
Finalize, which calls subroutines that write final output and deallocate memory.
The restructuring replaces only the main program unit of MODFLOW; subroutines belonging to individual
packages of MODFLOW were unchanged.
When the first formulation option is used, GW/SW flows calculated by HEC-RAS and mapped by OpenMI
to the MODFLOW model grid need to be accepted by MODFLOW and incorporated as sources or sinks in
the groundwater flow equation. The Link Source Array (LSA) Package was developed to support this
need. LSA does not read flow data from input files. Instead, its array of flows is expected to be
populated by calls from the MODFLOW wrapper function that supports OpenMI’s SetValues method
(OpenMI Association, 2007). Otherwise, implementation of MODFLOW’s various procedures (Harbaugh,
2005) by the LSA Package is similar to that of MODFLOW’s Recharge Package.
When the second formulation option is used, HEC-RAS river reaches are mapped to a list of head-
dependent boundaries in MODFLOW. The Link External River (LXR) Package was developed to
accommodate these boundaries. The LXR Package functions like MODFLOW’s River Package
(Harbaugh, 2005), except that arrays of the LXR Package are populated with data transmitted from HEC-
RAS through OpenMI. When the LXR Package is used, SW/GW exchange flow rates are calculated as
part of the solution of the groundwater flow equation and then passed back to HEC-RAS.
Implementation of iteration between models over an interval of simulation time under the control of an
iteration controller (OpenMI Association, 2007) requires that a model be able to store its state at a given
simulation time, execute one or more time steps, and then, as needed, restore its state to the stored state
and simulation time and resume simulation from the stored time. Program units and data arrays were
developed to enable MODFLOW to store variable values and simulation times and to restore itself to a
previous state and simulation time. When PerformTimeStep is next invoked following restoration of the
state to an earlier, stored simulation time, simulation starts from the stored time.
HEC-RAS was restructured to be OpenMI compliant. In addition to the changes needed to allow HEC-
RAS to perform one time step at a time, the program was modified to expose different data types for input
or output from a given HEC-RAS model.
The OpenMI version of HEC-RAS was changed to allow OpenMI (through the model wrappers) to control
a HEC-RAS simulation. These changes relate to: loading a data set and returning information specific to
that HEC-RAS model, taking and providing input and output to OpenMI, performing one time step at a
time, saving the current state of a model run and then restoring that state as part of the OpenMI iterations
between RAS-MODFLOW, writing the HEC-RAS output, and closing and cleaning files as part of the
OpenMI finish command.
Various input and output exchange items needed to support the RAS-MODFLOW connection were added
including: SW/GW exchange rate, groundwater hydraulic-head elevation, and river bed conductance.
Additional variables not directly needed for the RAS-MODFLOW connection also were added, including
water-surface altitude and flow at a river cross section.
For the computation of SW/GW exchange for a normal (non-OpenMI) simulation, HEC-RAS first
computes a conductance based on the length and width of the river section, hydraulic conductivity, and
bed thickness. Next, it computes the actual flow using the groundwater head that was entered as part of
the unsteady flow data. For a RAS-MODFLOW simulation, where HEC-RAS is calculating the SW/GW
exchange, the computations are done in the same manner except that the time-series groundwater head
values are replaced by values that come from MODFLOW through OpenMI. If MODFLOW is determining
the exchange, then HEC-RAS computes the conductance in the normal manner, passes conductance
through OpenMI to MODFLOW, and receives the MODFLOW-calculated SW/GW exchange.
ITERATION
When models are linked using OpenMI, the linkage is explicit in that each model solves its own set of
equations based on variable values that apply to the beginning of a time interval, which may consist of
one or more time steps, and returns variable values that apply to the end of the time interval (if the return
variable represents head) or to the time interval as a whole (if the return variable represents SW/GW
exchange flow). Depending on the choice of the simulation time interval between the exchange of data,
the solution can be unstable or can produce inaccurate results. Shortening this time interval can help
address this problem. Alternatively or in addition, use of iteration and damping of the changes in values
being passed can be an effective approach. The OpenMI documentation (OpenMI Association, 2007)
outlines the use of an iteration controller as a way to implement iteration. The purpose of an iteration
controller is to iteratively execute the models for a specified iteration time step and modify exchanged
data by applying a damping factor to data-value changes until a specified convergence criterion (or
criteria) is reached.
An iteration controller component was developed for RAS-MODFLOW. When the iteration controller is
used, it operates between HEC-RAS and MODFLOW. The linked model can be specified to converge to
changes in either heads or flows, depending on the selected linking formulation. When the linked RAS-
MODFLOW system executes, the iteration controller signals the models to save their respective model
states at the beginning of an iteration time step, causes the models to execute model time steps as
needed to simulate the iteration time step, and stores the head or SW/GW exchange flow values passed
between models. On subsequent executions of the iteration time step, the head or flow values are
compared to values from the previous iteration, and a damping factor is applied to the changes. Iteration
continues until the specified convergence criterion is met.
SUMMARY
REFERENCES
Barkau, R.L., 1995, UNET- One-dimensional unsteady flow through a full network of open channels: U.S.
Army Corps of Engineers, Hydrologic Engineering Center, Davis, CA, Report CPD-66.
Harbaugh, A.W., 2005. MODFLOW-2005, the U.S. Geological Survey modular ground-water model—the
ground-water flow process: U.S. Geological Survey Techniques and Methods, bk. 6, chap. A16,
variously paginated, available at http://pubs.er.usgs.gov/usgspubs/tm/tm6A16.
Harbaugh, A. and M. McDonald, 1996, User’s Documentation for MODFLOW-1996, an update to the U.S.
Geological Survey modular finite-difference ground-water flow model, U.S. Geological Survey
Open-File Report 96-485.
McDonald, M. and A. Harbaugh, 1988. A modular three-dimensional finite-difference ground-water flow
model, U.S. Geological Survey Techniques of Water-Resources Investigation Book 6-A1.
OpenMI Association, 2007. Part B—Guidelines for the OpenMI (version 1.4): OpenMI Document Series,
Butford Technical Publishing Ltd., Pershore, UK, 41 p., accessed 3/9/2011 at:
http://public.wldelft.nl/display/OPENMI/OpenMI+documentation+index.
Schaffranek, R.W., Baltzer, R.A., and Goldberg, D.E., 1981. A model for simulation of flow in singular and
interconnected channels: Book 7, Chap. C3, Techniques of Water Resources Investigations, U.S.
Geological Survey, Denver, Colo., 110 p.
Swain, E. and E.J. Wexler, 1993. MODBRANCH: A coupled surface-water and ground-water model for
simulation of stream-aquifer interaction, U.S. Geological Survey Open-File Report 92-138.
Therrien, R., R.G. McLaren, E.A. Sudicky and S.M. Panday, 2004. HydroGeoSphere: A three-
dimensional numerical model describing fully integrated subsurface and surface flow and solute
transport, Manual, HydroGeoLogic Inc., Herndon, VA.
U.S. Army Corps of Engineers Hydrologic Engineering Center, 2010. HEC-RAS River Analysis System,
User’s Manual 4.1, USACE Hydrologic Engineering Center Computer Program Documentation 68,
790 p., available at: http://www.hec.usace.army.mil/publications/pub_download.html
Walton, R., Wexler E.J., and R.S. Chapman, 1999. MODNET: An integrated groundwater/open channel
flow model, WEST Consultants, Inc. and Gartner Lee Ltd., developed for South Florida Water
Management District, West Palm Beach, FLA.