1 Introduction

The convection–diffusion processes are involved in many important engineering systems, such as nuclear reactors, chemical reaction in a flow field and environmental pollution treatment [1]. For some complex problems, it is often difficult to obtain an exact solution, thus numerical solutions are usually sought. The numerical solution of convection-dominated problem frequently encounters the difficulty owing to that it concludes so-called thin boundary or interior layers. In these layers, the field variables change very steeply, which leads to a low accuracy and lack of stability in these critical regions. Therefore, a lot of stabilized methods have been developed to eliminate nonphysical oscillations. For example, in the context of finite difference method (FDM) or finite volume method (FVM), various upwind schemes [2], total variation diminishing (TVD) [3] schemes and weighted essentially non-oscillatory (WENO) [4] schemes were designed. In the framework of the finite element method (FEM), the well-known streamline-upwind Petrov–Galerkin (SPUG) [5], Galerkin least square (GLS) [5] and sub-grid scales (SGS) [5] had been developed.

Recently, a kind of so-called meshless or meshfree methods have attracted considerable interest in computational modeling across various engineering disciplines. Many scientists have developed several meshless methods, such as the smoothed particle hydrodynamics (SPH) method, finite point method (FPM), element-free Galerkin (EFG) method, meshless local Petrov–Galerkin (MLPG) method and so on. For more details about the meshless method and its applications, please refer to [6,7,8,9,10,11]. Like the FEM, there are some stabilized meshless methods for solving convection–diffusion equation with convection-dominated. A considerable part of the stabilized methods are based on the idea of the stabilized FEM. For example, many Galerkin meshless methods coupled SUPG, GLS and SGS technique to solve the convection–diffusion equations [12,13,14]. But, in these stabilized methods, the choice of the stabilization parameter is nontrivial and problem dependent. To circumvent this shortcoming, Zhang et. al. [15] presented variational multiscale element-free Galerkin method (VMEFG) which inherits the advantages of variational multiscale method and meshless method to solve the convection–diffusion–reaction equation with convection/reaction-dominated. The most significant advantage of the VMEFG method is free of user-defined stabilization parameter. However, we found that for some strong convection-dominated problems, the solutions obtained by VMEFG method are still over- or under-shootings in the boundary or interior layers with very dense uniform nodal distribution.

In general, if the solution of a differential equation is sufficiently smooth, then a uniform mesh can get a satisfactory numerical solution. But there are some problems which the solution is not very smooth, such as discontinuous solutions or solutions with steep gradient. In this case, using a uniform mesh to calculate will be very expensive, and adaptive algorithms are a very effective method. Meanwhile, a great many of practical problems have local singularities, where requires a lot of computing mesh points usually, thus the evenly distributed mesh will greatly waste computing resources. Therefore, the reasonable distribution of mesh plays an important role in efficient and high accurate computation. However, for a given problem, we generally cannot accurately determine in advance where the solution has local singularities. At this time, the adaptive analysis provides a good way to overcome the above problems. The adaptive algorithm is a process of rationally arranging and adjusting the size, density of the mesh according to the characteristics of the physical problem, the differential equation or the shape of the calculation region.

Compared with the conventional numerical methods such as FEM, FDM and FVM, meshless methods are less dependent on the mesh. This feature makes meshless methods suitable for some problems that adaptive local node refinement is required to attain satisfactory solutions. In a general way, how to identify the regions where solutions have singularities and how to add or delete nodes are two main components in an adaptive algorithm, that is, the so-called a posteriori error estimation and the node refinement strategy [16]. The a posteriori error estimation can obtain the necessary information by measuring the local and global approximation errors, whereas the node refinement procedure determines whether a refinement/coarsening is required or not based on the error information. Up to now, there have been few results of the a posteriori error estimation for Galerkin meshless methods. But this does not mean that the local properties of the solution cannot be obtained in the meshless method. In fact, some scholars have proposed a series of error indicators based on collocation meshless methods [17,18,19,20,21,22,23,24,25,26]. In the paper, we mainly focus on the adaptive algorithm of Galerkin meshless methods which usually depend on a background cell for domain integration. Similarly, there exist some adaptive Galerkin meshless methods applied in various implementations. Most of them adopted a posteriori error based on gradient recovery in the background integration cell to find locations with largest error contribution, which is popular used in FEM and labeled as Zienkiewicz–Zhu method [16, 27,28,29,30].

This work develops an adaptive EFG and VMEFG methods to simulate convection–diffusion equation with convection-dominated. An error indicator based on triangular background integration cell and Zienkiewicz–Zhu indicator is used to locate the critical region. At the same time, due to the use of arbitrary convex polygonal node influence domain technique in moving least square (MLS) approximation, the Gaussian quadrature point in the background cell only contribute to the vertices in the cell, so that some mature mesh refinement strategies in FEM can be directly applied to the meshless method.

The rest of the paper is organized as follows: in Sect. 2, the governing equations as well as their variational multiscale weak form formulations are presented, meanwhile, the moving least square approximation is also briefly introduced. In Sect. 3, the adaptive technique based on triangular background integration cell and Zienkiewicz–Zhu indicator based on gradient recovery in each background integration cell is explained. In Sect. 4, We test VMEFG, adaptive EFG and adaptive VMEFG methods for some convection-dominated problems to show the validity of the approach. Finally, conclusions are drawn in Sect. 5.

2 Variational multiscale element-free Galerkin method for convection–diffusion equation

2.1 MLS approximation

Like element-free Galerkin method, the variational multiscale element-free Galerkin method also uses MLS approximation to generate shape functions, thus we first briefly review the MLS approximation, the more details can be referred to [6,7,8].

Let u be a real-value function define in \(\varOmega\), by the use of a MLS approximation, it is possible to construct an approximation function \(u^h (\varvec{x})\) that fits a discrete set of data \(\{u_I, I=1,2,\ldots , n\}\) such that

$$\begin{aligned} u^h (\varvec{x}) = \sum _{I=1}^{n} \varPhi _I(\varvec{x})u_I, \end{aligned}$$
(1)

where \(\varvec{\varPhi }^{T} = \varvec{P}^{T}(\varvec{x})\varvec{A}^{-1}(\varvec{x})\varvec{B}(\varvec{x})\) are MLS shape function and matrices \(\varvec{A}(\varvec{x})\), \(\varvec{B}(\varvec{x})\) are given as follows:

$$\begin{aligned} \varvec{A}(\varvec{x})= & {} \sum _{i=1}^{n} w(\varvec{x}-\varvec{x}_i) \varvec{p}(\varvec{x}_i) \varvec{p}^T (\varvec{x}_i), \end{aligned}$$
(2)
$$\begin{aligned} \varvec{B}(\varvec{x})= & {} \left[ w(\varvec{x}-\varvec{x}_1)\varvec{p}(\varvec{x}_1), w(\varvec{x}-\varvec{x}_2)\varvec{p}(\varvec{x}_2), \ldots , w(\varvec{x}-\varvec{x}_n)\varvec{p}(\varvec{x}_n)\right] , \end{aligned}$$
(3)

in which \(\{p_j(\varvec{x}), j = 1, \ldots , m \}\) represents the basis function of spatial coordinates, and m is the number of the basis functions. In general, \(m \le n\). \(w(\varvec{x}-\varvec{x}_I)\) is a weight function centered at \(\varvec{x}_I\). In the paper, the following cubic spline function is used as weight function

$$\begin{aligned} w(s) = {\left\{ \begin{array}{ll} \frac{2}{3} - 4s^2 + 4s^3, &{} \text {for} \quad s\le \frac{1}{2}, \\ \frac{4}{3} - 4s + 4s^2 - \frac{4}{3}s^3, &{} \text {for} \quad \frac{1}{2}< s < 1, \\ 0, &{} \text {for} \quad s\ge 1, \end{array}\right. } \end{aligned}$$
(4)

where \(s = d_I / r_I, d_I = || \varvec{x}-\varvec{x}_I ||\) is the distance between point \(\varvec{x}\) and node \(\varvec{x}_I\), \(r_I\) the radius of the influence domain of node \(\varvec{x}_I\). In general, circle and rectangle are most used as influence domain for two-dimensional problems [6]. For rectangle influence domain, the weight function needs to be slightly modified as follows [8]:

$$\begin{aligned} w_i(\varvec{x}) = w(s_x) w(s_y), \end{aligned}$$
(5)

where \(s_x = d_x/r_x, s_y = d_y/r_y, d_x = |x-x_i|, d_y = |y - y_i|\), \(r_x\) and \(r_y\) are the radii of rectangle influence domain along x-axis and y-axis, respectively.

In general, the MLS shape function is continuous in the entire global domain, as long as the weight function is enough smooth. But the MLS shape function has one obvious disadvantage, that is, it does not satisfy the Delta condition at each node, i.e.,

$$\begin{aligned} \varvec{\varPhi }_I(\varvec{x}_J) = \delta _{IJ}. \end{aligned}$$
(6)

As a result, it is not possible to enforce the Dirichlet boundary conditions as easy as that in the FEM.

To overcome this difficulty, many techniques had proposed. In the paper, we adopt the arbitrary convex polygonal influence domain technique which developed by Zhang et al. [31, 32]. In this technique, it just modifies the \(s=d_I/r\) in rectangle influence domain into \(s = d_I/r(\theta )\), then the node has different influence radius based on different angle \(\theta\). Figure 1 shows the schematic diagram of meshless node \(\varvec{x}_I\) having a convex-pentagon influence domain, where the convex pentagon ABCDE is the boundary of influence domain, triangles \(\varDelta x_I A'B'\), \(\varDelta x_I B'C'\), \(\varDelta x_I C'D'\), \(\varDelta x_I D'E'\) and \(\varDelta x_I E'A'\) are background integration cells. In the following, in combination with Fig. 1, we give a brief description how to compute the MLS shape function of node \(\varvec{x}_I\) at computed point \(\varvec{x}\) which usually is Gauss quadrature point in the triangle \(\varDelta x_I A'B'\) [31]:

  1. (1)

    Compute the influence radius \(r(\theta ) = |\varvec{x}_I F| = \alpha |\varvec{x}_I F'|\) along the direction of \(\overrightarrow{\varvec{x_Ix}}\), where \(\alpha\) is the dimensionless size of influence domain;

  2. (2)

    Projection \(r(\theta ) = |\varvec{x}_I F|\) along the x-axis and y-axis, respectively, to get \(r_x\) and \(r_y\);

  3. (3)

    The obtained \(r_x\) and \(r_y\) are substituted into Eq. (5) and then use MLS approximation to compute the shape function at point \(\varvec{x}\).

Fig. 1
figure 1

The sketch map of the node \(\varvec{x}_I\) having a convex pentagon influence domain

To date, how to choose an optimal dimensionless parameter \(\alpha\) is still a research hotspot in meshless method context. In the paper, we always set \(\alpha = 1.01\) which suggested by Zhang et al. [31]. In this setting, the MLS shape function has interpolation property.

This technique has two obvious advantages: one is that makes MLS shape functions pose interpolation property, the other is that avoids the node search procedure when a triangular background cell to perform domain integration and the cell vertices coincide with the domain nodes. In the paper, we will also discover another advantage of this technique in adaptive analysis.

2.2 Governing equations and classical weak formulations

We consider the following steady-state, linear convection–diffusion problem:

$$\begin{aligned} \begin{aligned} -\varepsilon \varDelta u + \varvec{b} \cdot \nabla u + {cu}&= f, \quad \text {in} \quad \varOmega , \\ u&= u_D, \quad \text {on} \quad \varOmega _D, \\ \varepsilon \frac{\partial u}{\partial \varvec{n}} = \varepsilon \nabla u \cdot \varvec{n}&= t_N, \quad \text {on} \quad \varOmega _N, \end{aligned} \end{aligned}$$
(7)

where \(\varOmega \subset R^2\), is a bounded polygonal domain with Lipschitz boundary \(\partial \varOmega = \varOmega _D \cup \varOmega _N\) and \(\varOmega _D \cap \varOmega _N = \emptyset\). u denotes the unknown scalar function, \(\varvec{b}=[b_x, b_y]\) is the velocity field of a given current supposed to be incompressible, that is, \(\nabla \cdot \varvec{b} = 0\), and the coefficient functions cf are assumed to be sufficiently smooth. In general, \(\varepsilon \varDelta u, \varvec{b}\cdot \nabla u, cu\) are called the diffusion term, convective term and reaction term, respectively. The unit outward normal vector on the boundary is described by \(\varvec{n}\). In this paper, we are mainly interested in the convection-dominated problem and assume the coefficient of diffusion is small, i.e., \(0<\varepsilon \ll 1\).

Let

$$\begin{aligned} H_D^1 (\varOmega ) := \{ v \in H^1 (\varOmega ) : v = 0 \quad \text {on} \quad \varOmega _D\}, \end{aligned}$$

the classical variational formulation of Eq. (7) is to find \(u\in H_D^1 (\varOmega )\) such that

$$\begin{aligned} a(u,v)=l(v) \quad \forall v \in H_D^1 (\varOmega ), \end{aligned}$$
(8)

where

$$\begin{aligned} \begin{aligned} a(u,v)&:= (\varepsilon \nabla u, \nabla v) + (\varvec{b} \cdot \nabla u, v) + {(cu,v)}, \\ l(v)&:= (f, v) + (t_N, v)_{\varOmega _N}. \end{aligned} \end{aligned}$$

2.3 The variational multiscale weak formulation

To eliminate numerical oscillations caused by convection-dominated when standard element-free Galerkin method applied, Zhang et al. [15] proposed the variational multiscale element-free Galerkin method to solve the convection–diffusion–reaction equation. It has been proven that VMEFG method can play a good stabilization role in the presence of boundary or interior layers. Here the implementation of VMEFG for convection–diffusion equation will be presented briefly, and the details of VMEFG method can be referred to [15, 32, 33].

In the variational multiscale framework, the scalar field u and weighting function v firstly decompose into coarse scale and fine scale, that is,

$$\begin{aligned} u(\varvec{x}) = {\bar{u}}(\varvec{x}) + u'(\varvec{x}), \end{aligned}$$
(9)

and

$$\begin{aligned} v(\varvec{x}) = {\bar{v}}(\varvec{x}) + v'(\varvec{x}), \end{aligned}$$
(10)

where \({\bar{u}}, {\bar{v}}\) are trial function and weighting function in coarse scale, respectively; \(u', v'\) are trial function and weighting function in the fine scale, respectively. Meanwhile, we further assume that \(u'\) and \(v'\) are non-zero within each triangular background integration cell \(\varOmega _K\) and vanished over the boundary of \(\varOmega _K\), that is,

$$\begin{aligned} u' = v' = 0, \quad \text {on} \quad \partial \varOmega _K. \end{aligned}$$
(11)

Substituting Eqs. (9) and (10) into the classical weak formulation (8), and using the linearity between coarse scale \({\bar{v}}\) and fine scale \(v'\), we can get the following coarse-scale problem and fine-scale problem:

$$\begin{aligned} a({\bar{u}}+u', {\bar{v}}) = l({\bar{v}}), \end{aligned}$$
(12)

and

$$\begin{aligned} a({\bar{u}}+u', v') = l(v'). \end{aligned}$$
(13)

Next, we use bubble function to analytical solve the fine scale problem and obtain the fine scale solution \(u'\) in \(\varOmega _K\) as follows:

$$\begin{aligned} u' = -\tau (\varvec{b}\cdot \nabla {\bar{u}} {+c {\bar{u}}} - \varepsilon \varDelta {\bar{u}} - f), \end{aligned}$$
(14)

where the stabilization parameter

$$\begin{aligned} \tau = \frac{b_1 \int _{\varOmega _K} b_2 \text {d}\varOmega }{a(b_1, b_2)}, \end{aligned}$$
(15)

in which bubble functions \(b_1\) and \(b_2\) in a reference triangle are given [15]

$$\begin{aligned} b_1(x,y)= & {} 27xy(1-x-y), \end{aligned}$$
(16)
$$\begin{aligned} b_2(x,y)= & {} {\left\{ \begin{array}{ll} \frac{xy}{X_b Y_b} \quad &{}\text {for }x, y\text { in region 1 and 3}, \\ \frac{1-x-y}{1-X_b - Y_b} \quad &{}\text {for }x, y\text {in region 2}, \end{array}\right. } \end{aligned}$$
(17)

where \(X_b, Y_b\) denote the location of the internal virtual node in the triangular background integral cell (see Fig. 2).

Fig. 2
figure 2

The bubble function \(b_2(x,y)\) for a reference triangle cell

Once we have got the fine scale solution \(u'\), then substitute it into coarse-scale problem (12), we have the final variational multiscale weak formulation:

$$\begin{aligned}&a({\bar{u}},{\bar{v}}) + \left( \varvec{b}\cdot \nabla {\bar{v}} + \varepsilon \varDelta {\bar{v}} {-c {\bar{v}}}, \tau (\varvec{b}\cdot \nabla {\bar{u}} - \varepsilon \varDelta {\bar{u}} {+c{\bar{u}}} ) \right) \nonumber \\&\quad = l({\bar{v}}) + (\varvec{b}\cdot \nabla {\bar{v}} + \varepsilon \varDelta {\bar{v}} {-c{\bar{v}}}, \tau f). \end{aligned}$$
(18)

For the sake of convenience and simplicity, we drop the superposed bars in Eq. (18) and write the resulting form as

$$\begin{aligned}&a(u,v) + \left( \varvec{b}\cdot \nabla v + \varepsilon \varDelta v {-cv}, \tau (\varvec{b}\cdot \nabla u - \varepsilon \varDelta u + {cu}) \right) \nonumber \\&\quad = l(v) + (\varvec{b}\cdot \nabla v + \varepsilon \varDelta v {-cv}, \tau f). \end{aligned}$$
(19)

To solve problem (19) by the Galerkin meshless method, we can construct a finite dimensional subspace \(V_h\) of \(H_D^1(\varOmega )\), then an approximation for the global variational multiscale weak formulation can be posed as

$$\begin{aligned} {\left\{ \begin{array}{ll} \text {find}\quad u_h \in V_h(\varOmega ) \quad \text {such that} \\ \begin{aligned} a(u_h,v_h) &{} + \left( \varvec{b}\cdot \nabla v_h + \varepsilon \varDelta v_h {-cv_h}, \tau (\varvec{b}\cdot \nabla u_h - \varepsilon \varDelta u_h {+cu_h}) \right) \\ &{} = l(v_h) + (\varvec{b}\cdot \nabla v_h + \varepsilon \varDelta v_h {-cv_h}, \tau f), \quad \forall v_h \in V_h(\varOmega ). \end{aligned} \end{array}\right. } \end{aligned}$$
(20)

Remark 1

If the second terms on the left and right hands are removed from the Eq. (20), it is the standard element-free Galerkin method discretization.

Here, I want to say that although the VMEFG method is a method with good stability properties, it does not preclude over- and under-shootings of the numerical solution in the close neighbourhood of layers, even if the node is very dense.

3 Adaptive refinement algorithm

As mentioned earlier, the EFG and VMEFG method require a background cell for domain integration. Thus, we can develop an adaptive algorithm that makes full of the background integration cell. In the paper, due to the use of arbitrary convex polygonal influence domain technique, the Gaussian integration points in a triangular background cell only contribute to the vertices of that cell. When the meshless nodes coincide with the vertices of the triangular background cell, the error can be estimated based on the background cell, so that the adaptive process can be performed like the FEM. Thus, a prototype adaptive EFG and VMEFG algorithm can be summarized as follows:

figure a

From the above adaptive algorithm, it usually consists of the following main ingredients:

  • How to compute the error indicators or error estimators based on background integration cell.

  • How to determine which background integration cell to be refined.

  • How to perform the refine procedure based on background integration cell.

3.1 A indicator based on gradient recovery

In the adaptive FEM algorithm, so called a posteriori error estimation can be used to compute local error indicators. In general, the error indicators based on Zienkiewicz–Zhu (named the \(Z^2\)-indicator) or element residual are used. In the paper, we applied \(Z^2\)-indicator to identify the regions with local singularities.

Let \(e = u - u_h\) be the error where u and \(u_h\) are the exact solution of the model problem and EFG or VMEFG approximation solution, respectively. \(Z^2\)-indicator uses the error of the gradient \(\nabla e = \nabla u - \nabla u_h\) instead of e itself. Since the exact solution is usually not available, its gradient can not be obtained and replaced with an approximation \(G(u_h)\) of \(\nabla u\). Thus, we have an approximation for the error in the \(L^2\) norm and set

$$\begin{aligned} \eta _K = || G(u_h)-\nabla u_h||_{0;K}, \quad \forall K. \end{aligned}$$
(21)

In the Kth triangular background integration cell, we can construct \(G(u_h)\) by element interpolation or MLS approximation with the same Gauss integration scheme as that used for domain integration. The difference of our gradient recovery between others adaptive meshless is that approximation \(\nabla u_h\) is limited to a single background cell. This is mainly due to the application of arbitrary convex polygonal influence domain technique, which is the third advantage of the technique mentioned above.

3.2 Marking strategies

Since an error indicator in Eq. (21) can be obtained in each background cell, we can use the mature marking strategies in the FEM to select the cell which may be refined.

There are two popular marking strategies for selecting the background cell to be refined given the cell error indicator \(\eta _K\). One is the maximum strategy, the other is Dörfler strategy which is used in the paper.

Set

$$\begin{aligned} \eta ^2 = \sum _{K\in {\mathscr {K}}_h} \eta _K^2 \end{aligned}$$
(22)

be an global error indicator with local contributions \(\eta _K\) with a triangular background integration cell K. The Dörfler marking strategy builds a minimal subset \({\mathscr {S}} \subset {\mathscr {K}}\) such that [34]

$$\begin{aligned} \theta \sum _{K\in {\mathscr {K}}}\eta _K^2 \le \sum _{K\in {\mathscr {S}}} \eta _K^2, \end{aligned}$$
(23)

where \(\theta \in (0,1]\) is a user-defined marking parameter. If \(\theta = 1\), we get a uniform refinement. If \(\theta =0\), none of cell is refined. That is, bigger values of \(\theta\) result in bigger subsets \({\mathscr {S}}\).

3.3 Refinement strategies

The refinement of triangular background cell means the refinement of meshless nodes, thus the refine strategies used in the FEM can be directly applied in the paper. For triangular meshes, there exist four well-known refinement rules, namely the red-, green-, blue-refinement strategies and newest vertex bisection refinement strategy. The details of these refinement strategies can be found in most finite element literature such as [34,35,36,37]. In the paper, we just use the newest vertex bisection refinement strategy for all numerical examples.

4 Numerical results and discussion

In this section, we illustrate the performance of our adaptive EFG and VMEFG algorithm, which is implemented in Matlab. In the following, we will consider seven experiments and exact solutions can be obtained from available literature for the first three examples. In our all experiments, linear basis function is used in the MLS approximation and seven Gaussian quadrature points in each triangular background integration cell.

4.1 Example 1: uniform convection problem without reaction term

This is a uniform convection problem with a nonconstant source term introduced in [30]. The problem data are \(\varepsilon =2\times 10^{-3}\), \(\varvec{b}=(0,1)\) and \(c=0\). The source term f is chosen such that

$$\begin{aligned} u(x,y) = \frac{\exp (\frac{1}{\varepsilon }) - \exp (\frac{x}{\varepsilon })}{\exp (\frac{1}{\varepsilon }) - 1} \end{aligned}$$
(24)

is the solution. The domain \(\varOmega = [0,1]\times [0,1]\) and the Dirichlet boundary conditions are imposed everywhere. The exact solution (24) develops boundary layer along the \(x=1\). For this problem, both adaptive EFG and VMEFG can capture boundary layer information well, and they can refine nodes at the boundary layer. Thus, only the numerical results of the adaptive VMEFG method are given here. Figure 3 presents the numerical solution and the contour of adaptive VMEFG method. It can be clearly seen that none of the oscillations arose along the boundary layer \(x=1\). Figure 4a shows the final nodal distribution of adaptive VMEFG method, which indicates the nodes only refined along the boundary layer. Also, Fig. 4b shows convergence rate of adaptive EFG and VMEFG methods for this example. It can be noted that the errors of EFG and VMEFG methods are not too different, meanwhile the result is identical with that of literature [30]. Table 1 lists the \(L^2\) error and CPU time of adaptive EFG and VMEFG method.

Fig. 3
figure 3

The numerical solution and the contour plot of adaptive VMEFG methods, \(\varepsilon = 2\times 10^{-3}\)

Fig. 4
figure 4

The final nodal distribution for adaptive VMEFG and the convergence rate of adaptive EFG and VMEFG for Example 1

Table 1 The \(L^2\) error and CPU time of adaptive EFG and VMEFG for Example 1

4.2 Example 2: uniform convection problem with reaction term

This example is a uniform convection problem with reaction term which taken from [30]. The problem data are \(\varepsilon = 1\times 10^{-5}, \varvec{b} = (1.0)\) and \(c=1\). The domain \(\varOmega =[0,1]\times [0,1]\) and Dirichlet boundary conditions are imposed on \(\partial \varOmega\). The source term f and Dirichlet boundary conditions are chosen such that [30]

$$\begin{aligned} u(x,y) = \frac{1}{2} \left( 1 - \tanh \left( \frac{x-0.5}{0.05}\right) \right) . \end{aligned}$$
(25)

This problem has internal boundary layer near \(x=0.5\). Figure 5 plots the solution and contour of adaptive VMEFG method with 2607 nodes. Figure 6a shows the final nodal distribution of adaptive VMEFG. It can be seen that the solution is smoothed in the internal boundary layer and none of the oscillations appears. The nodes are also refined in the internal boundary layer region \((0.4, 0.6)\times (0,1)\). Figure 6b also presents the convergence rates of the solutions obtained by adaptive EFG and VMEFG methods. It can be seen that the adaptive VMEFG method has better computational accuracy in this example. As Example 1, Table 2 gives the comparison of the computational time between the adaptive VMEFG and adaptive EFG method. It can be found that under the same computational accuracy, the adaptive VMEFG method requires fewer nodes and computational time, which indicates efficiency of the adaptive VMEFG method.

Fig. 5
figure 5

The numerical solution and the contour plot of adaptive VMEFG methods, \(\varepsilon = 1\times 10^{-5}\)

Fig. 6
figure 6

The final nodal distribution for adaptive VMEFG and the convergence rate of adaptive EFG and VMEFG for Example 2

Table 2 The \(L^2\) error and CPU time of adaptive EFG and VMEFG for Example 2

4.3 Example 3: uniform convection problem with regular boundary layers

In this example, we employ a test example with the following exact solution [30]:

$$\begin{aligned} u(x,y)= & {} xy^2 - y^2 \exp \left( \frac{2(x-1)}{\varepsilon }\right) \nonumber \\&- x \exp \left( \frac{3(y-1)}{\varepsilon }\right) + \exp \left( \frac{2(x-1)+3(y-1)}{\varepsilon }\right) , \end{aligned}$$
(26)

and other relevant data are \(\varepsilon =1\times 10^{-3}, \varvec{b}=(2,3)\) and \(c = 1\), the domain is also a unit square \(\varOmega =[0,1]\times [0,1]\). Using Eq. (26), we can easily know that the solution has characteristic regular boundary layers at \(x = 1\) and \(y = 1\).

Figure 7 plots the solution and contour of adaptive VMEFG method with 24,764 nodes. Figure 8a shows the final nodal distribution of adaptive VMEFG. It can be seen that the solution is very sharp at the regular boundary layers and almost no oscillatory solution is observed. The nodes are mainly refined along \(x=1\) and \(y=1\), where the solution changes rapidly. Figure 8b also presents the convergence rates of the solutions obtained by adaptive EFG and VMEFG methods. It can be seen that the adaptive VMEFG method has better computational accuracy for this example. However, with the increase of nodes, EFG method can also obtain satisfactory computational accuracy. As Examples 1 and 2, Table 3 shows the comparison of the computational time between the adaptive VMEFG and adaptive EFG method, which can easily get the same conclusion as Example 2.

Fig. 7
figure 7

The final nodal distribution for adaptive VMEFG and the convergence rate of adaptive EFG and VMEFG for Example 3

Fig. 8
figure 8

The final nodal distribution for adaptive EFG with 29410 nodes and adaptive VMEFG with 16293 nodes

Table 3 The \(L^2\) error and CPU time of adaptive EFG and VMEFG for Example 3

4.4 Example 4: double-glazing problem

This example is a simple model for the temperature distribution in a cavity with an external wall that is “hot” [38]. We consider a convection-dominated problem, i.e., \(\varepsilon = 10^{-4}, \varvec{b}(x,y) = ( 2y(1-x^2), -2x(1-y^2) )\), and source \(f = 0\) in the domain of a square \(\varOmega = [-1,1]\times [-1,1]\). Dirichlet boundary conditions are imposed everywhere on \(\partial \varOmega\), which \(u =0\) on the left and bottom portions of \(\partial \varOmega\) and \(u=1\) elsewhere. Usually, there are discontinuities at the two corners of \(x = 1, y = \pm 1\). Near these corners, the discontinuities cause the thin boundary layers as shown in Fig. 9 obtained by the adaptive EFG and VMEFG methods. The pictures of Fig. 10 show the final nodal distribution by the adaptive EFG method and VMEFG methods. It can be found that along the boundary of \(\varOmega\), both adaptive EFG and VMEFG methods lead to a node-refinement in the close region of the boundary layers. But to achieve the same effectiveness, the EFG method needs more nodes than that of VMEFG method under the same \(\varepsilon = 10^{-4}\). The contour plots of adaptive EFG and VMEFG methods are shown in Fig. 11, it can be found that they are agree with each other well. But it is important to note that adaptive EFG method uses more nodes, which means that adaptive EFG method requires more computational cost. To show the validate of adaptive VMEFG method, the solutions of VMEFG method on the denser nodes (40,401 nodes) are presented in Fig. 12. It can be found that the overshoot and undershoot at the two corners where are marked in Fig. 12a with red circles. This also proves the advantage of adaptive VMEFG method for strong convection-dominated problems.

Fig. 9
figure 9

The numerical solution of adaptive EFG and VMEFG methods, \(\varepsilon = 10^{-4}\)

Fig. 10
figure 10

The final nodal distribution for adaptive EFG with 29410 nodes and adaptive VMEFG with 16293 nodes

Fig. 11
figure 11

The contour plot of adaptive EFG and VMEFG methods

Fig. 12
figure 12

The three-dimensional surface plot and contour plot of VMEFG with \(201\times 201\) uniform nodes

4.5 Example 5: a variable vertical wind and characteristic boundary layers

This example is also posed on the square \(\varOmega = [-1,1]\times [-1,1]\). Again we have dominating convection because of a small diffusion coefficient, \(\varepsilon = 10^{-5}\), the convection velocity is \(\varvec{b}=(0, 1+(x+1)^2 /4)\) which the vertical velocity increases in strength from left to right. Dirichlet boundary values apply on the left, right and bottom boundary segments; \(u=1\) on the bottom boundary, \(u = (1-\frac{y+1}{2})^3\) on the left boundary and \(u = (1-\frac{y+1}{2})^2\) on the right boundary. The top boundary is set a Neumann condition \(\frac{\partial u}{\partial y} = 0\). In this example, there exists so called shear layer of width \(O(\sqrt{\varepsilon })\) along the left and right boundaries [38]. Figure 13 shows the three-dimensional surface plots obtained by adaptive EFG and adaptive VMEFG methods, respectively. The solution of adaptive EFG shows a small overshooting close the shear layers and smoothed by the adaptive VMEFG method. Figure 14 presents the final nodal distribution of adaptive EFG and VMEFG method. The nodes are refined at the left and right boundary where the shear layers are placed. In this example, it can be seen that the number of nodes in adaptive EFG method is more than four times that of adaptive VMEFG method. Figure 15 shows the contour of solutions of adaptive EFG and VMEFG methods, respectively. The color difference can be clearly found in the figure, which is mainly due to the over-shootings of adaptive EFG method at the shear layers. Meanwhile, the solution of VMEFG method with 10201 uniform nodes is plotted in Fig. 16. Sharp over-shootings along the left and right boundaries are still appeared, which means that the VMEFG methods may fail for strong convection-dominated problems.

Fig. 13
figure 13

The numerical solution of adaptive EFG and VMEFG methods, \(\varepsilon = 10^{-5}\)

Fig. 14
figure 14

The final nodal distribution for adaptive EFG with 18936 nodes and adaptive VMEFG with 4311 nodes

Fig. 15
figure 15

The contour plot of adaptive EFG and VMEFG methods

Fig. 16
figure 16

The three-dimensional surface plot and contour plot of VMEFG with \(101\times 101\) uniform nodes

4.6 Example 6: constant wind at a \(30^\circ\) angle to the left of vertical

In this example, the convection velocity is a constant \(\varvec{b} =(-\sin \frac{\pi }{3}, \cos \frac{\pi }{3} )\). Dirichlet boundary conditions are imposed on \(\partial \varOmega\), which \(u=0\) on the left, top and the bottom with \(x<0\) portions of \(\partial \varOmega\), \(u=1\) is imposed on the rest of portions of \(\partial \varOmega\). In this problem, there is a jump discontinuity at the point \((0,-1)\) obviously. The discontinuity of the boundary condition leads to the solution producing an interior layer of width \(O(\sqrt{\varepsilon })\). Meanwhile, there is also an boundary layer near the top boundary \(y = 1\) [38]. Figure 17 shows the surface plots of the solution obtained by adaptive EFG and VMEFG methods for \(\varepsilon = 10^{-3}\), it can be clearly seen that both methods capture the solution well at the interior and boundary layers. Figure 18 gives the final nodal distribution of adaptive EFG and VMEFG methods, respectively. It can be found that the node are strongly refined at the regions where the interior and boundary layers are placed. Combining Figs. 17 and 18, it can conclude that to achieve the same accuracy, adaptive EFG method needs much more nodes than that of adaptive VMEFG which means that adaptive VMEFG method requires less computing time. The contour of solution of adaptive EFG and VMEFG method is shown in Fig. 19, it can be found that the numerical results of the two methods are in good agreement. Figure 20 presents the surface and contour plots of the solution of VMEFG with 63,001 uniform nodes. It can be obviously found that over-shootings are appeared along the boundary \(y=1\) which implies oscillations also produced in VMEFG for very small diffusion coefficient even if the nodes are very dense.

Fig. 17
figure 17

The numerical solution of adaptive EFG and VMEFG methods, \(\varepsilon = 10^{-3}\)

Fig. 18
figure 18

The final nodal distribution for adaptive EFG with 57,729 nodes and adaptive VMEFG with 32850 nodes

Fig. 19
figure 19

The contour plot of adaptive EFG and VMEFG methods

Fig. 20
figure 20

The three-dimensional surface plot and contour plot of VMEFG with \(251\times 251\) uniform nodes

4.7 Example 7: convection–diffusion–reaction problem with reaction dominated

The convection–diffusion–reaction equation is considered in this example. that is,

$$\begin{aligned} \begin{aligned}&-\varepsilon \varDelta ^2 u + \varvec{b} \cdot \varDelta u + \gamma u = 1, \quad \varOmega = [0,1]\times [0,1], \\&\quad u = 0 , \quad \text {on} \quad \partial \varOmega , \end{aligned} \end{aligned}$$

where the diffusion coefficient \(\varepsilon = 10^{-5}\), the convection velocity \(\varvec{b} = 10^{-4}(\cos \frac{\pi }{3}, \sin \frac{\pi }{3} )\) and the reaction coefficient \(\gamma = 1\). In this case, it is often referred to as the reaction-dominated problem which also has boundary layers.

Like the previous three examples, here we also give four Figs. 21, 22, 23 and 24. Figure 21 shows the three-dimensional surface plot obtained by adaptive EFG and VMEFG methods, respectively. It can be seen that none of oscillations is arisen along the four boundaries where the boundary layers placed. Figure 22 presents the final nodal distribution of adaptive EFG and VMEFG method. It can be seen that the node just refined along the boundaries and the number of nodes in adaptive EFG method is more or less three times that of adaptive VMEFG method. The solution of contour plot is shown in Fig. 23, it can be clearly found that the thin boundary layers along the four boundaries. Figure 24 also shows the results of VMEFG on 10201 uniform nodes. It also can be found over-shootings along the boundaries, although it used more nodes than that of adaptive VMEFG method.

Fig. 21
figure 21

The numerical solution of adaptive EFG and VMEFG methods, \(\varepsilon = 10^{-5}\)

Fig. 22
figure 22

The final nodal distribution for adaptive EFG with 16190 nodes and adaptive VMEFG with 5622 nodes

Fig. 23
figure 23

The contour plot of adaptive EFG and VMEFG methods

Fig. 24
figure 24

The three-dimensional surface plot and contour plot of VMEFG with \(101\times 101\) uniform nodes

5 Conclusion

An adaptive EFG and VMEFG methods are developed in this paper to solve two-dimensional convection–diffusion equation with convection-dominated. The MLS approximation with arbitrary convex polygonal influence domain is used to generate the shape functions for EFG and VMEFG methods. When meshless nodes coincide with the vertices of background integration cell, the error indicator can be obtained directly based on background integration cell and the refinement procedure just like the FEM. The \(Z^2\)-indicator takes only the gradient of the numerical solution into consideration, which is easy to implement and problem independent. To illustrate efficiency of the proposed adaptive methods, seven examples are simulated numerically with strong convection-dominated. The numerical results indicate that the adaptive EFG and VMEFG methods can capture importance at the various of layers. Meanwhile, due to fewer nodes and better results for the same convection-dominated problem, adaptive VMEFG is more advantageous.