# A Generalized Expression of Discretization Schemes

The above discretization schemes can be expressed in a single generalized form. The total flux J at the interface between two grid points that were defined in eq. (4.230) can be used to define: $J^{*}=\frac{J}{\Gamma /\delta x}=\text{Pe}_{\Delta }\varphi -\frac{d\varphi }{d(x/\delta x)}$ (1)

which relates to the values of $\varphi$ at grid points i and i+1 (see Fig. 4.19). The first term on the right side of eq. (4.243) will be related to some weighted average of $\varphi _{i}$ and $\varphi _{i+1}$, and the second term will be related to the difference between $\varphi _{i}$ and $\varphi _{i+1}$. Thus, one can express J * the total flux as (Patankar, 1980) $J^{*}=B(\text{Pe}_{\Delta })\varphi _{i}-A(\text{Pe}_{\Delta })\varphi _{i+1}$ (2)

where A and B are dimensionless coefficients that are functions of the grid Peclet number. If the field of $\varphi$ is uniform, we will have $d\varphi /dx=0$ and eq. (4.243) becomes $J^{*}=\text{Pe}_{\Delta }\varphi _{i}=\text{Pe}_{\Delta }\varphi _{i+1}$ (3)

Comparing eqs. (4.244) and (4.245) yields $\begin{matrix}{}\\\end{matrix}B(\text{Pe}_{\Delta })-A(\text{Pe}_{\Delta })=\text{Pe}_{\Delta }$ (4)

For the grid system shown in Fig. 1, if we reconsider the problem in a reversed coordinate system x' (x' = − x), the grid Peclet number will become − PeΔ and J * becomes $J^{*}=B(-\text{Pe}_{\Delta })\varphi _{i+1}-A(-\text{Pe}_{\Delta })\varphi _{i}$ (5)

The symmetric properties of A and B can be obtained by comparing eqs. (4.244) and (4.247), i.e., $\begin{matrix}{}\\\end{matrix}A(-\text{Pe}_{\Delta })=B(\text{Pe}_{\Delta })$ (6) $\begin{matrix}{}\\\end{matrix}B(-\text{Pe}_{\Delta })=A(\text{Pe}_{\Delta })$ (7)

For the exponential schemes discussed above, one can obtain J * from eq(4.234)or (4.235), i.e., \begin{align} & J^{*}=\text{Pe}_{\Delta }\left[ \varphi _{i}+\frac{\varphi _{i}-\varphi _{i+1}}{\exp (\text{Pe}_{\Delta })-1} \right] \\ & =\frac{\exp (\text{Pe}_{\Delta })\text{Pe}_{\Delta }}{\exp (\text{Pe}_{\Delta })-1}\varphi _{i}-\frac{\text{Pe}_{\Delta }}{\exp (\text{Pe}_{\Delta })-1}\varphi _{i+1} \\ \end{align}

Comparing the above expression with eq. (4.244), one obtains $B=\frac{\exp (\text{Pe}_{\Delta })\text{Pe}_{\Delta }}{\exp (\text{Pe}_{\Delta })-1},\text{ }A=\frac{\text{Pe}_{\Delta }}{\exp (\text{Pe}_{\Delta })-1}$

It can be verified that the above A and B satisfy eqs. (4.246), and (4.248) – (4.249). The implication of the above properties of A and B is that if the function A(PeΔ) for the case that PeΔ > 0 is known, the expressions of A and B for all PeΔ can be obtained. For example, if PeΔ < 0, eq. (4.246) can be used to obtain

A(PeΔ) = B(PeΔ) − PeΔ

Substituting eq. (4.248) into the above equation yields

A(PeΔ) = A( − PeΔ) − PeΔ

Considering $-\text{Pe}_{\Delta }=\left| \text{Pe}_{\Delta } \right|$ for the case that PeΔ < 0, the above expression can be rewritten as $A(\text{Pe}_{\Delta })=A(\left| \text{Pe}_{\Delta } \right|)+\left| \text{Pe}_{\Delta } \right|\text{ for Pe}_{\Delta }<0$

Since $A(\text{Pe}_{\Delta })=A(\left| \text{Pe}_{\Delta } \right|)\text{ for Pe}_{\Delta }>0$ the following expression for A under any grid Peclet number can be expressed as $A(\text{Pe}_{\Delta })=A(\left| \text{Pe}_{\Delta } \right|)+\left[\!\left[ -\text{Pe}_{\Delta },0 \right]\!\right]$ (8)

Similarly, the expression of B for any grid Peclet number can be expressed as (see Problem 4.24). $B(\text{Pe}_{\Delta })=A(\left| \text{Pe}_{\Delta } \right|)+\left[\!\left[ \text{Pe}_{\Delta },0 \right]\!\right]$ (9)

Therefore, different discretization schemes for the convection-diffusion terms can be characterized by different $A(\left| \text{Pe}_{\Delta } \right|)$ . To derive the generalized formula for different discretization schemes, let us begin from eq. (4.232), i.e., $J_{e}^{*}\text{D}_{e}=J_{w}^{*}\text{D}_{w}$ (10)

The total fluxes at the faces of the control volumes can be obtained from eq. (4.244), i.e., $J_{e}^{*}=B(\text{Pe}_{\Delta e})\varphi _{P}-A(\text{Pe}_{\Delta e})\varphi _{E}$ (11) $J_{w}^{*}=B(\text{Pe}_{\Delta w})\varphi _{W}-A(\text{Pe}_{\Delta w})\varphi _{P}$ (12)

Substituting the above expressions into eq. (4.252) and rearranging the resulting equation yields $\left[ D_{e}B(\text{Pe}_{\Delta e})+D_{w}A(\text{Pe}_{\Delta w}) \right]\varphi _{P}=D_{e}A(\text{Pe}_{\Delta e})\varphi _{E}+D_{w}B(\text{Pe}_{\Delta w})\varphi _{W}$

which can be rearranged as $a_{P}\varphi _{P}=a_{E}\varphi _{E}+a_{W}\varphi _{W}$ (13)

where $a_{E}=D_{e}A(\text{Pe}_{\Delta e})=D_{e}\left\{ A(\left| \text{Pe}_{\Delta e} \right|)+\left[\!\left[ -\text{Pe}_{\Delta e},0 \right]\!\right] \right\}$ (14) $a_{W}=D_{w}B(\text{Pe}_{\Delta w})=D_{w}\left\{ A(\left| \text{Pe}_{\Delta w} \right|)+\left[\!\left[ \text{Pe}_{\Delta w},0 \right]\!\right] \right\}$ (15)

 aP = aE + aW + (Fe − Fw) (16)

In arriving at eqs. (4.256) and (4.257), A and B were obtained from eqs. (4.250) and (4.251). At this point, it is apparent that different discretization schemes can be characterized by different expressions for A(|PeΔ|). By comparing eqs. (4.256) and (4.257) with different expressions of aE and aW for different schemes, the corresponding A(|PeΔ|) for different schemes can be summarized in Table 1 and plotted in Fig. 2. It should be noted that the difference between the power law and exponential scheme is exaggerated for clear presentation. The generalized formula represented by eqs. (4.255) – (4.258) will be very helpful to develop a generalized computer code for all schemes. A special module or subroutine can be written for different schemes.

Table 1 Summary of A(|PeΔ|) for different schemes

 Scheme A(|PeΔ|) Central difference $1-0.5\left| \text{Pe}_{\Delta } \right|$ Upwind 1 Hybrid $\left[\!\left[ 0,1-0.5\left| \text{Pe}_{\Delta } \right| \right]\!\right]$ Exponential $\left| \text{Pe}_{\Delta } \right|/[\exp (\left| \text{Pe}_{\Delta } \right|)-1]$ Power Law $\left[\!\left[ 0,(1-0.1\left| \text{Pe}_{\Delta } \right|)^{5} \right]\!\right]$