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

Computer Note/

**Comput ing** ‘‘Anomalous’’

**Porous** **Media**: **The** CTRW MATLAB Toolbox

by Andrea Cortis 1 and Brian Berkowitz 2

Abstract

We describe the cont**in**uous 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 **in**cludes

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 treat**in**g 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 **in**verse problem (parameter identification from experimental BTC data) **in**

1D. Future extensions will **in**clude explicit treatment of sorb**in**g tracers, simple subrout**in**es for treat**in**g radial

flow from wells, **in**troduction of arbitrary **in**itial conditions, treatment of heterogeneous doma**in**s by use of the

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

Introduction

Laboratory and field-scale tracer dispersion breakthrough

curves (BTCs) are notorious for exhibit**in**g earlytime

arrivals and late-time tail**in**g that are not captured by

the classical advection-dispersion equation (ADE). **The**se

‘‘anomalous’’ (or ‘‘non-Fickian’’) features can be expla**in**ed

by the cont**in**uous time random walk (CTRW) theory.

**The** CTRW framework **in**cludes 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 migrat**in**g 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 Correspond**in**g author: Department of Environmental

Sciences and Energy Research, Weizmann Institute of Science,

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

brian.berkowitz@weizmann.ac.il

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 http://www.weizmann.ac.il/

ESER/People/Brian/CTRW. A user guide with **in**stallation

**in**structions, legal notice, and detailed usage of all the

subrout**in**es can be found **in** a pdf document **in**side the

zipped distribution file. **The** Web site also conta**in**s background

**in**formation and a comprehensive list**in**g 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

relevant.

In general, the govern**in**g transport equation is the

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

doma**in**, 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Þ

where

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

12 ~ wðuÞ

ð1Þ

ð2Þ

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 dist**in**ct 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 **in**terpretation

than **in** the usual ADE def**in**ition. 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 **in**terpretation and are **in**dicated

by a subscript w. **The** average mass flux j is def**in**ed

through:

~j

@~c

[ ~Mvw ~c2aw

@x

ð3Þ

Consider a f**in**ite doma**in** of unit length x = [0, 1].

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

~j = u21 at the **in**let (x = 0), the exact analytical solution of

Equation 1 for ~jðuÞ at x = 1 is readily obta**in**ed, as

detailed qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

**in** the user’s guide. With the def**in**itions

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

u

ðw21Þez1ðw11Þe k

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

ð4Þ

and for a Dirichlet BC at the outlet:

~cðu; xÞ [ 1

u

2 e

~Mvw

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

ð5Þ

**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

depend**in**g 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 **in**put parameters (b, a, and b), the

truncated power law (TPL) model:

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

expðt1uÞ

ÿð2b; s21 2 Þ

; 0,b,2

ð7Þ

which requires three **in**put parameters (b, t1, t2, where s2 =

t2/t1) and the modified exponential model:

n

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

o

1;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

def**in**ed **in** Cortis et al. (2004a). Equation 8 requires one

**in**put 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

ð9Þ

This form clearly does not require any **in**put 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 **in**put parameter (b). All these forms

have been implemented **in** the present version of the

CTRW toolbox. Other forms can also be def**in**ed and implemented.

For the 1D case, the total number of parameters

needed to obta**in** 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 Fitt**in**g 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/m**in**) a (m)

4.33 3 10 23 3.66 3 10 23

TPL vw (m/m**in**) aw (m) b t1 (m**in**) t2 (m**in**)

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/m**in** 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 obta**in** the actual temporal and spatial profiles,

the Laplace-transformed expression for the resident concentration

or the flux-averaged concentration is **in**verted

numerically to the time doma**in**; **in**version 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-def**in**ed customization. It is

possible to solve explicitly for the forward problem (concentration

prediction) **in** 1D and 2D and for the **in**verse

problem (parameter identification from experimental BTC

data) **in** 1D.

For the forward 1D case, the relevant MATLAB

function requires as **in**put (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 **in**put at the outlet (e.g., step, pulse, or a user-def**in**ed

**in**put), 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 obta**in** by iterat**in**g over a loop

on the spatial position. A complete spatial-temporal

behavior for the transport is thus obta**in**ed. Similarly, for

the forward 2D case, **in** addition to the aforementioned

**in**put parameters, the transverse dispersion coefficient D T w

is also required.

To solve the **in**verse problem, we **in**troduced a convenient

MATLAB structure that conta**in**s all relevant **in**formation

on the experiments, the fitt**in**g parameters, and

the fitted solutions. **The** fitt**in**g subrout**in**e m**in**imizes 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, depend**in**g on how close the **in**itial values of

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

a 2.6-GHz Intel processor, obta**in****in**g the optimized fits

shown **in** the figure required a few m**in**utes. Clearly, the better

the **in**itial guesses for the parameters, the faster the convergence

of the m**in**imization algorithm. Also, **in**accurate

estimation of the parameters may result **in** nonconvergence

or convergence to a local m**in**imum. For convenience, functions

that provide graphical and textual output of the

numerical results have been **in**cluded **in** the toolbox.

Example of Data Fitt**in**g

An example set of fits obta**in**ed 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 us**in**g an **in**jection rate

of 1.73 cm 3 /m**in**. In Figure 1, we plotted the orig**in**al 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, **in**dicat**in**g

that transition to a Fickian-dom**in**ated 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 **in**deed 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

**in**sensitive 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 **in**clude explicit treatment of sorb**in**g tracers, **in**troduction

of arbitrary **in**itial conditions, simple subrout**in**es

for treat**in**g radial flow from wells, treatment of heterogeneous

doma**in**s by use of the Fokker-Planck with memory

equation, and treatment of transport **in** multidimensional

systems.

Acknowledgments

**The** authors thank Chunmiao Zheng and an anonymous

reviewer for their helpful comments.

References

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 **in**version of Laplace transforms.

SIAM Journal on Scientific and Statistical **Comput ing**

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 describ**in**g miscible displacement

**in** porous media. In Proceed**in**gs of the **The**ory of Fluid

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

Oklahoma: University of Oklahoma.