I.4 FV for transport equation

To demonstrate this, let us solve the following problem : water flowing in a river is contaminated by a chemical leak. We want to determine where the chemical has reached after a given time t. The channel is shown in figure 1. The flow is uniform throughout the channel with speed u at all points. The concentration q of the contaminant is described by the following equation

@q    @uq     @ (   @q)
---+  ----=  ---  G ---
@t    @x     @x     @x
(I.4)
which is known as the 1-d transport equation. As we will see this is a very common equation in CFD.
PIC
Figure 1: River channel : a contaminant c has been introduced upstream. The flow is uniform with speed u all the way along. The mesh is shown below, in perspective and also showing the nomenclature used.

Figure 1 also shows the mesh to be used. We have split the channel up into a series of cells of volume dV = Adx, where A is the area of the faces between the boxes. To apply the FV method, we integrate (I.4) over the volume of the cell. This will be a triple integral dV over the volume dV .

The first term is easy, since we can swap the order of the integral and the time derivative :

 integral  integral   integral              integral   integral  integral 
       @q-dV =  d-       qdV  = -d (qdV)
    dV @t       dt     dV        dt
In the last step, we have assumed that the value of q is uniform over the whole cell, so the value of the integral is the value of q (stored at the cell centre multiplied by the volume of the cell.

The second term is more difficult. However, in this case the volume dV = Adx, and so

 integral   integral  integral            integral   integral  integral 
       @uq              @uq
       -@x-dV  =        -@x-Adx  = (uqA)e -  (uqA)w
     dV                dV
These two terms are now being evaluated on the boundary face between the cells. It is conventional to refer to the cells using compass directions : we consider a particular cell P , its neighbours W and E, and the cell faces separating the cells as w and e respectively. However we do not know the value of the variables on w and e, just the values stored at the cell centres W , P and E. We need to interpolate between these values. One possibility would be to take the value from the upstream cell. In this case the flow is W --> E, so this means
(uq)  =  (uq)  ,    (uq)  = (uq)
    w        W           e       P
This is referred to as upwind differencing. Alternatively we could average between the two cell centre values :
(uq)   = (uq)W--+-(uq)P-
    w          2
and similarly for (uq) e. This is known as central differencing. (Note that the area A is the same throughout, and so has been factored out. This is not always the case).

The term on the rhs. representing diffusion can be treated similarly :

 integral   integral  integral     (     )        (       )    (       )
       -@-    @q-            @q-          @q-
     dV @x   G @x   Adx  =   G@x A    -   G@x A
                                   e             w
Once again, we can express each of these terms in terms of the cell centre values, for example :
(       )
   @q-         qE---qP-
  G@x A    = G   dx    A
         e

Thus far we can write our discretised equations as

                              (       )    (       )
 d                                @q           @q
dt(qdV ) + (uqA)e - (uqA)w  =   G @xA    -   G @x-A
                                        e            w
Rearanging a bit and using central differencing to interpolate, we get
dq-+ --u- (qE -  qW) =  G--(qE - 2qP +  qW)
dt   2dx               dx2
This is a discretised equation for a single cell. If we number the cells i = 0...N, then we have a set of difference equations for the derivative ddqti :
dq       u                  G
--i = - ----(qi+1- qi-1) + ----(qi+1 - 2qi + qi- 1)
dt      2dx                dx2
(I.5)