But does it always work?

As an example, let’s look at something called advection, which is (more or less) just a fancy word for “floating along with the water”. When you throw a stick into a flowing river, the stick is advected downstream. All sorts of things can be advected; sticks, Prime Ministers, heat and salt to name just a few.

In the real world we usually expect things to spread out as they are carried along by the water; a process called diffusion. It’s important that our models include the right amount of diffusion, otherwise they lead to unrealistic predictions. To explore the difficulties in this we need some maths, in particular we need the one-dimensional diffusive advection equation:

$latex

\frac{\partial\phi}{\partial t}+u\frac{\partial\phi}{\partial x}=\kappa\frac{\partial^2\phi}{\partial x^2},$

in which is the quantity being advected in the -direction with speed and is the rate of diffusion. Let’s call this “equation 1”.

If you’ve studied some maths, you’re probably thinking “Aha! Just set to the right value and we’re fine”. Unfortunately it’s not as simple as that.

When we use a computer to solve equations like this we need to discretise the equations. That is, we break the equation up into lots of small chunks and write a computer program to solve the large number of simpler equations. This picture shows a function phi () that has been discretised. The derivative of with respect to can be approximated by the rise over the run.

Now the derivative can be approximated like this:

To illistrate how this can lead to solving the wrong problem, I’m going to set to be zero and see what happens. Approximating the derivatives with tangents (rise over run from high-school maths) gives this equation:

where the superscripts refer to the th or the th time step.

After a bit of rearranging we get a simple equation for at time and at the th point along :

$latex

\phi^{n+1}_{j} = \frac{u \Delta t}{\Delta x} \left(\phi_{j-1}^{n} -\phi_{j}^{n}\right) + \phi^{n}_{j}$

Let’s call this “equation 2”.

Now we can use a computer to solve this equation, and even to make a movie of the solution.

But what happened here? Didn’t we set to be zero? Why is there diffusion?

To answer these questions we need to dive into some more maths. In particular Taylor Series. Using Taylor Series to represent the different values of we get:

If we substitute these expressions back into equation 2 then we get:

A bit of rearranging and cancelling gives the following equation:

which looks a lot like the original *diffusive* advection equation (equation 1 in case you’ve forgotten) with

It’s possible to “tune” this very simple model to remove diffusion by setting

As you can see in the next video.

But this brings us uncomfortably close to the limit of the Courant-Friedrichs-Lewy condition for stability:

Even this solution doesn’t always help. It is often impossible to tune more complex models in this way, especially global models for weather and climate, because the grid size is not uniform across the globe. If we increase the time step (or decrease the step in ) by just 3%, then the numerical scheme becomes unstable.

If represents the concentration of salt, how do we interpret a negative concentration?

## Other interesting and related things to look at:

- This is Prather’s seminal paper describing the use of quadratic interpolation between grid boxes to limit numerical diffusion.
*“A comparison of the capabilities of different algorithms shows that each scheme has its advantages and that no one method is most advantageous under all conditions.”*

This presentation gives a good (if somewhat technical) overview of the numerical advection problem.