# Upwind Scheme

The central difference scheme assumes that the effects of the values of $\varphi$ at two neighboring grid points on the value of $\varphi$ at the face of the control volume are equal. This assumption is valid only if the effect of diffusion is dominant. If, on the other hand, the convection is dominant, one can expect that the effect of the grid point upwind is more significant than that of the point downwind. If we can assume that the value of $\varphi$ at the face of the control volume is dominated by the value of $\varphi$ at the grid point at the upwind side and that the effect of the value of $\varphi$ at the downwind side can be neglected, the two terms on the left hand side of eq. (4.211) can be expressed as

$(\rho u\varphi )_{e}=\left\{ \begin{matrix} F_{e}\varphi _{P},\text{ }F_{e}>0 \\ F_{e}\varphi _{E},\text{ }F_{e}<0 \\ \end{matrix} \right.$

$(\rho u\varphi )_{w}=\left\{ \begin{matrix} F_{w}\varphi _{W},\text{ }F_{w}>0 \\ F_{w}\varphi _{P},\text{ }F_{w}<0 \\ \end{matrix} \right.$

The above two equations can be expressed in the following compact form:

$(\rho u\varphi )_{e}=\varphi _{P}\left[\!\left[ F_{e},0 \right]\!\right]-\varphi _{E}\left[\!\left[ -F_{e},0 \right]\!\right]$

$(\rho u\varphi )_{w}=\varphi _{W}\left[\!\left[ F_{w},0 \right]\!\right]-\varphi _{P}\left[\!\left[ -F_{w},0 \right]\!\right]$

where the operator $\left[\!\left[ A,B \right]\!\right]$ denotes the greater of A and B (Patankar, 1980). Substituting the above expression into the left hand side of eq. (4.211) and using central difference for the right hand side of eq. (4.211), the discretized equation becomes

 $a_{P}\varphi _{P}=a_{E}\varphi _{E}+a_{W}\varphi _{W}$ (1)

where

 $a_{E}=D_{e}+\left[\!\left[ -F_{e},0 \right]\!\right]$ (2)
 $a_{W}=D_{w}+\left[\!\left[ F_{w},0 \right]\!\right]$ (3)
 $\begin{matrix}{}\\\end{matrix}a_{P}=a_{W}+a_{E}+(F_{e}-F_{w})$ (4)

The above scheme is referred to as the upwind scheme because the value of $\varphi$ at the grid point on the upwind side was used as the value of $\varphi$ at the face of the control volume to discretize the convection term. The upwind scheme ensures that the coefficients in eq. (4.221) are always positive so that a physically unrealistic solution can be avoided.