Abstract
An a posteriori error estimate is derived for the approximation of the transport equation with a time dependent transport velocity. Continuous, piecewise linear, anisotropic finite elements are used for space discretization, the Crank-Nicolson scheme scheme is proposed for time discretization. This paper is a generalization of Dubuis S, Picasso M (J Sci Comput 75(1):350–375, 2018) where the transport velocity was not depending on time. The a posteriori error estimate (upper bound) is shown to be sharp for anisotropic meshes, the involved constant being independent of the mesh aspect ratio. A quadratic reconstruction of the numerical solution is introduced in order to obtain an estimate that is order two in time. Error indicators corresponding to space and time are proposed, their accuracy is checked with non-adapted meshes and constant time steps. Then, an adaptive algorithm is introduced, allowing to adapt the meshes and time steps. Numerical experiments are presented when the exact solution has strong variations in space and time, illustrating the efficiency of the method. They indicate that the effectivity index is close to one and does not depend on the solution, mesh size, aspect ratio, and time step.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Space-time adaptive algorithms are efficient tools to approximate solutions of partial differential equations with accuracy and low computational cost. Whenever possible, the adaptive criteria is based on theoretical error estimates, this is mostly the case for elliptic and parabolic problems, fewer results are available for hyperbolic problems[11, 14, 18, 31, 37], nonlinear systems [3, 13, 30, 39, 41] or PDEs with variable coefficients [9, 24].
The classical theory of a posteriori error analysis for finite element methods was first developed on isotropic meshes [6, 16, 40], the involved constants were depending on the mesh aspect ratio. However, anisotropic finite elements, that is to say elements with possibly large aspect ratio, have been widely used to approximate phenomena involving boundary or internal layers. The isotropic theory for a posteriori error estimates was therefore updated, see for instance [4, 19, 22, 23, 25], and the involved constants were proved to be aspect ratio independent whenever the mesh was aligned with the solution.
The Crank-Nicolson method is a popular second order scheme for time dependent problems. However, most of the a posteriori error estimates are proved for first order methods only, for instance the Backward Euler scheme [8, 10, 32, 38]. Moreover, standard a posteriori proofs lead to suboptimal estimates for second order methods, as reported in [2]. To circumvent this problem, piecewise quadratic reconstructions have been introduced for parabolic problems [1, 2, 7, 28], in [21] for the transport equations and in [27] for the wave equation.
In this paper, the a posteriori error analysis of [21] for the transport equation is extended to the case where the velocity varies in space and time. As in [21], the a posteriori error analysis is valid for anisotropic meshes and a second order time discretization. In [21], the a posteriori error estimate was restricted to the case of a steady velocity while the new estimate is valid for velocity fields that may exhibit strong variations in time. The techniques used should be useful when coupling the transport equation to Navier-Stokes equations, which is the case for instance when considering free surface flows [20].
The outline of this paper is the following. In Sect. 2, the transport equation and the numerical method are presented. An a posteriori error estimate is proposed in Sect. 3, numerical experiments confirm the sharpness of the estimate in Sect. 4. Finally, an adaptive algorithm is presented in Sect. 5 and numerical results are discussed.
2 Statement of the problem and numerical scheme
Given a polygon \(\Omega\), a divergence free velocity field \({\mathbf {u}} \in C^1\left( \overline{\Omega } \times [0,T] \right)\), and an initial data \(\varphi _0 \in C^0\left( \overline{\Omega }\right)\), we are looking for \(\varphi :\Omega \times (0,T] \rightarrow {\mathbb {R}}\) the solution of the transport problem
where the inflow boundary is defined by
with \({\mathbf {n}}\) standing for the unit outer normal of \(\partial \Omega\). It is assumed that the velocity field is such that the inflow boundary does not depend on time and that the data \({\mathbf {u}},\Omega ,\varphi _0\) are smooth enough to justify the forthcoming computations.
To approximate in space (1) a finite element stabilization scheme is needed. This scheme corresponds to the stabilized scheme studied in [12], in which the stabilization term is updated to the anisotropic setting, following [11, 21, 29].
The fully discrete method reads as follows. For every \(h>0\), let \({\mathcal {T}}_h\) be a conformal triangulation of \(\overline{\Omega }\) into triangles K of diameter \(h_K \le h\). Let \(V_h\) be the set of continuous, piecewise linear functions on each triangle \(K\in {\mathcal {T}}_h\), zero valued on \(\Gamma ^{-}\). Let N be a non-negative integer and a partition \(0=t^0< t^1< t^2< \cdots < t^N=T\). We denote \(\tau ^{n+1}=t^{n+1}-t^n\) the time step, \(t^{n+{\nicefrac{1}{2}}}= (t^{n+1}+t^n)/2\), \(n=0,1,2,\ldots ,N-1\). Starting from \(\varphi _h^0 = r_h (\varphi _0)\), where \(r_h\) stands for the Lagrange interpolant defined on \({\mathcal {T}}_h\), for \(n=0,1,2,\ldots ,N-1\), we are looking for \(\varphi _h^{n+1}\in V_h\) such that
Here \(\delta _h>0\) stands for an O(h) stabilization parameter that will be specified in the sequel.
A priori error estimates for (2) have been proposed in [12] for isotropic meshes, constant time steps and a transport velocity independent of time. In [21], the analysis is extended to anisotropic meshes and variable time steps, and both a priori and a posteriori error estimates are derived. An a posteriori error analysis involving a time dependent transport velocity is proposed here, so as an adaptive algorithm. The corresponding a priori error estimates can be found in [20], so as additional numerical experiments.
In this paper, anisotropic finite elements will be used, that is to say meshes with possibly large aspect ratio. We will use the notations and results of [22, 23, 29], see also [25] for similar results. Let \(K\in {\mathcal {T}}_{h}\) and \(T_{K}:\hat{K}\longrightarrow K\) be the affine transformation mapping the reference triangle , into K defined by
with \(M_{K}\in {\mathbb {R}}^{2\times 2},{\mathbf {t}}_{K}\in {\mathbb {R}}^{2}.\) Observe that since \(M_{K}\) is invertible it admits a singular value decomposition \(M_{k}=R_{K}^{T}\Lambda _{K}P_{K},\) where \(R_{K}\) and \(P_{K}\) are orthogonal matrices and
We note
where \(r_{1,K},r_{2,K}\) are the unit vectors corresponding to directions of maximum and minimum stretching respectively, so that \(\lambda _{1,K},\lambda _{2,K}\) correspond to the value of maximum and minimum stretching.
A posteriori error analysis can be obtained using Clément’s interpolant [17]. Since anisotropic meshes are considered, the usual regularity assumption is omitted but two additional assumptions are needed. First, we assume that each vertex has a number of neighbours bounded from above, uniformly with respect to h. Second, we assume that for each K, the diameter of \(T_{K}^{-1}(\Delta K)\) (here \(\Delta K\) is the union of triangles sharing a vertex with K) is uniformly bounded with respect to h. For more details, we refer again to [22, 23, 29]. In this framework, the following estimation holds
where \(R_{h}\) is the Clément’s interpolant, \(\hat{C}>0\) is a constant depending only on the reference triangle \(\hat{K},\) and
with \(G_K\) standing for the gradient matrix given by
3 A posteriori error estimates
To recover an error estimate of order two in time, we follow the idea introduced in [28] for the Crank-Nicolson approximation of the heat equation, and define a piecewise quadratic reconstruction of the numerical solution \(\varphi _h^n\) of (2). We introduce the following notations. For any quantity \(w^n\) and for \(n=0,\ldots ,N-1\) we note
and for \(n=1,\ldots ,N-1\)
Setting \(\tau =\max (\tau ^1,\ldots ,\tau ^N)\), we define the piecewise numerical reconstruction \(\varphi _{h\tau }\) by
for \(({\mathbf {x}},t) \in \overline{\Omega }\times \left[ t^{n},t^{n+1}\right] , n \ge 1,\) and by
for \(({\mathbf {x}},t) \in \overline{\Omega }\times \left[ t^{0},t^{1}\right] .\)
Note that (5) is the unique quadratic polynomial interpolating exactly \(\varphi _h^{n+1},\varphi _h^n,\varphi _h^{n-1}\) at time \(t=t^{n+1},t^n,t^{n-1}\). This quadratic reconstruction was first introduced in [28] to recover an a posteriori error estimate for the Crank-Nicolson method applied to the heat equation which was of order two in time. It is modification of another quadratic reconstruction proposed in [2], where it was indeed observed that linear reconstructions would yield to suboptimal error estimates. Here, for the transport equation (1), the motivation is the following. A priori error estimates for a simplified differential problem indicate that the error is order two, the constant depending on \(\partial _{ttt}\varphi\) [20], which is formally equal to \(-\partial _{tt}({\mathbf {u}}\cdot \nabla \varphi )\). Therefore, some information about the second derivative in time of \(\varphi\) must be available in the error indicator, which is precisely the role of the quadratic term in (5).
Our error indicator for the time discretization is obtained by inserting the numerical reconstruction (5) (6) into the transport equation.
Proposition 1
Let \((\varphi _h^n)_{n=0}^N\) be the solution of (2). Let \(\varphi _{h\tau }\) be the numerical reconstruction (5) (6). For all \(0\le n \le N-1\), for all \(v_h\in V_h\) and for all \(t\in (t^n,t^{n+1})\), we have
where \(\theta _n\) is given for \(n\ge 1\) by
and for \(n=0\) by
and \(\varvec{\zeta }_n\) is given for \(n \ge 1\) by
and for \(n=0\) by
Remark 1
(Optimality of the local time error indicator)
-
(i)
Assuming that \({\mathbf {u}}=(u_1,u_2)\) is twice continuously differentiable in time, a Taylor expansion yields, for \(i=1,2\):
$$\begin{aligned} u_i(t)-u_i(t^{n-{\nicefrac{1}{2}}}) = (t-t^{n-{\nicefrac{1}{2}}}) \frac{\partial u_i(\bar{t})}{\partial t} \end{aligned}$$for some \(\bar{t}\) in (0, T) and
$$\begin{aligned} {\mathbf {u}}(t) - {\mathbf {u}}(t^{n+{\nicefrac{1}{2}}}) - (t-t^{n+{\nicefrac{1}{2}}}) \frac{\mathbf {u}(t^{n+{\nicefrac{1}{2}}}) - {\mathbf {u}}(t^{n-{\nicefrac{1}{2}}})}{\dfrac{\tau ^{n+1}+\tau ^n}{2}} = (t-t^{n+{\nicefrac{1}{2}}})^2 \frac{\partial ^2 {\mathbf {u}}(\tilde{t})}{\partial t^2} \end{aligned}$$for some \(\tilde{t}\) in (0, T). Therefore, \(\theta _n\) (for \(n\ge 1\)) is an approximation of
$$\begin{aligned} \tau ^2 {\mathbf {u}}\cdot \nabla \partial _{tt} \varphi _{h\tau } + \tau ^2 \partial _t {\mathbf {u}}\cdot \nabla \partial _t \varphi _{h\tau } + \tau ^2 \partial _{tt} {\mathbf {u}}\cdot \nabla \varphi _{h\tau }=\tau ^2\partial _{tt} ({\mathbf {u}}\cdot \nabla \varphi _{h\tau }), \end{aligned}$$and is thus of optimal order \(O(\tau ^2)\). We can also approximate \(\varvec{\zeta }_n\) (for \(n \ge 1)\) by
$$\begin{aligned} \tau ^2 (\partial _t \varphi _{h\tau } + {\mathbf {u}}\cdot \nabla \varphi _{h\tau }) \partial _{tt} (\delta _h {\mathbf {u}}) + \tau ^2 \partial _t (\partial _{t} \varphi _{h\tau } + {\mathbf {u}}\cdot \nabla \varphi _{h\tau }) \partial _t (\delta _h {\mathbf {u}}), \end{aligned}$$thus, since \(\delta _h =O(h)\), \(\varvec{\zeta }_n\) is of higher order \(O(h\tau ^2)\).
-
(ii)
Note that if \({\mathbf {u}}\) and \(\delta _h\) are independent of time, then \(\varvec{\zeta }_n=0\), \(n=0,1,\ldots ,N-1,\) and \(\theta _n\) reduces to the time error indicator given in [21], Lemma 1.
Proof
Let \(n\ge 1\) and \(t\in (t^n,t^{n+1})\), we have:
where
Observe that \(I_3\) is already part of (7) and order two in time, so it remains to transform \(I_1\) and \(I_2\) into quantity of second order.
A straightforward computation for \(I_1\) yields that
Using the numerical scheme (2), the first term is in fact zero, remaining the following expression for \(I_1\):
To simplify \(I_2\), we note that it looks like the discrete derivative of (2). Thus we first compute the difference between (2) taken at two successive steps, that is to say
and we divide by \((\tau ^{n+1} + \tau ^n)/2\). We obtain that
We now use the fact that we can transform the centered finite difference operator \(\bar{\partial }\) into the backward finite operator \(\partial\) through the relation
Plugging this last relation into (11), we get
By multiplying the last equality by \((t-t^{n+{\nicefrac{1}{2}}})\) it yields for \(I_2\) the following expression
Finally, in order to have finite differences of the velocity, we add and substract the terms
and
We therefore obtain as final expression for \(I_2\)
Now, by adding the first term of \(I_2\) with \(I_3\) and the third and the last terms with \(I_1\) yields the result for \(n\ge 1\).
Finally, for \(n=0\), reproducing the steps using to compute \(I_1\) here above yields that
\(\square\)
In order to prove an a posteriori error estimate for the numerical method (2) we now need to define the stabilization parameter \(\delta _h\) in (2). Following [11, 29], \(\delta _h\) is defined for all \(t\in [0,T]\) and for \(K\in {\mathcal {T}}_h\) by
if \({\mathbf {u}}(t)\) is not identically zero on K and by \(\delta _{h}(t)_{\vert K}=0\) otherwise.
Theorem 1
Assume that \(\varphi \in L^2(0,T;H^1(\Omega )) \cap H^1(0,T;L^2(\Omega ))\) where \(\varphi\) is the solution of (1). Let \((\varphi _h^n)_{n=0}^N\) be the solution of (2) with \(\delta _h\) defined by (12) and consider \(\varphi _{h\tau }\) the numerical reconstruction given by (5) (6). Setting \(e=\varphi -\varphi _{h\tau }\), there exists \(\hat{C}>0\) depending only on the reference triangle, in particular independent of \(T,\Omega , {\mathbf {u}}, \varphi\), the mesh size, aspect ratio and time step such that
where \(\omega _K\) is defined in (4) , \(\theta _n, \varvec{\zeta }_n\) are defined in Proposition 1 and \(c_0=\tau ^1\), \(c_n=T-\tau ^1\), for \(n\ge 1\).
Remark 2
-
(i)
The a posteriori error estimate (13) is not standard since the exact solution \(\varphi\) is contained in \(\omega _K(e)\). To obtain a computable upper bound, post-processing techniques were advocated in [11], for instance Zienkiewicz−Zhu (ZZ) post-processing [42,43,44]. More precisely, to compute \(G_K(\varphi -\varphi _{h\tau })\), we replace the first order partial derivatives with respect to \(x_i\)
$$\begin{aligned} \frac{\partial (\varphi -\varphi _{h\tau })}{\partial x_i} \; {\text {by}} \; \Pi _h^{ZZ} \frac{\partial \varphi _{h\tau }}{\partial x_i}-\frac{\partial \varphi _{h\tau }}{\partial x_i},\quad \quad i=1,2, \end{aligned}$$where, for any \(v_h\in V_h\) and for any vertex P of the mesh
$$\begin{aligned} \Pi _h^{ZZ} \frac{\partial v_h}{\partial x_i} (P) = \dfrac{\displaystyle \sum _{\begin{array}{c} K\in {\mathcal {T}}_h\\ P \in K \end{array}}\vert K \vert \; \frac{\partial v_h}{\partial x_i}_{\vert K}}{\displaystyle \sum _{\begin{array}{c} K\in {\mathcal {T}}_h\\ P \in K \end{array}} \vert K \vert }, \end{aligned}$$in other words, \(\Pi _h^{ZZ} \partial v_h/\partial x_i\) is an approximate \(L^2(\Omega )\) projection of \(\partial v_h/\partial x_i\) onto \(V_h\). It corresponds to the weighted mean value of the gradient \(\nabla v_h\) over the support of the hat functions centered at vertex P. Superconvergence of the ZZ recovery has been proved for elliptic problems and structured meshes [44] and more recently for unstructured anisotropic meshes [15]. Numerical experiments have shown that the efficiency of ZZ post-processing is better than theoretical predictions, see for instance [11, 28, 33,34,35,36].
-
(ii)
Observe that if \({\mathbf {u}}\) is independent of time, then due to definitions of \(\theta _n\) and \(\varvec{\zeta }_n\), the a posteriori error estimate (13) reduces to the one proven in [21], Theorem 2.
-
(iii)
Based on the a priori error estimates in [12, 20], it is expected that \(\Vert e(T) \Vert _{L^2(\Omega )}^2 = O(h^3 + \tau ^4)\) (written in the isotropic setting for simplicity). Numerical experiments will confirm that
$$\begin{aligned} \sum _{n=0}^{N-1}\sum _{K\in {\mathcal {T}}_{h}}\int _{t^{n}}^{t^{n+1}} \biggl ( \left\| \frac{\partial \varphi _{h\tau }}{\partial t}+{\mathbf {u}}(t)\cdot \nabla \varphi _{h\tau }\right\| _{L^{2}(K)}\omega _{K}(e)dt=O(h^3) \end{aligned}$$and
$$\begin{aligned} \sum _{n=0}^{N-1}\sum _{K\in {\mathcal {T}}_{h}}\int _{t^{n}}^{t^{n+1}} c_n\left\| \theta _n\right\| _{L^{2}(K)}^{2}dt =O(\tau ^4). \end{aligned}$$The term
$$\begin{aligned} \sum _{n=0}^{N-1}\sum _{K\in {\mathcal {T}}_{h}}\int _{t^{n}}^{t^{n+1}}\left( \left\| \theta _n\right\| _{L^{2}(K)}+ \frac{\left\| \varvec{\zeta _n}\right\| _{L^{2}(K)}}{\lambda _{2,K}}\right) \omega _K(e) dt \end{aligned}$$is a mixed quantity involving both space and time discretizations. It can be shown (see point (iv) below) to be of higher order when \(\tau ^2 = \Theta (h^{\nicefrac{3}{2}})\), that is exactly the goal of the adaptive algorithm proposed further. Since the initial error \(\Vert \varphi (0)-\varphi _{h\tau }(0) \Vert _{L^2(\Omega )}^2 = \Vert \varphi _0-r_h(\varphi _0) \Vert _{L^2(\Omega )}^2\) is \(O(h^4)\), the leading terms of the estimate (13) reduces to
$$\begin{aligned} \sum _{n=0}^{N-1}\sum _{K\in {\mathcal {T}}_{h}}\int _{t^{n}}^{t^{n+1}}\biggl ( \left\| \frac{\partial \varphi _{h\tau }}{\partial t}+{\mathbf {u}}(t)\cdot \nabla \varphi _{h\tau }\right\| _{L^{2}(K)}\omega _{K}(e) +c_n\left\| \theta _n\right\| _{L^{2}(K)}^{2}\biggr )dt \end{aligned}$$that can be used as an a posteriori estimator for the error \(\Vert e(T) \Vert _{L^2(\Omega )}^2\).
-
(iv)
Assuming that the solution is smooth enough [20], it is expected that
$$\begin{aligned} \omega _K(e)\lesssim h \Vert \nabla e \Vert _{L^2(\Omega )} = h O(h+\tau ^2) = O(h^2 + h\tau ^2). \end{aligned}$$Since \(\theta _n=O(\tau ^2)\) and \(\varvec{\zeta _n}=O(h\tau ^2)\) (see Remark 1), we finally have
$$\begin{aligned} \sum _{n=0}^{N-1}\sum _{K\in {\mathcal {T}}_{h}}\int _{t^{n}}^{t^{n+1}}\left( \left\| \theta _n\right\| _{L^{2}(K)}+ \frac{\left\| \varvec{\zeta _n}\right\| _{L^{2}(K)}}{\lambda _{2,K}}\right) \omega _K(e) dt = O(h^2 \tau ^2 + h \tau ^4). \end{aligned}$$Since the goal of our adaptive algorithm is to equidistribute the error due to space and time, then \(\tau ^2 \simeq h^{\nicefrac{3}{2}}\) and the above term is \(O(h^{3.5} + \tau ^{5+1/3})\), that is to say of higher order compared the error at final time \(\Vert e(T) \Vert _{L^2(\Omega )}^2=O(h^3+\tau ^4)\).
Proof
In the following, we denote by \(\hat{C}\) any positive constant, which may depend only on the reference triangle and may change from line to line. In particular, \(\hat{C}\) is independent of T, \(\Omega\),\({\mathbf {u}}\), \(\varphi\), the mesh size, aspect ratio and the time step. Let \(t\in \left( t^{n},t^{n+1}\right)\), \(n\ge 1\). First observe that for all \(v \in H^1(\Omega )\) that is zero on \(\Gamma ^{-}\), we have
Therefore, applying (14) with \(v=e\) and using the fact that \(\varphi\) is the solution to (1) we have
Subtracting any \(v_h + \delta _h(t) {\mathbf {u}}(t)\cdot \nabla v_h\) and using Proposition 1, we obtain
Splitting the last inequality into a sum over the triangles, and using the triangle and Cauchy-Schwarz inequalities yields
We now choose \(v_h = R_h e\) where we recall that \(R_h\) stands for the Clément’s interpolant. Using the anisotropic interpolation error estimate (3), we can prove that
Indeed, using that \(\nabla e = (\nabla e \cdot {\mathbf {r}}_{1,K}) {\mathbf {r}}_{1,K}+ (\nabla e \cdot {\mathbf {r}}_{2,K}) {\mathbf {r}}_{2,K})\) and
implies that
Thus, since
we obtain (15) by applying the interpolation error estimate (3). Moreover using (15) and the definition of \(\delta _{h|K}(t)\), we can finally prove that
So we obtain that
where we have set
\(\theta _K = \Vert \theta _n\Vert _{L^2(K)}\) and \(\displaystyle \zeta _K = \frac{\Vert \varvec{\zeta }_n\Vert _{L^2(K)}}{\lambda _{2,K}}\). The discrete Cauchy-Schwarz implies then that
Finally, the Young’s inequality yields
We conclude by using a Gronwall’s type inequality. Multiplying by \(\exp (-t / (T-t^1))\) on both sides and integrating between \(t^1\) and T yields
Note that the choice to use \(\exp (-t / (T-t^1))\) is made in order to eliminate the exponential growth with respect to T in the estimate. Proceeding in the same manner we can obtain an estimate for \(\Vert e(t^1) \Vert ^2_{L^2(\Omega )}\)
Combining both estimates yields finally
\(\square\)
4 Numerical experiments with non-adapted meshes and constant time steps
We denote \(e(T)_{L^2}\) the \(L^2\) numerical error at final time
Based on the a posteriori error estimate of Theorem 1, we define the error indicator \(\eta\) by
where the anisotropic space error indicator \(\eta ^A\) is defined by
with the local space error indicator given by
and the time error indicator \(\eta ^T\) is defined by
with the local time error indicator given by
where we recall that \(c_0 = \tau ^1\), \(c_n = T - \tau ^1\), \(n \ge 1\), and \(\theta _n\) is defined as in Proposition 1. As already anticipated in the Remark 2, the space error indicator (17) is made computable by replacing all the derivatives of \(\varphi\) by their ZZ post-processing. The sharpness of the error indicator \(\eta\) will be investigated by computing the effectivity index ei given by
Since we use the ZZ post-processing to make the space error indicator computable, we also check the efficiency of this procedure by computing the true \(H^1\) error
and the approximated \(H^1\) error
and the ZZ effectivity index is denoted by
To test the convergence of the numerical method presented above and check the sharpness of our error indicators, we start with numerical experiments for non-adapted meshes and constant time steps. The numerical experiments should possibly demonstrate the following properties:
-
(i)
To validate the equivalence between the error indicator and the true error, the effectivity index ei should remain close to a constant, in particular, the effectivity index ei should not depend on the solution, the time step and the mesh size and aspect ratio.
-
(ii)
To ensure that the ZZ post-processing is asymptotically exact and justify its use, the effectivity index \(ei^{ZZ}\) should be close to one.
We consider a ”1D” problem where the initial condition is given by
with \(C>0\) and we solve the transport equation
with
Finally, we impose Dirichlet boundary conditions on the left side of \(\Omega\) that is chosen as \((0,1)^2\) and we set \(T=0.05\). The exact solution is then given by
Observe that the solution is smooth, with small variations, except in a thin layer of width controlled by C.
The numerical results are reported in Table 1 where we choose \(\tau = O(h^2)\). When the error is mainly due to the space discretization, it is observed that ei stays close to a value of 20, as it was already concluded for non-depending on time velocity [21]. \(ei^{ZZ}\) is close to one, thus the ZZ post-processing is asymptotically exact, as predicted by the theory. The numerical errors are respectively \(\simeq O(h^{1.8})\) for the \(L^2\) error at final time and \(\simeq O(h)\) for the \(L^2(0,T; H^1(\Omega ))\) error. When we choose \(h=O(\tau ^2)\), the numerical error is mainly due to the time discretizazion and the effectivity index is close to 2. This value is already observed in [21] and we note that both numerical errors are \(O(\tau ^2)\), see Table 2. In all cases, ei is independent of the solution (the same effectivity indices are obtained with \(C=60\) and \(C=240\)), the mesh size and aspect ratio, and the time step as expected.
In order to have effectivity indices that are close to one, we finally perform numerical experiments with the normalized error indicator defined by
Numerical experiments will show that indeed, the effectivity indices corresponding to the normalized error indicator will be close to one and independent of the solution, the mesh size and aspect ratio, and the time step. This normalized indicator will be then used as a criterion towards mesh and time step adaptivity. In Table 3, the effectivity indices are reported when using (21) as error indicator and when setting \(h^{\nicefrac{3}{2}} = O(\tau ^2)\).
5 An adaptive algorithm
We now present an adaptive algorithm. The a priori error analysis contained in [12, 20] show that the final error increases as the square root of the final time T. Therefore, our goal is to ensure that the relative error over the time \(\frac{e(T)_{L^2}}{T^{{\nicefrac{1}{2}}}}=TOL\), where TOL is a preset tolerance chosen by the user. Since the normalized error indicator (21) is shown to be close to the true error, the goal of the adaptive algorithm is to build a sequence of meshes and time steps such that \(\frac{\eta }{T^{{\nicefrac{1}{2}}}}\) stays close to TOL. Therefore, we would like that at the end of the simulation, \(\eta\) verifies
A sufficient condition so that (22) holds is to equidistribute the error between the space and time approximations. Therefore, we build a sequence of meshes such that
and a sequence of time steps such that
Finally, sufficient conditions at every steps \(n=0,1,..,N-1\) to satisfy the above criteria are
and
If the conditions (26) are not satisfied, we refine or coarsen the time step. If (25) are not satisfied, the mesh is changed and a new anisotropic mesh is generated with the BL2D software [26]. In practice, the new mesh is built by equidistributed \(\eta _{K,n}^A\) between the direction \({\mathbf {r}}_{1,K}\) and \({\mathbf {r}}_{2,K}\), and by aligning each triangle K with the eigenvectors of the gradient matrix \(G_K(\varphi -\varphi _{h\tau })\) (that is post-processed with ZZ post-processing). For more details on this procedure, we refer to [20].
Everytime a new mesh has to be built, the old values of the solutions have to be interpolated on the meshes. A detailed discussion and several interpolation operator are presented in [11] and [21]. In both studies, the conservative interpolation [5] demonstrates the best result. Therefore we decide to use it also for the numerical experiments presented below. The main steps of the adaptive algorithm are summarized in Table 4.
Example 1
(An anisotropic example) We apply the adaptive algorithm to the following example. The domain is still chosen as \((0,1)^2\) and we set the final time to \(T=0.3\). Dirichlet boundary conditions are still imposed on the left side of \(\Omega\) and we choose the initial condition as before as
with \(C=60\) or \(C=240\).
We now choose \({\mathbf {u}}(x_1,x_2,t) = (u_{\bar{t}}(t),0)\) with \(u_{\bar{t}}\) given by
\(u_{\bar{t}}\) is a smooth function that is mainly 1 or 10, except in a small boundary layer of width 0.03 around \(t=\bar{t}\). Since the velocity quickly accelerates after \(t=\bar{t}\), it is expected that smaller time steps are chosen by the algorithm. For this particular example,we choose \(\bar{t}=0.25\).
We run the adaptive algorithm for various values of the prescribed tolerance TOL. We investigate the number of vertices, aspect ratio, number of time steps and remeshings. We summarize the notations we used for the analysis in Table 5. We make the following observations:
-
The number of vertices is multiplied by 1.6 as the tolerance is divided by two, expressing the fact that the method is \(O(h^{\nicefrac{3}{2}})\).
-
The number of time steps is multiplied by \(\sqrt{2}\) as the tolerance is divided by two, expressing the second order accuracy in time of the method.
-
The \(L^2\) error at final time is O(TOL).
-
ei stays around 1 and the ZZ post-processing is asymptotically exact.
-
The number of remeshings is independent of the tolerance and depends on the solutions.
In Tables 6, we present the converge results for several values of TOL. In Fig. 1, we check the evolution of the time step. We observe that the time step follows the evolution of \({\mathbf {u}}\), up to some oscillations occurring when the adaptive algorithm refuses the current time step. In particular, when \({\mathbf {u}}\) is 10 times larger, the adaptive algorithm selects a time step that is approximatively 10 times smaller. In Fig. 2, we represent the generated meshes and the solutions for \(C=240\) and \(TOL=0.00125\).
This example demonstrates the efficiency of anisotropic adaptive finite elements to approximate the behaviour of solutions with boundary layers. When \(TOL=0.00125\), the mesh size in the \(x_1\) direction is 0.0013 for \(C=60\) and 0.0003 for \(C=240\). An isotropic adaptive algorithm would need the same mesh size in both \(x_1\) and \(x_2\) directions, thus resulting in million vertices! Morover, numerical experiments show that the effectivity index corresponding to the normalized error indicator (21) remains close to one (say between 0.9 and 1.6).
Example 2
(An isotropic example) We present an isotropic example in order to show that the effectivity index indeed does not depend on the solution. The initial condition is given by
and the velocity field by
where \(u_{\bar{t}}(t)\) is as in (27) and we choose \(\bar{t}=0.125\). The final time is set to 0.15. Numerical results are reported in Table 7 when runing the adaptive algorithm. In Fig. 3, we represent the generated meshes and the solutions at time t = 0, 0.125, 0.15. The same observations can be made, namely that the effectivity index is close to one (it ranges between 1 and 1.7) and the ZZ post-processing is asymptotically exact.
Example 3
(Stretching of a circle in a vortex flow) The last test case is the stretching of a circle in a vortex flow. We set \(\Omega = ]0,1[^{2},T=4\). The initial condition is given by
where \(C=60\) or \(C=240\). No boundary conditions along \(\partial \Omega\) are prescribed. The velocity field is defined by
Since the flow is reversed at \(t=2\), we must have \(\varphi (x_1,x_2,4)=\varphi _0(x_1,x_2)\).
We start the adaptive algorithm with an initial grid of mesh size \(h=0.1\) and an initial time step \(\tau ^1 = 0.001\). Several meshes and numerical solutions are presented in Figs. 4 and 5 when \(TOL=0.00125\). In Figs. 6 and 7, convergence of the computed solution at final time is checked for several values of TOL.
6 Conclusion
We prove an a posteriori error estimate for the space-time approximation of the transport equation in the case where the transport velocity depends on space and time. Anisotropic finite elements are considered and the Crank-Nicolson method is used to advance in time. The corresponding a posteriori error estimate is shown to be of optimal order. Error indicators for space and time are proposed, numerical experiments confirm their sharpness. An adaptive algorithm is then introduced in order to capture with accuracy and low computational cost solutions that have strong variations in space and time. The efficiency of the method is shown for three 2D examples. A few 3D computations are reported in [20].
References
Akrivis G, Chatzipantelidis P (2010) A posteriori error estimates for the two-steps backward differentiation formula method for parabolic equations. SIAM J. Num. Analysis 48:109–132
Akrivis G, Makridakis C, Nochetto RH (2006) A posteriori error estimates for the Crank–Nicolson method for parabolic equations. Math. Comp 75:511–531
Akrivis G, Makridakis C, Nochetto RH (2009) Optimal order a posteriori error estimates for a class of Runge-Kutta and Galerkin methods. Numer. Math. 114(1):133. https://doi.org/10.1007/s00211-009-0254-2
Alauzet F, Loseille A (2016) A decade of progress on anisotropic mesh adaptation for computational fluid dynamics. Comput. Aided Des. 72:13–39
Alauzet F, Mehrenberger M (2010) \(P^{1}\)-conservative solution interpolation on unstructured triangular meshes. Int. J. Numer. Meth. Engng 84:1552–1588
Babushka I, Rheinboldt WC (1978) A-posteriori error estimates for the finite element method. Int. J. Numer. Methods Eng. 12(10):1597–1615
Bansch E, Brenner A (2016) A posteriori error estimates for pressure-correction schemes. SIAM J. Num. Anal. 54:2323–2358
Bernardi C, Sli E (2005) Time and space adaptivity for the second-order wave equation. Math. Models Methods Appl. Sci. 15(02):199–225
Bernardi C, Verfrth R (2000) Adaptive finite element methods for elliptic equations with non-smooth coefficients. Numer. Math. 85:579–608
Bernardi C, Verfrth R (2004) A posteriori error analysis of the fully discretized time-dependent Stokes equations. Math. Model. Numer. Anal. 38:437–455
Bourgault Y, Picasso M (2013) Anisotropic error estimates and space adaptivity for a semidiscrete finite element approximation of the transient transport equation. SIAM J. Sci. Comput. 35(2):A1192–A1211
Burman E (2010) Consistent SUPG-method for transient transport problems : Stability and convergence. Comput. Methods Appl. Mech. Engrg. 199:1114–1123
Caloz, G., Rappaz, J.: Numerical analysis for nonlinear and bifurcation problems, vol. 5, pp. 487–637. North Holland (1997)
Cangiani, A., Gerogoulis, E., Metcalfe, S.: Adaptive discontinuous galerkin methods for nonstationnary convection-diffusion problems. IMA Journal of Numerical Analysis, pp. 1–20 (2013)
Cao W (2014) Superconvergence analysis of the linear finite element method and a gradient recovery postprocessing on anisotropic meshes. Math. Comput. 84:89–117
Ciarlet, P.: The Finite Element Method for Elliptic Problems. Classics in Applied Mathematics. Society for Industrial and Applied Mathematics (2002). https://books.google.ch/books?id=isEEyUXW9qkC
Clment P (1975) Approximation by finite element functions using local regularization. RAIRO Annal. Numér. 9(R2):77–84
Cockburn B, Gremaud PA (1996) Error estimates for finite element methods for scalar conservation laws. SIAM J. Numer. Anal. 33(2):522–554. https://doi.org/10.1137/0733028
Coupez T (2011) Metric construction by length distribution tensor and edge based error for anisotropic adaptive meshing. J. Comput. Phys. 230(7):2391–2405
Dubuis, S.: Adaptive algorithms for two fluids flows with anisotropic finite elements and order two time discretizations. Ph.D. thesis, Ecole polytechnique fdrale de Lausanne (2019)
Dubuis S, Picasso M (2018) An adaptive algorithm for the time dependent transport equation with anisotropic finite elements and the Crank–Nicolson Scheme. J Sci Comput 75(1):350–375
Formaggia L, Perotto S (2001) New anisotropic a priori error estimates. Numer. Math. 89:641–667
Formaggia L, Perotto S (2003) Anisotropic error estimates for elliptic problems. Numer. Math. 94:67–92
Guignard D, Nobile F, Picasso M (2017) A posteriori error estimation for the steady Navier–Stokes equations in random domains. Comput. Methods Appl. Mech. Engrg. 313:483–511
Kunert G (2000) An a posteriori residual error estimator for the finite element method on anisotropic tetrahedral meshes. Numer. Math. 86(3):471–490
Laug, P., Borouchaki, H.: The BL2D Mesh Generator: Beginner’s Guide, User’s and Programmer’s Manual. Technical report RT-0194, Institut National de Recherche en Informatique et Automatique (INRIA), Rocquencourt, Le Chesnay, France (1996)
Lozinski A, Gorynina O, Picasso M (2018) Time and space adaptivity of the wave equation discretized in time by a second-order scheme. IMA J. Numer. Anal. 00:1–34
Lozinski A, Picasso M, Prachittham V (2009) An anisotropic error estimator for the Crank–Nicolson method : application to a parabolic problem. SIAM J. Sci. Comput. 31(2):2757–2783
Micheletti S, Perotto S, Picasso M (2003) Stabilized finite elements on anisotropic meshes : a priori error estimates for the advection-diffusion and the Stokes problems. SIAM J. Numer. Anal. 41(3):1131–1162
Nochetto RH, Schmidt A, Verdi C (2000) A posteriori error estimation and adaptivity for degenerate parabolic problems. Math. Comput. 69(229):1–24
Houston P, Rannacher R, Sli E (2000) A posteriori error analysis for stabilised finite element approximations of transport problems. Comput. Methods Appl. Mech. Eng. 190(11):1483–1508
Picasso M (1998) Adaptive finite elements for a linear parabolic problem. Comput. Methods Appl. Mech. Eng. 167:223–237
Picasso M (2002) Numerical study of the effectivity index for an anisotropic error indicator based on Zienkiewicz-Zhu error estimator. Commun. Numer. Meth. Eng. 19(1):13–23
Picasso M (2003) An anisotropic error estimator indicator based on Zienkiewicz-Zhu error estimator : application to elliptic and parabolic problems. SIAM J. Sci. Comput. 24(4):1328–1355
Picasso M (2006) Adaptive finite elements with large aspect ratio based on an anisotropic error estimator involving first order derivatives. Comput. Methods Appl. Mech. Eng. 196:14–23
Picasso M (2010) Numerical study of an anisotropic error estimator in the \(L^{2}(H^{1})\) norm for the finite element discretization of the wave equation. SIAM J. Sci. Comput. 32:2213–2234
Süli, E., Houston, P.: Adaptive finite element approximation of hyperbolic problems, pp. 269–344. Springer, Berlin (2003)
Verfürth R (2003) A posteriori error estimates for finite element discretizations of the heat equation. Calcolo 40(3):195–212. https://doi.org/10.1007/s10092-003-0073-2
Verfrth R (1994) A posteriori error estimates for nonlinear problems. Finite element discretizations of elliptic equations. Math. Comput. 62(206):445–475
Verfrth, R.: A review of a posteriori error estimation and adaptive mesh-refinement techniques. Wiley-Teubner (1996)
Verfrth R (1998) A posteriori error estimates for nonlinear problems: \(L^r, (0, T; W^r,\rho (\Omega ))\)-error estimates for finite element discretizations of parabolic equations. Numer. Methods Part. Differ. Equ. 14(4):487–518
Zienkiewicz OC, Zhu JZ (1987) A simple error estimator and adaptive procedure for practical engineering analysis. Int. J. Numer. Mehtods Eng. 24(2):337–357
Zienkiewicz OC, Zhu JZ (1989) Analysis of the Zienkiewicz-Zhu a posteriori error estimator in the finite element method. Int. J. Numer. Mehtods Eng. 28(9):2161–2174
Zienkiewicz OC, Zhu JZ (1992) The superconvergent patch recovery and a posteriori error estimates. I. the recovery technique. Int. J. Numer. Mehtods Eng. 33(7):1331–1364
Acknowledgements
Open access funding provided by EPFL Lausanne. Frédéric Alauzet is acknowledged for providing the Wolf-Interpol program corresponding to conservative interpolation [5].
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Dubuis, S., Picasso, M. An adaptive algorithm for the transport equation with time dependent velocity. SN Appl. Sci. 2, 1581 (2020). https://doi.org/10.1007/s42452-020-03283-z
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s42452-020-03283-z
Keywords
- A posteriori error estimates
- Space-time adaptive algorithm
- Anisotropic finite elements
- Second order time discretization
- Transport equation