Python-Based Tools for Modeling Transport
in Porous Media Columns
Boyang Lu
Illinois Institute of Technology
Chicago, Illinois
blu6@hawk.iit.edu
David Lampert
Illinois Institute of Technology
Chicago, Illinois
Dlampert1@iit.edu
ABSTRACT
The fate and transport of dissolved constituents in porous media has
important applications in the earth and environmental sciences and
many engineering disciplines. Mathematical models are commonly
applied to simulate the movement of substances in porous media
using the advection-dispersion equation. Whereas computer
programs based on numerical solutions are commonly employed to
solve the governing equations for these problems, analytical
solutions also exist for some important one-dimensional cases.
These solutions are often still quite complex to apply in practice,
and therefore computational tools are still needed to apply them to
determine the concentrations of dissolved substances as a function
of space and time. The Python Programming Language provides a
variety of tools that enable implementation of analytical solutions
into useful tools and facilitate their application to experimental data.
Python provides an important but underutilized tool in environ-
mental modeling courses. This article highlights the development
of a series of Python-based computing tools that can be used to
numerically compute the values of an analytical solution to the one-
dimensional advection-dispersion equation. These tools are targeted
to graduate and advanced undergraduate courses that teach
environmental modeling and the application of Python for
computing.
KEYWORDS
Python, Advection-Dispersion Model, Analytical Solution, Column
Experiment, Columntracer, Dispersion Coefficient, Breakthrough
Curve, Jupyter Notebook, Binder, Educational Computing Tools
1 INTRODUCTION
The fate and transport of dissolved constituents in porous media has
many important applications in geology, environmental science,
and engineering. Field and laboratory studies are often used to study
the fate and transport of contaminants in porous media. These
studies also require computational tools for interpretation of data
and forecasting of pollutant migration into uncontaminated areas.
Since many contaminants released to the environment are
eventually trapped in soils and sediments, these media can
contribute to the contamination to surface water and groundwater in
the vicinity, depending on the contaminant characteristics and site
geological properties.
Laboratory columns are widely used to study fate and
transport in porous media such as soils and sediments. For example,
McKenzie et al. [13] and Høisæter et al. [8] recently conducted
column experiments to improve the understanding of per- and
polyfluoroalkyl substances, an emerging class of pollutants, in
unsaturated soils and groundwater. Perujo et al. [16] carried out a
laboratory-scale column experiment to study the interaction
between physical heterogeneity and microbial processes in
subsurface sediments, and Westerhoff et al. [22] performed column
tests for arsenate removal in iron oxide packed bed columns. The
main purpose of column experiments is to investigate the transport
and attenuation of a specific compound within a specific sediment
or substrate [2]. Column experiments are flexible and simple to
manage; therefore, it is possible to run a column experiment as part
of an educational course. The boundary conditions, physical and
chemical properties of the contaminants, media characteristics, and
the type of the solvent can be controlled easily during preparation.
The resulting data can provide a useful educational experience for
students that are learning about fate and transport modeling.
The movement of dissolved constituents in porous media
strongly depends on the fluid flow characteristics. In laboratory
columns, it is reasonable to assume the flow is one-dimensional.
Tracer studies using an inert substance that does not interact with
the media are frequently used to assess fluid flow. The results of a
tracer study provide data that can be used with an appropriate model
to interpret the fluid movement, which can then be used to assess
migration of other substances within the media.
Mathematical models based on advection (the movement of a
dissolved substance with the bulk media) and dispersion (the
dissipation of concentration gradients in the media due to
differences in flow path lengths) are often used to simulate the fate
and transport of dissolved substances. One-dimensional advection-
dispersion models often provide excellent performance in
explaining observed concentrations within laboratory columns used
to study the movement of dissolved substances within porous media
[1]. Students in the earth and environmental sciences and engin-
eering disciplines require substantial training in computational
science to apply these models. In addition to knowledge of the
underlying physical and chemical processes, these students often
also require training in the solution of differential equations and the
development of computer programs to perform the calculations.
The Python Programming Language provides a convenient plat-
form for solving advection-dispersion problems, since it provides
access to many applicable computational and visualization tools;
however, limited educational tools are available to teach the
applications of Python for environmental modeling.
The one-dimensional dispersion-advection model can be used
to simulate the behavior of tracer transport in porous media. An
analytical solution for the model has been developed in the Fortran
programming language that is described in a report published by the
U.S. Geological Survey (USGS), which includes three additional
useful analytical solutions to 1-dimensional dispersion-advection
equation in porous media, and more solutions to 2 and 3-dimen-
sional situations [23]. Fortran is still used today for high perform-
ance computing, but it is difficult to implement for analytical
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that
copies bear this notice and the full citation on the first page. To copy
otherwise, or republish, to post on servers or to redistribute to lists,
requires prior specific permission and/or a fee. Copyright ©JOCSE, a
supported publication of the Shodor Education Foundation Inc.
© 2023 Journal of Computational Science Education
DOI: https://doi.org/10.22369/issn.2153-4136/14/1/2
Volume 14, Issue 1 Journal of Computational Science Education
8 July 2023