Upwind scheme

From HandWiki
Short description: Discretization method for differential equations

In computational physics, the term advection scheme refers to a class of numerical discretization methods for solving hyperbolic partial differential equations. In the so-called upwind schemes typically, the so-called upstream variables are used to calculate the derivatives in a flow field. That is, derivatives are estimated using a set of data points biased to be more "upwind" of the query point, with respect to the direction of the flow. Historically, the origin of upwind methods can be traced back to the work of Courant, Isaacson, and Rees who proposed the CIR method.[1]

Model equation

To illustrate the method, consider the following one-dimensional linear advection equation

[math]\displaystyle{ \frac{\partial u}{\partial t} + a \frac{\partial u}{\partial x} = 0 }[/math]

which describes a wave propagating along the [math]\displaystyle{ x }[/math]-axis with a velocity [math]\displaystyle{ a }[/math]. This equation is also a mathematical model for one-dimensional linear advection. Consider a typical grid point [math]\displaystyle{ i }[/math] in the domain. In a one-dimensional domain, there are only two directions associated with point [math]\displaystyle{ i }[/math] – left (towards negative infinity) and right (towards positive infinity). If [math]\displaystyle{ a }[/math] is positive, the traveling wave solution of the equation above propagates towards the right, the left side of [math]\displaystyle{ i }[/math] is called upwind side and the right side is the downwind side. Similarly, if [math]\displaystyle{ a }[/math] is negative the traveling wave solution propagates towards the left, the left side is called downwind side and right side is the upwind side. If the finite difference scheme for the spatial derivative, [math]\displaystyle{ \partial u / \partial x }[/math] contains more points in the upwind side, the scheme is called an upwind-biased or simply an upwind scheme.

First-order upwind scheme

A simulation of a first-order upwind scheme in which a = sin(t).

The simplest upwind scheme possible is the first-order upwind scheme. It is given by[2]

[math]\displaystyle{ \frac{u_i^{n+1} - u_i^{n}}{\Delta t} + a \frac{u_i^n - u_{i-1}^n}{\Delta x} = 0 \quad \text{for} \quad a \gt 0 }[/math]

 

 

 

 

(1)

[math]\displaystyle{ \frac{u_i^{n+1} - u_i^n}{\Delta t} + a \frac{u_{i+1}^n - u_i^n}{\Delta x} = 0 \quad \text{for} \quad a \lt 0 }[/math]

 

 

 

 

(2)

where [math]\displaystyle{ n }[/math] refers to the [math]\displaystyle{ t }[/math] dimension and [math]\displaystyle{ i }[/math] refers to the [math]\displaystyle{ x }[/math] dimension. (By comparison, a central difference scheme in this scenario would look like

[math]\displaystyle{ \frac{u_i^{n+1} - u_i^{n}}{\Delta t} + a \frac{u_{i+1}^n - u_{i-1}^n}{2\Delta x} = 0, }[/math]

regardless of the sign of [math]\displaystyle{ a }[/math].)

Compact form

Defining

[math]\displaystyle{ a^+ = \text{max}(a,0)\,, \qquad a^- = \text{min}(a,0) }[/math]

and

[math]\displaystyle{ u_x^- = \frac{u_i^{n} - u_{i-1}^{n}}{\Delta x}\,, \qquad u_x^+ = \frac{u_{i+1}^{n} - u_{i}^{n}}{\Delta x} }[/math]

the two conditional equations (1) and (2) can be combined and written in a compact form as

[math]\displaystyle{ u_i^{n+1} = u_i^n - \Delta t \left[ a^+ u_x^- + a^- u_x^+ \right] }[/math]

 

 

 

 

(3)

Equation (3) is a general way of writing any upwind-type schemes.

Stability

The upwind scheme is stable if the following Courant–Friedrichs–Lewy condition (CFL) is satisfied.[3]

The effects of the courant number, c, on the stability of the first-order upward numerical scheme.
[math]\displaystyle{ c = \left| \frac{a\Delta t}{\Delta x} \right| \le 1 }[/math] and [math]\displaystyle{ 0 \le a }[/math].

A Taylor series analysis of the upwind scheme discussed above will show that it is first-order accurate in space and time. Modified wavenumber analysis shows that the first-order upwind scheme introduces severe numerical diffusion/dissipation in the solution where large gradients exist due to necessity of high wavenumbers to represent sharp gradients.

Second-order upwind scheme

The spatial accuracy of the first-order upwind scheme can be improved by including 3 data points instead of just 2, which offers a more accurate finite difference stencil for the approximation of spatial derivative. For the second-order upwind scheme, [math]\displaystyle{ u_x^- }[/math] becomes the 3-point backward difference in equation (3) and is defined as

[math]\displaystyle{ u_x^- = \frac{3u_i^n - 4u_{i-1}^n + u_{i-2}^n}{2\Delta x} }[/math]

and [math]\displaystyle{ u_x^+ }[/math] is the 3-point forward difference, defined as

[math]\displaystyle{ u_x^+ = \frac{-u_{i+2}^n + 4u_{i+1}^n - 3u_i^n}{2\Delta x} }[/math]

This scheme is less diffusive compared to the first-order accurate scheme and is called linear upwind differencing (LUD) scheme.

See also

References

  1. Courant, Richard; Isaacson, E; Rees, M. (1952). "On the Solution of Nonlinear Hyperbolic Differential Equations by Finite Differences". Comm. Pure Appl. Math. 5 (3): 243..255. doi:10.1002/cpa.3160050303. 
  2. Patankar, S. V. (1980). Numerical Heat Transfer and Fluid Flow. Taylor & Francis. ISBN 978-0-89116-522-4. 
  3. Hirsch, C. (1990). Numerical Computation of Internal and External Flows. John Wiley & Sons. ISBN 978-0-471-92452-4.