**3.4 Influence of the choice of profile on the face of the control volume on the quality of difference schemes**

When obtaining discrete analogs of the convective-diffusion problems given above, on the basis of multipoint PUs, it was possible to construct better compact circuits in a three-point template. However, there is another approach to improve the quality of the scheme based on the choice of the decision profile.

Since the work of Leonard, in order to improve the results of the numerical solution, attempts have been made to improve the algorithm, which is built in a fivepoint pattern.

*Moving Node Method for Differential Equations DOI: http://dx.doi.org/10.5772/intechopen.107340*

In all the above schemes (except for the scheme against the flow), the conditions of boundedness and non-negativity of the coefficients are violated.

Here it is proposed to improve the scheme based on the choice of the solution profile on the edge of the control volume in the three-point template of the convective-diffusion problem. The upwind scheme with one-sided differences is taken as the initial scheme. The QUICK scheme uses quadratic upwind interpolation to determine the convective flow. Here we use the solution obtained by the upwind scheme based on the method of moving nodes.

MNM for simple cases allows one to obtain an analytical representation of the solution between the nodal points of the boundary value problem. Based on this representation, it is possible to construct a better discrete scheme.

We integrate (73) over the control volume ½ � *w*,*e*

$$
\Phi\_{\epsilon} - \Phi\_w = \frac{1}{Pe} \left( \frac{d\Phi}{d\kappa} \right)\_{\epsilon} - \frac{1}{Pe} \left( \frac{d\Phi}{d\kappa} \right)\_w + \int\_w^{\epsilon} S(\kappa) d\kappa.
$$

Replacing the derivatives with difference relations, we have

$$
\Delta\Phi\_{\varepsilon} - \Phi\_{w} = \frac{\mathbf{1}}{\mathrm{Pe}} \frac{\Phi\_{E} - \Phi\_{\mathrm{P}}}{\varkappa\_{E} - \varkappa\_{\mathrm{P}}} - \frac{\mathbf{1}}{\mathrm{Pe}} \frac{\Phi\_{\mathrm{P}} - \Phi\_{W}}{\varkappa\_{\mathrm{P}} - \varkappa\_{W}} + (\varkappa\_{\varepsilon} - \varkappa\_{w})f\_{\mathrm{P}}.\tag{86}
$$

Here *<sup>f</sup> <sup>P</sup>* <sup>¼</sup> <sup>1</sup> *xe*�*xw* Ð *e w S x*ð Þ*dx*. Depending on the type of function profile *Ф* on the control volume, different schemes are obtained.

Let the profile *Ф* be piecewise constant in each control volume. Then, assuming *Ф<sup>e</sup>* ¼ *ФP*, *Ф<sup>w</sup>* ¼ *ФW*, we have an upwind scheme:

$$
\Phi\_P - \Phi\_W = \frac{1}{Pe} \frac{\Phi\_E - \Phi\_P}{\varkappa\_E - \varkappa\_P} - \frac{1}{Pe} \frac{\Phi\_P - \Phi\_W}{\varkappa\_P - \varkappa\_W} + (\varkappa\_\varepsilon - \varkappa\_w) f\_P. \tag{87}
$$

If the profile *Ф* is linear between the nodes and the edges of the control volume are located in the middle between the node points, we have a scheme with central differences:

$$\frac{\Phi\_{\rm E} + \Phi\_{\rm P}}{2} - \frac{\Phi\_{\rm P} + \Phi\_{\rm W}}{2} = \frac{1}{Pe} \frac{\Phi\_{\rm E} - \Phi\_{\rm P}}{\chi\_{\rm E} - \chi\_{\rm P}} - \frac{1}{Pe} \frac{\Phi\_{\rm P} - \Phi\_{\rm W}}{\chi\_{\rm P} - \chi\_{\rm W}} + (\chi\_{\rm e} - \chi\_{\rm w})f\_{\rm P}.\tag{88}$$

To improve the accuracy of circuits, many authors recommended various circuits. All these schemes are multipoint (more than three). Here is a way to improve three-point circuits.

From (87) we get

$$\begin{split} \Phi\_{P} &= \frac{\mathbf{x}\_{P} - \mathbf{x}\_{W}}{\mathrm{Pe}(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{x}\_{P} - \mathbf{x}\_{W}) + \mathbf{x}\_{E} - \mathbf{x}\_{W}} \Phi\_{E} + \frac{(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{1} + \mathrm{Pe}(\mathbf{x}\_{P} - \mathbf{x}\_{W}))}{\mathrm{Pe}(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{x}\_{P} - \mathbf{x}\_{W}) + \mathbf{x}\_{E} - \mathbf{x}\_{W}} \Phi\_{W} + \frac{(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{x}\_{E} - \mathbf{x}\_{W})}{\mathrm{Pe}(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{1} + \mathrm{Pe}(\mathbf{x}\_{P} - \mathbf{x}\_{W}))} \Phi\_{W} + \frac{(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{x}\_{E} - \mathbf{x}\_{W})}{\mathrm{Pe}(\mathbf{x}\_{E} - \mathbf{x}\_{P})(\mathbf{x}\_{P} - \mathbf{x}\_{W}) + \mathbf{x}\_{E} - \mathbf{x}\_{W}} \Phi\_{W} \tag{89}$$

If the nodes *xE* and *xW* are fixed, and the node *xP* is movable, we get a profile *Ф<sup>P</sup>* between the nodes *xE* and *xW*. This profile is used in (86) to determine *Ф<sup>e</sup>* and *Фw*.

To improve scheme (87), we proceed as follows. Eq. (89) connects at three nodes (*xW*, *xP*, *xE*), if we apply Eq. (89) for nodes ( *xW*, *xw*, *xP*), we have

$$
\Phi\_w = \frac{2 + R\_h}{4 + R\_h} \Phi\_P + \frac{2}{4 + R\_h} \Phi\_E + \frac{R\_h}{2(R\_h + 4)} \frac{h}{4} f\_w. \tag{90}
$$

Similarly, for nodes ( *xP*, *xe*, *xE*), we have

$$
\Phi\_{\varepsilon} = \frac{2 + R\_h}{4 + R\_h} \Phi\_P + \frac{2}{4 + R\_h} \Phi\_E + \frac{R\_h h}{2(R\_h + 4)} f\_{\varepsilon}. \tag{91}
$$

Substituting (90) and (91) into (86) we have

$$
\left[\frac{R\_h^2}{4+R\_h} + 2\right] \Phi\_P = \left[1 + \frac{2+R\_h}{4+R\_h}\right] \Phi\_W + \left[1 - \frac{2R\_h}{4+R\_h}\right] \Phi\_E + hR\_hf\_P - \frac{h \cdot R\_h^2}{2(4+R\_h)} \left(f\_\epsilon - f\_w\right).
\tag{92}
$$

The condition *Rh* < 4 is ensured by the positivity of the coefficients and the stability of the scheme (92).

Proceeding similarly as in the derivation of (92), but using (92) for the profile, for a uniform step we obtain

$$\begin{aligned} \left[\frac{(4+R\_h)^2-16}{(4+R\_h)^2+16}\right]\Phi\_P &= \left[\frac{1}{R\_h}-\frac{16}{(4+R\_h)^2+16}\right]\Phi\_E + \left[\frac{(4+R\_h)^2}{(4+R\_h)^2+16}+\frac{1}{R\_h}\right]\Phi\_W + \left[\frac{(4+R\_h)^2-16}{(4+R\_h)^2+16}\right]\Phi\_W + \left[\frac{(4+R\_h)^2-16}{(4+R\_h)^2+16}\right]\Phi\_W \\ hS(P) &+ \frac{h\left(8R\_h+8R\_h^2\right)}{2\left[\left(4+R\_h\right)^2+16\right]} \cdot (\mathbf{S}(\mathbf{x}\_w) - \mathbf{S}(\mathbf{x}\_\epsilon)), \end{aligned} \tag{93}$$

Test problems 1. Consider the equation

$$\frac{du}{d\mathbf{x}} = \frac{1}{P\mathbf{e}} \frac{d^2 u}{d\mathbf{x}^2} + \sin \pi \mathbf{x}.$$

with boundary conditions *u*ð Þ¼ 0 *u*ð Þ¼ 1 0. **Table 4** shows the maximum absolute differences of the schemes calculated at the nodal points ( *u* is the exact solution of the problem, *u*<sup>1</sup> is the solution obtained according to the upwind scheme, *u*<sup>2</sup> is according to the power law, *u*<sup>3</sup> according to the Leonard scheme, *u*<sup>4</sup> according to (92) and *u*5 according to the scheme (93).


**Table 4.** *The maximum absolute differences.* *Moving Node Method for Differential Equations DOI: http://dx.doi.org/10.5772/intechopen.107340*

2. Consider the equation

$$\frac{du}{d\mathbf{x}} = \frac{\mathbf{1}}{P\mathbf{e}} \frac{d^2 u}{d\mathbf{x}^2} + \mathbf{s}(\mathbf{x}),$$

with boundary conditions *u*ð Þ¼ 0 0, *u*ð Þ¼ 1 1, with source

$$s(\mathbf{x}) = \begin{cases} 10 - 50\mathbf{x}, & 0 \le \mathbf{x} \le \mathbf{0}.3, \\ 50\mathbf{x} - 2\mathbf{0}, & 0.3 < \mathbf{x} \le \mathbf{0}.4, \\ 0, & 0.4 < \mathbf{x} \le \mathbf{1} \end{cases}$$

**Figure 43** shows that scheme (93) gives the best results. Leonard's scheme gives an incorrect solution near the right boundary. Scheme (92) also exhibits a slight non-monotonicity. This is due to the fact that scheme (92) is stable for *Rk*<4.

**Figure 44** Shows that for large grid Peclet numbers, the upstream and Patankar schemes give close results. Scheme (93) gives the best results. This can also be seen in **Table 5**, which compares the considered schemes (SDS—central scheme).

3. Two-dimensional case. Consider the equation

$$\frac{\partial \mathbf{g}}{\partial \mathbf{x}} = \frac{1}{\text{Re}} \left( \frac{\partial^2 \mathbf{g}}{\partial \mathbf{x}^2} + \frac{\partial^2 \mathbf{g}}{\partial \mathbf{y}^2} \right) + s(\mathbf{x}, \mathbf{y}).$$

Exact solution *<sup>g</sup>* <sup>¼</sup> <sup>6</sup>*y*<sup>10</sup> <sup>1</sup> � *<sup>y</sup>*<sup>10</sup> ð Þ <sup>1</sup> � *<sup>x</sup>*<sup>3</sup> ð Þþ <sup>6</sup>*x*<sup>3</sup>*y*ð Þ <sup>1</sup> � *<sup>y</sup>* . The equations are solved in the area 0, 1 ½ �� ½ � 0, 1 . The source term is defined so that the given function is a

#### **Figure 43.**

*Comparison of various schemes. P*e ¼ 100, *Rh* ¼ 5*: The solid line is the exact solution, the circle is the upwind scheme, the circle is the Patankar scheme, the asterisk is the Leonard scheme, + is the scheme (92), the diamond is according to (93).*

#### **Figure 44.**

*Comparison of various schemes.* Re ¼ 500, *Rh* ¼ 25*: The solid line is the exact solution, the circle is the upwind scheme, the circle is the Patankar scheme, the asterisk is the Leonard scheme, + is the scheme (92), the diamond is according to (93).*


#### **Table 5.**

*Comparison of circuits with respect to grid Peclet number.*

*Moving Node Method for Differential Equations DOI: http://dx.doi.org/10.5772/intechopen.107340*


#### **Table 6.**

*Results of calculations of errors according to the schemes.*

solution to the equation. The boundary conditions were determined based on the exact solution. **Table 6** shows the results of calculations according to the schemes. From **Table 6**, it is clear that the proposed schemes show the best results.

### **3.5 Schema improvement with flow equality**

MNM can improve the quality of the scheme. We demonstrate this method based on the upwind scheme (87) written in the form:

$$\frac{\Phi\_P - \Phi\_W}{\varkappa\_P - \varkappa\_W} = \frac{2}{Pe(\varkappa\_E - \varkappa\_W)} \left( \frac{\Phi\_E - \Phi\_P}{\varkappa\_E - \varkappa\_P} - \frac{\Phi - \Phi\_W}{\varkappa\_P - \varkappa\_W} \right) + \mathcal{S}(\varkappa\_P). \tag{94}$$

In (94) we pass to the limit at *xE* ! *xP* and, assuming the existence of the limit, we have

$$\frac{\boldsymbol{\Phi}\_{\mathrm{P}} - \boldsymbol{\Phi}\_{\mathrm{W}}}{\boldsymbol{\Lambda}\_{\mathrm{P}} - \boldsymbol{\infty}\_{\mathrm{W}}} = \frac{2}{\mathrm{Pe}(\boldsymbol{\varkappa}\_{\mathrm{P}} - \boldsymbol{\varkappa}\_{\mathrm{W}})} \left( \frac{d\boldsymbol{\Phi}\_{\mathrm{P}}^{-}}{d\boldsymbol{\varkappa}\_{\mathrm{P}}} - \frac{\boldsymbol{\Phi}\_{\mathrm{P}} - \boldsymbol{\Phi}\_{\mathrm{W}}}{\boldsymbol{\varkappa}\_{\mathrm{P}} - \boldsymbol{\varkappa}\_{\mathrm{W}}} \right) + \mathrm{S}(\boldsymbol{\varkappa}\_{\mathrm{P}}) .$$

Here, *dФ*� *<sup>P</sup> =dxP* is the left-hand derivative of the unknown function at the point *xP*. From here

$$\frac{d\Phi\_P^-}{d\mathbf{x}\_P} = \frac{2 + \text{Pe}(\mathbf{x}\_P - \mathbf{x}\_W)}{2} \cdot \frac{\Phi\_P - \Phi\_W}{\mathbf{x}\_P - \mathbf{x}\_W} - \frac{\text{Pe}(\mathbf{x}\_P - \mathbf{x}\_W)}{2} \cdot \mathbf{S}(\mathbf{x}\_P),\tag{95}$$

Similarly, taking an arbitrary point *x*∈ð Þ *xP*, *xE* and passing to the limit *x* ! *xP*, we find

$$\frac{d\Phi\_P^+}{d\boldsymbol{\infty}\_P} = \frac{2}{2 + P e(\boldsymbol{\infty}\_E - \boldsymbol{\infty}\_P)} \cdot \frac{\Phi\_E - \Phi\_P}{\boldsymbol{\infty}\_E - \boldsymbol{\infty}\_P} + \frac{P e(\boldsymbol{\infty}\_E - \boldsymbol{\infty}\_P)}{2 + P e(\boldsymbol{\infty}\_E - \boldsymbol{\infty}\_P)} \cdot S(\boldsymbol{\infty}\_P),$$

By equating *dФ*<sup>þ</sup>*=dx* ¼ *dФ*�*=dx* the flows, we get an improved scheme:

$$
\sigma\_P \Phi\_P = a\_P \Phi\_W + b\_P \Phi\_E + d\_P \mathbf{S}(\mathbf{x}\_P) \tag{96}
$$

*Numerical Simulation – Advanced Techniques for Science and Engineering*

#### **Figure 45.**

*Comparison of schemes. The solid curve is the exact solution, the dotted line according to (87), the dotted line according to (96).*

#### where

*aP* <sup>¼</sup> <sup>2</sup>þ*Pe x*ð Þ *<sup>P</sup>*�*xW* ð Þ *xP*�*xW* , *bP* <sup>¼</sup> <sup>2</sup> ½ � <sup>2</sup>þ*Pe x*ð Þ *<sup>E</sup>*�*xP* ð Þ *xE*�*xP* ,*cP* <sup>¼</sup> *aP* <sup>þ</sup> *bP*, .

**Figure 45** shows a comparison of the exact solution and the schemes according to (87) and (96) for *Pe* = 5, with one moving node (*S*(*х*) = 0). It can be seen from the graph that the solution is improving. Numerical diffusion decreases.

#### **3.6 Investigation of the scheme by the MNM**

At this point, we are dealing with monotonicity and MMN approximation of the circuit. On the basis of the analytical form of the approximate solution of the problem between the nodes, which is obtained on the basis of the MMN, it is possible to investigate monotonicity and the type of approximation of the scheme.

#### *3.6.1 Investagation of monotonicity*

Scheme with central-difference approximation of the convective term. Consider Eq. (73). Take a segment ½ � *xi*�1, *xi*þ<sup>1</sup> ⊂½ � 0, 1 and any point *x* � *xi* ∈ð Þ *xi*�1, *xi*þ<sup>1</sup> . Consider the grid analog (73)

$$\frac{u\_{i+1} - u\_{i-1}}{\infty\_{i+1} - \infty\_{i-1}} = \frac{2}{\operatorname{Pe}(\infty\_{i+1} - \infty\_{i-1})} \left( \frac{u\_{i+1} - u}{\infty\_{i+1} - \infty} - \frac{u - u\_{i-1}}{\infty - \infty\_{i-1}} \right) + \operatorname{S}(\infty) \tag{97}$$

If we set *x* ¼ ð Þ *xi*þ<sup>1</sup> þ *xi*�<sup>1</sup> *=*2, we have a central-difference approximation. Here, *ui*þ<sup>1</sup> is the approximate value of the solution at the point *xi*þ1, *u* is the approximate value of the solution at the point *x:* To obtain a physically plausible solution in simple cases, we set S(*x*) = 0.

From (97) we find

$$u = \frac{(\mathbf{x} - \mathbf{x}\_{i-1})(2 - Pe(\mathbf{x}\_{i+1} - \mathbf{x}))u\_{i+1} + (\mathbf{x}\_{i+1} - \mathbf{x})(2 + Pe(\mathbf{x} - \mathbf{x}\_{i-1}))u\_{i-1}}{2(\mathbf{x}\_{i+1} - \mathbf{x}\_{i-1})}.\tag{98}$$

*Moving Node Method for Differential Equations DOI: http://dx.doi.org/10.5772/intechopen.107340*

By changing *x* the values on the interval ð Þ *xi*�1, *xi*þ<sup>1</sup> , we can determine the behavior of the solution. For given values *xi*þ1, *xi*�1, *ui*�1, *ui*þ1(98) is a parabola.

From (98) one can get

$$\frac{u - u\_{i-1}}{u\_{i+1} - u\_{i-1}} = \frac{(\varkappa - \varkappa\_{i-1})(2 - Pe(\varkappa\_{i+1} - \varkappa))}{2(\varkappa\_{i+1} - \varkappa\_{i-1})}.\tag{99}$$

A physically plausible solution is obtained if 0≤ *<sup>u</sup>*�*ui*�<sup>1</sup> *ui*þ1�*ui*�<sup>1</sup> <sup>≤</sup>1. This condition imposes a restriction 2 � *Pe x*ð Þ *<sup>i</sup>*þ<sup>1</sup> � *x* ≥0. This condition is the condition of monotonicity of the central-difference scheme for a non-uniform grid. In the case of a uniform grid, we have 2 ≥*Pe* � *h*. This condition is the well-known monotonicity condition [46]. For a coarse grid (N = 2, one movable node) at Pe = 5, the solution of exact and approximate solutions are shown in **Figure 46**.

In **Figure 46**, the solid curve represents the exact solution, while the dotted one represents the approximate solution obtained on the basis of (99). It can be seen from the graph that scheme (99) does not give a physically plausible analytical solution. That is why scheme (99) for large Peclet numbers gives an oscillatory numerical solution. A plausible solution should have the same qualitative character as the exact solution. When solving numerically, scheme (97) is implemented using a sweep, and for the stability of the sweep, the nodes are selected so that 2 � *Pe x*ð Þ *<sup>i</sup>*þ<sup>1</sup> � *xi* ≥0. For example, for a coarse grid (one nodal point), the credibility condition gives *xi* ≥0, 6. Indeed, for *Pe* = 5, it 2 � *Pe*ð Þ 1 � *х* ≥0 follows that *xi* ≥0, 6 (see **Figure 46**).

For *Pe* = 2, comparisons of the solutions are shown in **Figure 47**, which gives a physically plausible solution.

Upwind scheme. Let us consider a difference analog of Eq. (73), in which the convective term is approximated by a one-sided difference relation (without a source)

$$\frac{u - u\_{i-1}}{\infty - \varkappa\_{i-1}} = \frac{2}{Pe(\varkappa\_{i+1} - \varkappa\_{i-1})} \left( \frac{u\_{i+1} - u}{\varkappa\_{i+1} - \varkappa} - \frac{u - u\_{i-1}}{\varkappa - \varkappa\_{i-1}} \right).$$

From here we get

#### **Figure 46.**

*Comparison of solutions in a coarse grid. The dotted curve is approximate, the solid curve is exact, Pe = 5 (Ф<sup>0</sup> = 0, Ф<sup>1</sup> = 1).*

*Numerical Simulation – Advanced Techniques for Science and Engineering*

#### **Figure 47.**

*Comparison of the solution in a coarse grid. The dotted curve is approximate, the solid curve is exact, Pe = 2 (Ф<sup>0</sup> = 0, Ф<sup>1</sup> = 1).*

$$u = \frac{2(\varkappa - \varkappa\_{i-1})u\_{i+1} + (\varkappa\_{i+1} - \varkappa)(2 + Pe(\varkappa\_{i+1} - \varkappa\_{i-1}))u\_{i-1}}{(\varkappa\_{i+1} - \varkappa\_{i-1})(2 + Pe(\varkappa\_{i+1} - \varkappa))}$$

or

$$\frac{u - u\_{i-1}}{u\_{i+1} - u\_{i-1}} = \frac{2(\varkappa - \varkappa\_{i-1})}{(\varkappa\_{i+1} - \varkappa\_{i-1})(2 + Pe(\varkappa\_{i+1} - \varkappa))}.\tag{100}$$

Since, the right side of relation (100) into segments is a hyperbola and therefore we have 0≤ *<sup>u</sup>*�*ui*�<sup>1</sup> *ui*þ1�*ui*�<sup>1</sup> <sup>≤</sup> 1. Those the upstream circuit is always monotonic. **Figure 48** shows a comparison of the exact and approximate analytical solutions (Pe = 5). However, numerical diffusion occurs.

#### **Figure 48.**

*Comparison of the solution in a coarse grid. The dotted curve is approximate, and the solid curve is exact (Ф<sup>0</sup> = 0, Ф<sup>1</sup> = 1).*
