MODFLOW Lecture 1 v1.5
MODFLOW Lecture 1 v1.5
MODFLOW: an introduction
v.1.5 released on 20/09/2019
FREEWAT - Free and Open Source Software Tools for Water Resource Management
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant
agreement No 642224
DATA LICENSES
FREEWAT - Free and Open Source Software Tools for Water Resource Management
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant
agreement No 642224
Overview of MODFLOW
1
MODFLOW
Documentation and reading
2
MODFLOW
Documentation and reading
3
Keep up-to-date
4
Scroll Down to
http://water.usgs.gov/ogw/modf
low/MODFLOW-2005-Guide/ 5
6
And the new MODFLOW-OWHM
One Water Hydrologic flow Model
7
Online MODFLOW Manual
http://water.usgs.gov/nrp/gwsoftware/modflow2000/MFDOC/guide.h
tml
ESSENTIAL BOOKMARK!
**Note you can download this to your computer and use it off line,
but it will not be updated unless you download and replace it
8
9
What is MODFLOW?
Widely used ground-water flow simulation program that runs on any
platform (Windows, Sun, Unix, Linux,…).
11
What is MODFLOW?
What is MODFLOW-2005?
•Packages allow
•examination of specific hydrologic features independently
•facilitates development of additional capabilities
17
MODFLOW development
18
Original modular structure (1988)
•BAS - basic package
•general tasks - gridding, constant head and no-flow boundaries, initial conditions,
time stepping
•OC - output control package
•controls the information and format of results
•BCF - block centered flow package
•layer types, grid dimensions, material properties
•WEL - well package
•locations and flow rates of wells
•RCH - recharge package
•recharge rates and locations
•RIV - river package
•locations, river bed material properties, and river stages
•DRN - drain package
•location, material properties surrounding drains, and elevation of drains
•EVT - evapotranspiration package
•parameters describing evapotranspiration rate with depth to water table
•GHB - general head boundary package
•locations, local material properties, and elevation of specified heads
•SOLVERS
•SIP - strongly implicit procedure package
•SOR - slice-successive over-relaxation package
19
Packages written after original MODFLOW
•PCG2 - preconditioned conjugate-gradient 2 package
•alternative matrix solver
•STR1 - stream routing package
•differs from the river package in that the surface water stage varies based on the
surface water flow and the Manning equation
•BCF2 - block-centered flow 2 package
•allows for re-wetting of cells that have gone dry
•BCF3 - block-centered flow 3 package
•a supplement to the BCF2 package, allowing alternative interblock transmissivity
formulations
•HFB1 - horizontal flow barrier package
•simulation of thin, vertical, low permeability features that impede horizontal flow
•TLK1 - transient leakage package
•simulates transient leakage and storage changes in confining units of quasi-3D
models
•GFD1 - general finite difference flow package
•substitutes for the BCF package, allows user to enter conductance rather than
calculating with MODFLOW
•IBS1 - interbed storage package
•simulates compaction of compressible, fine-grained units within or adjacent to
aquifers in response to pumping
•CHD1 - time-variant specified head boundary package
•allows time varying specified head 20
Packages written for MODFLOW-2000
and since
•rapidly growing long list
•earlier packages are listed here,
•refer to the
•USGS MODFLOW and related programs web page, OR
•use the USGS OnLine Guide for MODFLOW
GWF1 - ground water flow process (GWF in name file) finite difference simulation
of saturated porous media flow
OBS1 - observation process (OBS in name file) monitors value of head or flow at
specified locations
SEN1 - sensitivity process (SEN in name file) calculates the change in simulated
head and flows at observation locations PES1
- parameter estimation process (PES in name file) estimates values of
parameters by nonlinear regression to minimize the weighted sum of
squared residuals for observations
DIS - discretization package (DIS in name file) gridding, defining division of space
and time for the numerical solution
MULT - multiplier file (MULT in name file) defines the spatial distribution of
multipliers in the grid that act on parameter values specified in those
zone 21
Packages written for MODFLOW-2000
and since
ZON - zone file (ZONE in name file) defines the spatial distribution of zones in
the grid where specified parameters apply
BAS6 - basic package (BAS6 in name file) constant head and no-flow boundary
conditions; and initial conditions
OC - output control package (OC in name file) controls the information and
format of results
BCF6 - block centered flow package (BCF6 in name file) defines material
properties with some parameters being dependent on grid
dimensions (e.g. transmissivity), thus this package ignores the
discretization information in DIS for some purposes -- the parameter
method of inputting data cannot be used -- method of interblock
conductance calculations can be selected
LPF1 - layer property flow package (LPFin name file) an alternative to BCF6
defines material properties with all parameters independent of grid
dimensions (e.g. hydraulic conductivity) -- the parameter method of
inputting data can be used -- method of interblock conductance
calculations can be selected
HFB6 - horizontal flow barrier package (HBF6 in name file) represents thin
barriers that occur between model cells by defining their hydraulic
conductivity divided by their thickness and specifying where they
occur 22
Packages written for MODFLOW-2000
and since
WEL6 - well package (WEL in name file) locations and flow rates of wells
RCH6 - recharge package (RCH in name file) recharge rates and locations
RIV6 - river package (RIV in name file) locations, river bed material properties,
and river stages
STR6 - stream routing package (STR in name file) differs from the river package in
that the surface water stage varies based on the surface water flow
(calculated as specified flow and ground water flux to/from stream) and
the Manning equation
DRN6 - drain package (DRN in name file) location, material properties
surrounding drains, and elevation of drains (this update allows a fraction
[0-1] of the drain outflow to be returned to a specified cell)
EVT6 - evapotranspiration package (EVT in name file) parameters describing
evapotranspiration rate with depth to water table
GHB6 - general head boundary package (GHB in name file) locations, local
material properties, and elevation of specified heads
CHD6 - time-variant specified head boundary package (CHD in name file) allows
time varying specified head
23
Packages written for MODFLOW-2000
and since
SOLVERS (SIP SOR PCG DE4 LMG in name file)
SIP5 - strongly implicit procedure package
SOR5 - slice-successive over-relaxation package
PCG2 - preconditioned conjugate gradient package
DE45 - direct solution by alternating diagonal ordering package
LMG1 - multigrid solver speeds execution for large grids and high
degree of heterogeneity
ADV2 - advective transport observation package (ADV2 in name file) allows use
of travel time observations for parameter observations
RES1 - reservoir package (RES in name file) simulates leakage between
reservoir and aquifer as reservoir area changes in response to stage
changes
FHB1 - flow and head boundary package (FHB in name file) allows flow and
head boundary conditions that vary at times other than starting and
ending times of stress periods
IBS6 - interbed storage (subsidence) (IBS in name file) simulates compaction
related to hydraulic head decline
HUF1 - hydrologic-unit flow package (HUF in name file) calculates effective
hydraulic properties for cells based on geometric description of
hydrologic units 24
Packages written for MODFLOW-2000
and since
LAK3 - lake package (LAK in name file) allows variation of lake stage based on
water budgets
ETS1 - evapotranspiration package with segment ET function (ETS in name file)
allows function describing evapotranspiration rate with depth to water
table to be piece-wise linear
DRT1 - drain package with return flows (DRT in name file) allows user to allocate
proportions of drain flow to be recharge to specified cells
LMT6 - link to MT3D (LMT in name file) allows printing of file to be read by
MT3D for contaminant transport
SFR - Streamflow-Routing package (SFR in name file) is used to simulate streams
in a model (provides greater flexibility in how streams are specified than
STR)
UZF - Unsaturated Zone Flow Package (UZF in name file) simulates vertical flow
of water through the unsaturated zone to the saturated zone
25
Basic MODFLOW input and output
BASIC INPUT ITEMS INCLUDE:
Grid
Time stepping
Hydraulic parameters
Boundary Conditions
Stresses
Solution parameters
The NAME file specifies the names of the input and output
files used for a MODFLOW simulation, associates each file
name with a FORTAN unit number, and identifies the
packages that will be used in the model.
27
MODFLOW basics:
the Finite-Difference method
For complex systems and boundary conditions, there are no analytical solutions
to the groundwater-flow equation, and numerical methods are needed.
MODFLOW uses finite-difference methods.
User
- DISCRETIZE modeled area into N grid cells
- Assign aquifer properties to each grid cell
- Assign boundary conditions
MODFLOW
- Set up finite-difference solution to the GROUNDWATER-FLOW
EQUATION for each grid cell (N EQUATIONS)
- Either H or Q will be KNOWN at each block N UNKNOWNS
- SOLVE for H or Q in all blocks using matrix algebra and
iterative solutions
h h h h
bK x bK y bK z Ss W ( x, y, z, t )
x x y y z z t
28
The Finite-Difference grid
Complex geologic material distributions are simplified.
Physical aquifer properties likely vary within and between layers.
Square or rectangular grid cells arranged in rows and columns.
Active (closed circle) and inactive cells (open circles).
• Mesh-centered
• Block-centered
• Easier math for boundaries
• MODFLOW
30
MODFLOW: defining layers
• Layer Representation Options
• Constant layer thickness /variable properties
• Expedites modeling
• Rough approximation
• Compatibility with another function
31
MODFLOW: defining layers
• One layer
• layer represents a single
hydrostratigraphic unit or aquifer
• Quasi-3D
• Hydrogeologic units horizontal
• Leakance
• Fully 3D
• Dipping units
• Aquifers and confining units explicit 32
MODFLOW: grid orientation
• Grid drawn on an overlay of a map of the area to be
modeled
Discretize Time
35
MODFLOW: discretize time
36
Flow model creation: time
Steady state
– Inputs = outputs. No change in storage
– No time dimension: easier to visualize
– Errors in model setup more clear in results
Transient
– Requires (often steady-state) initial conditions
– Requires a value for storage
– Stresses are defined using stress periods (time interval of input)
– Each stress period is divided into time steps (time interval of head
calculation).
• TIME
• Easy to test smaller time steps
• Stress periods require recompiling stress data (may be time
consuming) and updating any packages with stresses specified
•SPATIAL
• Unless you have an automated grid generator / input file creator,
then the time requirements and logistics of rebuilding the model
with smaller cell sizes renders the task unreasonable
• Important to use smaller grid sizes from the beginning of
numerical model development because you will never be able to
test this issue.
• In reality, few if any modelers check this.
38
Solving the Finite-Difference equations
The finite-difference equations for head are solved for each grid cell in
a model resulting in a matrix of equations to be solved.
Direct solutions used rarely because the problems we solve are large
and require direct solutions of the entire matrix with available
computer memory.
39
Finite-Difference solution
ITERATIVE SOLVER – Iterative (approximate) solution of equations starting from
initial conditions
Iterative solvers begin from an input initial condition (initial head at n=0) and
repeatedly approximate (iterate) the solution to the matrix, until there is very
little change from the previous approximation and the solution converges.
Often the code provides the user the opportunity to specify an acceleration or
relaxation (two terms for the same variable) parameter to speed up or stabilize
the convergence process. Occasionally a particular solver requires specific input
items and you will need to carefully read the manual to understand the options,
but nearly all solvers require a tolerance and relaxation. 40
Finite-Difference solution
41
Finite-Difference solution
For example, a user may specify a tolerance for head change between
iterations that is smaller than the precision of the computer ... this
tolerance could never be met but the solution would be very precise. In
a case like this, it is usually desirable to increase the tolerance so that
the problem converges to avoid the unfounded concerns of those who
feel uncomfortable with the words "did not converge!" In reality the
solution will not be any better. One could simply look at the model
output to see how much head change occurred for the last iteration
and use a value just slightly larger. Then the solution would be identical
but the output would say "solution converged!"
42
Finite-Difference solution
43
Acceleration or Relaxation
If progress toward convergence is proceeding too slowly, use a factor larger than
one. If progress toward convergence is over shooting the answer (maximum head
change alternates sign with each iteration), use a factor less than one.
Typically the maximum head change varies in location. A good code will report the
node at which the maximum occurred. If your model is not converging efficiently, it
can be useful to note where the maximum head change is occurring. Sometimes
evaluation of your input will reveal that you have a "typo", for example you may
have typed the exponent on a hydraulic conductivity incorrectly resulting in a large
contrast of conductivity between adjacent cells, or you may have added an extra
"0" to a boundary head for one cell causing a huge influx at one cell. 44
Example excerpt from
BEGINNING OF SIMULATION MODFLOW output
SOLVING FOR HEAD
ITER: 0 RES: 2.5980E+07 CFAC: 1.000
ITER: 1 RES: 1.8517E+06 CFAC: 0.071
ITER: 2 RES: 4.9647E+05 CFAC: 0.268
ITER: 3 RES: 9.6388E+04 CFAC: 0.194
ITER: 4 RES: 2.0855E+04 CFAC: 0.216
ITER: 5 RES: 5.9308E+03 CFAC: 0.284
---------------------------------------------------------
PCG ITERATIONS : 5
DAMPING : 0.5662E-07
L2-NORM OF RESIDUAL : 5.9308E+03
MAX HEAD CHANGE : 1.7661E+07
MAX HEAD CHANGE AT (COL,ROW,LAY) : ( 24, 110, 12)
---------------------------------------------------------
..
.
.LATER TIME IN SIMULATION
ITER: 0 RES: 8.6464E+02 CFAC: 1.000
ITER: 1 RES: 7.0492E+01 CFAC: 0.082
---------------------------------------------------------
PCG ITERATIONS : 1
DAMPING : 0.1000E+01
L2-NORM OF RESIDUAL : 7.0492E+01
MAX HEAD CHANGE : 8.5938E-01
MAX HEAD CHANGE AT (COL,ROW,LAY) : ( 11, 49, 6)
---------------------------------------------------------
-------------------------------
TIME STEP : 5
STRESS PERIOD : 2
GMG CALLS : 4
PCG ITERATIONS : 4
------------------------------- 45
TOTAL PCG ITERATIONS : 17880
Mass balance – another consideration
for convergence
ULTIMATELY THE SOLUTION MUST CONSERVE MASS
Although your conceptual model may be based on a balanced hydrologic
budget, the numerical model will have mass imbalances if the heads are
not calculated accurately. The fluxes will be based on gradients between
cells. If the heads are not accurate, the gradients will produce
inconsistent fluxes, thus the inflows and outflows (note that flow into
storage is an outflow and flow in from storage is an inflow) will not
balance.
47
Example excerpt from
MODFLOW output
VOLUMETRIC BUDGET FOR ENTIRE MODEL AT END OF TIME STEP 5 IN STRESS PERIOD 16
------------------------------------------------------------------------------
CUMULATIVE VOLUMES L**3 RATES FOR THIS TIME STEP L**3/T
------------------ ------------------------
IN: IN:
--- ---
STORAGE = 61384087785.7633 STORAGE = 5644891.4979
CONSTANT HEAD = 0.0000 CONSTANT HEAD= 0.0000
WELLS = 0.0000 WELLS= 0.0000
DRAINS = 0.0000 DRAINS= 0.0000
RIVER LEAKAGE = 105133899486.2039 RIVER LEAKAGE = 3559330.3534
HEAD DEP BOUNDS = 0.0000 HEAD DEP BOUNDS= 0.0000
RECHARGE = 2.7380E+12 RECHARGE = 7194487.6472
SPECIFIED FLOWS = 0.0000 SPECIFIED FLOWS = 0.0000
STREAM LEAKAGE = 69744176600.6383 STREAM LEAKAGE= 1955526.7305
ET SEGMENTS = 0.0000 ET SEGMENTS = 0.0000
MNW = 321347679.5662 MNW = 47991.3395
TOTAL IN = 2.9746E+12 TOTAL IN = 88402227.5684
OUT: OUT:
---- ----
STORAGE = 42534787126.9181 STORAGE = 729950.6762
CONSTANT HEAD= 0.0000 CONSTANT HEAD = 0.0000
WELLS = 40637515208.1547 WELLS = 17999510.6501
DRAINS = 16552965696.6484 DRAINS = 373047.8186
RIVER LEAKAGE= 13184784416.5005 RIVER LEAKAGE = 975905.1566
HEAD DEP BOUNDS=18640052988.0677 HEAD DEP BOUNDS = 399313.7562
RECHARGE= 0.0000 RECHARGE = 0.0000
SPECIFIED FLOWS= 55214439264.0000 SPECIFIED FLOWS = 1219104.0000
STREAM LEAKAGE=725689791735.0275 STREAM LEAKAGE = 7224961.1519
ET SEGMENTS = 1.8580E+12 ET SEGMENTS = 48937653.1254
MNW = 4123872601.1030 MNW = 541647.0605
TOTAL OUT = 2.9746E+12 TOTAL OUT = 88401093.3958
IN - OUT = 10027659.6802 IN - OUT = 1134.1726
PERCENT DISCREPANCY = 0.00 PERCENT DISCREPANCY = 0.00 48
Mass balance – another consideration
for convergence
SOMETIMES A LARGE MASS BALANCE IS NOT A PROBLEM:
For example, if there is a large imbalance for an early time step, perhaps even
200%, it may not be important, because models generally start with very small
time steps and gradually increase the length of each time step, so a 200% error
in the first time step may only reflect lost accounting for a gallon of water while
the problem as a whole involves 10s of thousands of gallons and subsequent
time steps have reasonable mass balances.
ALWAYS MONITOR:
Q @ CONSTANT H CELLS
AND
H @ SPECIFIED Q CELLS
49
MODFLOW: defining
Boundary Conditions
• Correct selection of boundary conditions is a critical step in model design.
Constant/
Type 1
Specified Dirichlet H=C
specified head
Head
No-Flow or Type 2
Neumann
Specified Flux specified flux
Head-
Type 3
dependent Cauchy Q = f(h, K, A)
mixed condition
Flux
After:
Definition of Boundary and Initial Conditions in the Analysis of
Saturated Ground-Water Flow Systems – An Introduction,
O. Lehn Franke, Thomas E. Reilly, and Gordon D. Bennett, USGS - TWRI Chapter B5, Book 3, 1987
And Anderson and Woessner, 1992, Applied Groundwater Modeling 52
Back to the world of Users
(instead of programmers)
Package input files for each process (only the GWF Process is always required)
– Basic (BAS6) (can define constant head BC’s here)
– Discretization (DIS)
– Hydrogeologic info (for example, LPF or BCF)
Turn Packages on and define input files using the NAME file
Example:
# GW Flow process input files
bas6 41 test0.bas
lpf 42 test0.lpf
wel 43 test0.wel
pcg 44 ../data/test0.pcg
.
.
Using FREEWAT, the NAME file gets created automatically, but it is
important to know that the NAME is the place where the names of all
the files used in the model are stored.
54
Basics of data input
Two types of input data: List data (for example as in the RIVER package
that is presented later) and Array data (for example as in the
RECHARGE package)
• Conceptual model
• Base map
• Grid design
– Areal
– Model layers (thickness can be variable)
• Boundary conditions
• Aquifer properties
• Pumping wells
• Recharge
• Time
56
If you need any assistance, please contact
Laura Foglia, UC Davis (Davis, California) - lfoglia@ucdavis.edu
Iacopo Borsi , TEA Sistemi SpA – iacopo.borsi@tea-group.com
Giovanna De Filippis – Scuola Superiore Sant’Anna (Pisa - Italy) -
g.defilippis@santannapisa.it
Rudy Rossetto, Scuola Superiore Sant’Anna (Pisa - Italy) – r.rossetto@santannapisa.it
FREEWAT development received funding from the following projects:
1. Hydrological part was developed starting from the project SID&GRID, funded by Regione Toscana through EU POR-FSE 2007-2013
(sidgrid.isti.cnr.it) (2010-2013)
2. Porting of SID&GRID under QGIS has been performed through funds provided by Regione Toscana to Scuola Superiore S.Anna -
Project Evoluzione del sistema open source SID&GRID di elaborazione dei dati geografici vettoriali e raster per il porting negli
ambienti QGis e Spatialite in uso presso la Regione Toscana (CIG: ZA50E4058A) (2015)
3. Saturated zone solute transport simulation capability has been developed within the EU FP7-ENV-2013-WATER-INNO-DEMO
MARSOL. MARSOL project received funding from the European Union's Seventh Framework Programme for Research, Technological
Development and Demonstration under grant agreement n. 619120 (www.marsol.eu) (2014-2017)
4. FREEWAT was developed within the EU H2020 project FREEWAT - Free and Open Source Software Tools for Water Resource
Management. FREEWAT project received funding from the European Union’s Horizon 2020 research and innovation programme
under grant agreement n. 642224 (www.freewat.eu) (2015-2017)
5. Integration of SFT (StreamFlow Transport) and LKT (Lake Transport) packages of MT3D-USGS is being performed at Scuola
Superiore Sant'Anna within the project SMAQua (SMart ICT tools per l'utilizzo efficiente dell'AcQua) - co-financed by Regione Toscana,
ASA S.p.A. and ERM Italia S.p.A. (2018-2020)