Wednesday, 2 December 2015

Numerical Diffusion vs. Numerical Dispersion




Numerical diffusion and dispersion are a major error source in CFD studies. In informal discussion the terms may be used interchangeably or along with others (eg: “Numerical Dissipation”, “Numerical viscosity” etc.) but the two terms have quite separate formal meanings.

Numerical diffusion is the tendency for transported variables to diffuse more than they should. Compared to exact solutions with diffusion terms (viscosity, mass diffusivity etc.) that are physically realistic, the numerical diffusion is an error that adds to this diffusion, “smudging” the results. In a grid independence study (GIS) this is one of the errors you are testing for. Say you observe a velocity profile in your GIS, with mesh refinement you will see that peaks will become more defined as this “smudging” effect is reduced.


Figure 1 – The effect of numerical diffusion (Andersson et al., 2009).

Numerical diffusion occurs when 1st order discretisation are used such as the first order upwind scheme.  It is sometimes referred to as “numerical viscosity” because the error behaves as if there was an addition to the diffusion term (which is viscosity in the case of fluid flow).

Numerical dispersion occurs when a higher order discretisation scheme is used to improve accuracy of the result. Numerical dispersion often takes the form of so-called ‘spurious oscillations’. The difference between numerical diffusion and dispersion is often depicted as an approximation to a step change as shown in Figure 2. The spurious oscillations cause problems in the flow, for example if this step change was in a variable that can only be between 0 and 1 (such as mass fraction for example), spurious oscillations can lead to unphysical values.


Figure 2 – The difference between numerical diffusion and numerical dispersion (Wendt, 2009).

This is due to the truncation error of the discretisation. If the truncation is an odd-order method (such as the first order unwind method) the leading truncation error is even. If the truncation is, say, a second order upwind method, the leading truncation error is odd. Even order derivatives in the truncation error contribute to numerical diffusion, odd order derivatives contribute to numerical dispersion. These represent real and imaginary parts respectively in the Von Neumann amplification factor (more information in Hirsch, (2007)).

Ideally we would like to eliminate both errors from our simulation result. But this is hindered by Godunov’s Theorem: “linear numerical schemes for solving PDE’s having the property of not generating new extrema (monotone scheme) can at most be first order accurate”. First-order upwind schemes are the least diffusive of the first order schemes.

Some more points to finish:

  • Shock waves are often resolved using artificial viscosity, deliberately including an extra viscosity term to produce something like the LHS of Figure 2.
  • FLUENT contains an option called “first to higher order blending” that will switch to first order
  • For higher-order methods a loophole exists, involving the non-linear limiter functions that enforce monotonicity (Wendt, 2009).

That’s all I know about it so far. I’m interested in finding out more regarding how to actually identify dispersive errors in your simulation. That’s what I’m hopefully going to look into in the future.

References:


Andersson, B. et al. (2012). Computational Fluid Dynamics for Engineers. Cambridge University Press.

Hirsch, C. (2007). Numerical Computation of Internal and External Flows, 2nd ed. Elsevier.

Wendt, JF. (2009). Computational Fluid Dynamics an Introduction. Springer.

2 comments:

  1. Thanks for the wonderful references mentioned at the end. Helped me.

    ReplyDelete