Examples Gallery
The following examples illustrate the functionality of Flopy. After the tutorials, the examples are the best resource for learning the underlying capabilities of FloPy.
Preprocessing and Discretization
- Triangular mesh example
- Voronoi Grid and MODFLOW 6 Flow and Transport Example
- Use Triangle to Generate Points for Voronoi Grid
- Create and Plot FloPy Voronoi Grid
- Use the VertexGrid Representation to Identify Boundary Cells
- Create Run and Post Process a MODFLOW 6 Flow Model
- Create Run and Post Process a MODFLOW 6 Transport Model
- Irregular Domain Boundary
- Simple Rectangular Domain
- Circular Grid
- Circular Grid with Hole
- Regions with Different Refinement
- Regions with Different Refinement and Hole
- Intersecting model grids with shapes
- Creating Layered Quadtree Grids with GRIDGEN
- ModelGrid classes demo
- The three modelgrid classes
StructuredGrid
,VertexGrid
, andUnstructuredGrid
will be demonstrated in this notebook. - Accessing the modelgrid and common usage
- Building modelgrid objects from scratch
- Useful methods and properties of the modelgrid classes
- The three modelgrid classes
- Intersecting rasters with modelgrids using FloPy’s Raster class
Postprocessing and Visualization
- Plotting SWR Process Results
- Plotting Model Arrays and Results
- Load and Run an Existing Model
- Plotting Model Data
- Plotting three-dimensional data
- Plotting transient two-dimensional data
- Plotting simulated model results
- Passing other
matplotlib.pyplot
keywords to.plot()
methods - Plotting data for a package or a model
- Plot all data for a package
- Plot package input data for a specified layer
- Plot all input data for a model
- Plot model input data for a specified layer
- Making Cross Sections of Your Model
- Mapping is demonstrated for MODFLOW-2005 and MODFLOW-6 models in this notebook
- Load and Run an Existing MODFLOW-2005 Model
- Creating a Cross-Section of the Model Grid
- Ploting Ibound
- Plotting Boundary Conditions
- Plotting an Array
- Contouring an Array
- Plotting Heads
- Plotting a surface on the cross section
- Plotting discharge vectors
- Plotting a cross section from Shapefile data
- Plotting geographic coordinates on the x-axis using the
PlotCrossSection
class - Plotting boundary conditions and arrays
- Plotting specific discharge with a MODFLOW-6 model
- Plotting a line based cross section through the model grid
- Plotting Arrays and Contouring with Vertex Model grids
- Plotting specific discharge vectors for DISV
- Making Maps of Your Model
- Mapping is demonstrated for MODFLOW-2005, MODFLOW-USG, and MODFLOW-6 models in this notebook
- Load and Run an Existing MODFLOW-2005 Model
- Create and Run MODPATH 6 model
- Creating a Map of the Model Grid
- Ploting Ibound
- Plotting Boundary Conditions
- Plotting an Array
- Contouring an Array
- Plotting Heads
- Plotting Discharge Vectors
- Plotting MODPATH endpoints and pathlines
- Plotting a Shapefile
- Plotting GIS Shapes
- Plotting boundary conditions and arrays
- Contouring Arrays
- Plotting specific discharge with a MODFLOW-6 model
- Setting MODFLOW-6 Vertex Model Grid offsets, rotation and plotting
- Plotting boundary conditions with Vertex Model grids
- Plotting Arrays and Contouring with Vertex Model grids
- Plotting MODPATH 7 results on a vertex model
- Plotting specific discharge vectors for DISV
Exporting data
- Shapefile export demo
- set the model coordinate information
- Export a package to a shapefile
- Export a FloPy list or array object
- MfList.export() exports the whole grid by default, regardless of the locations of the boundary cells
- combining data from different packages
- exporting other data
- Adding attribute data to an existing shapefile
Other FloPy features
MODFLOW 6 examples
- Creating a Complex MODFLOW 6 Model with Flopy
- Model splitting for parallel and serial MODFLOW 6
- Example 1: splitting a simple structured grid model
- Creating an array that defines the new models
- Splitting the model using
Mf6Splitter()
- Visualize and reassemble model output
- Array based model output can be assembled into the original model’s shape by using the
reconstruct_array()
method - Recarray based model inputs and outputs can also be assembled into the original model’s shape by using the
reconstruct_recarray()
method
- Example 2: a more comprehensive example with the watershed model from Hughes and others 2023
- Example 3: create an optimized splitting mask for a model
- Example 1: splitting a simple structured grid model
- Creating a Simple MODFLOW 6 Model with Flopy
- Flopy MODFLOW 6 (MF6) Support
- Conceptual model
- Creating a simulation
- Accessing namefiles
- Specifying options
- MFArray templates
- Specifying MFArray Data
- MFList Templates
- Cell IDs
- Specifying MFList Data
- Packages that Support both List-based and Array-based Data
- Utility Files (TS, TAS, OBS, TAB)
- Saving and Running a MF6 Simulation
- Exporting a MF6 Model
- Loading an Existing MF6 Simulation
- Retrieving Data and Modifying an Existing MF6 Simulation
- Modifying Data
- Modifying the Simulation Path
- Adding a Model Relative Path
- Post-Processing the Results
MODFLOW USG examples
- MODFLOW-USG CLN package demo
- Loading Example 03_conduit_confined
- Create example 03A_conduit_unconfined of mfusg 1.5
- Modify CLN amd WEL package to example create 03B_conduit_unconfined of mfusg 1.5
- Modify CLN amd WEL package to example create 03C_conduit_unconfined of mfusg 1.5
- Modify CLN amd WEL package to example create 03D_conduit_unconfined of mfusg 1.5
- Comparing four cases
- MODFLOW-USG Freyberg demo
- MODFLOW-USG: Discontinuous water table configuration over a stairway impervious base
MODFLOW-2005/MODFLOW-NWT examples
- Flopy Drain Return (DRT) capabilities
- Lake Package Example
- Simple water-table solution with recharge
- Postprocessing head results from MODFLOW
- Load example model and head results
- Plot heads in each layer; export the heads and head contours for viewing in a GIS
- Compare rotated arc-ascii and GeoTiff output
- Get the vertical head gradients between layers
- Get the saturated thickness of a layer
- Get the water table
- Get layer transmissivities at arbitrary locations, accounting for the position of the water table
- SFR package Prudic and others (2004) example
- Problem description:
- copy over the example files to the working directory
- Load example dataset, skipping the SFR package
- Read pre-prepared reach and segment data into numpy recarrays using numpy.genfromtxt()
- Segment Data structure
- define dataset 6e (channel flow data) for segment 1
- define dataset 6d (channel geometry data) for segments 7 and 8
- Define SFR package variables
- Instantiate SFR package
- Plot the SFR segments
- Check the SFR dataset for errors
- Load SFR formated water balance output into pandas dataframe using the
SfrFile
class
- Plot streamflow and stream/aquifer interactions for a segment
- SWI2 Example 1. Rotating Interface
- SWI2 Example 4. Upconing Below a Pumping Well in a Two-Aquifer Island System
- Unsaturated Zone Flow (UZF) Package demo
Flopy Drain Return (DRT) capabilities
Lake Package Example
Simple water-table solution with recharge
Postprocessing head results from MODFLOW
SFR package Prudic and others (2004) example
SWI2 Example 1. Rotating Interface
SWI2 Example 4. Upconing Below a Pumping Well in a Two-Aquifer Island System
Unsaturated Zone Flow (UZF) Package demo
MODPATH examples
- Working with MODPATH 6
- Creating a MODPATH 7 simulation
- Using MODPATH 7 with structured grids
- Using MODPATH 7 with structured grids (transient example)
- Using MODPATH 7 with a DISV unstructured model
- Using MODPATH 7: DISV quadpatch example
- FloPy VTK/PyVista particle tracking pathline visualization demo
Working with MODPATH 6
Creating a MODPATH 7 simulation
Using MODPATH 7 with structured grids
Using MODPATH 7 with structured grids (transient example)
Using MODPATH 7 with a DISV unstructured model
Using MODPATH 7: DISV quadpatch example
FloPy VTK/PyVista particle tracking pathline visualization demo
MT3D and SEAWAT examples
- MT3D-USGS Example
- MT3DMS Example Problems
- Example 1. One-Dimensional Transport in a Uniform Flow Field
- Example 2. One-Dimensional Transport with Nonlinear or Nonequilibrium Sorption
- Example 3. Two-Dimensional Transport in a Uniform Flow Field
- Example 4. Two-Dimensional Transport in a Diagonal Flow Field
- Example 5. Two-Dimensional Transport in a Radial Flow Field
- Example 6. Concentration at an Injection/Extraction Well
- Example 7. Three-Dimensional Transport in a Uniform Flow Field
- Example 8. Two-Dimensional, Vertical Transport in a Heterogeneous Aquifer
- Example 9. Two-Dimensional Application Example
- Example 10. Three-Dimensional Field Case Study
Examples from Bakker and others (2016)
Examples from Hughes and others (2023)
Miscellaneous examples
- Henry Saltwater Intrusion Problem
- ZoneBudget Example