1 Introduction

It is believed that the residual distribution (RD) methods are less sensitive to mesh variations [12] and have more potential of incorporating multidimensional physics [5] compared to finite volume methods. Deconinck and Ricchiuto [4] described the residual distribution (RD) methods in details to distinguish the basic differences between RD methods with finite volume (FV) and finite element methods. There are also more recent studies describing the developments of RD methods by Abgrall et al. [2, 3] and references therein. For the FV method, perhaps there are a lot more developments but the most recent ones which include studies of deterioration in accuracy are the work of [8, 13]. There also have been studies on results deterioration based on quadrilateral grid degradation [7], though therein the work is purely numerical.

Guzik and Groth [6] investigated the performance of the RD and FV methods on deformed triangular grids solving from the scalar equations to the system of Euler equations but using only numerical means. Furthermore, their work did not have a systematic and fully controlled grid degradation process when working on fully unstructured grids which makes it difficult to analytically investigate the performance of both methods. To the authors’ best knowledge, there is yet a rigorous mathematical analysis to investigate the effects of grid skewness on the accuracy of numerical methods on triangular grids.

Grid skewness (or stretching) is a common occurrence in boundary layer meshes, specifically to improve the flow prediction normal to the wall. This is done by employing more grid points normal to the wall relative to the tangential direction, which causes a stretching of grid size in the normal direction. Unfortunately, the grid deterioration causes a loss in accuracy in the CFD simulation [10]. Although there exists high-order accurate RD and FV methods (above 3rd order), those methods utilize more neighboring points thus would be more susceptible to grid changes. Herein, the focus would be more on investigation the error loss due to the inherent nature of the RD and FV methods rather than the influence of the number of neighboring nodes. Since the data are stored on the nodes for the RD methods, we shall focus only on the cell-vertex FV methods to have a fair comparison.

In this paper, our main intention is to provide an analytical study on the deterioration of the order-of-accuracy on the first- and second-order accurate residual distribution and cell-vertex finite volume methods on skewed triangular grids. The focus of the work would be on the transport (hyperbolic) problems thus, only upwind methods are considered. Moreover, since this paper is based mainly on an analytical approach, only the scalar equations are utilized.

The order-of-accuracy analysis is based on a Taylor series expansion about a particular node of interest which is a generic approach to analyze accuracy of finite difference, finite volume and finite element methods. We shall develop an analytical formulation for the order-of-accuracy of each of the numerical method as a function of the grid skewness based on the two-dimensional scalar advection equation. The other perspective of this paper is analyzing high frequency waves of the flow and capturing these waves on a variety of grid skewness. It is well known that in order to resolve turbulence flow, accurate predictions of high-frequency waves are necessary. According to [9, 14], high-frequency waves are more difficult to be accurately captured when the grid skewness is increased. Numerical tests will also be conducted to reaffirm our analytical results.

The paper is organized as follows. Section 2 reintroduces the classical RD and the cell-vertex FV methods. Section 3 presents the Taylor Series analysis to determine the truncation errors for RD and FV methods. Section 4 will include results and discussion, whereas Sect. 5 draws a conclusion to this paper.

2 Residual Distribution and Cell-Vertex Finite Volume Methods

Consider the two-dimensional scalar advection equation,

$$\begin{aligned} u_t+\varvec{\nabla }\cdot \mathbf {F}=0, \end{aligned}$$
(1)

where u is the unknown quantity in temporal and two-dimensional space. The fluxes are

$$\begin{aligned} \mathbf {F}=(au)\hat{i}+(bu)\hat{j} \end{aligned}$$

for the linear advection and

$$\begin{aligned} \mathbf {F}=\left( \frac{u^2}{2}\right) \hat{i}+(u)\hat{j} \end{aligned}$$

for the nonlinear Burgers equation.

The \(\hat{i}\) and \(\hat{j}\) are the unique characteristic vector along x- and y-direction. In the following, the basis of the classic residual distribution and cell-vertex finite volume will be reviewed.

2.1 Residual Distribution

The main concept of the residual distribution method is finding the signal for each point from the total integral of a cell (element). In this paper, two approaches of the RD methods are used which are the N-scheme (first order) and LDA (second order). By using Green’s theorem, the total cell residual would be

$$\begin{aligned} \phi ^\tau =-\iint u_t \mathrm{d}A=\iint \varvec{\nabla }\cdot \mathbf {F} \mathrm{d}A=\oint \mathbf {F}\cdot \hat{n} \mathrm{d}S \end{aligned}$$
(2)

In discrete form, the integral over a triangular element is

$$\begin{aligned} \phi ^\tau =\sum _{\text {edge}=1}^{3} (F_xn_x + F_yn_y)^\text {edge}{\varDelta } l^\text {edge} \end{aligned}$$
(3)

Based on the characteristic vector direction in a triangular grid there are two types of cells (Fig. 1). If a cell has one outlet point, then all of the residual is assigned to that outlet. Note that in this case there is no difference between N-scheme and LDA. Nonetheless, if there are two outlet points, there will be a difference between the N-scheme and LDA. Note that most of the upwind RD methods (i.e., K approach) originate from the classic N-scheme and LDA methods based on the Positivity and Linearity Preserving properties [12].

Fig. 1
figure 1

Two different types of cells. a Type (I). b Type (II)

Fig. 2
figure 2

Two different RD methods. a N-scheme method. b LDA method

2.1.1 N-Scheme

In the N-scheme, the advection vector is split into two components parallel to the sides opposite the downstream vertices as shown in Fig. 2a.

$$\begin{aligned} \varvec{\lambda }=\varvec{\lambda }_2+\varvec{\lambda }_3 \end{aligned}$$
(4)

In this approach, the total cell residual \(\phi _\tau \) is not determined using the main flow direction (\(\varvec{\lambda }=a\hat{i}+b\hat{j}\)). The integral is determined by two new directions (\(\varvec{\lambda }_2=a_2\hat{i}+b_2\hat{j}\) and \(\varvec{\lambda }_3=a_3\hat{i}+b_3\hat{j}\)). In a linear problem, Eq. 2 reduces to

$$\begin{aligned} \begin{aligned} \displaystyle \phi ^\tau&\displaystyle =\iint \varvec{\nabla }\cdot \mathbf {F} \mathrm{d}A=\iint \varvec{\lambda }\cdot \varvec{\nabla }u \mathrm{d}A =\iint \left[ \varvec{\lambda }_2+\varvec{\lambda }_3\right] \cdot \varvec{\nabla }u \mathrm{d}A \\&\displaystyle =\iint \varvec{\lambda }_2\cdot \varvec{\nabla }u \mathrm{d}A+\iint \varvec{\lambda }_3\cdot \varvec{\nabla }u \mathrm{d}A =\phi ^\tau _2+\phi ^\tau _3 \end{aligned} \end{aligned}$$
(5)

A similar approach can be done for the Burgers equation, although certain averaging must be done to ensure conservation. The details can be found in [1].

The signals are distributed to nodes 2 and 3, respectively, and have the following discrete form.

$$\begin{aligned} \begin{aligned} \displaystyle \phi ^\tau _2&=\sum _{\text {edge}=1}^{3} (F_xn_x + F_yn_y)^\text {edge}_2{\varDelta } l^\text {edge}, \quad (F_x)_2=a_2u,\quad (F_y)_2=b_2u \\ \displaystyle \phi ^\tau _3&=\sum _{\text {edge}=1}^{3} (F_xn_x + F_yn_y)^\text {edge}_3{\varDelta } l^\text {edge}, \quad (F_x)_3=a_3u,\quad (F_y)_3=b_3u \end{aligned} \end{aligned}$$
(6)

2.1.2 LDA

After finding the \(\phi ^\tau \) for each cell by using Eq. 3, the signals of each point are computed. According to Fig. 2b, the area ratio will determine the signals of each point.

$$\begin{aligned} \phi ^\tau _1=0,\qquad \phi ^\tau _2=\frac{A_2}{A_\mathrm{cell}}\phi ^\tau ,\qquad \phi ^\tau _3=\frac{A_3}{A_\mathrm{cell}}\phi ^\tau \end{aligned}$$
(7)

2.1.3 Final Step

Consequently, all signal for all the points are determined. Now, for each point, we could evaluate residuals by signal’s summation of the neighboring cells. The time evolution of the solution is then given by the following update:

$$\begin{aligned} u^{m+1}_i=u^m_i-\frac{{\varDelta } t}{A_i}\sum _j\phi _i^j \end{aligned}$$
(8)

where j shows the neighboring cells to the main node (point) i.

2.2 Finite Volume Method

2.2.1 Finite Volume: First Order

In this paper, the cell-vertex finite volume is used to make a consistent comparison with the RD since both methods store the variables in nodes (Fig. 3). The total integration of the cell-vertex FV method is,

$$\begin{aligned} \frac{\partial u}{\partial t}=\oint \mathbf {F}\cdot \hat{n}\mathrm{d}l=\sum _\text {edges}\mathbf {F}\cdot \mathbf {N}=\sum _{\text {edge}=i}^{vi} (F_xN_x + F_yN_y)^\text {edge} \end{aligned}$$
(9)

where \(\mathbf {F}\) is the flux vector of the edge; and, \(\mathbf {N}\) shows the outside normal vector of the edge scaled by the edge length (Table 1). For the first-order method, the value as each edge will be value of the point in center of its upstream cell. For instance,

$$\begin{aligned} F_x^{ii}=au_0,\qquad F_y^{ii}=bu_0 \end{aligned}$$
(10)

2.2.2 Finite Volume: Least-Squares

The least square method is used to reconstruct the slope of each point for a high-order finite volume method. The summation is on all the neighboring points of the main point (point of interest).

$$\begin{aligned} \begin{aligned} \displaystyle s^x&= \frac{\sum {\varDelta } x{\varDelta } u\sum {\varDelta } y{\varDelta } y - \sum {\varDelta } y{\varDelta } u\sum {\varDelta } x{\varDelta } y}{\sum {\varDelta } x{\varDelta } x\sum {\varDelta } y{\varDelta } y - \sum {\varDelta } x{\varDelta } y\sum {\varDelta } y{\varDelta } x} \\ \displaystyle s^y&= \frac{\sum {\varDelta } x{\varDelta } x\sum {\varDelta } y{\varDelta } u - \sum {\varDelta } x{\varDelta } u\sum {\varDelta } x{\varDelta } y}{\sum {\varDelta } x{\varDelta } x\sum {\varDelta } y{\varDelta } y - \sum {\varDelta } x{\varDelta } y\sum {\varDelta } y{\varDelta } x} \end{aligned} \end{aligned}$$
(11)

where

$$\begin{aligned} {\varDelta } u=u_{\text {neighbor}}-u_{\text {main}} \end{aligned}$$
(12)

For instance,

$$\begin{aligned} \begin{aligned} F_x^{ii}=a\left[ u_0+\left( \frac{h}{2}\right) s^x_0+\left( \frac{k}{2}\right) s^y_0\right] \\ F_y^{ii}=b\left[ u_0+\left( \frac{h}{2}\right) s^x_0+\left( \frac{k}{2}\right) s^y_0\right] \end{aligned} \end{aligned}$$
(13)

The time integration process involves a summation of all of the fluxes around a particular cell.

Fig. 3
figure 3

The finite volume cell-vertex diagram

Table 1 Normal components scaled by the edge length for each edge in finite volume cell vertex for right-running grid

3 Truncation Error Analysis

3.1 General Approach

In order to find the truncation error for the RD methods (N-scheme and LDA) and FV methods, the first step would be to determine general temporal and spatial update equation. Based on Eq. 8 the equation could be written in the form of,

$$\begin{aligned} u^{m+1}_i=u^m_i-{\varDelta } t\left( w_iu_i+\sum _jw_ju_j\right) ^m \end{aligned}$$
(14)

where j denotes the neighboring points; and, \(w_j\) depicts the coefficients of the point. For a start, we assume the following for our mathematical analysis:

  • Steady state

  • Constant wave speed \(\varvec{\lambda }=a\hat{i}+b\hat{j}\) (in time and space)

  • Specific grid topology: structured (right-running) and anisotropic triangular grids with uniformly sized element

In steady state, \(u^{m+1}_i = u^m_i\). Therefore, in Eq. 14, the terms inside parentheses will be the truncation error (TE) or the order-of-accuracy of the method.

$$\begin{aligned} \text {TE}=w_iu_i+\sum _jw_ju_j \end{aligned}$$
(15)

Using the Taylor series expansion of the neighboring points from the main point (i) of interest, the TE will be determined.

Since the solution is constant along the characteristic vector (streamline), all derivatives in tangential direction are neglected. The Taylor series expansion are based only on the derivatives normal to the streamline. Based on Fig. 4, for a specific triangular grid, the Taylor series expansion of the neighboring points about the main point is as below.

$$\begin{aligned} u_j=\sum _{d=0}^{\infty }\frac{(l^j_n)^d}{d!}\left( \frac{\partial ^d u}{\partial n^d}\right) \end{aligned}$$
(16)

where \(l_n\) is the normal distance from the main point (Tables 2, 3) and \(\frac{\partial ^d u}{\partial n^d}\) shows the normal derivative of dth order. Note that the magnitude of wave-speed is determined as

$$\begin{aligned} r=\sqrt{a^2+b^2} \end{aligned}$$
(17)

We now intend to find the formal order-of-accuracy for each method on the two grid types. The right-running (structured) triangular grid topology is shown in Fig. 4a, whereas the anisotropic triangular grid topology is depicted in Fig. 4b.

Fig. 4
figure 4

The points arrangement for the right-running and anisotropic grid. a Right-running grid. b Anisotropic

Table 2 Normal distance of the neighbor points from the main point for right-running grid
Table 3 Normal distance of the neighbor points from the main point for anisotropic grid

3.2 Formal Order-of-Accuracy on Right-Running Grid

3.2.1 N-Scheme

The coefficients of Eq. 15 are determined by first computing the total signals of each point which is based on the decomposition of the characteristic vector along the element’s edges (type II). Note that in the type I cell, all the residuals are going to one point.

Fig. 5
figure 5

The decomposition of characteristic vector for two different conditions (left \(\frac{b}{a}>\frac{k}{h}\); right \(\frac{b}{a}<\frac{k}{h}\))

Assume (\(a,b>0\)), then there will be two conditions for N-scheme (\(\frac{b}{a}<\frac{k}{h}\) and \(\frac{b}{a}>\frac{k}{h}\)). Note that the decomposition of the characteristic vectors are shown in the Fig. 5. In the case of \(\frac{b}{a}<\frac{k}{h}\),

$$\begin{aligned} \varvec{\lambda }=a\hat{i}+b\hat{j}=\frac{b}{k}\left( h\hat{i}+k\hat{j}\right) +\left( \frac{ak-bh}{k}\right) \hat{i} \end{aligned}$$
(18)
Fig. 6
figure 6

The N-scheme effective cells for \(\frac{b}{a}<\frac{k}{h}\)

According to Fig. 6, the signals of each point

$$\begin{aligned} \phi ^1= & {} \phi ^2=\phi ^6=0,\quad \phi ^4=\frac{1}{2}\left( aku_0-bhu_6-(ak-bh)u_5\right) \nonumber \\ \phi ^3= & {} \sum \left( -\frac{1}{2}\left( \frac{ak-bh}{k}\right) \hat{i}\cdot \mathbf {N}_i\right) u_i \nonumber \\= & {} \frac{1}{2}\left( ak-bh\right) u_0 -\frac{1}{2}(ak-bh)u_5 =\frac{(ak-bh)}{2}\left( u_0-u_5\right) \end{aligned}$$
(19)
$$\begin{aligned} \phi ^5= & {} \sum \left( -\frac{1}{2}\left( \frac{b}{k}\left( h\hat{i}+k\hat{j}\right) \right) \cdot \mathbf {N}_i\right) u_i \nonumber \\= & {} \frac{1}{2}bhu_0-\frac{1}{2}bhu_6=\frac{bh}{2}\left( u_0-u_6\right) \end{aligned}$$
(20)

Substituting these signals in the Eq. 8, the coefficients in Eq. 14 are

$$\begin{aligned} \begin{aligned} w_0&=\frac{a}{h},\quad w_1=0 ,\quad w_2=0 ,\quad w_3=0 ,\quad w_4=0, \\ w_5&=\frac{-ak+bh}{hk} ,\quad w_6=\frac{-b}{k} ,\quad w_7=0 ,\quad w_8=0 \end{aligned} \end{aligned}$$
(21)

The results for both conditions are presented in Table 4. Substituting the weight from Table 4 into Eq. 15 for the first condition,

Table 4 The weight coefficient for each neighbor point and condition for the N-scheme (exclude \(w_4\) and \(w_8\))
Table 5 The N truncation error coefficients (\(p+q=3\))
$$\begin{aligned} \text {TE}=\frac{a}{h}u_0+\left( -\frac{a}{h}+\frac{b}{k}\right) u_5+\left( -\frac{b}{k}\right) u_6 \end{aligned}$$
(22)

Using Taylor series for points \(u_5\) and \(u_6\) from Eq. 16, the TE will be

$$\begin{aligned} \frac{b}{a}<\frac{k}{h}:\text {TE}_\text {N}= & {} \frac{a}{h}u_0+\left( -\frac{a}{h}+\frac{b}{k}\right) \left( \sum _{d=0}^{\infty }\frac{1}{d!}\left( \frac{bh}{r}\right) ^d\left( \frac{\partial ^d u}{\partial n^d}\right) \right) \nonumber \\&+\left( -\frac{b}{k}\right) \left( \sum _{d=0}^{\infty }\frac{1}{d!}\left( -\frac{ak-bh}{r}\right) ^d\left( \frac{\partial ^d u}{\partial n^d}\right) \right) \end{aligned}$$
(23)

which is expanded as

$$\begin{aligned} \frac{b}{a}<\frac{k}{h}:\text {TE}_\text {N}= & {} \frac{a}{h}u_0+\left( -\frac{a}{h}+\frac{b}{k}\right) \left( u_0+\left( \frac{bh}{r}\right) u_n+\frac{1}{2}\left( \frac{bh}{r}\right) ^2u_{nn}+\cdots \right) \nonumber \\&+\left( -\frac{b}{k}\right) \left( u_0+\left( -\frac{ak-bh}{r}\right) u_n+\frac{1}{2}\left( -\frac{ak-bh}{r}\right) ^2u_{nn}+\cdots \right) \nonumber \\ \end{aligned}$$
(24)

After some simplification and using the coefficients on the first row of Table 5, the overall truncation error for N-scheme is given below.

$$\begin{aligned} \frac{b}{a}<\frac{k}{h}:\text {TE}_\text {N}= & {} \left( -\frac{ab}{2r^2}(ak-bh)\right) u_{nn} \nonumber \\&+\left( \frac{ab}{6r^3}(ak-bh)(ak-2bh)\right) u_{nnn} \nonumber \\&+\,O(h^pk^q),\qquad p+q=3 \end{aligned}$$
(25)

This TE is for the first condition. Note that the second condition is similarly determined but both would formally yield a first-order accurate method.

3.2.2 LDA

The coefficients (\(w_i\)) of Eq. 15 for the LDA method are determined similar to the N-scheme. The final formulation is written in Table 6 with \(TE_\text {LDA}=O(h^p,k^q), p+q=2\). Note that for \(\left( \frac{b}{a}<\frac{k}{h}\right) \), if \(ak=2bh\), the LDA becomes third-order accurate.

Table 6 The LDA truncation error coefficients (\(p+q=4\))

3.2.3 Finite Volume: First Order

For the first-order FV method, three conditions are considered for the integration. According to Fig. 3, these conditions are developed based on the upwind point which will be used in the integration which are \(\frac{b}{a}<\frac{k}{2h}\), \(\frac{k}{2h}<\frac{b}{a}<\frac{2k}{h}\) and \(\frac{2k}{h}<\frac{b}{a}\). For each condition, the upwind point being used for the integration will be different. After applying all of these conditions and performing similar mathematical steps as before, the TE is given in Table 7.

Table 7 The first-order finite volume truncation error coefficients (\(p+q=6\))

3.2.4 Finite Volume: Least-Squares

Furthermore, the truncation error of the least square FV method is demonstrated in Table 8. Interestingly, the first and third conditions provide a less accurate method since there are related to more skewed grid. For the second condition, formal order of accuracy of least-squares approach is \(\text {TE}_{\text {FV-LS}}=O(h^pk^q) (p+q=3)\) which demonstrates a third-order accuracy on right-running grids.

Table 8 The least squares finite volume truncation error coefficients (\(p+q=6\))
Fig. 7
figure 7

The two neighbor points for analyzing the analytical order-of-accuracy which are different in the arrangement of neighbor cells

3.3 Formal Order-of-Accuracy on Anisotropic Grid

For the anisotropic grid element, the procedure for TE analysis is same as the right-running grid but that there are some differences between the two type of grids. First of all, there are two stretching parameters in anisotropic grid element (Fig. 4).

$$\begin{aligned} s_1=\frac{k_1}{h},\quad s_2=\frac{k_2}{h} \end{aligned}$$
(26)

Second, the anisotropic grids do not have the same arrangement of neighboring cells unlike for the right-running grids (Fig. 7). The summation of analytical truncation error will be calculated for the two neighboring points as shown in Fig. 7 (point 0 and 1). This is because these two have a different pattern of neighboring cells.

3.3.1 N-Scheme

Recall \(a,b>0\). There are two possibilities of placing the characteristics for RD methods which are,

$$\begin{aligned} \frac{b}{a}>s_2>s_1,\qquad s_2>\frac{b}{a}>s_1 \end{aligned}$$
(27)

The mathematical formulation will be discussed here for the second condition. The N-scheme total signals for the points 0 and 1 are

$$\begin{aligned} \phi _0= & {} \frac{1}{2}\left( a(k_1 (u_0-2 u_5+u_7)+2 k_2 (u_0-u_5))+b h (u_0-u_7)\right) \nonumber \\ \phi _1= & {} \frac{1}{2} (a (k_1 (u_1-2 u_7+u_8)-2 k_2 (u_0-u_1))+b h (2 u_0+u_1-2 u_7-u_8)) \end{aligned}$$

Therefore, the general equation for the N-scheme could be determined.

$$\begin{aligned} \text {TE}_\text {N}= & {} \frac{a (k_1 (u_0+u_1-2 u_5-u_7+u_8)+2 k_2 (u_1-u_5))}{4 h (k_1+k_2)} \nonumber \\&+\frac{b h (3 u_0+u_1-3 u_7-u_8)}{4 h (k_1+k_2)} \end{aligned}$$
(28)

The next step will be substituting the Taylor series for each point, to estimate the truncation error.

$$\begin{aligned} \text {TE}_\text {N}= & {} h\left( \frac{a \left( a^2 s_1^2+2 a b (s_1-s_2)-b^2\right) }{4 r^2}\right) u_{nn}+ h^2\left( -\frac{a \left( 3 a^3 s_1^2 (2 s_1+s_2)\right) }{24 r^3}\right. \nonumber \\&\left. -\frac{a \left( a^2 b \left( 11 s_1^2-8 s_1 s_2-4 s_2^2\right) -3 a b^2 (2 s_1+s_2)+b^3\right) }{24 r^3}\right) u_{nnn}+O\left( h^3\right) \nonumber \\ \end{aligned}$$
(29)

A similar approach can be done to the first condition but the results are omitted for brevity.

3.3.2 LDA

For the LDA, also, there are two conditions similar to N-scheme (Eq. 27). For the second condition,

$$\begin{aligned} \text {TE}_{\text {LDA}}= & {} h^2 \left( -\frac{a \left( 3 a^3 s_1^2 (s_1+2 s_2)-a^2 b (s_1-2 s_2)^2+3 a b^2 (2 s_2-5 s_1)+b^3\right) }{24 r^3} \right) u_{nnn} \nonumber \\&+\,h^3 \left( \frac{a^2 \left( a^3 s_1^2 (5 s_1+s_2) (s_1+2 s_2)-a^2 b s_1 \left( s_1^2-7 s_1 s_2+8 s_2^2\right) \right) }{48 r^4} \right. \nonumber \\&\left. +\,\frac{a^2 \left( a b^2 \left( -29 s_1^2+9 s_1 s_2+2 s_2^2\right) +b^3 (13 s_2-11 s_1)\right) }{48 r^4} \right) u_{nnnn}+O\left( h^4\right) \nonumber \\ \end{aligned}$$
(30)

3.3.3 Finite Volume: First Order

In finite volume methods, there are two conditions which are,

$$\begin{aligned} \frac{b}{a}<\frac{s_2-s_1}{2},\qquad \frac{b}{a}>\frac{s_2-s_1}{2} \end{aligned}$$
(31)

For the second condition,

$$\begin{aligned} \text {TE}_{\text {FV}1\mathrm{st}}= & {} h\left( -\frac{a \left( a^2 s_2 (2 s_1+s_2)+a b (s_1+3 s_2)+b^2\right) }{6 r^2}\right) u_{nn} \nonumber \\&+\,h^2\left( \frac{a (a s_1+b) (a s_2+b) (a (2 s_1+s_2)+b)}{12 r^3}\right) u_{nnn}+O\left( h^3\right) \end{aligned}$$
(32)

3.3.4 Finite Volume: Least-Squares

Similar to the first-order finite volume, truncation error equation for least-squares finite volume for the second condition could be written as,

$$\begin{aligned} \text {TE}_{\text {FV-LS}}= & {} h^2 \left( \frac{b (s_1-s_2) \left( a^3 \left( 8 s_1^3+11 s_1^2 s_2+11 s_1 s_2^2+3 s_2^3\right) \right) }{72 r^3 \left( s_1^2+s_1 s_2+s_2^2\right) } \right. \nonumber \\&\left. +\,\frac{b (s_1-s_2) \left( 11 a^2 b \left( s_1^2+s_1 s_2+s_2^2\right) -a b^2 (2 s_1+s_2)-3 b^3\right) }{72 r^3 \left( s_1^2+s_1 s_2+s_2^2\right) } \right) u_{nnn} \nonumber \\&+\,h^3 \left( \frac{a \left( a^4 s_2 \left( 8 s_1^5+26 s_1^4 s_2+39 s_1^3 s_2^2+34 s_1^2 s_2^3+16 s_1 s_2^4+3 s_2^5\right) \right) }{144 r^4 \left( s_1^2+s_1 s_2+s_2^2\right) } \right. \nonumber \\&\left. +\,\frac{a \left( 2 a^3 b \left( -2 s_1^5+15 s_1^4 s_2+34 s_1^3 s_2^2+42 s_1^2 s_2^3+25 s_1 s_2^4+6 s_2^5\right) \right) }{144 r^4 \left( s_1^2+s_1 s_2+s_2^2\right) } \right. \nonumber \\&\left. +\,\frac{a \left( a^2 b^2 \left( -3 s_1^4+38 s_1^3 s_2+52 s_1^2 s_2^2+52 s_1 s_2^3+17 s_2^4\right) \right) }{144 r^4 \left( s_1^2+s_1 s_2+s_2^2\right) } \right. \nonumber \\&\left. +\,\frac{a \left( 2 a b^3 \left( s_1^3+9 s_1^2 s_2+6 s_1 s_2^2+8 s_2^3\right) -b^4 \left( s_1^2+s_1 s_2-8 s_2^2\right) \right) }{144 r^4 \left( s_1^2+s_1 s_2+s_2^2\right) } \right) u_{nnnn} \nonumber \\&+\,O\left( h^4\right) \end{aligned}$$
(33)

This is shows that the least-squares finite volume reduces to second order accurate in anisotropic grid unlike for the right-running grid which was third order. It should be mentioned that only for a specific case which is \(s_1=s_2\) the least squares finite volume will be third order on anisotropic grids which happens only for an equilateral element. Note that we choose the worst aspect ratio for a given skewness therefore, the only choice of having \(s_1=s_2\) is the equilateral element.

At this point the analysis is unable to precisely depict the effect of grid skewness on the degradation in order-of-accuracy since the actual values of the normal derivatives (i.e., \(\frac{\partial ^d u}{\partial n^d}\)) are unknown. The following section will attempt to address this issue by examining the grid skewness effect on a specific test case in which the normal derivatives can be computed.

4 Results and Discussion

4.1 Linear Case

The linear test case [11] which is used in this paper is a square domain with an inlet boundary condition for left and bottom sides, and an outlet for the right and top sides. The inlet boundaries and the steady state exact solution is determined as

$$\begin{aligned} u(x,y)=-\cos (2\pi \omega _\mathrm{f}(bx-ay)) \end{aligned}$$
(34)

where a and b the characteristic wave speeds in x and y directions; and, \(\omega _\mathrm{f}\) is the frequency of wave.

Two different kinds of grids (Fig. 4) are used for the analytical and numerical part of the linear case to make a realistic comparison. We start with the right-running grid which is a basic grid topology. Then, an anisotropic grid will be used to make the closest possible comparison with the fully unstructured grid. The details of both grid types are available in “Appendix”.

Using a right-running triangular grid shown in Fig. 4a and by controlling the length (h) an height (k) of the grid, analytical and numerical order-of-accuracy for different skewnesses (Q) could be determined. The range of skewness for the right-running grid is \(0.3 \le {Q}\le {1}\) The definition of grid skewness can be found in “Appendix”.

Furthermore, in the anisotropic grid element (Fig. 4b), a similar error analysis will be performed. The parameters \(k_1,k_2\) and h are used to control the anisotropic grids. The skewness range for anisotropic grids is \(0\le {Q}\le {1}\). Both types of grids would be skewed uniformly in the sense that all cells will have the same element size and skewness when the grid is generated.

For simplicity, all of the calculations below use \(a=b=1\) but \(\omega _\mathrm{f}\) would vary and the square domain is one by one in lengths.

The analytical results herein strictly speaking are confined to this particular test case. However, this test case is a \(\sin -\cos \) type problem with a variation in frequencies which could represent the general smooth transport problem based on Fourier analyses.

4.1.1 Right-Running Grid: Analytical Results

In order to calculate the analytical order-of-accuracy for RD and FV methods, only the first six dominant terms of the truncation error are considered. For conciseness, the mathematical analysis is presented only for the N-scheme.

Each truncation error term includes a coefficient and the normal derivative of the solution on that point. For this particular test case, the normal derivatives \(\left( \frac{\partial ^d u}{\partial n^d}\right) \) are easily obtained. The normal direction to the characteristic vector is the lines \(x+y=c\) where c is constant. Therefore, from Eq. 34 all the derivatives along the normal direction are

$$\begin{aligned} \begin{array}{l} X_n=\frac{\sqrt{2}}{2} (x-y) \\ \displaystyle \frac{\partial ^d u}{\partial n^d}= \left\{ \begin{array}{l} \displaystyle (-1)^{\frac{d-1}{2}}\left( \sqrt{2} \pi \omega _\mathrm{f} \right) ^d \sin \left( \sqrt{2} \pi \omega _\mathrm{f} X_n\right) ,\quad d=1,3,5,\ldots \\ \displaystyle (-1)^{\frac{d-2}{2}}\left( \sqrt{2} \pi \omega _\mathrm{f} \right) ^d \cos \left( \sqrt{2} \pi \omega _\mathrm{f} X_n\right) ,\quad d=2,4,6,\ldots \end{array} \right. \end{array} \end{aligned}$$
(35)

which in a discrete sense \(x=ih (i=0,1,2,\ldots ,N_x)\) and \(y=jk (j=0,1,2,\ldots ,N_y)\). For each (ij) the error will be,

$$\begin{aligned} \text {Er}_{(i,j)}=\sum _d c_d\frac{\partial ^d u}{\partial n^d} \end{aligned}$$
(36)

where the \(c_n\) is the coefficient of the \(u_n\) in the truncation error calculated in the previous section (Tables 5, 6, 7, 8). Using the definition of the stretching parameter, the error will be a function of h and s.

$$\begin{aligned} s=\frac{k}{h}\quad \rightarrow \quad k=hs \end{aligned}$$
(37)

For N-scheme with the first condition one could use Table 5 in order to find the truncation error as a function of h and s. For brevity, the formulation is shown only \(\omega _\mathrm{f}=1\).

$$\begin{aligned} \text {Er}_{(i,j)}^\text {N}= & {} \frac{\pi ^4 h^2 (s-1)^2}{518400}\left( \left( \pi ^4 h^4 \left( s^4-5 s^3+10 s^2-10 s+5\right) \right. \right. \nonumber \\&\left. -\,30 \pi ^2 h^2 \left( s^2-3 s+3\right) +360\right) \cos (\pi h (i-js)) \nonumber \\&\left. -\,6 \pi h (s-2) \left( \pi ^2 h^2 \left( s^2-2s+2\right) -20\right) \sin (\pi h (i-js)) \right) \end{aligned}$$
(38)

Note that for \(s=1\), for the N-scheme and LDA methods produce the exact solution for the linear advection equation. In other words, all the TE terms will go to zero. This means the analytical order-of-accuracy is not a finite number for the RD methods thus all the calculations are based on \(s>1\). The next step would be finding the \(L_2\) error [12] which is,

$$\begin{aligned} L_2=\sqrt{\sum _{i=0}^{N_x}\sum _{j=0}^{N_y}\left( \text {Er}_{(i,j)}^2A_{(i,j)}\right) } \end{aligned}$$
(39)

where \(A_{(i,j)}\) is the area of the cell; and, \(N_x\) and \(N_y\) show the number of points along x and y direction. Herein \(N_x=\frac{1}{h}\) and \(N_y=\frac{1}{hs}\). \(L_2\) will be constructed as a function of (hs). The logarithmic grid spacing is used to find the analytical order-of-accuracy. By replacing \(h=10^P\) and use it in \(L_2\) one could find the logarithmic error function which is a function of grid size and stretching ratio, i.e., \(f(P,s)=\log L_2\). Consequently, the order-of-accuracy \(\text {OoA}(s)\) will be determined based on the slope of the function of

$$\begin{aligned} \text {OoA}(s)=\left. \frac{\partial f(P,s)}{\partial P}\right| _{P=-2} \end{aligned}$$
(40)
Fig. 8
figure 8

Analytical (lines) and numerical (symbols) order-of-accuracy for all the skewness in right-running grid. a \(\omega _\mathrm{f}=1\). b \(\omega _\mathrm{f}=4\). c \(\omega _\mathrm{f}=8\)

Note that the grid size in the numerical test cases is in \(O(10^4)\) which makes \(h=\frac{1}{100}\) thus \(P=-2\). For the N-scheme the \(\text {OoA}(s)\) is in the form of,

$$\begin{aligned} \text {OoA}^\text {N}(s)= & {} \frac{g_\text {nom}(s)}{g_\text {den}(s)} \end{aligned}$$
(41)
$$\begin{aligned} g_\text {nom}(s)= & {} 5.5098 s^{11}+429.471 s^{10}-118825. s^9-8.47948\times 10^6 s^8 \nonumber \\&+\,8.55746\times 10^8 s^7+5.10412\times 10^{10} s^6-1.98879\times 10^{13} s^5 \nonumber \\&-\,1.42472\times 10^{15} s^4+2.10591\times 10^{17} s^3+1.31733\times 10^{19} s^2 \nonumber \\&-\,2.69726\times 10^{19} s+1.35902\times 10^{19} \end{aligned}$$
(42)
$$\begin{aligned} g_\text {den}(s)= & {} (s-1)^2 \left( s^9+89.0196 s^8-25977.5 s^7-2.20327\times 10^6 s^6\right. \nonumber \\&+\,2.32324\times 10^8 s^5+1.76881\times 10^{10} s^4-7.81836\times 10^{12} s^3 \nonumber \\&\left. -\,7.32856\times 10^{14} s^2+1.37319\times 10^{17} s+1.35239\times 10^{19} \right) \end{aligned}$$
(43)

For the RD methods, the order-of-accuracy will be unbounded for \(s=1\). However, the limit of \(s\rightarrow 1^+\) still exists and bounded which for the N-scheme is 1 and for the LDA would be 2. Since the grid stretching parameter is related to grid skewness by \(s=2\tan \left( \frac{\pi }{2}Q\right) \) (Appendix), we can now determine the order-of-accuracy function based on the skewness for the N-scheme and consequently for all other methods.

The analytical order-of-accuracy versus skewness of RD and FV methods for different frequencies are demonstrated in Fig. 8. Note that \(Q=0.3\) is the best condition for right-running triangular grids (Appendix). For the FV methods, there are two functions for \(L_2\), one for \(0.3<Q<0.5\) and one function for \(Q>0.5\). Moreover, the order-of-accuracy of LDA for \(Q=0.5\) will be three (Eq. 6). For the least square FV method, the order-of-accuracy becomes \(3^{rd}\) when \(s\rightarrow 1^+\) on a right-running triangular grids.

Overall, the accuracy of both RD and FV methods are preserved quite well on uniformly skewed right-running grids. However, the results become more erratic at the highest frequency (\(\omega _\mathrm{f}=8\)) on a very high grid skewness (\(\hbox {Q}=0.9\)) which is unsurprising considering the difficulty of capturing high-frequency waves.

4.1.2 Right-Running Grid: Numerical Results

For the numerical test four grid sizes (in x-direction) are considered for the low frequency wave (\(\omega _\mathrm{f}=1\)) which are 101, 201, 301 and 401 points. According to the skewness control parameters number of the points in y-direction is different for each skewness (Table 9). Note that for the high frequency wave (\(\omega _\mathrm{f}=4\) and \(\omega _\mathrm{f}=8\)) three grid sizes are used (401, 501, 601 and 501, 601, 701) in order to resolve the fidelity of incoming wave.

Table 9 Number of the points in x- and y-direction
Fig. 9
figure 9

The stencil of right-running grid for different methods. a N. b LDA. c FV 1st. d FV LS

Fig. 10
figure 10

The error contours of different methods for \(Q=0.8\) and \(\omega _\mathrm{f}=1\) in right-running grid. a N. b LDA. c Finite volume 1st. d Finite volume LS

Fig. 11
figure 11

Analytical (lines) and numerical (symbols) \(L_2\) error versus the grid distance in logarithmic scale for the linear case \(Q=0.7\) in the right-running grid

In order to construct an impartial comparison between all the methods, the stencil of each method on two different grid element are shown in Figs. 9 and 12. It is clear that the second finite volume with least square slope reconstruction has the largest stencil of all. The interesting part is although LDA is second-order the first-order finite volume and LDA have the same stencil size. Indeed, the narrowest stencil belongs to the N-scheme.

The error distribution of the RD and FV methods for \(\omega _\mathrm{f}=1\) are shown in Fig. 10 for skewness 0.8. As it can be seen, for N-scheme the error is about one order of magnitude less than the FV first-order method. Furthermore, the high order methods obviously have lower error than the first-order methods. Both LDA and FV-LS have a similar order of magnitude for error although the FV-LS is formally third order accurate. The asymptotic order-of-accuracy of the each scheme is shown in Fig. 11 but only results for \(Q=0.7\) and \(\omega _\mathrm{f}=1\) are included for conciseness. The complete order-of-accuracy results are shown in Fig. 8.

Overall, the numerical order-of-accuracy for different skewnesses and frequencies reaffirms the analytical results (Fig. 8) with slightly more diffusion than the analytical part particularly on high-frequency data. For a high frequency wave and high skewness, the number of points in y-direction dramatically decreases (Table 9). Thus, the diffusion term in the truncation error becomes more dominant in the y-direction causing an overly dissipative influence to first order methods especially for highly frequency waves.

On the other hand, the FV-LS produces a third order solution on the right-running grid which is shown in Fig. 8. For the linear problem until the skewness of 0.6–0.7, the order-of-accuracy is maintained. This is because the FV-LS uses more points and has a greater opportunity to gather better information for the solution.

4.1.3 Anisotropic Grid

The procedure of generating Eq. 41 for the anisotropic grid (Fig. 12) is same as the right-running grid. However, there are some technical differences which should be noted.

Fig. 12
figure 12

The stencil of anisotropic grids for different methods. a N. b LDA. c FV 1st. d FV LS

  • The normal derivation of each point which is derived from exact solution is same as before similar to Eq. 35. Note that since the topology of grid is different, the definition of x and y will be different too.

  • Number of points in x- and y-direction will be \(\frac{1}{h}\) and \(\frac{1}{k_1+k_2}\).

  • There are two stretching parameter here which we can write them as a function of skewness. Indeed, the function might be more complicated than the right-running grid.

    $$\begin{aligned} \displaystyle C= & {} \sec ^2\left( \frac{\pi Q}{2}\right) ,\qquad y_{\max }=\frac{\sqrt{4 C-1}-\sqrt{C-1}}{2 C} \nonumber \\ \displaystyle s_1= & {} \frac{\sqrt{C-\left( y_{\max }+\sqrt{C-1}\right) ^2}}{y_{\max }} ,\quad s_2=\frac{1-\sqrt{C-\left( y_{\max }+\sqrt{C-1}\right) ^2}}{y_{\max }}\nonumber \\ \end{aligned}$$
    (44)

Note that for the anisotropic grid, the order-of-accuracy equation is extremely large therefore, we could not demonstrate it here. However, we have included the analytical plot of the order-of-accuracy for each method in Fig. 13. Overall, the numerical results on anisotropic grids are quite consistent with the analytical results excluding the very high skewness range (\(Q\ge {0.7}\)). Above \(Q=0.7\), the numerical results (Fig. 14) are quite erratic for all methods. The analytical results seem to preserve order-of-accuracy for almost all of the methods except for the FV least-squares approach. Similar patterns exist for other \(\omega _\mathrm{f}\) but would not be presented here. The asymptotic range for numerical order-of-accuracy is also shown for one case in Fig. 15 though all of the numerical order-of-accuracy results herein are within the asymptotic range.

Fig. 13
figure 13

Analytical (lines) and numerical (symbols) order-of-accuracy for all skewness in a uniform anisotropic grid

For the anisotropic grid element, the \(L_2\) errors for \(Q=0.5\) are shown in Fig. 15. Even though the first-order finite volume uses more points than the N approach, the \(L_2\) error for N is less. The second-order finite volume method is very close to the LDA results, despite it has an extraordinary larger stencil than LDA.

Fig. 14
figure 14

The error contours of different methods for \(Q=0.8\) and \(\omega _\mathrm{f}=1\) in a uniform anisotropic grid. a N. b LDA. c Finite volume 1st. d Finite volume LS

Fig. 15
figure 15

Analytical (lines) and numerical (symbols) \(L_2\) error versus the grid distance in logarithmic scale for the linear case \(Q=0.5\) in a uniform anisotropic grids

4.2 Non-linear Cases

4.2.1 Expansion Case

Consider the Burgers equation.

The characteristic speed is \((a,b)=(u,1)\). In this case, solution will be solved in a square area (\([-1,0]\times [0,1]\)). The bottom edge is the inlet wave,

$$\begin{aligned} u_\text {bottom}=\frac{U_r+x(U_r-U_l)}{1+y(U_r-U_l)},\qquad U_r>U_l \end{aligned}$$
(45)

where \(U_r\) and \(U_l\) are the right and left side of the values. The condition \(U_r>U_l\) ensures that the solution will expand without any shock waves. In this study, \(U_r=1.5\) and \(U_l=-0.5\) are chosen.

The expansion (nonlinear case) is examined numerically with different skewness in only the anisotropic grid element since this grid-type is more realistic in unstructured grids. Note that only the numerical order-of-accuracy is presented since it is impossible at this point to determine the order-of-accuracy for a nonlinear equation using the Taylor series. All the methods show a consistent order-of-accuracy up to \(Q=0.7\).

The \(L_2\) error for different skewness is demonstrated in Fig. 16, which depicts a steady increase in error as the grids are highly skewed but it is difficult to judge whether the FV or RD is better. The numerical order-of-accuracy for each method is only shown for \(Q=0.5\) in Fig. 17, though similar pattern exists for other skewness.

Fig. 16
figure 16

Numerical \(L_2\) error for all skewness in a uniform anisotropic grids for the nonlinear expansion case

Fig. 17
figure 17

Numerical \(L_2\) error versus the grid distance in logarithmic scale for the expansion case \(Q=0.5\) on uniform anisotropic grids

Fig. 18
figure 18

Numerical \(L_2\) error versus the grid distance in logarithmic scale for the expansion case (50 % disturbed grids)

Fig. 19
figure 19

Numerical \(L_2\) error versus the grid distance in logarithmic scale for the expansion case (80 % disturbed grid)

In order to connect this study to a more realistic grid topology, we examine the performance of each method in a non-uniformly skewed grids. The way we construct the non-uniform skewed grids are explained in “Non-uniform Anisotropic Grids” in “Appendix”. Figs. 18 and 19 show the results for 50 and 80 % grid disturbances. For the 50 % grid disturbance, it is obvious that the finite volume least-squares has a less amount of \(L_2\) error. However, its order-of-accuracy is a little less than the LDA. On the other hand, for the 80 % grid disturbance, all of the finite volume methods error is not reduced when grids are refined, let alone achieving second-order (or first order) accuracy. Nonetheless, the RD methods preserve the first order (N-scheme) and second-order accuracy (LDA) even for the non-uniform anisotropic grids.

Fig. 20
figure 20

Cross section of different methods for uniform anisotropic grids with \(Q=0.0\)

Fig. 21
figure 21

Cross section of different methods for \(Q=0.50, 0.8\) grid skewness on uniform anisotropic grids. a \(Q=0.5\). b \(Q=0.8\)

Fig. 22
figure 22

Cross section of different methods for 50 and 80 % grid disturbance. a 50 %. b 80 %

4.2.2 Shock-Tree Case

This test case is to examine the performance of each method on a discontinuous data, particularly the shock case. The shock-tree case is the Burgers’ equation, with the inflow boundary at the bottom, left and right of the domain.

$$\begin{aligned} u(x,0)=1.5-2x \end{aligned}$$
(46)

The steady state exact solution is,

$$ \begin{aligned} u(x,y)=\left\{ \begin{array}{ll} -0.5 &{} y\le \frac{1}{2} \quad \& \quad \frac{x-\frac{3}{4}}{y-\frac{1}{2}}<\frac{1}{2} \\ 1.5 &{} y\le \frac{1}{2} \quad \& \quad \frac{x-\frac{3}{4}}{y-\frac{1}{2}}>\frac{1}{2} \\ \max \left( -0.5,\min \left( 1.5,\frac{x-\frac{3}{4}}{y-\frac{1}{2}}\right) \right) &{} \text {elsewhere} \end{array} \right. \end{aligned}$$
(47)

We have included a limited version for the FV (FV-LS minmod) and RD (PSI) methods. The FV-LS minmod is based on a TVD approach, whereas the PSI is based on limited RD method [1]. This case is also tested on uniform and non-uniform anisotropic grid elements. We have only included the cross-sectional results of the shock rather than then \(L_2\) errors since the former demonstrates the differences between the schemes much more clearly. The cross section of the shock wave for different skewness are shown in Figs. 20 and 21. The cross section of the shock wave for two different non-uniform grids (50 and 80 % disturbance) are shown in Fig. 22. Overall, the FV least-squares has an increased oscillatory behavior around the shock when the grids are highly skewed (both uniform and non-uniform) compared to the LDA. In addition, the FV first order becomes extremely diffusive on very skewed grids. Surprisingly, the N-scheme maintains a very sharp shock profile even for highly skewed grids. Both the limited version of the RD and FV methods are able to preserve monotonicity for most grid skewness although the limited FV method fails to do so on highly skewed grids.

5 Conclusion

It has been analytically and numerically demonstrated that the cell-vertex FV methods and the RD schemes perform quite similarly in terms of the degradation in order-of-accuracy on uniformly skewed triangular grids. However, the \(L_2\) errors for the N-scheme are at least an order of magnitude smaller compared to the first-order FV method even though both preserve first-order accuracy. The \(L_2\) errors for the least-squares FV method are about the same order of magnitude for the second-order LDA although the least-squares FV is formally third order accurate on some type of grids. More importantly, the FV methods generally have larger stencils relative to the RD methods with the least-squares FV method using more than twice the number of points being utilized by LDA. This presents a huge computational cost to achieve the same level of accuracy performance which should be highlighted. Note that the LDA has an identical stencil size to the first-order FV.

On a non-uniformly skewed triangular grids which are common in practical CFD, the FV methods are unable to preserve the formal order-of-accuracy unlike the RD methods. This is where the superiority of the RD methods is demonstrated relative to the FV methods. These findings are consistent with the results obtained by [6] where a randomized but skewed grids were used to investigate the performance between the two type of methods. In fact, our results demonstrate the errors increase when the grids are refined for the FV methods as the grids become highly skewed. There is need to analytically develop the error analysis on non-uniformly skewed triangular grids to better understand this phenomena. The work is currently underway.