Skip to content

Latest commit

 

History

History
94 lines (81 loc) · 6.29 KB

paper.md

File metadata and controls

94 lines (81 loc) · 6.29 KB
title tags authors affiliations date bibliography
DPFEHM: a differentiable subsurface physics simulator
Julia
hydrology
multiphase flow
transport
wave equation
name corresponding orcid affiliation
Daniel O'Malley
true
0000-0003-0432-3088
1
name orcid affiliation
Sarah Y. Greer
0000-0001-6463-0296
1, 2
name orcid affiliation
Aleksandra Pachalieva
0000-0003-1246-0410
1
name orcid affiliation
Wu Hao
0000-0002-9402-7401
1
name orcid affiliation
Dylan Harp
0000-0001-9777-8000
3
name orcid affiliation
Velimir V. Vesselinov
0000-0002-6222-0530
4
name index
Los Alamos National Laboratory, USA
1
name index
Massachussets Institute of Technology, USA
2
name index
The Freshwater Trust, USA
3
name index
SmartTensors, LLC, USA
4
30 June 2022
paper.bib

Summary

The Earth's subsurface is a key resource that provides energy via fossil fuels and geothermal sources, stores drinking water, and is used in the fight against climate change via carbon sequestration. Simulating the physical processes that occur in the Earth's subsurface with computers enables better use of this resource. DPFEHM is a Julia package that includes computer models with a focus on the Earth's subsurface, especially fluid flow, which is critical for the aforementioned applications. DPFEHM is able to solve the groundwater flow equations (single phase flow), Richards equation (air/water), the advection-dispersion equation, and the 2d wave equation. One of the key features of DPFEHM is that it supports automatic differentiation, so it can be integrated into machine learning workflows using frameworks such as Flux or PyTorch. The automatic differentiation capabilities give it the same performance as adjoint methods.

Statement of need

Numerical models of subsurface flow and transport such as MODFLOW [@harbaugh2005modflow], FEHM [@zyvoloski1997summary], PFLOTRAN [@lichtner2015pflotran], etc. are ubiquitous, but these models cannot be efficiently integrated with machine learning frameworks. They cannot because they do not support automatic differentation, which is needed for the gradient-based optimization methods that are ubiquitous in machine learning workflows. An automatically-differentiable model like DPFEHM can be seamlessly integrated into these machine learning workflows. This enables machine learning workflows with DPFEHM in the loop, e.g., to learn to manage pressure in a scenario where wastewater or carbon dioxide are being injected into the subsurface [@pachalieva2022physics]. For example, without automatic differentiation the machine learning would get stuck when it needed to compute a Jacobian-vector product involving the subsurface simulator. DPFEHM fills this gap and enables the efficient computation of the Jacobian-vector product. It is additionally useful for non-machine learning workflows, because gradient calculations are also ubiqitous in more traditional workflows such as inverse analysis [@wu2022inverse] and uncertainty quantification [@betancourt2017conceptual] (UQ). For example, inverse analysis often uses the gradient to perform some variation of gradient descent to find the solution to the inverse problem, so making this fast is important in this context. Traditional inverse modeling and UQ tools (PEST [@doherty2010approaches] being the most widely used example), take a non-intrusive approach, which allows them to work with any simulator but forces them to treat the simulator as a black box. DPFEHM lays the groundwork for next-generation UQ tools that utilize the gradient and Jacobian information that DPFEHM efficiently provides. Of course, it can also be used to efficiently simulate complex physics related to flow and transport in the subsurface [@greer2022comparison] without exploiting the differentiability very deeply.

An alternative to a differentiable numerical model is to use a differentiable machine learning model that is trained on data from a non-differentiable numerical model such as those listed above. However, this approach has two major drawbacks. First, such a machine learning model may be insufficiently trustworthy, depending on the application. By contrast, DPFEHM uses a finite volume method that ensures local mass conservation, which is backed by rigorous accuracy guarantees. Second, in scenarios with complex physics, it may be impossible to generate sufficient data to train an adequate machine learning model. By contrast, DPFEHM does not require any training -- just a description of the equations, boundary conditions, etc. that define the problem.

DPFEHM was designed to be a research tool to explore the interface between numerical models and machine learning models. To date, it has been used in several publications including [@greer2022comparison;@wu2022inverse;@pachalieva2022physics]. DPFEHM uses a two-point flux approximation finite volume scheme. This means that an orthogonal grid is required to ensure convergence, similar to other codes such as FEHM and PFLOTRAN Alternative codes such as Amanzi-ATS [@mercer2020amanzi], which use a more advanced mimetic finite difference discretization, do not require orthogonal meshes. The performance advantage for DPFEHM over non-differentiable alternatives such as those mentioned previously comes in computing the gradient of a function that involves the solution of a subsurface physics equation. In these settings, the cost of computing a gradient with DPFEHM is typically around the cost of running two physics simulations. For non-differentiable models, the cost is equal to performing a number of simulations that is proportional to the number of parameters -- exorbitant when the number of parameters is large. This is important for subsurface physics, because there is often one or more parameters at each node in the mesh.

Installation

DPFEHM can be installed from within Julia by running import Pkg; Pkg.add("DPFEHM"). The installation can subsequently be tested by running Pkg.test("DPFEHM").

Acknowledgements

This project was supported by Los Alamos National Laboratory LDRD project 20200575ECR. S. Y. Greer acknowledges support from the United States Department of Energy through the Computational Science Graduate Fellowship (DOE CSGF) under grant number DE-SC0019323.

References