Online Guide to MODFLOW

Beginner's Guide to MODFLOW

Hide Navigation Pane

Beginner's Guide to MODFLOW

Previous topic Next topic No directory for this topic No expanding text in this topic  

Beginner's Guide to MODFLOW

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for expanding text JavaScript is required for the print function  

Obtaining MODFLOW

There are several different versions of MODFLOW available. Check https://water.usgs.gov/ogw/modflow/index.html for the version you want.  If you want MODFLOW-2005, you can get it from https://water.usgs.gov/ogw/modflow/MODFLOW.html.

Installing MODFLOW

On both Windows and Unix/Linux, MODFLOW is distributed as a zip file with source code, documentation, and examples. The Windows version also contains a compiled executable. Users of Unix/Linux will need to compile MODFLOW. To install MODFLOW on Windows, you need to extract the files. The preferred location to install MODFLOW is as a subdirectory of "C:\WRDAPP" (Water Resources Division Application).

When you unzip the distribution file, MODFLOW and its associated files should be extracted in a subfolder C:\WRDAPP. For MODFLOW-2005 version 1.8, the subfolder is named "MF2005.1_8". The MODFLOW program is located in the "bin" subfolder of the MF2005.1_8 folder as shown below.

MODFLOW_Installation_Directory

MODFLOW-2005 Installation directory

There are actually two different versions of MODFLOW in the bin directory. mf2005.exe is the normal version.  The other version, mf2005dbl.exe, is a version that has been compiled in such a way that all the real numbers used for calculations are in double-precision rather than single precision. Double-precision numbers use 8 bytes rather than 4 bytes to store the number so they are more precise but calculations may take longer and binary files that store double-precision variables will be bigger than if single-precision had been used. The other programs in the bin directory hydfmt.exe and mnw1to2.exe will not be discussed here. The doc folder contains some of the documentation for MODFLOW. The src folder contains the source code for MODFLOW. The test-run folder contains example input files for MODFLOW. The test-out folder contains output files generated by running the example problems.

Running MODFLOW from the command line on Windows

To run MODFLOW from the command line, you must first open a command line window. In Windows, select Start|Run. Then in the "Run" window, type "cmd" and click OK.

StartCMD_1

StartCMD_2

In the command line window, you must first navigate to the folder that contains the MODFLOW input files. If the files are on a different drive first type the drive letter followed by a colon.

NavigateToD

Then you need to change the folder to the one that contains your MODFLOW input files. In this case the folder is D:\MyModflowFiles. Use the "CD" command to change directories.

ChangeDirectories

Next type the full path for MODFLOW followed by the name of the Name file for your model which in this case is GhbTest.nam.

RunMODFLOW

When MODFLOW has finished running, it will display a message in the command line window. If it says "Normal termination of simulation", the model ran to completion without any problems.

NormalTermination

If some other message (or no message) appears, there was some problem with your model.

Failure

 

Running MODFLOW with a batch file

Running MODFLOW from the command line repeatedly can become tedious.  Another way to run MODFLOW is with a batch file.  A batch file is a simple text file with the extension ".bat" It contains commands that you could type in a command line window. A simple batch file for running MODFLOW might look like this.

C:\WRDAPP\MF2005.1_8\bin\mf2005.exe GhbTest.nam

pause

The "pause" command will keep the command line window open until you press a key on the keyboard. That allows you to see what MODFLOW has written to the screen.

To run the batch file, just double click on it in Windows Explorer.

On Unix or Linux a shell script can be used similarly to how a batch file is used in Windows.

Running MODFLOW with a graphical user interface

Insted of running MODFLOW from the command line, it may be simpler, especially for a beginner to use a graphical user interface for MODFLOW. There are several graphical user interfaces available. See https://en.wikipedia.org/wiki/MODFLOW#Graphical_user_interfaces for examples.

Generating the input files for MODFLOW

The rest of this guide describes the formats for the MODFLOW input files.  However, modelers are advised to read the original documentation which describes the purposes of the various packages and how they work.

Model design

The following references may be helpful in designing a model.

Anderson, M. P., and Woessner, W.W., 1992, Applied Groundwater Modeling, Simulation of Flow and Advective Transport, Academic Press, San Diego, 381 p. ISBN: 0-12-059485-4.
Hill, M.C., 1998, Methods and guidelines for effective model calibration: U.S. Geological Survey, Water-Resources Investigations Report 98-4005, 90 p.
Hill, M.C., and Tiedeman, C.R., 2007, Effective groundwater model calibration, with analysis of sensitivities, predictions, and uncertainty: New York, New York, Wiley, 455p.
Reilly, T.E., 2001 , System and boundary conceptualization in ground-water flow simulation: U.S. Geological Survey Techniques of Water-Resources Investigations, book 3, chap. B8, 30 p.
Reilly, T.E., and Harbaugh, A.W., 2004, Guidelines for evaluating ground-water flow models: U.S. Geological Survey Scientific Investigations Report 2004-5038, 30 p.

Parameters and Observations

It is a good idea to define you model using parameters wherever possible because that makes calibrating your model easier. For example, the LPF package supports parameters whereas the BCF package does not so if you use the LPF package and you define the hydraulic conductivity using parameters, you will have an easier time calibrating the hydraulic conductivity than you would if you used the BCF package or used the LPF package without parameters.

You can use the Observation process to specify the observations against which you wish to calibrate your model. Typically, one type of observation will be head observations.  However, typically you will not be able to calibrate your model using head observations alone. You will usually need to either have some other type of observation such as flow observations or to have prior information.  Prior information is not part of the MODFLOW input but you may be able to specify prior information in one of the programs used for automated model calibration. For more information about model calibration see Hill (1998) and Hill and Tiedeman (2007) as cited above.

It can be difficult to convert a model that does not use parameters to one that does so it is best to design your model from the beginning to use parameters.

Tips

When you are first starting to create a model, it is often helpful to treat all layers as confined even if they are really convertible or unconfined. Confined models have fewer problems with cells converting to dry and convergence issues so you can make progress on improving the model. Once you have the model in good shape, you can try converting some layers to unconfined or convertible. At that point, you can try converting to unconfined or convertible layers.