1 Introduction

Singular perturbation problems are commonplace in almost every branch of science and engineering, especially in fluid/solid mechanics, mathematical biology, ecological models, electrical networks, quantum mechanics, financial mathematics, and control theory. Generally speaking, singularly perturbed differential equations are differential equations with positive small parameters controlling the highest-order derivative(s). Assuming that we deal with second-order differential equations, e.g., convection–reaction–diffusion equations, as the perturbation parameter tends to zero, i.e., \(\varepsilon \) \(\rightarrow 0^{+}\), the problem is dominated even more by convection. It is a well-known fact that traditional discretization methods are incapable of treating such problems accurately, as will be discussed in the following paragraphs. For further details on singularly perturbed problems, from their asymptotic analysis to engineering applications, one can refer to Bender and Orszag (1999), Johnson (2005).

Similar to singularly perturbed problems, reaction–convection–diffusion equations that model phenomena resulting from transport processes in nature have a wide range of applications, including fluid dynamics, the kinetic theory of gases, chemotaxis processes, biomedical problems, semiconductor theory, financial models, and even in environmental sciences and food engineering. One can refer to Roos et al. (2008) for the numerical treatment of reaction–convection–diffusion problems and (Bird et al. 2015) for more on the transport phenomena.

In this study, we are interested in solving singularly perturbed steady-state linear reaction–convection–diffusion equations numerically by combining two phenomena: singular perturbation and the transport process, i.e., convection-dominated transport problems. A class of such problems can be expressed mathematically in the following form:

$$\begin{aligned} -\varepsilon \Delta u + \textbf{b} \cdot \nabla u + cu&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(1)
$$\begin{aligned} u&=g^{D} \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(2)

where \(\Gamma = \partial \Omega \) denotes the boundary of the problem domain \(\Omega \), \(u=u\left( x,y \right) \) is the unknown function, the term \(\varepsilon \) is the diffusion (perturbation) parameter with \(0<\varepsilon \ll 1\), and the term \(c \in L^{\infty }\left( \Omega \right) \) is the reaction constant. If Eqs. (1)–(2) are assumed to model a two-dimensional problem, then the convection vector, \(\textbf{b}\), which is the coefficient to the gradient vector \(\nabla u\), can be taken as \(\textbf{b}=\left( b_{1}, b_{2}\right) ^{T}\), where \(b_{1}, b_{2} \in W^{1,\infty }(\Omega )\). The source term \(f=f\left( x,y \right) \in L^2(\Omega )\), located on the right hand side of Eq. (1), is assumed to be a sufficiently smooth function. The function \(g^{D}=g^{D}\left( x,y \right) \) represents Dirichlet-type boundary conditions with \(g^{D} \in \mathcal {H}^{1/2}\left( \partial \Omega \right) \). The interested reader is referred to Adams and Fournier (2003) for the definitions and properties of these aforementioned special function spaces.

As the diffusion phenomenon dominates the transport process, the model problem expressed by Eqs. (1)–(2) becomes a convection-dominated elliptic boundary-value problem. That is, the solution of problem (1)–(2) usually experiences rapid and sharp changes, called boundary/interior layer behavior. This situation makes it difficult to obtain accurate and oscillation-free approximations to the solution of the problem by employing standard methods, e.g., central finite differences and Galerkin finite elements. In order to prevent spurious oscillations and resolve sharp gradients accurately, finer space discretizations can be invoked (at least near the regions where the boundary/interior layer(s) occur(s)), adaptive mesh techniques can be used, standard discretization methods can be modified, or any appropriate combination of these can be adopted. It should be noted that, contrary to the general assumption, spurious oscillations can occur not only in convection-dominated problems but also in reaction-dominated problems with sharp gradients due to high reaction rates (Tezduyar and Park 1986).

The (Bubnov–) Galerkin finite element method (GFEM) is a very powerful computational tool since it can handle problems defined on severely complex geometries, has a very well-developed theoretical background with sharp error estimates, and relies primarily on polynomials, for which algebraic manipulations are typically simple. In addition to these, there are also numerous theoretical and applied studies devoted to the methodology. Compared to other computational approaches, these are some of the most significant distinguishing characteristics of finite element methods (FEM). However, due to the method’s inadequacy in solving convection-dominated problems, various remedies to stabilize the solutions have been sought since the 1970 s. The streamline-upwind/Petrov–Galerkin (SUPG) formulation (Hughes and Brooks 1979; Brooks and Hughes 1982) is one of the most successful and well-known of these stabilized formulations. One can refer to Brezzi and Russo (2000) for further discussion on the need for stabilized formulations in the world of the FEM.

The SUPG formulation was first introduced in an ASME paper (Hughes and Brooks 1979) in 1979, and later in a journal article (Brooks and Hughes 1982) in 1982 by Hughes and Brooks for computing incompressible flows. Soon after, the method was reformulated for computing compressible flows in a NASA technical report (Tezduyar and Hughes 1982) in 1982, published as an AIAA paper (Tezduyar and Hughes 1983) in 1983, and as a journal article (Hughes and Tezduyar 1984) with further considerations in 1984 by Tezduyar and Hughes. Even though promising results were achieved by employing these SUPG-based stabilized formulations in the computations, it was clear that something extra, which we call shock-capturing or discontinuity-capturing today, was required at shocks, where sudden and sharp changes in solutions were observed. We refer the interested reader to John and Schmeyer (2008), Hughes et al. (2010) for more on the application of the SUPG method to compressible/incompressible flow computations.

Until 2004, the SUPG formulation was almost always complemented with certain types of shock-capturing techniques for both incompressible and compressible flow simulations, resulting in better solution profiles at shocks and discontinuities. In 2004, Tezduyar (2004), Tezduyar (2007) introduced new ways for defining the stabilization and shock-capturing parameters in the SUPG formulation. The set of stabilization parameters introduced in 2004 is today called “\(\tau _{04}\).” The proposed techniques for shock-capturing can be divided into two main groups: in a style the discontinuity-capturing directional dissipation (DCDD) (Tezduyar 2003) and the YZ\(\beta \) (Tezduyar 2004, 2007) shock-capturing. We restrict our attention to the latter approach, i.e., the YZ\(\beta \) technique, in the rest of this paper since we adopt it to augment the standard SUPG formulation. Note that, as can also be seen in the following sections, the name of the technique comes from its components Y, Z, and \(\beta \). It is reported in Tezduyar and Senga (2006), Tezduyar and Senga (2007), Tezduyar et al. (2006) that, by using the YZ\(\beta \) technique, the shock-capturing parameter can be calculated in a simpler way compared to previous techniques, also yielding better shock representations. Beyond these, the parameter \(\beta \) embedded in the formulation allows flexibility for smooth and sharp shocks. One can refer to Tezduyar and Senga (2006), Tezduyar and Senga (2007), Tezduyar et al. (2006), Rispoli et al. (2015) for several applications of the technique for solving problems arising in computational fluid dynamics (CFD). In addition to these, the implementation of the formulation for Burgers’-type equations at high Reynolds numbers is available in Cengizci and Uğur (2023), as is the implementation for reaction–convection–diffusion equations with nonlinear reaction mechanisms in Cengizci et al. (2022).

We now turn our attention back to the model problem given by Eqs. (1)–(2) and attempt to provide a brief survey of research conducted on singularly perturbed reaction–convection–diffusion equations. Johnson et al. (1987) adopted equations having the form

$$\begin{aligned} -\delta u_{xx}-\varepsilon u_{yy}+u_{x}+u=f, \end{aligned}$$
(3)

as a model problem. They solved the problem by adding a small amount of artificial crosswind diffusion to the SUPG formulation. Lube (1992) employed the SUPG method for solving Burgers’-type equations and derived some error estimates. Codina (1993) applied the SUPG method to both one- and two-dimensional problems by adding shock-capturing crosswind-dissipation. Stynes and Tobiska (1995) investigated linear convection–diffusion equations and derived necessary conditions for \(\varepsilon \)-uniform convergence. Zhou (1997) considered equations in the form of

$$\begin{aligned} -\varepsilon \Delta u+u_{x}+u=f, \end{aligned}$$
(4)

and studied the accuracy of the SUPG formulation in solving them. Brezzi et al. (1998) introduced the pseudo-residual-free bubble concept, compared the results with those obtained by using the SUPG method, and reported that similar results were obtained. Stynes and Tobiska (1998), Linß and Stynes (2001a), Linß and Stynes (2001b) considered the model problem given by Eqs. (1)–(2) on a Shishkin mesh employing the SUPG formulation and derived some error estimates. John et al. (1998) applied the SUPG method to the model problem (1)–(2) by adding a parameter-free shock-capturing term. Kopteva (2004) investigated how accurate the SUPG formulation is for solving boundary/interior-layer problems. John and Knobloch (2007), John and Knobloch (2008), John and Schmeyer (2008) presented a comprehensive review and comparisons of stabilized formulations used for solving convection-dominated problems. Matthies (2009) handled the model problem by employing a local projection stabilization method on Shishkin and Shishkin–Bakhvalov meshes. Franz (2010) used an edge stabilization technique for the model problem on a Shishkin mesh and derived some error bounds. Franz and Matthies (2010) used layer-adapted meshes, analyzed the GFEM and a local projection scheme for bilinear and higher-order finite elements where enriched spaces were employed. Roos (2012) reviewed the studies that dealt with singularly perturbed convection–diffusion problems conducted between 2008 and 2012. Finally, Zhang et al. (2016), Zhang and Liu (2018) examined the SUPG formulation from various aspects for solving convection-dominated problems on Shishkin meshes.

As summarized and discussed in the previous paragraphs, there are a variety of stabilized formulations supplemented with various shock-capturing mechanisms for solving convection-dominated problems. The correct determination of stabilization and shock-capturing parameters used in these formulations is very demanding and is still an active research area today. In this study, the SUPG formulation is used to overcome the instability issues encountered in solving problems having the form of Eqs. (1)–(2). To achieve better solution profiles near sharp gradients, the stabilized formulation is further complemented with YZ\(\beta \) shock-capturing.

Our main aim in this paper is to implement the YZ\(\beta \) shock-capturing technique as a supplement to the SUPG formulation for solving convection-dominated linear reaction–convection–diffusion equations because it has not been employed for solving such problems specifically. Rather than taking a theoretical approach, we intend to evaluate the performance of the technique on a comprehensive set of test problems. Although the vast majority of studies in the literature dealing with the numerical solution of convection-dominated problems have been conducted on Shishkin/Shishkin–Bakhvalov type or other (pre)adaptive meshes, the computations in this study are performed and compared on uniform meshes.

The next section presents the variational formulations for the model problem given by Eqs. (1)–(2). The GFEM formulation is derived first, followed by the outline of the SUPG-stabilized formulation, which also includes shock-capturing terms. Section 3 compares the results obtained by employing the proposed formulations on five test problems and evaluates the impact of the YZ\(\beta \) shock-capturing mechanism. Finally, the findings are discussed in detail, and a possible future outlook is presented in Sect. 4.

2 Proposed method for the model problem

In this section, the GFEM and SUPG formulations are presented, and the YZ\(\beta \) shock-capturing technique is introduced for solving the model problem. To that end, let us recast the model problem:

$$\begin{aligned} -\varepsilon \Delta u + \textbf{b} \cdot \nabla u + cu&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \\ u&=g^{D} \quad \text {on} \, \quad \partial \Omega . \end{aligned}$$

Before presenting the variational formulation of the problem, some special function spaces need to be introduced first. Let \(w \in \mathcal {H}_{0}^{1}\subset \mathcal {H}^{1}\) be a test (weighting) function, where the Sobolev spaces \(\mathcal {H}_{0}^{1}\) and \(\mathcal {H}^{1}\) are defined as follows:

$$\begin{aligned} \mathcal {H}_{0}^{1}=\left\{ w\in \mathcal {H}^{1}:\, w\vert _{\partial \Omega }=0\right\} , \quad \mathcal {H}^{1}=\left\{ w:\Vert w \Vert _{L^{2}_{\Omega }}+\Vert \nabla w\Vert _{L^{2}_{\Omega }} <\infty \right\} , \end{aligned}$$
(5)

where \(L^{2}_{\Omega }=L^{2}\left( \Omega \right) \) represents the space of square-integrable functions on \(\Omega \), and is equipped with the standard \(L^{2}\)–norm:

$$\begin{aligned} \Vert w\Vert _{L^{2}_{\Omega }}=\sqrt{\int _{\Omega }w^{2}dx}. \end{aligned}$$
(6)

By multiplying both sides of Eq. (1) by a test function, \(w \in \mathcal {V}\subset \mathcal {H}_{0}^{1}\), and integrating it over the computational domain \(\Omega \), one obtains

$$\begin{aligned} \int _{\Omega }w\left( -\nabla \cdot \left( \varepsilon \nabla u \right) + \textbf{b} \cdot \nabla u + cu \right) \, d\Omega = \int _{\Omega } wf \, d\Omega . \end{aligned}$$
(7)

Then, by applying integration by parts to the diffusion term in Eq. (7), the weak formulation reads:

$$\begin{aligned} \int _{\Omega }\left[ \nabla w \cdot \varepsilon \nabla u + w\left( \textbf{b} \cdot \nabla u\right) + cwu -wf\right] \, d\Omega - \int _{\Gamma _\text {H}} w \cdot H ~d\Gamma =0, \end{aligned}$$
(8)

where H denotes the Neumann boundary condition associated with Eq. (7), and \(\Gamma _{\text {H}}\) is the part of the boundary \(\Gamma \) where such conditions are prescribed. Note that, since a Dirichlet boundary condition has been specified in Eq. (2), the boundary term associated with Neumann boundary condition can be neglected, and eventually, the weak formulation reads: find \(u\in \mathcal {V}\) such that

$$\begin{aligned} \int _{\Omega }\left[ \nabla w \cdot \varepsilon \nabla u + w\left( \textbf{b} \cdot \nabla u\right) + cwu -wf\right] \, d\Omega =0, \hspace{5.0pt}\forall w \in \mathcal {V}. \end{aligned}$$
(9)

Now that a weak formulation is obtained, then a finite element spatial discretization can be obtained. Introducing the following finite-dimensional function space

$$\begin{aligned} \mathcal {V}^{h}=\left\{ w^{h} \in \mathcal {C}\left( \overline{\Omega }\right) : w^{h}\vert _{\partial \Omega }=0,\, w^{h}\vert _{\Omega ^{e}} \in \mathcal {P}_{1}\left( \Omega ^{e}\right) , \forall \Omega ^{e} \in \mathcal {T}^{h} \right\} , \end{aligned}$$
(10)

the discrete GFEM formulation reads: find \(u^{h}\in \mathcal {V}^{h}\) such that

$$\begin{aligned} \int _{\Omega }\left[ \nabla w^{h} \cdot \varepsilon \nabla u^{h} + w^{h}\left( \textbf{b}^{h} \cdot \nabla u^{h}\right) + c^{h}w^{h}u^{h} - w^{h}f^{h}\right] \, d\Omega =0, \hspace{5.0pt}\forall w^{h} \in \mathcal {V}^{h}. \end{aligned}$$
(11)

Here, \(\mathcal {P}_{1}\left( \Omega ^{e}\right) \) is the space of linear polynomials over the element \( \Omega ^{e} \in \mathcal {T}^{h}\), and \(\mathcal {T}^{h}\) is the triangulation of the domain \(\Omega \) into triangular elements.

Now, let us consider the SUPG formulation of Eqs. (1)–(2). In the light of studies by Tezduyar and Senga (2006), Tezduyar and Senga (2007), Tezduyar et al. (2006), the SUPG-stabilized discrete formulation enhanced with the YZ\(\beta \) shock-capturing mechanism can be given as follows: find \(u^{h} \in \mathcal {V}^{h}\) such that

$$\begin{aligned}{} & {} \int _{\Omega } \left[ \nabla w^{h} \cdot \varepsilon \nabla u^{h} + w^{h}\left( \textbf{b}^{h} \cdot \nabla u^{h}\right) + c^{h}w^{h}u^{h} - w^{h}f^{h}\right] \, d\Omega \nonumber \\{} & {} \quad + \sum _{e=1}^{n_\text {el}} \int _{\Omega ^{e}}\tau _{\text {SUPG}} \left( -\nabla \cdot \left( \varepsilon \nabla u^{h} \right) + \textbf{b}^{h} \cdot \nabla u^{h} + c^{h}u^{h}-f^{h}\right) \left( \textbf{b}^{h} \cdot \nabla w^{h} \right) \, d\Omega \nonumber \\{} & {} \quad + \sum _{e=1}^{n_\text {el}} \int _{\Omega ^{e}} \nu _{\text {SHOC}} \left( \nabla w^{h} \cdot \nabla u^{h} \right) ~ d\Omega = 0, \hspace{5.0pt}\forall w^{h}\in \mathcal {V}^{h}, \end{aligned}$$
(12)

where the finite-dimensional space \(\mathcal {V}^{h}\) is defined by Eq. (10). In this formulation, e is the element counter, and \(n_\text {el}\) is the number of elements. The terms \(\tau _{\text {SUPG}}\) and \(\nu _{\text {SHOC}}\) are the stabilization and shock-capturing parameters, respectively.

Remark 1

Note that the stabilized formulation given by Eq. (12) includes some extra terms compared to the classical GFEM formulation given by Eq. (11). The first two terms on the LHS (first two lines) of Eq. (12) represent the SUPG formulation, which introduces artificial diffusion in the streamline direction. The third term on the LHS (third line) of formulation (12) is associated with the shock-capturing mechanism and introduces additional numerical diffusion near steep gradients in order to resolve sharp layers.

How the stabilization and shock-capturing parameters are determined directly affects the accuracy and quality of the numerical solutions. More specifically, while the stabilization parameter plays an important role in the (global) behavior and accuracy of the approximations, the shock-capturing parameter has a crucial influence on the (local) quality of the solutions at shocks and near discontinuities. For defining the stabilization parameter, \(\tau _{\text {SUPG}}\), we adopt the definition introduced in Shakib (1988):

$$\begin{aligned} \tau _{\text {SUPG}}=\left[ \left( \frac{2 \Vert \textbf{b}^{h}\Vert }{h^{e}} \right) ^{2} + \left( \frac{4\varepsilon }{(h^{e})^{2}}\right) ^{2} \right] ^{-\frac{1}{2}}. \end{aligned}$$
(13)

where \(\Vert \cdot \Vert \) denotes the standard Euclidean norm, and \(h^{e}\) is the cell diameter associated with element e. For a review of various definitions of the stabilization parameter, \(\tau _{\text {SUPG}}\), one can refer to Tezduyar (1992), John and Knobloch (2007).

The shock-capturing parameter, \(\nu _{\text {SHOC}}\), is defined in light of studies by Tezduyar and Senga (2006), Tezduyar and Senga (2007), Tezduyar et al. (2006). In this work, we slightly modify the original definition of this parameter to solve the model problem as follows (Bazilevs et al. 2007):

$$\begin{aligned} \nu _{\text {SHOC}}=\vert \text {Y}^{-1}\text {Z}\vert \left( \sum _{i=1}^{n_\text {sd}} \bigg \vert \text {Y}^{-1}\frac{\partial u^{h}}{\partial x_{i}} \bigg \vert ^{2} \right) ^{\frac{\beta }{2}-1} \left( \frac{h_{\text {SHOC}}}{2}\right) ^{\beta }, \end{aligned}$$
(14)

where

$$\begin{aligned} \text {Z}=-\nabla \cdot \left( \varepsilon \nabla u^{h} \right) + \textbf{b}^{h} \cdot \nabla u^{h} + c^{h}u^{h}-f^{h}. \end{aligned}$$
(15)

Remark 2

By using Eq. (15) in computations, we adopt the residual form of Z, which is similar to that used in Bazilevs et al. (2007) as a variation of the advective form introduced in Tezduyar (2004, 2007):

$$\begin{aligned} \text {Z} = \textbf{b}^{h} \cdot \nabla u^{h}. \end{aligned}$$
(16)

In addition to that used in Bazilevs et al. (2007), following this way, we also include the reaction term \(c^{h}u^{h}\) in the definition of Z.

In Eq. (14), the quantity Y is set to a reference value of the scalar field:

$$\begin{aligned} \text {Y}=u_{\text {ref}}. \end{aligned}$$
(17)

The reference value \(u_{\text {ref}}\) can be determined according to the initial data given for unsteady problems. Since we are interested in steady-state problems throughout this manuscript, we determine these reference values through numerical experiments.

Remark 3

In the definition of the shock-capturing parameter given by Eq. (14), the spatial variables are denoted by \(x_{i}\)’s, where \(i=1,2,\dots ,{n_\text {sd}}\), in order to ensure consistency with the literature. Since we are interested in two-dimensional problems in this paper, i.e., \(n_\text {sd}=2\), the spatial variables \(x_{1}\) and \(x_{2}\) correspond to x and y, respectively.

The local element length scale, \(h_{\text {SHOC}}\), is given as

$$\begin{aligned} h_{\text {SHOC}}=2\left( \sum _{a=1}^{n_\text {en}}\vert \textbf{j} \cdot \nabla N_{a}\vert \right) ^{-1}, \end{aligned}$$
(18)

with the unit vector in the direction of the gradient of \(u^{h}\):

$$\begin{aligned} \textbf{j}=\frac{\nabla u^{h}}{\Vert \nabla u^{h} \Vert }. \end{aligned}$$
(19)

Here, the term \(N_{a}\) represents the interpolating function associated with element node a. The indices \(n_\text {sd}\) and \(n_\text {en}\) stand for the number of space-dimensions and number of element nodes. The parameter \(\beta \) is typically set \(\beta =1\) for mild shocks and \(\beta =2\) for sharper shocks (Tezduyar and Senga 2006, 2007; Tezduyar et al. 2006). Since the problems we deal with in this study are highly dominated by convection, we set the sharpness parameter \(\beta \) as \(\beta =2\) in computations.

3 Numerical experiments

In this section, five challenging test computations are provided. Since the first two test problems have analytical solutions, numerical solutions are compared with the exact solutions. In computations, three different norms, the \(L^{2}\)–norm, \(\Vert \cdot \Vert _{L^{2}}\), the maximum norm, \(\Vert \cdot \Vert _{L^{\infty }}\), and an \(\varepsilon \)-weighted energy norm, \(\Vert \cdot \Vert _{L^{\varepsilon }}\), are used to measure the errors in approximations obtained. The \(L^{2}\)–norm has already been defined by Eq. (6). The maximum and \(\varepsilon \)-weighted energy norms are defined as follows:

$$\begin{aligned} \Vert v \Vert _{L^{\infty }}&= \max _{i} \vert v_{i}\vert ,\\ \Vert v \Vert ^{2}_{L^{\varepsilon }}&=\varepsilon \Vert \nabla v \Vert ^{2}_{L^{2}}+ \Vert v \Vert ^{2}_{L^{2}}. \end{aligned}$$

The rate of convergence, \(\rho ^{N}\), can be computed in the sense of double-mesh principle using the formula (Farrell and Hegarty 1991):

$$\begin{aligned} \rho ^{N}=\frac{\ln {E^{N}}-\ln {E^{2N}}}{\ln {2}}, \end{aligned}$$
(20)

where \(E^{N}=u-u^{N}\) and \(E^{2N}=u-u^{2N}\) are point-wise errors associated with meshes with \(N\times N\) and \(2N\times 2N\) elements, respectively. Similarly, \(u^{N}\) and \(u^{2N}\) are the computed solutions on meshes with \(N\times N\) and \(2N\times 2N\) elements. Since the last three test examples have no known analytical solution, we estimate the errors in solutions using the formula (Farrell and Hegarty 1991):

$$\begin{aligned} E^{N}_{\text {dm}}=\max \vert u^{N}-u^{2N} \vert , \end{aligned}$$
(21)

where the subscript “dm” indicates that the error is computed in the sense of the double-mesh principle. However, we do not present error plots for Example 5 because it is given as a counterexample.

Although the test problems in which we are interested in this study are linear, the algebraic equation systems arising from their SUPG-YZ\(\beta \) discrete formulations are highly nonlinear. We employ the Newton–Raphson (N–R) method for solving these systems of nonlinear equations. The linear systems emerging at each N–R iteration are not too large to solve with a direct method, and therefore, we use the lower-upper (LU) factorization for solving the resulting linear equation systems. The absolute and relative error tolerances in the N–R iterative process are set to \(\epsilon _{\text {tol}}=10^{-12}\).

Our test computations and experiences demonstrate that, at least for the problems we deal with in this study, “sharper shocks” are observed in the solutions for values of the diffusion parameter less than \(\varepsilon =10^{-3}\), even though it is quite difficult to generalize because the behavior of solution is closely related to the nature of the problem at hand. Therefore, since this work deals with lower values of the diffusion parameter \(\varepsilon \), on the order of \(\varepsilon =10^{-8}\), we set the \(\beta \) parameter of YZ\(\beta \) as \(\beta =2\).

For developing the finite element solvers and performing computations, the FEniCS (Alnæs et al. 2015) environment, an open-source scientific computing platform, is used. For the most recent updates on the project, the interested reader can visit the FEniCS website: https://fenicsproject.org/.

Figure 1 shows two meshes used in computations, which have 1849 nodes and \(3528=2\times 42\times 42\) triangular elements, and 3613 nodes and \(7056=4\times 42\times 42\) crossed triangular elements. The mesh constructed with crossed elements is used for solving Examples 4 and  5 only.

Fig. 1
figure 1

Meshes used in computations: a \(2 \times 42 \times 42\) triangular elements, b \(4 \times 42 \times 42\) (crossed) triangular elements

Example 1

Consider the following singularly perturbed convection–diffusion equation (Zhang 2003):

$$\begin{aligned} -\varepsilon \Delta u + u_{x} + u_{y}&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(22)
$$\begin{aligned} u&=0 \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(23)

where the source term, \(f=f(x,y)\), is given as

$$\begin{aligned} f(x,y)= & {} \left( x+y \right) \left( 1-\exp \left( \frac{x-1}{\varepsilon }\right) \exp \left( \frac{y-1}{\varepsilon } \right) \right) \nonumber \\{} & {} + \left( x-y \right) \left( \exp \left( \frac{y-1}{\varepsilon }\right) - \exp \left( \frac{x-1}{\varepsilon } \right) \right) . \end{aligned}$$
(24)

The exact solution to Eqs. (22)–(23) is

$$\begin{aligned} u(x,y)=xy\left( 1-\exp \left( \frac{x-1}{\varepsilon } \right) \right) \left( 1-\exp \left( \frac{y-1}{\varepsilon } \right) \right) . \end{aligned}$$
(25)

In Fig. 2, the GFEM solutions to the problem (22)–(23) are presented for various values of \(\varepsilon \). Although the GFEM results are quite good for \(\varepsilon =1\) and acceptable for \(\varepsilon =10^{-2}\), it is not the case for \(\varepsilon =10^{-4}\) and \(\varepsilon =10^{-6}\). Figure 3 compares the results obtained with the SUPG and SUPG-YZ\(\beta \) with the corresponding absolute errors for \(\varepsilon =10^{-8}\). Although spurious oscillations pollute the entire computational domain in the GFEM solutions, the SUPG formulation suppresses them significantly. The GFEM fails to capture the sharp gradients around the point (1.0, 1.0); however, the SUPG-YZ\(\beta \) formulation overcomes this issue successfully. In Fig. 4, logarithmic plots comparing the degrees of freedom and errors in approximations are given for \(\varepsilon =10^{-4}\) and \(\varepsilon =10^{-8}\). Note that we use the abbreviations “SUPG-YZ\(\beta \)” and “SUPG-SC” interchangeably, where the suffix “SC” stands for “shock-capturing.”

We also compare the errors in the GFEM, SUPG, and SUPG-YZ\(\beta \) approximations in \(L^{\infty }\) and \(L^{2}\) norms for \(\varepsilon =10^{0}\), for which the solution is quite smooth, in Fig. 5. It is clearly observed that the shock-capturing mechanism does not introduce excessive artificial diffusion when the solution is smooth. We also see that as the mesh becomes finer, the SUPG-YZ\(\beta \) approximations are getting even better than those obtained with the SUPG.

In computations, we set the scaling term Y of YZ\(\beta \) as Y \(=0.25\). The number of Newton–Raphson iterations in SUPG-YZ\(\beta \) computations is found to be 5.

Fig. 2
figure 2

GFEM approximations for solving Example 1: a \(\varepsilon =1.0\), b \(\varepsilon =10^{-2}\), c \(\varepsilon =10^{-4}\), and d \(\varepsilon =10^{-6}\); \(n_\text {el}=2\times 42 \times 42\)

Fig. 3
figure 3

Effect of shock-capturing for solving Example 1: a SUPG solution, b SUPG-YZ\(\beta \) solution, c absolute error in SUPG solution, and d absolute error in SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 2\times 42\times 42\)

Fig. 4
figure 4

Comparison of errors for solving Example 1: a \(\varepsilon =10^{-4}\), b \(\varepsilon =10^{-8}\)

Fig. 5
figure 5

Comparison of errors for solving Example 1; \(\varepsilon =1.0.\)

Example 2

Consider the following singularly perturbed reaction–convection–diffusion equation (Linß and Stynes 2001b):

$$\begin{aligned} -\varepsilon \Delta u + 2u_{x} + 3u_{y}+ u&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(26)
$$\begin{aligned} u&=0 \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(27)

where the source term, \(f=f(x,y)\), is determined such that the exact solution given as

$$\begin{aligned} u(x,y)=2y^{2}\sin (x)\left( 1-\exp \left( \frac{2(x-1)}{\varepsilon } \right) \right) \left( 1-\exp \left( \frac{y-1}{\varepsilon } \right) \right) \end{aligned}$$
(28)

is satisfied.

Figure 6 demonstrates that the GFEM gives unacceptable solutions when solving Example 2 for values of the diffusion parameter less than \(\varepsilon =10^{-2}\). In Fig. 7, the results obtained with the SUPG and SUPG-YZ\(\beta \) formulations are compared for \(\varepsilon =10^{-8}\), and the corresponding absolute errors are also presented. The effect of the shock-capturing mechanism proposed is clearly observed. Eventually, in Fig. 8, logarithmic plots comparing the degrees of freedom and errors in approximations are given. From these error plots, we see that the SUPG-YZ\(\beta \) formulation results in more accurate approximations compared to those obtained without shock-capturing.

Fig. 6
figure 6

GFEM approximations for solving Example 2: a \(\varepsilon =1.0\), b \(\varepsilon =10^{-2}\), c \(\varepsilon =10^{-4}\), and d \(\varepsilon =10^{-6}\); \(n_\text {el}=2\times 42 \times 42\)

Fig. 7
figure 7

Effect of shock-capturing for solving Example 2: a SUPG solution, b SUPG-YZ\(\beta \) solution, c absolute error in SUPG solution, and d absolute error in SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 2\times 42\times 42\)

Fig. 8
figure 8

Comparison of errors for solving Example 2: a \(\varepsilon =10^{-4}\), b \(\varepsilon =10^{-8}\)

The scaling term Y of YZ\(\beta \) is set as Y \(=0.15\). The number of Newton–Raphson iterations for SUPG-YZ\(\beta \) computations is 6.

Example 3

Consider the following singularly perturbed reaction–convection–diffusion equation (Linß and Stynes 2001a):

$$\begin{aligned} -\varepsilon \Delta u + u_{x} + \frac{11}{7}u_{y}+ u&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(29)
$$\begin{aligned} u&=0 \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(30)

where the source term, \(f=f(x,y)\), is given as follows:

$$\begin{aligned} f(x,y)=x(1-x)+y(1-y). \end{aligned}$$
(31)

There is no known analytical solution to this problem. Therefore, the formula given in Eq. (21) is used for measuring the errors in approximations.

One can point out from Fig. 9 that, as in the previous test problems, the GFEM yields unacceptable solutions when solving Example 3 for values of the perturbation parameter less than \(\varepsilon =10^{-2}\). In Fig. 10, the approximations obtained with the SUPG and SUPG-YZ\(\beta \) formulations are compared, and the success of the shock-capturing technique employed is illustrated. Finally, in Fig. 11, logarithmic plots comparing the degrees of freedom and errors in approximations are given. We observe that the formulation enhanced with the shock-capturing mechanism gives better accuracy as finer meshes are used. On the other hand, errors in the SUPG and SUPG-YZ\(\beta \) approximations are very close to each other for meshes constructed with \(n_{\text {el}}=2\times 16\times 16\) or more elements.

Fig. 9
figure 9

GFEM approximations for solving Example 3: a \(\varepsilon =1.0\), b \(\varepsilon =10^{-2}\), c \(\varepsilon =10^{-4}\), and d \(\varepsilon =10^{-6}\); \(n_\text {el}=2\times 42 \times 42\)

Fig. 10
figure 10

Effect of shock-capturing for solving Example 3: a SUPG solution, b SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 2\times 42\times 42\)

Fig. 11
figure 11

Comparison of errors for solving Example 3 for a \(\varepsilon =10^{-4}\), b \(\varepsilon =10^{-8}\)

For solving Example 3, the scaling term Y of YZ\(\beta \) is set as Y \(=0.035\). The number of iterations in the N–R process is 6.

Example 4

Consider the following singularly perturbed convection–diffusion equation (Hughes et al. 1986; John and Knobloch 2007):

$$\begin{aligned} -\varepsilon \Delta u + \cos \left( -\frac{\pi }{3}\right) u_{x} + \sin \left( -\frac{\pi }{3}\right) u_{y}&= 0 \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(32)
$$\begin{aligned} u&=g^{D} \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(33)

where the Dirichlet boundary condition is given as follows:

$$\begin{aligned} g^{D}\left( x, y \right) = \left\{ \begin{array}{ll} 0, &{} \text {if } x=1 \text { or } y\le 0.7, \\ 1, &{} \text {else}. \end{array} \right. \end{aligned}$$
(34)

In the direction of convection, the solution exhibits an interior layer that starts at the point (0, 0.7). Exponential layers are developed along the boundary \(x= 1\) and on the right part of the boundary \(y= 0\).

For solving Example 4, we use the mesh constructed with crossed elements (see Fig. 1b). Figure 12 shows the GFEM solutions to the solution of Example 4 for various values of the diffusion parameter. The method yields unacceptable approximations for values of the diffusion parameter \(\varepsilon \) smaller than \(10^{-2}\). In Fig. 13, the SUPG and SUPG-YZ\(\beta \) solutions are compared. It is clearly seen that shock-capturing provides better resolutions near strong gradients. In Fig. 14, logarithmic plots comparing the degrees of freedom and errors in approximations are given. Figure 15 compares the solutions obtained with the SUPG and SUPG-YZ\(\beta \) formulations for \(\varepsilon =10^{-4}\) and \(\varepsilon =10^{-8}\) along the line \(y=0.1\). The success of the YZ\(\beta \) shock-capturing in resolving steep gradients is clearly observed.

Fig. 12
figure 12

GFEM approximations for solving Example 4: a \(\varepsilon =1.0\), b \(\varepsilon =10^{-2}\), c \(\varepsilon =10^{-4}\), and d \(\varepsilon =10^{-6}\); \(n_\text {el}=4\times 42 \times 42\)

Fig. 13
figure 13

Effect of shock-capturing for solving Example 4: a SUPG solution, b SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 4\times 42\times 42\)

Fig. 14
figure 14

Comparison of errors for solving Example 4: a \(\varepsilon =10^{-4}\), b \(\varepsilon =10^{-8}\)

Fig. 15
figure 15

Comparison of SUPG and SUPG-YZ\(\beta \) approximations along \(y=0.1\) for solving Example 4: a \(\varepsilon =10^{-3}\), b \(\varepsilon =10^{-8}\); \(n_\text {el}= 4\times 42\times 42\)

In our computations, we set the scaling term Y of YZ\(\beta \) as Y \(=0.03\). The number of nonlinear iterations is 5.

Example 5

Consider the following singularly perturbed convection–diffusion equation (John and Knobloch 2008):

$$\begin{aligned} -\varepsilon \Delta u + u_{x}&= f \quad \text {in} \, \quad \Omega =\left( 0,1 \right) ^{2}, \end{aligned}$$
(35)
$$\begin{aligned} u&=0 \quad \text {on} \, \quad \partial \Omega , \end{aligned}$$
(36)

where the source term, \(f=f(x,y)\), is given as follows:

$$\begin{aligned} f\left( x, y \right) = \left\{ \begin{array}{ll} 16\left( 1-2x\right) , &{} \text {if } (x,y) \in [0.25,0.75]^{2}, \\ 0, &{} \text {else}. \end{array} \right. \end{aligned}$$
(37)

The solution of Eqs. (35)–(36) exhibits two interior layers at \((0.25,0.75) \times \{0.25\}\) and \((0.25,0.75) \times \{0.75\}\).

Figure 16 shows the GFEM approximations to the solution of Example 5 for various values of the diffusion parameter. The method yields unacceptable approximations for values smaller than \(\varepsilon =10^{-2}\). It should also be noticed in Fig. 16d that, although a relatively finer mesh with 7, 056 elements is used, the GFEM approximation is highly oscillatory for \(\varepsilon =10^{-6}\). In Fig. 17, the SUPG and SUPG-YZ\(\beta \) solutions are presented. We also present the result of computations performed on the mesh constructed with \(4 \times 42 \times 42\) crossed elements in Fig. 18.

Figure 19 compares the solutions obtained with the SUPG and SUPG-YZ\(\beta \) formulations for \(\varepsilon =10^{-4}\) and \(\varepsilon =10^{-8}\) along the line \(y=0.1\). Although the SUPG formulation gives oscillation-free solutions, the SUPG-YZ\(\beta \) introduces unwanted layers for solving Example 5. It is reported by John and Knobloch (2008) that Example 5 is an example for which all the spurious oscillations at layers diminishing (SOLD) methods examined in John and Knobloch (2008) fail. Therefore, similar to the results obtained in John and Knobloch (2008), a qualitatively correct approximation to the solution of Example 5 is not possible by employing the SUPG-YZ\(\beta \) formulation. Although tuning the scaling parameter Y of the YZ\(\beta \) can reduce the effect of the shock-capturing term and produce better solution profiles, since the solutions obtained with the SUPG formulation do not contain any oscillation, we conclude that the use of any shock-capturing mechanism is not necessary. Because the SUPG-YZ\(\beta \) formulation is not required for this problem, we believe that displaying error comparison plots for the obtained approximations is unnecessary.

The scaling term Y of YZ\(\beta \) is set as Y \(=0.5\). The numbers of Newton–Raphson iterations are found to be 5 for both meshes with \(2 \times 42 \times 42\) and \(4 \times 42 \times 42\) elements.

Fig. 16
figure 16

GFEM approximations for solving Example 5: a \(\varepsilon =1.0\), b \(\varepsilon =10^{-2}\), c \(\varepsilon =10^{-4}\), and d \(\varepsilon =10^{-6}\); \(n_\text {el}=4\times 42 \times 42\)

Fig. 17
figure 17

Effect of shock-capturing for solving Example 5: a SUPG solution, b SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 2\times 42\times 42\)

Fig. 18
figure 18

Effect of shock-capturing for solving Example 5: a SUPG solution, b SUPG-YZ\(\beta \) solution; \(\varepsilon =10^{-8}\), \(n_\text {el}= 4\times 42\times 42\)

Fig. 19
figure 19

Comparison of SUPG and SUPG-YZ\(\beta \) results along \(x=0.85\) for solving Example 5: a \(\varepsilon =10^{-4}\), b \(\varepsilon =10^{-8}\); \(n_\text {el} = 2\times 42\times 42\)

4 Conclusions

For solving convection-dominated problems, i.e., the problems where the diffusion term is perturbed by positive small parameters, it is a well-known fact that classical methods are insufficient in obtaining oscillation-free solutions. Therefore, this study has aimed to compare the GFEM and SUPG formulations for solving such kinds of problems. In addition to stabilization terms, the SUPG formulation has also been supplemented with the YZ\(\beta \) shock-capturing technique, thereby improving the stability near regions where the solution has steep gradients.

The proposed formulation and techniques have been evaluated on five challenging test problems. Apart from Example 5 given by Eqs. (35)–(36), it has been observed that quite good solution profiles were achieved by employing the SUPG-YZ\(\beta \) formulation. Besides, the errors in approximations obtained have been compared both locally and globally, revealing that the shock-capturing mechanism yields better results near steep gradients. Therefore, the SUPG-YZ\(\beta \) formulation exhibits superior performance compared to the SUPG in convection dominance in terms of maximum (\(L^{\infty }\)-norm) errors. It can also be stated that errors in the SUPG and SUPG-YZ\(\beta \) approximations typically show similar trends in the \(L^{2}\) and \(L^{\varepsilon }\) norms.

The methods and techniques used for solving stationary reaction–convection–diffusion equations in this study can be extended to solve time-dependent problems and 3-dimensional computations. Problems with discontinuous data can also be considered. In another aspect, Shishkin/Shishkin–Bakhvalov-type layer-adapted meshes can be used, and the results can be compared.