Computing ''Anomalous'' Contaminant Transport in Porous Media: The

Computing ''Anomalous'' Contaminant Transport in Porous Media: The

Computer Note/

Computing ‘‘Anomalous’’ Contaminant Transport in

Porous Media: The CTRW MATLAB Toolbox

by Andrea Cortis 1 and Brian Berkowitz 2


We describe the continuous time random walk (CTRW) MATLAB toolbox, a collection of MATLAB scripts

and functions that compute breakthrough curves (BTCs) and one-dimensional/two-dimensional (1D/2D) resident

concentration profiles for passive tracer dispersion. The transport model is based on the CTRW theory. CTRW includes

as special cases the classical Fickian dispersion based advection-dispersion equation, multirate and mobileimmobile

models, and the fractional-in-time derivative transport equation. Several models for treating the memory

effects responsible for the anomalous character of dispersion have been implemented in the CTRW toolbox.

In the current version of the toolbox, it is possible to solve explicitly for the forward problem (concentration

prediction) in 1D and 2D and for the inverse problem (parameter identification from experimental BTC data) in

1D. Future extensions will include explicit treatment of sorbing tracers, simple subroutines for treating radial

flow from wells, introduction of arbitrary initial conditions, treatment of heterogeneous domains by use of the

Fokker-Planck with Memory equation, and treatment of transport in multidimensional systems.


Laboratory and field-scale tracer dispersion breakthrough

curves (BTCs) are notorious for exhibiting earlytime

arrivals and late-time tailing that are not captured by

the classical advection-dispersion equation (ADE). These

‘‘anomalous’’ (or ‘‘non-Fickian’’) features can be explained

by the continuous time random walk (CTRW) theory.

The CTRW framework includes as a special case the

classical ADE for Fickian transport, as well as multirate

and mobile-immobile models and fractional derivative

formulations. The CTRW MATLAB toolbox v0.1 provides

a unique collection of easy-to-use MATLAB scripts

and functions to calculate the full temporal and spatial

behavior of a migrating tracer. The CTRW toolbox v0.1

runs on the MATLAB versions v7.0 and earlier and

1 Department of Environmental Sciences and Energy

Research, Weizmann Institute of Science, 76100 Rehovot, Israel.

2 Corresponding author: Department of Environmental

Sciences and Energy Research, Weizmann Institute of Science,

76100 Rehovot, Israel; 1972 8 934 2098; fax 1972 8 934 4124;

Received August 2004, accepted December 2004.

Copyright ª 2005 National Ground Water Association.

doi: 10.1111/j.1745-6584.2005.00045.x

can be downloaded freely at

ESER/People/Brian/CTRW. A user guide with installation

instructions, legal notice, and detailed usage of all the

subroutines can be found in a pdf document inside the

zipped distribution file. The Web site also contains background

information and a comprehensive listing of our

publications on CTRW theory and applications, as well as

a variety of other specialized numerical codes.

The Equations

For the convenience of the reader, we provide here

a short summary of the relevant partial differential equation

solutions that are actually solved by the CTRW toolbox.

A full discussion on the CTRW theory can be found

in the various references on the Web site; for the toolbox,

the publications by Cortis and Berkowitz (2004), Cortis

et al. (2004a, 2004b), and Dentz et al. (2004) are particularly


In general, the governing transport equation is the

Fokker-Planck with Memory equation (FPME). For a uniform

domain, the one-dimensional (1D) form of the

FPME is given in terms of the Laplace (L)–transformed

concentration, ~cðx; uÞ, where u is the Laplace variable, by:

Vol. 43, No. 6—GROUND WATER—November–December 2005 (pages 947–950) 947

u~cðx; uÞ2c0ðxÞ = 2 ~MðuÞ



vw ~cðx; uÞ2Dw

@x 2

@x2~cðx; uÞ


~MðuÞ [ tu ~ wðuÞ

12 ~ wðuÞ



is a memory function that accounts for the unknown

heterogeneities below the level of measurement resolution.

In Equation 1, t is some characteristic time, and vw

and Dw are the transport velocity and generalized dispersion

coefficient, respectively. The dimensionless dispersivity,

aw[Dw=vw. It is important to recognize that the

transport velocity, v w, is distinct from the average pore

velocity, v, whereas in the classical advection-dispersion

picture, these velocities are identical. Similarly, the dispersion

coefficient, Dw, has a different physical interpretation

than in the usual ADE definition. A detailed

discussion of ~ wðuÞ, which describes the tracer transition

time distribution, is given subsequently. We stress that

from here on, the terms velocity, dispersion, and dispersivity

refer to the CTRW interpretation and are indicated

by a subscript w. The average mass flux j is defined




[ ~Mvw ~c2aw



Consider a finite domain of unit length x = [0, 1].

Given a unit steady-state flux boundary condition (BC)

~j = u21 at the inlet (x = 0), the exact analytical solution of

Equation 1 for ~jðuÞ at x = 1 is readily obtained, as

detailed qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

in the user’s guide. With the definitions

w = 1 1 ð4uawÞ=ð ~MvwÞ,

z = ð1 1 wÞx =ð2awÞ, and

k = ð2w2xw 1 xÞ=ð2awÞ, the expressions for the Laplacetransformed

resident concentration take the form for a

Neumann BC at the outlet:

~cðu;xÞ[ 1


ðw21Þez1ðw11Þe k

ðw11Þ ~Mvw12uaw ew=aw 1 ðw21Þ ~Mvw22uaw


and for a Dirichlet BC at the outlet:

~cðu; xÞ [ 1


2 e


k2ez ðw 1 1Þew=aw 1 ðw21Þ


The relevant equations for the computation of the

two-dimensional (2D) resident concentration profiles are

omitted here and can be found in Dentz et al. (2004).

The function ~MðuÞ can take on several expressions

depending on the functional form for the ~ wðuÞ, with a variable

number of parameters. General forms that have been

described extensively in literature are the so-called

asymptotic model:

~wðuÞ [ ð1 1 au 1 bu b Þ 21 ; 0,b,2 ð6Þ

which requires three input parameters (b, a, and b), the

truncated power law (TPL) model:

~wðuÞ [ ð1 1 s2ut1Þ b ÿð2b; s21 2 1 t1uÞ


ÿð2b; s21 2 Þ

; 0,b,2


which requires three input parameters (b, t1, t2, where s2 =

t2/t1) and the modified exponential model:


~wðuÞ [ L g3F3½ 1;1;1



2;2;2 ; 2sŠexpðgs4F4½2;2;2;2 ; 2sŠÞ; s/u ;

g > 0 ð8Þ

where the generalized hypergeometric functions, pFq, are

defined in Cortis et al. (2004a). Equation 8 requires one

input parameter (g).

Equation 1 reduces to the classical ADE (i.e.,

~MðuÞ = 1) when ~ wðuÞ is the Laplace transform of an exponential

in time:

~wðuÞ [ 1

1 1 tu


This form clearly does not require any input parameter.

Also, Equation 1 reduces to the fractional-in-time

derivative equation (FDE) when:

~wðuÞ [ 1

1 1 ub; 0,b,1 ð10Þ

which requires one input parameter (b). All these forms

have been implemented in the present version of the

CTRW toolbox. Other forms can also be defined and implemented.

For the 1D case, the total number of parameters

needed to obtain a BTC (or a spatial profile) is given by

the number of parameters of the w function plus two, i.e.,

vw and Dw. For the 2D case, three extra parameters are

needed, namely, vw, D L w , and DT w .

Table 1

Summary of the Fitting Parameters for the Example in Figure 1, for the ADE, TPL, and FDE Solutions. The

Quality of the Different Fits is Given by the Standard Deviation sN21

ADE v (m/min) a (m)

4.33 3 10 23 3.66 3 10 23

TPL vw (m/min) aw (m) b t1 (min) t2 (min)

7.25 3 10 23 1.10 310 23 1.59 2.84 3 10 22 4.44 3 10 4

FDE v w (m/min b ) a w (m) b

4.51 3 10 23 2.40 3 10 23 0.99

948 A. Cortis, B. Berkowitz GROUND WATER 43, no. 6: 947–950

To obtain the actual temporal and spatial profiles,

the Laplace-transformed expression for the resident concentration

or the flux-averaged concentration is inverted

numerically to the time domain; inversion is based on the

de Hoog algorithm (de Hoog et al. 1982).

Features of the CTRW Toolbox

The CTRW toolbox is structured as a collection

of different MATLAB scripts and functions to allow maximum

flexibility in user-defined customization. It is

possible to solve explicitly for the forward problem (concentration

prediction) in 1D and 2D and for the inverse

problem (parameter identification from experimental BTC

data) in 1D.

For the forward 1D case, the relevant MATLAB

function requires as input (for the desired concentration:

resident or flux averaged) the time range over which the

BTC spans, the location of the column at which the BTC

is calculated, the w function (selected from among the

five listed in the aforementioned section), the form of the

flux input at the outlet (e.g., step, pulse, or a user-defined

input), and the BC at the outlet (Neumann or Dirichlet).

Also required are the transport velocity vw, the local

CTRW dispersion coefficient Dw, and the parameters for

the particular w function. Resident concentration profiles

are also straightforward to obtain by iterating over a loop

on the spatial position. A complete spatial-temporal

behavior for the transport is thus obtained. Similarly, for

the forward 2D case, in addition to the aforementioned

input parameters, the transverse dispersion coefficient D T w

is also required.

To solve the inverse problem, we introduced a convenient

MATLAB structure that contains all relevant information

on the experiments, the fitting parameters, and

the fitted solutions. The fitting subroutine minimizes the

norm of the difference between the data and the model.

Several possible choices for the norm have been implemented,

as well as the possibility of a logarithmic evaluation

of the fits and the possibility to fit only parts of the

data. All parameters are fit simultaneously. This can be

a lengthy task, depending on how close the initial values of

the parameters are to the optimized ones. On a PC with

a 2.6-GHz Intel processor, obtaining the optimized fits

shown in the figure required a few minutes. Clearly, the better

the initial guesses for the parameters, the faster the convergence

of the minimization algorithm. Also, inaccurate

estimation of the parameters may result in nonconvergence

or convergence to a local minimum. For convenience, functions

that provide graphical and textual output of the

numerical results have been included in the toolbox.

Example of Data Fitting

An example set of fits obtained with the CTRW toolbox

is given in Figure 1, where the best-fit TPL solution

is compared to the best-fit classical ADE and FDE solutions

(Cortis and Berkowitz 2004). A summary of

parameter values appears in Table 1. This data set refers

to an experiment of displacement in homogeneous porous

Figure 1. Comparison of best fits with the ADE, TPL, and

FDE models for the experimental data presented in Cortis

et al. (2004a).

media by Scheidegger (1959). A Berea Sandstone core

with a pore volume of 315 cm 3 and a permeability of

0.311 Darcy was fully saturated with tracer and subsequently

flushed with clean liquid using an injection rate

of 1.73 cm 3 /min. In Figure 1, we plotted the original data

set and three best-fit BTC based on the ADE, the TPL,

and the FDE. The TPL model provides the best fit to the

data set, with a value of the exponent b = 1.59. The truncation

time t 2 for the TPL model is very large, indicating

that transition to a Fickian-dominated regime has not yet

occurred. The time t 1 represents the time below which

one should not expect to see any homogenized anomalous

effects, and it is indeed small when compared to the time

span of the BTC. This means that the only critical parameter

is the anomalous exponent b, whereas the fit is relatively

insensitive to the t1 and t2 parameters.

Future Additions

We are currently in advanced stages of development

to extend the scope of the CTRW toolbox. New features

will include explicit treatment of sorbing tracers, introduction

of arbitrary initial conditions, simple subroutines

for treating radial flow from wells, treatment of heterogeneous

domains by use of the Fokker-Planck with memory

equation, and treatment of transport in multidimensional



The authors thank Chunmiao Zheng and an anonymous

reviewer for their helpful comments.


Cortis, A., and B. Berkowitz. 2004. Anomalous transport in

‘‘classical’’ soil and sand columns. Soil Science Society of

America Journal 68, no. 5: 1539–1548.

Cortis, A., Y. Chen, H. Scher, and B. Berkowitz. 2004a. Quantitative

characterization of pore-scale disorder effects on

transport in ‘‘homogeneous’’ granular media. Physical

Review E 70, no. 4: 1–8.

Cortis, A., C. Gallo, H. Scher, and B. Berkowitz. 2004b. Numerical

simulation of non-Fickian transport in geological

formations with multiple-scale heterogeneities. Water

Resources Research 40, no. 4: 1–16.

A. Cortis, B. Berkowitz GROUND WATER 43, no. 6: 947–950 949

de Hoog, F.R., J.H. Knight, and A.N. Stokes. 1982. An

improved method for numerical inversion of Laplace transforms.

SIAM Journal on Scientific and Statistical Computing

3, no. 3: 357–366.

Dentz, M., A. Cortis, H. Scher, and B. Berkowitz. 2004. Time

behavior of solute transport in heterogeneous media:

950 A. Cortis, B. Berkowitz GROUND WATER 43, no. 6: 947–950

Transition from anomalous to normal transport. Advances

in Water Resources 27, no. 2: 155–173.

Scheidegger, A.E. 1959. An evaluation of the accuracy of the

diffusivity equation for describing miscible displacement

in porous media. In Proceedings of the Theory of Fluid

Flow in Porous Media Conference, 101–116. Norman,

Oklahoma: University of Oklahoma.

More magazines by this user
Similar magazines