II.2 3d Transport Equations using FV method

The generic transport equation was introduced in the last lecture. This can be written in vector notation as

@f-+   \~/ .(uf) = n \~/ 2f + S
@t                       f
(II.1)
To apply the FV method to this equation, we divide the region of interest up into cells, and integrate this equation over the volume of each cell in turn.
PIC
Figure 3: A general FV cell

The first term in the equation becomes

 integral   integral  integral  @f       d   integral   integral   integral        d
       --- dV =  --       fdV  =  --(fdV )
    dV @t        dt     dV        dt
if we assume that f is uniform over the cell - valid if the cell is small enough, which is what we want. We assume that f is associated with the cell centre, and that we can express this as the difference in the value of f at two times
 d          ft+dt- ft
dt(fdV ) =  ---dt----dV

The second term

 \~/ .(uf)
represents convection of fluid into and out of the cell. Integrating this is complicated, but produces a simple answer - this term can be represented as the flux of f across the cell faces
 integral  integral   integral 
                 sum 
        \~/ .(uf) =     fu.dA
    dV
Here the faces dA- have been written as vector areas - giving the direction in which the surface points as well as its size. If for example the problem is 1d, with a flow (and a mesh) orientated in the x direction as in the last lecture, then this term becomes
 sum 
    fu.dA  = (f × u  A)  - (f × u  A)
                    x  w         x   e
Of course, we still need to evaluate the values of these variables on the face centres.

A CFD mesh is sometimes described as either colocated or staggered. If the mesh is colocated, then all the variables are stored at the cell centres, and we need to find some way of interpolating between the cell centres to get the value of the flux at the face. If the mesh is staggered, then some variables are stored at the face locations. However this is simply a matter of storage - at some stage the code needs to perform an interpolation.

There are two simple ways of interpolating to get the face value from the cell centre values :

  1. Take the value from the upwind cell centre - upwind differencing
  2. Take an average of the two cell centres - central differencing

These are illustrated in figure 4.


PIC
Figure 4: Possible interpolation procedures.

Although strictly speaking these are interpolations between cell centred values, they are exactly equivalent to the upwind and central differencing methods used in FD, and so are referred to as differencing schemes. They are of course approximations. Upwind differencing produces an error involving dx2 and higher, and so is said to be 1st order accurate. Central differencing has an error involving dx3, so is 2nd order accurate. As important as the order of the error is the type of effect it induces. This is best explored by looking at what the scheme does to a step function such as the one below.


PIC
Figure 5: Errors induced by upwind and central differencing schemes.

More sophisticated schemes are also used, either to increase the order of accuracy of the differencing scheme (e.g. up to 4th order) or to merge features of the upwind and central differencing schemes. For example a number of schemes attempt to blend these two to provide a scheme which introduces the minimum numerical viscosity necessary to stabilise features such as shocks, but without smearing them out more than is absolutely necessary.

These techniques can also be utilised to evaluate the diffusion term

n\ ~/ 2f
The source term is straightforward to express. We assume that the value of Sf is uniform over the cell, and so
 integral  integral   integral 
       SfdV  = SfdV
    dV
If all of these expressions are recombined, the result is a difference equation linking the values of f at the cell centres at time t + dt to the values at time t. Depending on exactly how this is done, the result is either an explicit scheme (the equation can be rearanged directly to give ft+dt in terms of values already known at time t) or an implicit scheme, which can be written as
M[ft+dt]  = Q