Courses: The GoldSim Contaminant Transport Module:

# Unit 8 - Modeling Spatially Continuous Processes: Diffusive Transport

# Lesson 4 - Creating a Diffusive Mass Flux Link

You will recall that to define advection between Cells, we created an * advective mass flux link* (using the

**Outflows**tab of the Cell element). In this Lesson, we are going to define diffusion between Cells by creating a

*.*

**diffusive mass flux link**Returning to the tube example discussed in the previous Lesson, to simulate diffusion, we will need to discretize the tube (e.g., by creating a number of Cell pathways that represent different “slices” of the tube), and then specify diffusive mass flux links between the Cells. We will use 10 “slices” (we will discuss the implications of this decision in the next Lesson).

In this Lesson, we will work through the process together of creating a diffusive mass flux link between just two Cells (i.e., the first two “slices”) of the tube through which we will simulate diffusion:

In the next Lesson, we will then look at a completed model with all 10 Cell pathways defined and explore its behavior.

Let’s open a model (that is partially built) and walk through the process of creating a diffusive mass flux link. Go to the “Examples” subfolder of the “Contaminant Transport Course” folder you should have downloaded and unzipped to your Desktop, and open a model file named ExampleCT18_Diffusive_Tube_Intro.gsm.

What we are going to do is simulate a tube filled with sand that is saturated with water. The tube is 1 m long and has a radius of 5 cm. We will assume one end of the tube is closed (no mass can move through that end) and 1 g of mass (of species X) is instantaneously injected at that end (uniformly over the entire area). The other end of the tube is connected (through a screen that holds the sand in the tube) to a small tank filled with water that is rapidly flushed (effectively maintaining the concentration in that tank at zero). We then want to simulate the rate of diffusion of X out of the far end of the tube into the tank.

To do this, we have discretized the tube into 10 “slices” (as shown above). We also have a Cell representing the tank. We will create a diffusive mass flux link between Cell1 and Cell2:

Before we do that, however, let’s first take a look at Cell1:

What we see here is that the **Amount **of Water in the Cell (in terms of a volume) is simply the total volume in the tube multiplied by the porosity (and divided by N, the number of Cells). Similarly, the **Amount **of Sand in the Cell (in terms of a mass) is simply the total volume in the tube multiplied by the sand density (and divided by N). Note that an **Initial Inventory** is also specified for this Cell. Cell2 is identical to Cell1, but does not have any **Initial Inventory**. (Note that the various input variables are all within the Inputs Container.)

When we created an advective mass flux link, we used the **Outflows **tab. To create a diffusive mass flux link we will use the **Diffusive Fluxes** tab:

When we created an advective mass flux link, the only required input was a flow rate. Recalling our discussion from the previous Lesson, however, for a diffusive mass flux link, we are going to need to specify a number of inputs. This is because the diffusive mass transfer rate is controlled by the ** diffusive conductance**:

τ n D_{m} A / Δx

One property is a function of the fluid through which diffusion is occurring:

- the diffusion coefficient (D
_{m})

Two properties are functions of the porous medium (if any) through which the diffusion is occurring:

- the tortuosity (τ)
- the porosity (n)

Two properties are a function of the geometry and discretization of the pathway:

- the area through which the diffusion is taking place (A)
- the distance through which the diffusion is occurring (Δx)

So how do we specify all of this information? To understand this, let’s first discuss conceptually how GoldSim represents diffusion between two pathways.

As illustrated schematically below, a diffusive mass flux link between two pathways has two "sides" (one for each of the linked pathways). Mass diffuses from one pathway, through the "diffusive layer" on one side of the link, through the "diffusive layer" on the other side of the link, and into the other pathway.

To create a diffusive mass flux link between two pathways in GoldSim, you must do the following:

- For each side of the link, a
**Fluid**must be specified. This determines the diffusion coefficient that is used. Each side of the link can contain a different Fluid (we will see an example of this later in this Unit). - For each side of the link, a diffusive
**Length**must be specified. This length represents the thickness of the "diffusive layer". It typically represents the distance from the center of the Cell to the “edge” or interface of the Cell. The diffusive lengths on the two sides of the link do not have to be the same. In fact, as we will see, in some cases, only one "diffusive layer" may be present (the diffusive length may be assumed to be 0 on one side of the link). - For each side of the link, you can optionally specify a
**Porous Medium**contained within the "diffusive layer". If you do, the diffusive flux is multiplied by the product of the porosity and the tortuosity associated with the porous medium. - A single
**Diffusive Area**for the link must be specified.

These inputs, along with the properties of the fluids and porous media involved, determine the value of the diffusive conductance.

So let’s create a diffusive mass flux link between Cell1 and Cell2. To do this, open Cell1, and select the **Diffusive Fluxes** tab. Press the **Add Flux** button. You will be prompted to select a pathway. Select Cell2 and press **OK**. The following dialog will appear:

This dialog provides several inputs. The first simply indicates that pathway to which you are connecting (you could change it by pressing the **Select…** button). The second two indicate what **Fluid **is involved (it can be different for each Cell). In this case, each Cell only contains one Fluid (Water), so it cannot be changed.

Finally, you can indicate the **Link Type**. When connecting two Cells, this must be “Coupled” (and hence cannot be changed).

When you press **OK**, the **Diffusive Fluxes** tab will look like this:

We now must specify the various inputs. It is best to start with a “from” Cell at one end of the row of Cells, and build connections towards the “to” end of the row. This establishes a “sign” for diffusion where it is considered positive in the from-to direction. Although diffusion can result in transport in either direction, having a consistent “sign” allows diffusive fluxes to be plotted consistently in a Result element.

In this particular case (a 1-D tube), the **Length** represents distance from the center of the Cell to the “edge” of the Cell. Since the tube has a total length of L, the Length (for each side) should be L/(2*N), where N is the number of Cells (both L and N are already defined in the Inputs Container). Note that as a result, the total diffusive distance from Cell1 to Cell2 is L/N.

We are assuming diffusion through a porous medium, so for each side, the **Porous Medium** should be specified as “Sand”.

Finally, the **Diffusive Area** is simply the cross-sectional area of the tube (defined as A in the Inputs Container). This assumes that the porous medium in question is fully saturated with respect to the fluid (Water, in this case).

When you are done, the **Diffusive Fluxes** tab should look like this:

Press the **OK **button to close the dialog. Now open Cell2, and go to the **Diffusive Fluxes** tab:

We see that the diffusive flux link appears in both Cells (and can be edited from either location). This is analogous to an advective Outflow from one Cell appearing as an Inflow to the downstream Cell.

The inputs entered for the diffusive flux link are used to determine the value of the diffusive conductance.

As discussed in the previous Lesson, the diffusive conductance is multiplied by the concentration difference in the two Cells to compute the mass transfer rate at any given timestep. We’ve stated above that the diffusive conductance is computed as (τ n D_{m} A / Δx). But this is actually a simplification. To be more general (accounting for the fact that we have two “sides” to the diffusive connection, each of which can have a different fluid, different porous medium and different length), the diffusive conductance is actually computed as follows:

In this equation, A is the diffusive area, L_{1} and L_{2} are the diffusive lengths in pathways 1 and 2, D_{x} is the diffusion coefficient in fluid X (in pathway 1), D_{Y} is the diffusion coefficient in fluid Y (in pathway 2), τ_{N }is the tortuosity in porous medium N in pathway 1, τ_{M} is the tortuosity in porous medium M in pathway 2, n_{N} is the porosity in porous medium N in pathway 1, n_{M} is the porosity in porous medium M in pathway 2, and K_{XY }is the partition coefficient between fluids X and Y. If the fluids, solids and lengths are the same in both pathways, this equation reduces to the simplified equation we presented initially.

The diffusion coefficients for Water are specified in the Reference Fluid dialog, so let’s briefly revisit that. If you open the Water element (inside the Material Container), you will recall that it looks like this:

There are two inputs you should note here: a **Reference Diffusivity **and **Relative Diffusivities**. The **Reference Diffusivity** is the diffusivity for a “standard” or “reference” species in the Fluid. It has dimensions of area/time. **Relative Diffusivities** are specified for each species (or if you are simulating isotopes, each element). These are dimensionless values that all default to one. For a given species, the actual diffusion coefficient (used to compute the diffusive conductance) is equal to the **Reference Diffusivity** times the **Relative Diffusivity** for that species. Hence, if you keep all of the **Relative Diffusivities** at their default value of 1, all of the species will have the same diffusion coefficient (equal to the **Reference Diffusivity**).

There is another field here (**Diff. Reduction Formula**) that also affects the diffusivity (if changed from its default value of 1). It is used to adjust for diffusion through porous media that are only partially saturated. We will discuss this in Lesson 11.

The porosity and tortuosity for the porous medium are specified in the Solid dialog, so let’s briefly revisit that. If you open the Sand element (inside the Material Container), you will recall that it looks like this:

The **Porosity **and **Tortuosity **are specified directly here. The meaning of the **Porosity **of a Solid needs no further discussion, but the **Tortuosity **does.

The tortuosity quantifies the degree to which the rate of diffusion is slowed down due to the tortuous path that a diffusing species must travel as it moves through the pore space in the Solid. The tortuosity can be defined in different ways. Within GoldSim, it is defined such that the smaller the tortuosity, the more tortuous the path. That is, it is the length of the straight line distance between two points in a porous medium divided by the tortuous path distance between those two points. (The tortuosity is sometimes defined as the inverse of how it is defined in GoldSim, such that more tortuous paths have a higher tortuosity.) As a result, in GoldSim the tortuosity should be specified as a value which is less than or equal to one.

As we will discuss in Lesson 11, the **Advanced Properties **for a Solid also have several inputs that can affect diffusion (if changed from their default values).

Note: The equation for the diffusive conductance presented above has several additional terms that appear when modeling complex diffusion problems (e.g., partially saturated porous media, species-specific porosity adjustment factors). These are dimensionless factors that default to 1 (and hence they do not appear in the equation or have any impact unless they are modified). We will discuss these in Lesson 11.

Before we leave this Lesson, there are two additional points regarding diffusive mass flux links that should be noted:

- Diffusive mass flux links are bi-directional. That is, mass can be transferred in either direction depending on the concentration difference between the Cells (and, in fact, could reverse during a simulation). GoldSim always defines one of the two pathways as the "Outflux Pathway" and one of the pathways as the "Influx Pathway". The pathway
via the*from which the link was created***Diffusive Fluxes**tab is identified as the Outflux Pathway for the link. Diffusive mass fluxes away from the Outflux Pathway in the link are, by convention, positive, and diffusive mass fluxes toward the Outflux Pathway are negative. - In the next Unit we will introduce some additional pathway types other than Cells (
and*Aquifer pathways*). All diffusive mass flux links must originate in a Cell pathway. This is because, by definition, GoldSim does not allow mass to diffuse out of a pathway that is not a Cell (it can only diffuse in). Within GoldSim, the concentration and diffusive length on the non-Cell side of a diffusive mass flux link are assumed to be zero. Hence, diffusive mass flux links involving non-Cell pathways are uni-directional. (This is physically realistic only in cases where the receiving pathway has a high flow rate; that is, high enough to maintain the concentration gradient into the receiving pathway.) A diffusive mass flux link can only be bi-directional if it is between two Cell pathways.*Pipe pathways*

In the next Lesson we will examine this model again, but this time with all of the mass flux links already created so that we can explore its behavior.