Upwind Schemes meaning

1.3k Views Asked by At

What is an upwind scheme?(Why the name "upwind") Why Gudunov scheme for conservation laws is an upwind sceme?

2

There are 2 best solutions below

0
On

I'll try to explain with a simple example. The name almost speaks for itself when you think about the diffusion and convection of heat inside a metal rod. Let's suppose the heat is convected from left to right.

The equation that models this problem is this: \begin{equation} -\epsilon u''+p u' = 0, \end{equation} with some sort of boundary condition (take $u(0) = 0$, $u(1)=1$ as an example). Note that $p>0$. It's a fairly easy equation, but it serves our purpose.

If we discretize the problem using centered finite differences (just as an example), we have that given a certain point $x_i$ of the grid, the solution $u(x_i)$ is calculated using "in equal amount" the solution in $u(x_{i-1})$ and in $u(x_{i+1})$. But, if we have $\epsilon << p$, then the diffusion contribute is almost negligible. If you keep using this method you will encounter numerical instability, unless you use a ludicrously fine grid. If you use instead a skewed stencil, instead of a symmetric one, you can give more importance to the operator in the equation that is actually more important (i.e. $pu'$) - because $p$ is larger than $\epsilon$.

TL;DR: From a physicist point of view, this means that in every point of the grid, when you are calculating the solution in that point, you are "putting yourself upwind": you are facing the direction of the wind, or, in our case, the direction of the heat through the metal rod. In other terms: if the heat is moving from L to R, and you are at the point $x_i$, there's no need to look at the diffusion nor the convection of heat that come from the point $x_{i+1}$, because the heat is coming from the point $x_{i-1}$.

About Godunov's scheme, if you consider what I just said about using skewed stencils it is immediate why it's an upwind scheme ;)

I hope this clarifies.

0
On

To add some formulas to the answer of Paolo, you can show that the Godunov scheme $$ F_{i + 1/2}^{(n)} = F\Big(u_i^{(n)}, u_{i+1}^{(n)}\Big) = \begin{cases} \underset{u_i^{(n)}\leq \theta \leq u_{i+1}^{(n)}}{\min} f(\theta) & u_i^{(n)}\leq u_{i+1}^{(n)} \\ \underset{u_{i+1}^{(n)}\leq \theta \leq u_{i}^{(n)}}{\max} f(\theta) & u_{i+1}^{(n)} < u_{i}^{(n)} \end{cases}$$

reproduces the ("classic", first-order) upwind scheme typically used for the transport equation $$u_t + au_x = 0, \quad a \neq a(x)$$ since for this equation the (linear) flux $f(u)$ is given by $au$ and consequently the Godunov scheme reads $$ F_{i + 1/2}^{(n)} = \begin{cases} \underset{u_i^{(n)}\leq \theta \leq u_{i+1}^{(n)}}{\min} a \theta & u_i^{(n)}\leq u_{i+1}^{(n)} \\ \underset{u_{i+1}^{(n)}\leq \theta \leq u_{i}^{(n)}}{\max} a \theta & u_{i+1}^{(n)} < u_{i}^{(n)} \end{cases} = a \begin{cases} u_i^{(n)} & a \geq 0 \\ u_{i+1}^{(n)} & a < 0 \end{cases} $$ which follows from considering the cases $a \geq 0, a < 0$. For $a \geq 0$, the solution of $\underset{u_i^{(n)}\leq \theta \leq u_{i+1}^{(n)}}{\min} a \theta$ is given by $u_i^{(n)}$ which coincides with the solution of $\underset{u_{i+1}^{(n)}\leq \theta \leq u_{i}^{(n)}}{\max} a \theta$. By solving both optimization problems in the case $a < 0$ you observe that they also lead to the same solution, in this case $u_{i+1}^{(n)}$.

Plugging this into the classic finite volume update equation $$u_i^{(n+1)} = u_i^{(n)} - \frac{\Delta t}{\Delta x} \Big( F_{i+1/2}^{(n)} - F_{i-1/2}^{(n)}\Big)$$ gives for $a \geq 0$ $$u_i^{(n+1)} = u_i^{(n)} - \frac{\Delta t}{\Delta x} a\Big( u_i^{(n)} - u_{i-1}^{(n)}\Big),$$ which is exactly the form of finite-difference formula of the linear transport equation if discretized with Forward Euler. (Same holds of course for $a < 0$.)

Note, however, that finite volume methods (FVM) do not work with point values as finite difference schemes do, but instead with specially constructed cell averages. But if you set (just for the purpose of this example) the cell average of the FVM to the point value (multiplied by cell size $\Delta x$), you get exactly the same results. In essence, the Godunov scheme can be seen as the extension of the upwind scheme for nonlinear fluxes $f$ in the context of finite volume schemes.