An adaptive finite element method for evolutionary convection dominated problems

12
An adaptive finite element method for evolutionary convection dominated problems Javier de Frutos a,1 , Bosco García-Archilla b,2 , Julia Novo c,,3 a Departamento de Matemática Aplicada, IMUVA, Universidad de Valladolid, Spain b Departamento de Matemática Aplicada II, Universidad de Sevilla, Sevilla, Spain c Departamento de Matemáticas, Universidad Autónoma de Madrid, Spain article info Article history: Received 25 May 2011 Received in revised form 28 July 2011 Accepted 9 August 2011 Available online 26 August 2011 Keywords: Convection dominated problems Finite element methods SUPG method Adaptivity abstract We present an adaptive finite element method for evolutionary convection–diffusion problems. The algo- rithm is based on an a posteriori indicator of the size of the oscillations displayed by the finite element approximation. The procedure is able to refine or coarsen dynamically the mesh adjusting it automati- cally to evolving layers. The method produces nearly non-oscillatory approximations in the convection dominated regime. We check the performance of the adaptive method with some numerical experiments. Ó 2011 Elsevier B.V. All rights reserved. 1. Introduction In this paper we study the numerical approximation of evolu- tionary convection–diffusion equations in the convection domi- nated regime. It is well known that standard finite element methods over uniform meshes perform poorly and exhibit non- physical oscillations. As stated in [25] there is a, perhaps general, consensus that adaptive methods will provide the most satisfac- tory approach to solving convection–diffusion problems. However, even for steady state problems, the behaviour of adaptive proce- dures applied to convection-dominated problems is still poorly understood, see [12] (see also [3,26,17–19,4]). Some other works consider nonstationary convection–diffusion models. Residual based a posteriori error estimates for nonstation- ary convection–diffusion equations are introduced in [27]. The author considers discretizations with the h-scheme in time and con- forming finite elements in space on locally refined, isotropic meshes. The estimates are uniformly bounded with respect to the viscosity. In [9], a finite element method in space and time with streamline diffusion is used to generate an adaptive method applied to a nonstationary nonlinear one dimensional model. A class of implicit vertex-centered finite volume methods to approximate the solution of weakly coupled convection-dominated parabolic systems is shown in [20]. In this reference an a posteriori error estimator in the L 1 norm is introduced and an adaptive algorithm based on the estimator is proposed. In [21], a space and time adaptive algorithm is developed for the discretization of a time dependent convec- tion–diffusion problem. The Crank–Nicolson scheme in time is cou- pled with continuous linear stabilized finite elements in space. An a posteriori upper bound is derived which is not robust with respect to the diffusion parameter. An adapted Lagrange–Galerkin method for singularly perturbed unsteady linear convection–diffusion prob- lems is introduced in [10]. The Lagrange–Galerkin method is based on combining the method of characteristics with the standard Galer- kin finite element method. A computable a posteriori error bound is derived in order to ensure the analytical solution is reliably approx- imated by the Lagrange–Galerkin approximation in the space–time L 2 norm. Numerical experiments show that as the diffusion param- eter tends to zero the mesh adaptation strategy concentrates the mesh within layers that are orthogonal to the flow direction, while the mesh remains coarser within layers that are aligned with the flow. An heuristic approach to generate an adaptive mesh in a La- grange–Galerkin method can be found in [1]. The method combines a semi-Lagrangian scheme with a second order implicit-explicit Runge–Kutta Chebyshev method to calculate the numerical solution of convection-dominated reaction–diffusion problems. Most of the above mentioned works for the nonstationary models are based on space–time formulations. In the present paper we fol- low the approach of separating spatial and temporal discretizations using the method of lines. In [5] we present a procedure that 0045-7825/$ - see front matter Ó 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.cma.2011.08.010 Corresponding author. Tel.: +34 914974074; fax: +34 914974889. E-mail addresses: [email protected] (J. de Frutos), [email protected] (B. García-Archilla), [email protected] (J. Novo). 1 Research supported by Spanish MICINN under Grant MTM2010-14919 and by JCyL under Grant VA001A10-1. 2 Research supported by Spanish MICINN under Grant MTM2009-07849. 3 Research supported by Spanish MICINN under Grant MTM2010-14919. Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 Contents lists available at SciVerse ScienceDirect Comput. Methods Appl. Mech. Engrg. journal homepage: www.elsevier.com/locate/cma

Transcript of An adaptive finite element method for evolutionary convection dominated problems

Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

Contents lists available at SciVerse ScienceDirect

Comput. Methods Appl. Mech. Engrg.

journal homepage: www.elsevier .com/locate /cma

An adaptive finite element method for evolutionary convectiondominated problems

Javier de Frutos a,1, Bosco García-Archilla b,2, Julia Novo c,⇑,3

a Departamento de Matemática Aplicada, IMUVA, Universidad de Valladolid, Spainb Departamento de Matemática Aplicada II, Universidad de Sevilla, Sevilla, Spainc Departamento de Matemáticas, Universidad Autónoma de Madrid, Spain

a r t i c l e i n f o

Article history:Received 25 May 2011Received in revised form 28 July 2011Accepted 9 August 2011Available online 26 August 2011

Keywords:Convection dominated problemsFinite element methodsSUPG methodAdaptivity

0045-7825/$ - see front matter � 2011 Elsevier B.V. Adoi:10.1016/j.cma.2011.08.010

⇑ Corresponding author. Tel.: +34 914974074; fax:E-mail addresses: [email protected] (J. de F

(B. García-Archilla), [email protected] (J. Novo).1 Research supported by Spanish MICINN under Gr

JCyL under Grant VA001A10-1.2 Research supported by Spanish MICINN under Gra3 Research supported by Spanish MICINN under Gra

a b s t r a c t

We present an adaptive finite element method for evolutionary convection–diffusion problems. The algo-rithm is based on an a posteriori indicator of the size of the oscillations displayed by the finite elementapproximation. The procedure is able to refine or coarsen dynamically the mesh adjusting it automati-cally to evolving layers. The method produces nearly non-oscillatory approximations in the convectiondominated regime. We check the performance of the adaptive method with some numerical experiments.

� 2011 Elsevier B.V. All rights reserved.

1. Introduction vertex-centered finite volume methods to approximate the solution

In this paper we study the numerical approximation of evolu-tionary convection–diffusion equations in the convection domi-nated regime. It is well known that standard finite elementmethods over uniform meshes perform poorly and exhibit non-physical oscillations. As stated in [25] there is a, perhaps general,consensus that adaptive methods will provide the most satisfac-tory approach to solving convection–diffusion problems. However,even for steady state problems, the behaviour of adaptive proce-dures applied to convection-dominated problems is still poorlyunderstood, see [12] (see also [3,26,17–19,4]).

Some other works consider nonstationary convection–diffusionmodels. Residual based a posteriori error estimates for nonstation-ary convection–diffusion equations are introduced in [27]. Theauthor considers discretizations with the h-scheme in time and con-forming finite elements in space on locally refined, isotropic meshes.The estimates are uniformly bounded with respect to the viscosity.In [9], a finite element method in space and time with streamlinediffusion is used to generate an adaptive method applied to anonstationary nonlinear one dimensional model. A class of implicit

ll rights reserved.

+34 914974889.rutos), [email protected]

ant MTM2010-14919 and by

nt MTM2009-07849.nt MTM2010-14919.

of weakly coupled convection-dominated parabolic systems isshown in [20]. In this reference an a posteriori error estimator inthe L1 norm is introduced and an adaptive algorithm based on theestimator is proposed. In [21], a space and time adaptive algorithmis developed for the discretization of a time dependent convec-tion–diffusion problem. The Crank–Nicolson scheme in time is cou-pled with continuous linear stabilized finite elements in space. An aposteriori upper bound is derived which is not robust with respect tothe diffusion parameter. An adapted Lagrange–Galerkin method forsingularly perturbed unsteady linear convection–diffusion prob-lems is introduced in [10]. The Lagrange–Galerkin method is basedon combining the method of characteristics with the standard Galer-kin finite element method. A computable a posteriori error bound isderived in order to ensure the analytical solution is reliably approx-imated by the Lagrange–Galerkin approximation in the space–timeL2 norm. Numerical experiments show that as the diffusion param-eter tends to zero the mesh adaptation strategy concentrates themesh within layers that are orthogonal to the flow direction, whilethe mesh remains coarser within layers that are aligned with theflow. An heuristic approach to generate an adaptive mesh in a La-grange–Galerkin method can be found in [1]. The method combinesa semi-Lagrangian scheme with a second order implicit-explicitRunge–Kutta Chebyshev method to calculate the numerical solutionof convection-dominated reaction–diffusion problems.

Most of the above mentioned works for the nonstationary modelsare based on space–time formulations. In the present paper we fol-low the approach of separating spatial and temporal discretizationsusing the method of lines. In [5] we present a procedure that

3602 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

considerably reduces the spurious oscillations of the standard finiteelement spatial semidiscretization of the problem

ut � �Duþ b � ruþ cu ¼ f ; in X;

u ¼ 0; in @X;

uð0; xÞ ¼ u0ðxÞ; in X;

ð1Þ

in the convection dominated regime. Here, X is a bounded opendomain with polygonal or polyhedral boundary in Rn; n ¼ 1;2;3; band c are given functions, �P 0 is a constant diffusion coefficientand u0 a given initial data. The method we study in [5] is as follows.Let us denote by uh(t), t 2 (0,T], the semidiscrete Galerkin finiteelement approximation to (1). Assume that output is wanted at atime t⁄ 2 (0,T]. Then, we postprocess uh(t⁄) to get a new approxima-tion ~uhðt�Þ by solving numerically the steady problem of findingv 2 H1

0ðXÞ such that L(v) = f(t⁄) � uh,t(t⁄), where L(v) = ��Dv +b � rv + cv. This steady problem is solved using the stabilized stream-line-upwind Petrov Galerkin (SUPG) method [2,11]. In [5] we showthat the new approximation ~uhðt�Þ is essentially free of oscillations.Of course, in practice, both the Galerkin uh(t⁄) and postprocessedapproximation ~uhðt�Þ cannot be computed exactly and, instead,approximations, obtained with some time stepping procedure,Un

h � uhðtnÞ and eUnh � ~uðtnÞ, on given time levels t0 < t1 < � � � < tN = T

are computed. In [5] we use the almost non-oscillatory character ofthe postprocessed approximation to propose an adaptive algorithmin the one dimensional case. The main idea is to use the difference be-tween the postprocessed (nearly oscillation-free) approximation eUn

h

and the polluted Galerkin approximation Unh as an a posteriori

(elementwise) indicator of the oscillations presented in the Galerkinapproximation. This is done at any time level tn, so that the grid isadapted as time evolves. In the present paper we extend this ideato design an adaptive algorithm in the more interesting and compli-cated two dimensional case. We check the good behaviour of thealgorithm with several examples where the method is able to dynam-ically adapt the mesh, refining it locally around emerging layers, andcoarsening it after a moving front has passed.

The outline of the paper is as follows. In Section 2 we introducesome theoretical results that are needed to understand the adap-tive algorithm that is presented in Section 3. A comprehensiveset of numerical experiments are shown in Section 4. Finally, weinclude an Appendix A which is devoted to summarize the proce-dure to refine and coarsen the mesh.

2. Some theoretical background

In the sequel we will consider the following convection–diffu-sion problem

ut � �Duþ b � ruþ cu ¼ f ; in X;

u ¼ g1; in @XD;@u@n¼ g2; in @XN ;

uð0; xÞ ¼ u0ðxÞ; in X;

ð2Þ

where b and c are sufficiently smooth functions of x. We assumethat @�X � oXD, @�X being the inflow boundary of X � Rd, i.e.,the set of points x 2 oX such that b(x) � n(x) < 0. Let us assume thatX is a convex polygonal or polyhedral domain. We denote by Vh afinite element space based on continuous linear local polynomials.Here h is the maximum element diameter in the underlying trian-gulation T h. We assume vh = 0 in oXD for all vh 2 Vh. Also, for sim-plicity in the present section, we assume that g1 = 0 and g2 = 0.

We denote by uh : (0,T] ? Vh the spatial semidiscrete Galerkinapproximation to (2) satisfying uhð0; �Þ ¼ u0

h 2 Vh and

ðuh;t ;uhÞ þ �ðruh;ruhÞ þ ðb � ruh;uhÞ þ ðcuh;uhÞ ¼ ðf ;uhÞ8uh 2 Vh; ð3Þ

where, here and in the rest of the paper, (�, �) denotes the usualL2(X)-inner product. We will denote by aS(�, �) the bilinear formassociated to the SUPG method, defined by:

aSðvh;whÞ ¼ �ðrvh;rwhÞ þ ðb � rvh;whÞ þ ðcvh;whÞþ ð��Dvh þ b � rvh þ cvh; b � rwhÞh 8vh;wh 2 Vh;

ð4Þ

where (�, �)h is the broken inner product

ðf ; gÞh ¼XK2T h

dKðf ; gÞK ; ð5Þ

dK being the stabilization parameter and (�, �)K the standard innerproduct in L2(K). The stabilization parameter dK is defined asdK = c0hK/maxx2Kjb(x)j if PeK = hKmaxx2Kjb(x)j/(2�) > 1, ordK ¼ c1h2

K=�, if PeK 6 1, for some positive constants c0 and c1.Let us fix any positive time t⁄, we define the spatial semidiscrete

postprocessed approximation ~uhðt�Þ 2 Vh as the solution of the fol-lowing stationary convection–diffusion problem

aS ~uhðt�Þ;uhð Þ ¼ f ðt�Þ � uh;tðt�Þ;uh

� �þ f ðt�Þ � uh;tðt�Þ; b � ruh

� �h

8uh 2 Vh: ð6Þ

We observe that ~uhðt�Þ is the SUPG approximation to the steadyproblem (t⁄ is fixed in (6)) L(v) = f(t⁄) � uh,t(t⁄), where L(v) = ��Dv +b � rv + cv. Following [5, Theorem 1] the rate of convergence of thesemidiscrete postprocessed approximation is the following

�krðu� ~uhÞk20 þ

XK2T h

dkkb � rðu� ~uhÞk20;K þ kl1=2ðu� ~uhÞk2

0

!1=2

6 Ch kuk2 þ kutk2 þ kuttk1ð Þ þ C �1=2 þ h1=2� �

hkuk2; ð7Þ

where C > 0 is a generic constant independent of �. We have de-noted by k�ks the norm in the Sobolev space Hs(X) withH0(X) = L2(X). From (7) we observe that the rate of convergencein the weighted L2 norm is O(h) while the rate of convergence inthe streamline derivative is O(h1/2). Comparing with the rate of con-vergence of the SUPG method, see [14], we have a difference of halfan order, the SUPG method being more accurate. Let us observe thatin (7) the Sobolev norm kuk2 still, in general, depends on �, so thatthese comments on the rate of convergence of the methods are tosome extend heuristic arguments. In any case, the most interestingproperty of the postprocessed approximation is that is able to anni-hilate most of the spurious oscillations of the Galerkin approxima-tion, see the numerical experiments in [5]. This is the property ofthe postprocessed approximation of which we take advantage inthe present paper to design an adaptive algorithm.

In order to gain some intuition about this, somewhat surprising,stabilization property of the SUPG-based postprocessed method,let us consider the simple one-dimensional problem

ut � �uxx þ ux ¼ f ; 0 < x < 1; t > 0 ð8Þ

with homogeneous Dirichlet boundary conditions and a given ini-tial condition u(0,x) = u0(x). Let uh and ~uh be, respectively, the Galer-kin linear finite element and postprocessed approximations, see (3)and (6), computed in a uniform mesh of size h, x0 = 0 < x1 < � � � <xN = 1. For a given fixed time t⁄, we consider the auxiliary functionwh defined as the SUPG approximation in the same finite elementspace and mesh to the stationary problem

��uxx þ ux ¼ g

with g(t⁄,x) = f(t⁄,x) � ut(t⁄,x), 0 < x < 1. That is, wh is defined by thesystem of equations

aSðwh;ujÞ ¼ ðg;ujÞ þ ðg;uj;xÞh; j ¼ 1; . . . ;N � 1;

J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 3603

where uj denotes the standard nodal basis function associated withnode xj, j = 1, . . . ,N � 1. We define ~rh ¼ ~uh �wh. An easy computa-tion shows that, if the stabilization parameter is chosen as d = h/2,the error equation for ~rh can be written, for j = 1, . . . ,N � 1, as~rj � ~rj�1

h¼ 1

hðut � uh;t ;ujÞ þ

12ðut � uh;t;uj;xÞ �

�hð~rh;x;uj;xÞ;

where ~rj ¼ ~rhðxjÞ. In the limit case � = 0, the formula above givesdirectly

j~rj � ~rj�1j 6 2hkut � uh;tk1;j; ð9Þ

where k�k1,j denotes the maximum norm in the interval [xj�1,xj+1].Note that, as the function wh is much less oscillatory, the left handside of (9) essentially measures the oscillation in the postprocessedapproximation. Thus, this last equation tell us that the postpro-cessed approximation can reduce the oscillation in the Galerkin fi-nite element solution by a factor of size h. If � > 0, (9) no longerholds, but one can show instead

max16j6N�1

j~rj � ~rj�1j 6 2h max16j6N�1

kut � uh;tk1;j þ C�hkut � uh;tk0:

Thus, the conclusions in this case are the same as in the case where� = 0. We refer to [5] for a more detailed analysis. Numerical experi-ence [5,6], confirms that the postprocessed approximation reduceseffectively the oscillations presented in a poorly resolved Galerkinapproximation.

We now consider the fully discrete case in which approxima-tions Un

h � uhðtnÞ on time levels 0 = t0 < t1 < � � � < tM = T are com-puted by means of a convergent time integrator. The particularchoice of the time integrator is of no consequence at this moment.The fully discrete postprocessed approximation eUn

h 2 Vh is ob-tained as the solution of the following problem:

aSeUn

h;uh

� �¼ ðf � d�t Un

h;uhÞ þ ðf � d�t Unh; b � ruhÞh 8uh 2 Vh;

ð10Þ

where

d�t Unh ¼ ��AhUn

h � Ph b � rUnh þ cUn

h

� �þ Phf ðtnÞ; ð11Þ

Ph being the L2-orthogonal projection onto the finite element spaceand Ah denoting the discrete Laplacian operator defined by

ðAhvh;whÞ ¼ ðrvh;rwhÞ 8vh; wh 2 Vh:

Note that d�t Unh is actually the right hand side of the system of ordin-

ary differential equations defined by the semidiscrete Eq. (3), sothat it is, usually, computed jointly with Un

h in most timeintegrators.

The error at a time level tn can be decomposed as follows

uðtnÞ � eUnh ¼ ðuðtnÞ � ~uhðtnÞÞ þ ~en:

The first term on the right hand side above is the spatial error of thepostprocessed approximation that has been bounded in (7), whilethe second term ~en ¼ ~uhðtnÞ � eUn

h is the temporal error, for whichwe obtain in [5] an a priori bound that we now explain. Considerany convergent time stepping procedure satisfying

limk!0

max06n6N

kenk0 ¼ 0; limk!0

max06n6N

kenk1 ¼ 0;

where k = max{kn�1 = tn � tn�1j1 6 n 6 N}, where en ¼ uhðtnÞ � Unh is

the temporal error of the Galerkin approximation. We prove in [5,Theorem 2], that, for a constant independent of �, the followingbound holds

�kr~enk20 þ

XK2T h

dkkb � r~enk20;K þ kl1=2~enk2

0

!1=2

6 C �h�1kenk1 þ kbk1kenk1 þ kck1kenk0

� �: ð12Þ

Thus, we deduce that the temporal error of the fully discrete post-processed approximation can be bounded in terms of the temporalerror of the Galerkin approximation. In the numerical experimentswe take a sufficiently small tolerance in the time integrator in orderto keep the temporal error of the Galerkin approximation smallerthan the spatial error, so that this is dominant in both the Galerkinand the postprocessed approximations, and, hence, their differenceis an indicator of the spatial error in the Galerkin approximation.

3. The adaptive algorithm

With the theoretical background summarized in last section wedevelop now the adaptive algorithm that we will use in the numer-ical experiments section of this paper. The main idea in the algo-rithm is to use, at each element in the mesh, the differenceeUn

h � Unh between the postprocessed nearly oscillation-free approx-

imation at time tn; eUnh, and the polluted Galerkin approximation,

Unh, as a local a posteriori indicator of the oscillations presented in

the Galerkin approximation. Using this indicator at each time step,one can expect to detect the oscillations in the Galerkin approxima-tion and, consequently, locally refine the mesh before these oscilla-tions become excessively large and globally pollute theapproximation. A simplified version for one dimensional problemsof the algorithm that we present here was first introduced in [5].

Let us choose two positive numbers TOL1 > TOL2. Assume that ata time level tn, n = 0, . . . ,M � 1, we have already computed anapproximation Un

h defined in some finite element mesh T nh. This

grid is the last one of a sequence of meshes, T 0h; T

1h; . . . ; T n

h, whereeach one is obtained from the previous one by subdividing or elim-inating some elements. The algorithm reads as follows:

1. Perform one time step to compute the Galerkin approximationUnþ1

h at time tn+1 in the mesh T nh.

2. Compute the postprocessed approximation eUnþ1h in the same

mesh T nh.

3. Compute the indicator

gnþ1K ¼ 1

measureðKÞðd�1Þ=d

ZKjreUnþ1

h �rUnþ1h jdxdy: ð13Þ

4. If gnþ1K > TOL1 the element K is marked to be refined. If

gnþ1K < TOL2; K is marked as a candidate to be coarsened.

5. Perform the refining/coarsening procedure (see next section) togenerate the new mesh T nþ1

h .6. Interpolate Unþ1

h on the new mesh T nþ1h and return to the first

step of the algorithm until the final time is reached.

The aim of the algorithm is to reduce as much as possible thespurious oscillations of the Galerkin approximation. In the onedimensional case, see [5, Section 4], denoting nnþ1

h ¼ eUnþ1h � Unþ1

h ,then, for every element Ij = [xj�1,xj] in the partition, we took thequantity nnþ1

h ðxjÞ � nnþ1h ðxj�1Þ

�� �� as a measure of the Galerkin oscilla-tion in the interval Ij. For the two-dimensional algorithm (d = 2) theerror indicator (13) can be considered as an extension of the sameidea.

Let us observe that the approximation we compute is the Galer-kin approximation defined in an automatically adapted mesh. Thetemporal error of the approximation is then the temporal error ofthe Galerkin approximation that evolves in time. Then, if we use atime integrator with variable time step, a standard technique canbe applied for changing the step length. Let us also observe thatthe temporal error of the postprocessed approximation is of thesame order as the temporal error of the Galerkin approximation,see (12). Then, choosing a step length changing procedure thatkeeps the temporal error slightly smaller than the spatial error, itis not expected that temporal errors will pollute the quantity gn

K

Fig. 1. Adaptive algorithm for � = 10�6 interpolating the Galerkin approximation(top) and the postprocessed approximation (bottom).

3604 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

that is taken as a measure of the spatial error. We finally remarkthat in most convection-dominated convection–diffusion prob-lems, the most significant part of the total error comes from thespatial error, and that in the procedure we propose it is controlledby means of the automatically adapted mesh that our techniquegenerates.

One could wonder if it would be better to interpolate the post-processed approximation at every time step instead of interpolat-ing the Galerkin approximation as we have proposed in theadaptive algorithm. Trying to answer this question we present avery simple example in the one dimensional case. We considerthe equation

ut � �uxx þ ux ¼ f ; 0 < x < 1; t > 0;uð0; tÞ ¼ uð1; tÞ ¼ 0; uðx;0Þ ¼ u0

ð14Þ

with f = 1, u0 = 0 and � = 1e � 6. On the top of Fig. 1 we have plottedthe result of the adaptive algorithm at time T = 0.6 interpolating theGalerkin approximation. The algorithm ends with only 45 nodesand produces a very good approximation where the boundary layeris perfectly solved, see also [5, Fig. 4.5]. On the bottom of Fig. 1, wehave plotted the approximation obtained interpolating the postpro-cessed approximation at every time step. The algorithm ends with40 nodes. However, as we can observe in the figure, the approxima-tion is too dissipative. For this reason, in all the numerical experi-ments of next section we interpolate the Galerkin approximationas is stated in the algorithm.

4. Numerical experiments

In this section, we consider the model problem (2) in the do-main X = [0,1] � [0,1] with c = 0. We present three different exam-ples which try to asses different properties of the adaptiveprocedure. In the first example the solution possesses two charac-teristic and one exponential layers. The last two examples dealwith dynamic properties of the adaptive procedure. We examinea well-known three body rotating problem in the second example.In the third example, we present the results in a problem with aninternal layer that moves through the domain X driven by the con-vective field.

For the spatial discretization we use linear finite elements. Tosolve the corresponding linear systems, we stored the matrices ina sparse form and used a direct method, more precisely, thatimplemented in the backslash command of MATLAB. We did notfind any significant difficulty with this procedure.

For the time integration we have used the trapezoidal ruleimplemented as described in [8]. This time integrator is a variablestepsize implementation of the trapezoidal rule that uses the expli-cit two-step Adams formula for error estimation and employs a sta-bilization strategy to suppress the (�1)n mode (see [8] for details).The implementation in [8] is carefully designed to avoid subtractivecancellation. As argued in [8], the implementation is well suited fortime dependent convection–diffusion problems as those we dealwith in the present paper. The algorithm requires several parame-ters, whose values were set in our computations exactly the sameas used in the numerical experiments in [8] (including initial step-size Dt0 = 10�10). The only change we made to the algorithm in [8]was that the stepsize updates suggested in [8, Eq. (1.15)] and thoseafter a rejection were further multiplied by 0.85. This provision re-duced the proportion of rejections. We tried different values for thetolerance of the time integrator. The value of the tolerance in all theexperiments shown here is TOLT = 10�5. With this value of the tol-erance the temporal errors arising from the time discretization aresmaller than the spatial errors. We also integrated in time with thebackward Euler method with fixed time step obtaining essentiallythe same results for a small enough time step.

In the experiments we performed and whose summary is pre-sented below, we tried different combinations of values TOL1 andTOL2, which are the tolerances used to refine or coarsen the mesh,see (3). However, in all the experiments reported below these val-ues are TOL1 = 10�2 and TOL2 = TOL1/20. We found that this choiceresults in a reasonable number of elements to refine or coarseneach time step. In all the examples, the initial triangulation is ob-tained by performing four consecutive (green) refinements on auniform triangulation of a 25 � 25 regular grid.

Example 1 (Example with an exponential boundary layer and twocharacteristics boundary layers). Next example is a problem withone exponential and two characteristics boundary layers. Weconsider problem (2) with b = (1,0)T, u0 = 0, f = 1, � = 10�4 andhomogeneous Dirichlet boundary conditions. The side of X definedby x = 1 is the outflow boundary and an exponential boundarylayer appears there. The tangential flow boundaries y = 0 and y = 1have characteristic or parabolic boundary layers.

The steady state of this example have been considered in manyreferences, we can cite for example [25, Example 6.1, 12, Example6.5, 13, Example 1]. In [12] the sharpness of the parabolic boundarylayers is used as a criterion for the quality of the computedsolutions. It is shown there that insufficient refinement within theparabolic layers leads to a non-accurate approximation. It is alsowell known that, in the steady case, the SUPG method overuniform meshes does not perform well enough for this experiment,see [16].

In Fig. 2 we have represented on the left of the picture thecomputed Galerkin approximation at time t = 0.6. On the right ofFig. 2 we have depicted the corresponding mesh. In Fig. 3 we showthe approximation and the mesh at time t = 1.2.

We can see that the mesh is automatically refined not onlyaround the exponential layer but also around the two paraboliclayers. In the experiment it can be observed that the different kindof layers is reflected on the mesh. In the regular or exponentiallayers the first-order derivatives of the solution in the directionperpendicular to the layer have magnitude O(1/�) and the width ofthe layer is O(� log(1/�)). The parabolic or characteristic layers havea more complicated structure than exponential layers. Althoughthe first order derivatives in the direction perpendicular to theboundary are O 1=

ffiffiffi�p� �

, not as large as for exponential layers, thewidth of the layer is O

ffiffiffi�p

logð1=�Þ� �

, wider than exponential layers,see [25]. On the right of Fig. 3 it can be seen a much more refinedmesh around the exponential layer x = 1, together with a wideramplitude of the parabolic layers at y = 0 and y = 1.

Fig. 2. Example 1. On the left, Galerkin approximation at time t = 0.6, on the right the computational mesh.

Fig. 3. Example 1. On the left, Galerkin approximation at time t = 1.2, on the right the computational mesh.

Fig. 4. Example 1. Zoom of right of Fig. 3.

J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 3605

The two different ways in which the mesh is refined around theexponential and the characteristic layers can be clearly seen inFig. 4, where we show a zoom of the mesh represented in Fig. 3. Inthis figure we can see in more detail the higher concentration ofelements near the exponential layer than in the neighbourhood ofthe parabolic layer, as well as the larger width of this one. Ofcourse, the same behaviour can be observed close to y = 1, althoughthis part of the domain is not shown in Fig. 4.

In order to study in detail the size of the spurious oscillations ofthe adaptive approximation we have plotted in Fig. 5 the section ofthe Galerkin approximation along the plane x = 0.5. We notice thatthere are still small oscillations around the parabolic layers y = 0, onthe left of the figure, and y = 1, on the right of the figure. On the otherhand, if we look at the section along the plane y = 0.5 in Fig. 6, weobserve that the oscillations around the exponential layer have beencompletely removed with the adaptive algorithm in this example.

We have compared the performance of the algorithm wepropose in this paper with a more common approach that usesonly the Galerkin method but where the grid refinement/coarsen-ing strategy is controlled by the gradient indicator. Then, instead of(13) we take gnþ1

K ¼ krUnþ1h kL2ðKÞ.

Fig. 5. Example 1. Zoom of section at x = 0.5 of Galerkin approximation at time t = 1.2. On the left the parabolic layer y = 0, on the right the parabolic layer y = 1.

Fig. 6. Example 1. Section at y = 0.5 of the Galerkin approximation at time t = 1.2.

3606 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

We tried different values for the tolerances TOL1 and TOL2. Thebest results were for TOL1 = 0.1 and TOL2 = TOL1/20 which are theones reported here. For the time integration we used the

Fig. 7. Example 1. On the left, Galerkin approximation at time t = 0.4 u

trapezoidal rule with the same tolerance TOLT = 10�5 as in therest of the experiments. The total computing time for thisexperiment up to the final time t = 1.2 was 3.56 times bigger forthe gradient procedure than for the algorithm we propose. Also,the number of elements in the final mesh at time t = 1.2 was for thegradient procedure almost double than the number of elements forour algorithm. In Figs. 7 and 8 we can observe the Galerkinapproximations on the left, and the corresponding meshes on theright, at times t = 0.4 and t = 0.6, respectively. As we can see, theapproximations have non-negligible oscillations that could not beeliminated with the gradient indicator.

Example 2 (Rotating three body problem). We consider a configu-ration of three geometrical bodies that rotate clockwise. This prob-lem was studied in the hyperbolic limit, � = 1e � 20, in [15] (seealso [14]).

In this example, the rotation is driven by b = (y � 0.5,0.5 � x)T.The forcing term is f = 0. We consider homogeneous Dirichletboundary conditions. We report here the results obtained with theadaptive algorithm for the value � = 1e � 6. The initial condition,consisting of three disjoint bodies, is represented on the left ofFig. 9. The initial condition is zero outside the three bodies.

sing the gradient estimator, on the right the computational mesh.

Fig. 8. Example 1. On the left, Galerkin approximation at time t = 0.6 using the gradient estimator, on the right the computational mesh.

Fig. 9. Example 2. Initial condition and approximation after one rotation for � = 1e � 6.

Fig. 10. Example 2. Difference between the initial condition and the Galerkinapproximation after one rotation.

J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 3607

More precisely, for a given (x0,y0), let

rðx; yÞ ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiðx� x0Þ2 þ ðy� y0Þ

2q

=r0 with r0 ¼ 0:15. The center of

the slotted cylinder is (x0,y0) = (0.5,0.75) and its shape is definedby

uð0; x; yÞ ¼1 if rðx; yÞ 6 1; jx� x0jP 0:0225 or y P 0:85;0 otherwise:

�The hump at the left hand side is defined by (x0,y0) = (0.25,0.5) and

uð0; x; yÞ ¼ 14

1þ cosðpminfrðx; yÞ;1gÞð Þ:

The conical body on the lower part is given by (x0,y0) = (0.5,0.25)and

uð0; x; yÞ ¼ 1� rðx; yÞ:

The Galerkin approximation obtained after a complete revolution,that is at time t = 2p, is shown on the right of Fig. 9. Comparing withthe plot of the initial condition on the left of the Fig. 9 we can seethat except for the slight smearing due to the effect of diffusionand some very small oscillations the computed approximation coin-cides with the initial condition. In Fig. 10 we have plotted the differ-ence between the initial condition and the Galerkin approximation.

3608 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

We can observe that the bigger errors correspond to the cylinder. Asin [15], we define the variation of the Galerkin approximation attime 2p as max (uh) �min(uh) = 1.0066 � (�0.0093) = 1.0159. Thisquantity can be taken as a measure of the small oscillations stillremaining in the approximation.

Fig. 11 is devoted to study how the meshes change with time. InFig. 11 we have represented the meshes obtained at times p/2, p,3p/2 and 2p. In the picture we can see that the mesh is refinedalong the path of the three bodies following its movement aroundthe center of the square. The procedure we propose in this paper isable to follow the evolution of the bodies updating the mesh eachtime step. This interesting property is also observed in the next andlast numerical example.

Example 3 (Example with moving internal layers). We considerproblem (2) with b = (y,�x)T, u0 = 0, f = 0 and � = 10�5. We imposeDirichlet boundary conditions defined by u = 0 at the boundariesx = 1, y = 0 and y = 1 and u = 1 at x = 0. In this example, a front isgenerated at the side x = 0 and, as time evolves, it moves throughthe domain rotating around the origin of coordinates. In thisprocess, it creates a curved interior layer. Also, when the frontarrives to the boundary y = 0 an exponential boundary layer isgenerated there. In the steady state the curved internal layercoexists with the exponential boundary layer at y = 0.

Fig. 11. Example 2. Computational me

In Fig. 12 we can observed the Galerkin approximations at fivedifferent values of time t = 0.20, 0.60, 1.00, 1.40 and 1.80. Thecorresponding meshes are depicted if Fig. 13. As we can see, theadaptive procedure is able to follow closely the evolution of thefront refining only where and when it is necessary. Importantly,the coarsening algorithm reduces the number of degrees offreedom located in smooth regions once the front has moved.Overall, the algorithm controls the number of degrees of freedomneeded to resolve the solution whereas it still produces a practi-cally non-oscillating numerical approximation.

We remark that in this kind of problems, an adaptiveprocedure that dynamically adjusts the location of the smallestand largest triangles as well as their density, is of most interest.Notice that in many realistic situations the location of layers isunknown as it is sometimes even their existence. Furthermore, ifthe problem is time-dependent, there may be dynamic phenom-ena like moving fronts similar to that in the present example.Computations in such situations may be greatly helped by adynamic refining and coarsening procedure that generatesmeshes of markedly different sizes in different parts of thedomain that change with time.

It is clear that different choices of the parameters TOL1 and TOL2

as well as other refining/coarsening strategies could lead to adifferent density of elements near the layers. However, we remark

shes at times p/2, p, 3p/2 and 2p.

Fig. 12. Example 3. A sequence of computed Galerkin approximations at times t = 0.20, 0.60, 1.00, 1.40 and 1.80 for � = 1e � 5 using the trapezoidal rule.

J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 3609

that the error indicator defined in (13) is able to localize theboundary layers and the adaptive procedure we propose is able toreturn a nearly oscillation-free approximation. A comparison amongdifferent possibilities will be the subject of future research and willappear elsewhere.

Appendix A. Refining and coarsening strategies

This section is devoted to describe, in some detail, the meshrefinement and coarsening strategies that we have used in thenumerical experiments reported in the previous section.

Fig. 13. Example 3. Computational meshes at times t = 0.20, 0.60, 1.00, 1.40 and 1.80 using the trapezoidal rule.

3610 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

A.1. Refinement process

We use the technique known as red–green refinement with lon-gest edge bisection [22,23,28]. In this technique, the basic trianglesubdivision, known as green refinement, is done by joining themidpoint of the longest edge to the opposite vertex, as indicated

in Fig. 14. The new node created by this process, the midpoint ofthe bisected side, is known as a hanging node in the neighbouringtriangle. In order to obtain a compatible triangulation, triangleswith hanging nodes must be themselves subdivided. This is doneby green refinement if the hanging node is on the longest side. Ifnot, the following rules are followed.

Fig. 14. Green refinement.

J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612 3611

� The triangle is subdivided by joining the hanging node to themidpoint of the longest side, and this one to the opposite vertex.This is known as blue refinement and is illustrated in Fig. 15(left).� If the triangle has two hanging nodes and one of them is on the

longest side, blue refinement is applied.� Otherwise, the triangle is divided into four equivalent ones by

joining the mid points of its three edges. This is known as reg-ular or red refinement and is illustrated in Fig. 15 (right).

Fig. 15. Blue refinement (left) of a triangle with a hanging node not on the longest sideside.

Fig. 16. An example of a refined mesh with triangles marked for coarsening that cannot

Fig. 17. Examples of a blue-refined triangle (triangle number 2) that cannot replace itstriangle allows coarsening the mesh.

Fig. 18. Top: A refinement sequence. Bottom: The coarsening process with all

Fig. 19. Second phase of the coarsening process for the example in Fig. 18. Left: end of firsone of those triangles originally marked for coarsening (in darker grey) but not coarsen

In [24] it is shown that when using this technique the smallestangle in all refined triangulations is at least half the smallest angleof the initial triangulation. In the sequel, given a triangle K, thosetriangles in which it is subdivided will be referred to as its children,and K as their parent. Furthermore, in a blue refinement, the twosmaller triangles will be referred to as twins.

Let us also mention that in our codes, in order not to have wildlydifferent meshes from step to step, the number of elementsmarked for refinement was always checked. If it exceeded 45% ofthe number of elements, then the elements were sorted indescending order of their estimate gn

K in (13), and only those upto 45% of the number of elements were marked for refinement.After performing the refinement process and coarsening process(described below), the step was repeated. Similarly, the numberof elements marked for coarsening was never allowed to exceed

and red refinement (right) of a triangle with two hanging nodes not on the longest

be replaced by their parents, so the coarsening process leaves the mesh unchanged.

children, but replacing its two twin children (shaded triangles 7 and 8) by a new

triangles marked for coarsening does not recover the initial triangulation.

t phase. Center: in lighter grey the newly recovered triangle who share a parent withed. Right the result at the end of the second phase.

3612 J. de Frutos et al. / Comput. Methods Appl. Mech. Engrg. 200 (2011) 3601–3612

45% of the number of elements, although, contrary to the refine-ment case, the step was not repeated when the list of elementsmarked for coarsening had to be shortened.

A.2. Coarsening process

In the coarsening process, triangles replace their children aslong as these are marked for coarsening and hanging nodes arenot created (that is, their neighbours on bisected sides can also re-place their children) In Fig. 16 we can see an example where trian-gle number 1 cannot replace its children (which are both markedfor coarsening) since its neighbour on the bisected side, trianglenumber 2, cannot replace its children since one of them, trianglenumber 6, is not marked for coarsening.

The coarsening process, being the reverse of the mesh refine-ment, is quite a standard procedure. Let us mention though twodetails that we have taken into account to allow for coarsermeshes. (A full description of the algorithm can be found in [7].)The first one is that when a blue-refined triangle has the two twinchildren marked for coarsening but cannot replace its three chil-dren, whenever possible the two twins are joined in a new triangleas if the blue-refined triangle had been green-refined. Examples ofthis can be seen in Fig. 17. Initially, the hanging node created bybisection of triangle number 3 forces triangle number 2 to beblue-refined. Later, it cannot replace its children, either becauseon doing so it would end up with a hanging node (top diagram),or because only the two twins are marked for coarsening (bottomdiagram). However replacing the twins by a new triangle allows fora coarser mesh.

The second detail worth mentioning is that, when there are sev-eral levels of refinement, the coarsening process can be a multi-phase process. This is easily understood in the example in Figs.18 and 19. The mesh is refined in two stages. Later, all trianglesare marked for coarsening, but, as shown in Fig. 18, only triangles3 and 7 can replace their children. On the second phase in Fig. 19,with triangle number 7 recovered, triangles number 1 and 2 can re-place their children. We remark that although the second phasecan be repeated as many times as necessary, for simplicity of pro-gramming, in our codes it is only done once.

References

[1] R. Bermejo, J. Carpio, An adaptive finite element semi-Lagrangian implicit–explicit Runge–Kutta–Chebyshev method for convection dominated reaction-diffusion problems, Appl. Numer. Math. 58 (2008) 16–39.

[2] A.N. Brooks, T.J.R. Hughes, Streamline upwind/Petrov–Galerkin formulationsfor convection dominated flows with particular emphasis on theincomprensible Navier–Stokes equations, Comput. Methods Appl. Mech.Engrg. 32 (1982) 199–259.

[3] L. Chen, J. Xu, Stability and accuracy of adapted finite element methods forsingularly perturbed problems, Numer. Math. 109 (2008) 167–191.

[4] W. Dahmen, S. Müller, T. Schlinkmann, On an adaptive multigrid solver forconvection-dominated problems, SIAM J. Sci. Comput. 23 (2001) 781–804.

[5] J. de Frutos, B. García-Archilla, J. Novo, Stabilization of Galerkin finite elementapproximations to transient convection–diffusion problems, SIAM J. Numer.Anal. 48 (2010) 953–979.

[6] J. de Frutos, B. García-Archilla, J. Novo, Numerical Experience with TransientConvection–diffusion Problems: Adaptive Discretizations, preprint.

[7] J. de Frutos, B. García-Archilla, J. Novo, Description of a Refine-CoarseningStrategy for Adaptive Finite-Element Computations in: D. Aubry, P. Díez, B. Tie,N. Parés, (Eds.), Adaptive Modelling and Simulation 2011, CIMNE, Barcelona,2011, pp. 149–158.

[8] P.M. Gresho, D.F. Griffiths, D.J. Silvester, Adaptive time-stepping forincompressible flow. I: scalar advection-diffusion, SIAM J. Sci. Comput. 30(2008) 2018–2054.

[9] F.K. Hebeker, R. Rannacher, An adaptive finite element method for unsteadyconvection-dominated flows with stiff source terms, SIAM J. Sci. Comput. 21(1999) 799–818.

[10] P. Houston, E. Süli, Adaptive Lagrange–Galerkin methods for unsteadyconvection–diffusion problems, Math. Comput. 70 (2000) 77–106.

[11] T.J.R. Hughes, A.N. Brooks, A multidimensional upwind scheme with nocrosswind diffusion, in: T.J.R. Hughes (Ed.), Finite Element Methods forConvection Dominated Flows, ASME, 1979, pp. 19–35.

[12] V. John, A numerical study of a posteriori error estimators for convection–diffusion equations, Comput. Methods Appl. Mech. Engrg. (2000) 757–781.

[13] V. John, P. Knobloch, On spurious oscillations at layers diminishing (SOLD)methods for convection–diffusion equations. Part I: a review, Comput.Methods Appl. Mech. Engrg. 196 (2007) 2197–2215.

[14] V. John, J. Novo, Error analysis of the SUPG finite element discretization ofevolutionary convection–diffusion–reaction equations, SIAM J. Numer. Anal.49 (2011) 1149–1176.

[15] V. John, E. Schmeyer, Stabilized finite element methods for time-dependentconvection–reaction–diffusion equations, Comput. Methods Appl. Mech.Engrg. 198 (2008) 475–494.

[16] N. Kopteva, How accurate is the streamline-diffusion FEM inside characteristic(boundary and interior) layers?, Comput Methods Appl. Mech. Engrg. 193(2004) 4875–4889.

[17] N. Kopteva, M. Stynes, A robust adaptive method for a quasi-linear one-dimensional convection–diffusion problem, SIAM J. Numer. Anal. 39 (2001)1446–1467.

[18] T. Linß, Layer-adapted meshes for convection–diffusion problems, Comput.Methods Appl. Mech. Engrg. 192 (2003) 1061–1105.

[19] G. Matthies, Local prohection methods on layer-adapted meshes for higherorder discretisations of convection–diffusion problems, Appl. Numer. Math. 59(2009) 2515–2533.

[20] M. Ohlberger, C. Rohde, Adaptive finite volume approximations for weaklycoupled convection dominated parabolic systems, IMA J. Numer. Anal. 22(2002) 253–280.

[21] M. Picasso, V. Prachittham, An adaptive algorithm for the Crank–Nicolsonscheme applied to a time-dependent convection–diffusion problem, J. Comput.Appl. Math. 233 (2009) 1139–1154.

[22] M.C. Rivara, Design and data structure of fully adaptive, multigrid, finite-element software, ACM Trans. Math. Softw. 10 (1984) 242–264.

[23] M.C. Rivara, Algorithms for refining triangular grids suitable for adaptive andmultigrid techniques, Internat. J. Numer. Methods Engrg. 20 (1984) 745–756.

[24] I.G. Rosenberg, F. Stenger, A lower bound on the angles of triangles constructedby bisecting the longest side, Math. Comput. 29 (1975) 390–395.

[25] M. Stynes, Steady-state convection–diffusion problems, Acta Numer. (2005)445–508.

[26] P. Sun, L. Chen, J. Xu, Numerical studied of adaptive finite element methods fortwo dimensional convection-dominated problems, J. Sci. Comput. 43 (2010)24–43.

[27] R. Verfürth, Robust a posteriori error estimates for nonstationay convection–diffusion equations, SIAM J. Numer. Anal. 43 (2005) 1783–1802.

[28] R. Verfürth, A Review of A Posteriori Error Estimation and Adatpvie Mesh-Refinement Techniques, Wiley Teubner, Chichester, 1996.