# Don't we care about the numerical diffusion in the diffusion term?

In the context of the solution of advection-diffusion equations by finite volume method, many numerical schemes, papers and book chapters are dedicated to address the numerical diffusion and/or numerical dispersion that comes from the discretization of the advection term.

If I understand it correctly, the discretization of the diffusion term also creates numerical diffusion and/or dispersion. However, given the lack of literature about it, it seems not to be a problem.

Why is that so?

• I've written about numerical diffusion due to discretization of advection operators before here: scicomp.stackexchange.com/questions/16130/… . In this case, I derive the numerical diffusion due to a first-order upwind discretization, but the approach can be generalized for your particular scheme. It can give you an idea of how large the numerical diffusion is in your problem compared to the "real" diffusion. – Tyler Olsen Mar 10 '18 at 16:55

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$

The function $u$ may represent for example the concentration that propagates at velocity $v>0$ and disperses in a medium with viscosity $\nu>0$. Since only we are discussing how terms are discretised initial and boundary conditions are unnecesary.

Imagine we discretise the equation $(*)$ according to the following scheme: $$\color{red}{\frac{\partial u}{\partial x} = \frac{u_i-u_{i-1}}{\Delta x}}$$ $$\color{blue}{\frac{\partial^2 u}{\partial x^2}\approx \frac{u_{i-1}-2u_i+u_{i+1}}{\Delta x^2}}$$ Giving the following numerical approximation: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{u_i-u_{i-1}}{\Delta x}}-\nu\color{blue}{\frac{u_{i-1}-2u_i+u_{i+1}}{\Delta x^2}}=0 \tag{**}$$

If we reverse the transformation, to find what equation $(**)$ solves by means of taylor expansion: $$u_{i\pm 1}=u_i\pm\frac{\partial u}{\partial x}\Delta x+\frac{1}{2}\frac{\partial^2u}{\partial x^2}\Delta x^2\pm\frac{1}{6}\frac{\partial ^3 u}{\partial x^3}\Delta x^3+\mathcal{O}(\Delta x^4)$$ we find: $$\frac{\partial u}{\partial t}+v\left[\color{red}{\frac{\partial u}{\partial x}-\frac{1}{2}\frac{\partial^2 u}{\partial x^2}\Delta x+\mathcal{O}(\Delta x^2)}\right]-\nu\left[\color{blue}{\frac{\partial^2u}{\partial x^2}+\mathcal{O}(\Delta x^2)}\right]=0$$

We can say that when using the scheme $(**)$ we approximate the following equation exactly (up to an error $\mathcal{O}(\Delta x^2)$):

$$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\left(\nu+\color{red}{\frac{v\Delta x}{2}}\right)\color{blue}{\frac{\partial^2u}{\partial x^2}}=\color{blue}{\mathcal{O}(\Delta x^2)}$$

The added viscosity is then $v\Delta x/2$.

If you would have used a centred scheme for convective term , you would have solved equation $(*)$ exactly up to second order (check it!).

This is the main reason of the fact that books does not stop to describe the added viscosity from the discretisation of the diffusive term (the leading one is the added by convective terms for stable schemes, e.g. upwind).

• thank you for the detail explanation. However, the fact that the order of the error of the convection term is lower than that of the advection term does not mean that the error itself of the convection term is higher than that of the advection term. It simply tells how the error reduces as the mesh is refined. – toliveira Mar 12 '18 at 12:53
• You are confused with the difference between convection and diffussion. What is more, I think you don't remember what have you asked: "the discretization of the diffusion term also creates numerical diffusion and/or dispersion. However, given the lack of literature about it, it seems not to be a problem". My answer I think that explains this point: Numerical diffusion introduced by the discretisation of a second derivative (diffusion) is smaller than the introduced by a first one (convection). – HBR Mar 12 '18 at 14:18
• I really liked your answer but I don't think that it allow us to conclude that "numerical diffusion introduced by the discretization of a second derivative (diffusion) is smaller than the introduced by a first one". To get to that conclusion we may need still to consider what typical values for $\nu$, $v$, $\Delta x$ and $\partial^{(i)} / \partial{x^(i)}$ are. You argument is complete just if $\Delta x \rightarrow 0$, which is never the case in numerical simulation. – toliveira Mar 12 '18 at 14:45
• This answer provides the prelude of what are you talking about. Next time you should be more specific in what you are asking for. Anyways, what you are interested in is: nondimensional analysis... For numerical diffusion (from convection) to be unimportant it is required that: $$v\Delta x/(2\nu)\ll 1$$ and the one for diffusion (to be of the order of the introduced from convection) $$v\sim \nu\Delta x/(6x_0^2)$$ $x_0$ is some characteristic length. As you can see the velocity for this to happen is ridiculously small. Sorry for the mistakes... I am writing in my mobile phone. – HBR Mar 12 '18 at 15:01
• I detailed what I suppose to be the derivation of this result $v \sim \nu \Delta x /(6x_0^2)$ in another answer.... In the phone!? You are very patient to color equations in LaTeX in the phone! – toliveira Mar 14 '18 at 14:08

Numerical diffusion is not a (big) problem in diffusive equation solvers because it is there in your model. If you had no diffusion in your model, say Euler's equations or nondiffusive Shallow Water equation or any other hyperbolic equation, then numerical diffusion becomes an issue because it denatures the numerical solution by giving (or removing from) it properties that the exact solution hasn't (or has). For example, an exact solution that forms shocks will be approximated by a smeared out numerical solution.

From a mathematical point of view, the minimum we require from a numerical method is that a sequence of numerical solutions corresponding to a sequence of ever finer grids (or meshes) converges (in some sense) to the exact solution. If you have diffusion in the exact model, the exact solution is smooth and there are numerous convergence theorems that guarantee the convergence of the numerical method. However if there is diffusion in the exact model, its solutions are more singular (they can have shocks for example, or lack even a first derivative and must be interpreted in some generalized sense). The few convergence results are restricted to special situations and the convergence rates are those dictated by the smoothness of the exact solution (which is low). And if there is too much diffusion then this convergence is further slowed down (and in some cases completely obliterated).

So the reason we don't need to worry (too much) about numerical diffusion for convection-diffusion equations is that the solution begin smooth, it is easier to approximate with smooth numerical solutions (where smoothness of a discrete function can be measured by using discrete smooth norms).

Numerical dispersion is a different story, which I'm not really entitled to comment about, but because your equation is not dispersive it might be important to think about it. However, generally speaking numerical dispersion is much less of a problem when compared to numerical diffusion.

"Caring" is a modeling question. Whether you care depends on the granularity of your model, the required precision, and the question you're trying to answer. Of course methods can always be more precise, but that's not the purpose of a numerical approximation. A numerical approximation is a fast calculation that's a good enough solution of your equation to analyze your results, so there is no general answer.

You need to ask yourself whether the amount of numerical diffusion due to your chosen $dx$, $dt$, spatial discretization methods and order, etc. is an appropriate tradeoff in terms of runtime and your development time, and whether the amount of error that is numerically introduced does not interfere with your modeling conclusions.

• Thank you. I agree with the guidelines you exposed. My question is whether, for some reason, the numerical diffusion introduced by the a diffusion term is systematically much smaller (or difficult to tackle) than that of the advection term. Why is that that following the guidelines you mentioned, the discretization of the advection term has been scrutinized, but not that of the diffusion term? – toliveira Mar 10 '18 at 12:32

What I know is that when discretizing ad-/convective-diffusive equations, this problem (numerical diffusion) faces both of the ad-/convection term and the diffusion term due to the numerical approximations when computing the gradient. Therefore, the numerical diffusion is a numerical/truncation error and is a function of a few parameters, mainly the grid size and the alignment of the streamlines with the grids.

I tend to think that "solving" this problem (numerical diffusion) for the ad-/convection term and the diffusion term is the same. Note that higher order approximations have less numerical diffusion. However, they have numerical oscillations.

I am sure someone else would answer your question better than I did. I am still a graduate student in CFD.

• When you, e.g, choose to use a flux limiter scheme instead of upwind, you are changing the discretization scheme just of the advection term. So I wouldn't agree that "solving this problem for the ad-/convection term and the diffusion term is the same" when the solution used is an alternative numerical scheme. – toliveira Mar 10 '18 at 12:37
• OK, this is a different question. Again I am not an expert in this but I am going to answer you based on my student-like understanding of it. Discretization scheme should respect the influence of the flow direction. This means that some schemes choose second order approximation for both terms and some choose fist order approximation for one and second for the other. This is because the second order approxiamtion has less numerical diffusion = more accurate, but has numerical oscillations = bad when you have high gradient. First order approxiamation is less accurate but more stable. – Mazen Draw Mar 10 '18 at 13:33
• You should choose the discretization scheme based on your understanding of your unique problem. The flux limiter scheme would not be ideal for all problems, because some problems can afford to have a second order approximation for the diffusion term. P.S. I have no idea about the flux limiter scheme. I am answering based on what you wrote about it. – Mazen Draw Mar 10 '18 at 13:37

I took from him the structure of it and colours so to keep consistency and make it easier for those who read both. Any mistakes are mine.

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$

were $u$ is a quantity that diffuses with diffusion coefficient $\nu>0$ and is advected by velocity $v>0$.

Imagine we discretise the equation $(*)$ according to the following scheme (upwind for the advection term, central difference for the diffusion term) on a 1D equispaced mesh: $$\color{red}{\frac{\partial u}{\partial x} = \frac{u_i-u_{i-1}}{\Delta x}}$$ $$\color{blue}{\frac{\partial^2 u}{\partial x^2}\approx \frac{u_{i-1}-2u_i+u_{i+1}}{\Delta x^2}}$$

Giving the following numerical approximation: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{u_i-u_{i-1}}{\Delta x}}-\nu\color{blue}{\frac{u_{i-1}-2u_i+u_{i+1}}{\Delta x^2}}=0 \tag{**}$$

Taylor expansion for $u_{i\pm 1}$ around $u_i$ is $$u_{i\pm 1} = u_i \pm \frac{\partial u}{\partial x}\Delta x +\frac{1}{2}\frac{\partial^2u}{\partial x^2}\Delta x^2 \pm\frac{1}{6}\frac{\partial ^3 u}{\partial x^3}\Delta x^3 + \frac{1}{24}\frac{\partial^4u}{\partial x^4}\Delta x^4 \pm\frac{1}{120}\frac{\partial^5 u}{\partial x^5}\Delta x^5 +\mathcal{O}(\Delta x^6)$$

If we use this Taylor expansion in $(**)$ find out what equation $(**)$ solves, we find: $$\frac{\partial u}{\partial t}+v \left[\color{red}{ \frac{\partial u}{\partial x} -\frac{1}{2}\frac{\partial^2 u}{\partial x^2}\Delta x +\mathcal{O}(\Delta x^2) }\right] -\nu\left[\color{blue}{ \frac{\partial^2u}{\partial x^2} +\frac{1}{12}\frac{\partial^4u}{\partial x^4}\Delta x^2 +\mathcal{O}(\Delta x^4) }\right]=0$$

We can say that when using the scheme $(**)$ we approximate the following equation exactly (up to an error $\mathcal{O}(\Delta x^2)$):

$$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\left(\nu+\color{red}{\frac{v\Delta x}{2}} - \color{blue} {\frac{\nu\Delta x^2}{12}\frac{\partial^2}{\partial x^2}} \right)\color{blue}{\frac{\partial^2u}{\partial x^2}}=\color{red}{\mathcal{O}(\Delta x^2)}$$ where $\frac{\partial^2}{\partial x^2}$ is not a quantity, but an operator.

The lowest order term introduced by the discretization of the advection term is the numerical diffusion $\frac{v\Delta x}{2}\frac{\partial^2u}{\partial x^2}$, which would be unimportant just if $$\color{red} {\frac{v \Delta x}{2 \nu} \ll 1} \tag{***}$$ The quantity $\frac{v \Delta x}{\nu}$ is known as the grid Péclet number. $(** $$*) is rarely true, so the lowest order term introduced by the discretization of the advection term is rarely unimportant. The lowest order term introduced by the discretization of the diffusion term is \frac{\nu\Delta x^2}{12}\frac{\partial^4u}{\partial x^4}, which is unimportant if \frac{v\Delta x}{2}\frac{\partial^2u}{\partial x^2}$$\color{blue}{\frac{\nu\Delta x^2}{12}\frac{\partial^4u}{\partial x^4}} \ll \color{red}{\frac{v\Delta x}{2}\frac{\partial^2u}{\partial x^2}}\frac{\nu\Delta x}{6x_0^2} \ll v \tag{****}$$where x_0 is some characteristic length. (**$$**)$ is usually true, so the lowest order term introduced by the discretization of the diffusion term is usually unimportant.