Skip to article frontmatterSkip to article content

Upwinding and stability

Let’s focus on the constant-velocity linear advection equation,

ut+cux=0,u(0,x)=u0(x). u_t + c u_x = 0, \quad u(0,x)=u_0(x).

For now, we suppose there are no boundaries. Keep in mind that cc is a velocity, not a speed: if c>0c>0, solutions travel rightward, and if c<0c<0, they travel leftward.

In Traffic flow we argued that u(x,t)=ψ(xct)u(x,t)=\psi(x-ct) is a solution of (12.2.1). It’s therefore clear that u(x,t)=u0(xct)u(x,t)=u_0(x-ct).

In the advection equation, the domain of dependence at (x,t)(x,t) is the single point {xct}\{x-ct\}, and the upwind direction is to the left or to the right of xx if cc is positive or negative, respectively.

Any numerical method we choose has an analogous property.

Numerical domain of dependence for the explicit time stepping scheme in Example {number}. If  \tau and h are infinitesimally small, the shaded region is filled in.

Figure 12.2.1:Numerical domain of dependence for the explicit time stepping scheme in Example 12.2.1. If τ and hh are infinitesimally small, the shaded region is filled in.

12.2.1The CFL condition

We now state an important principle about a required relationship between the domains of dependence.

Although we will not provide the rigor behind this theorem, its conclusion is not difficult to justify. If the CFL condition does not hold, the exact solution at (x,t)(x,t) could be affected by a change in the initial data while having no effect on the numerical solution. Hence there is no way for the method to get the solution correct for all problems. By contradiction, then, the CFL criterion is necessary for convergence.

Equation (12.2.4) is the implication of the CFL condition for the stated discretization. Notice that h/τh/\tau is the speed at which information moves in the numerical method; thus, it is common to restate the CFL condition in terms of speeds.

We can rearrange (12.2.4) to imply a necessary time step restriction τh/c\tau \le h/|c|. This restriction for advection is much less severe than the τ=O(h2)\tau = O(h^2) restriction we derived for Euler in the heat equation in Stiffness, which is our first indication that advection is less stiff than diffusion.

Example 12.2.4 is a special case of a more general conclusion.

12.2.2Upwinding

There are other ways to discretize the uxu_x term in the advection equation (12.2.1). The implications of the CFL criterion may differ greatly depending on which is chosen.

It’s clear that when the domain of dependence and the numerical method both have a directional preference, they must agree.

It might seem like one should always use a centered difference scheme so that upwinding is not an issue. However, at a shock front, this requires differencing across a jump in the solution, which causes its own difficulties.

12.2.3Inflow boundary condition

Now suppose that (12.2.1) is posed on the finite domain x[a,b]x \in [a,b]. Since the PDE has only a first-order derivative in xx, we should have only one boundary condition. Should it be specified at the left end, or the right end?

If we impose a condition at the downwind side of the domain, there is no way for that boundary information to propagate into the interior of the domain as time advances. On the other hand, for points close to the upwind boundary, the domain of dependence eventually wants to move past the left boundary. This is impossible, so instead the domain of dependence has to stay there.

In summary, we require an inflow condition on the PDE. For c>0c>0 this is at the left end, and for c<0c<0 it is at the right end. This requirement is true of the exact PDE as well as any discretization of it.

12.2.4Exercises

  1. ✍ Suppose you want to model the weather, including winds up to speed 200 km/hr, using an explicit method with a second-order centered spatial discretization. If the shortest time step you can take is 4 hr, what is the CFL limit on the spatial resolution of the model? Is this a lower bound or an upper bound?

  2. ✍ Suppose you want to model the traffic on a high-speed freeway using an explicit method with a second-order centered spatial discretization. Derive a CFL condition on the allowable time step, stating your assumptions carefully.

  3. ✍ For the heat equation, the domain of dependence at any (x,t)(x,t) with t>0t>0 is all of x(,)x \in (-\infty,\infty). Show that the CFL condition implies that τ/h0\tau/h\to 0 is required for convergence as h0h\to 0.

  4. ✍ Suppose you wish to solve ut=uuxu_t = u u_x for x[1,1]x\in[-1,1].

    (a) If u(x,0)=2+sin(πx)u(x,0) = -2+\sin(\pi x), which end of the domain is the inflow?

    (b) Does the answer to part (a) change if u(x,0)=1+e16x2u(x,0) = 1 + e^{-16x^2}?