Los Alamos National Laboratory
Lab Home  |  Phone
LANL: >> EES Home
EES Resources

Python for FEHM (PyFEHM)

PyFEHM is an open-source (LGPL 2.1) Python library that provides classes and methods to support a scripting environment for the subsurface heat and mass transfer, and geomechanics code FEHM. It is inspired by a similar library, PyTOUGH, available for use with the TOUGH2 family of codes.


• parsing and interpretation of 3-D structured and unstructured grids
• generation of 3-D rectilinear grids of arbitrary complexity
• reading, writing and scripting of text-based FEHM input files
• support for most commonly-used macros, including geomechanics (STRS) and CO2 (CARB), but excluding particle tracking (TRAC) and reactive chemistry (RXN)
• association of macro-defined material properties, source/sink terms, and state variables (temperature, pressure, etc.) with grid information (nodes, zones)
• in-built calls for simulation execution, dynamic monitoring and job termination
• directory and file management, allocation of grid, input, output files to sub-directories
• simulation restarts
• support for batch simulations
• parsing and post-processing of common FEHM output formats including, contour, profile and history plotting
• functions for calculating thermophysical properties (e.g., enthalpy, density) of water and CO2 as used in FEHM
• output of model input and output data to Paraview form, automated loading and processing in Paraview
• diagnostic window that dynamically tracks simulation progress, timestepping, balances, residuals etc.
• pyfehmrc config file

PyFEHM Documentation

The PyFEHM User Manual comes bundled with the download of PyFEHM. In addition, the user manual can be found online here.

PyFEHM Online User Manual

PyFEHM Development Team

For help or suggestions you may contact a team member directly

• David Dempsey, d.dempsey@lanl.gov

• Dylan Harp, dharp@lanl.gov

PyFEHM Distribution

PyFEHM is supported on WINDOWS, Linux and Mac operating systems. The latest version of PyFEHM (1.1.1) can be downloaded below.

Now Available: Version 1.1.1 August 26, 2014 To install: unzip folder and run setup script, i.e., 'python setup.py install'.

PyFEHM Release Notes

Copyright 2013. Los Alamos National Security, LLC. This material was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the U.S. Department of Energy. The U.S. Government has rights to use, reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to produce derivative works, such modified software should be clearly marked, so as not to confuse it with the version available from LANL.

Additionally, this library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Accordingly, this library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Please note, downloading PyFEHM does not provide the user with an FEHM executable. FEHM is free, but controlled, software, and must be obtained by registering as a user at fehm.lanl.gov

PyFEHM supports a visualisation connection to Paraview. Paraview is free, open-source software, available for download at www.paraview.org

Operated by Los Alamos National Security, LLC for the U.S. Department of Energy's NNSA

Inside | © Copyright 2010-11 Los Alamos National Security, LLC All rights reserved | Disclaimer/Privacy | Web Contact