1 Introduction

High-order discontinuous Galerkin (DG) methods are becoming a popular alternative to low-order methods for solving partial differential equations (PDEs) because of their high accuracy and flexibility [8, 48]. Among those, the traditional discontinuous Galerkin spectral element method (DGSEM) [21, 23] is a nodal (collocation) version of the DG method on hexahedral meshes which allows p-anisotropic representations and has been used in a wide range of applications [9, 13, 23, 27, 35]. In the DG approach, the continuity constraint on element interfaces is relaxed, allowing for discontinuities in the numerical solution. This feature makes them more robust than continuous methods for describing advection-dominated problems, like the ones usually encountered in fluid dynamics. Moreover, DG methods can handle non-conforming meshes with hanging nodes and/or different polynomial orders efficiently, as is necessary for mesh adaptation strategies [12, 23, 37].

Error estimates are a powerful tool in computational sciences as they quantify how accurately a numerical solution satisfies the governing mathematical equations [28, 38, 40]. A precise assessment of the numerical errors is useful for defect correction (a technique that enables high accuracy by correcting the numerical solution using an estimation of the error [24, 38]), or for guiding mesh adaptation strategies [25, 26, 49]. The former requires highly accurate estimates of the discretization error and, therefore, a significant amount of computational resources is usually invested in computing them [32]. The latter has been broadly studied in the literature. In particular, the most common approaches are the adjoint-based adaptation [10, 16, 17, 34, 47], where the numerical error of a functional (e.g. lift or drag) is estimated, which involves a high computational cost; the feature-based adaptation, which relies on on easy-to-compute adaptation criteria, such as the assessment of jumps across element interfaces in the case of DG discretizations [36], or the identication of large gradients [1, 29]; and the local-error-based adaptation [3, 14, 19, 20, 25, 26, 44, 45], which depends on the assessment of any measurable local error in all the cells of the domain. A detailed comparison of the different approaches for error estimation and adaptation can be found in [14] in the context of finite volumes or [20] for high-order DG schemes. The local-error-based adaptation methods are interesting since, in contrast to feature-based methods, they provide a way to predict and control the overall accuracy, and are computationally cheaper than adjoint-based schemes [19, 20]. The topic of our work is the development of an accurate and cheap local error estimator to drive p-anisotropic adaptation in the DGSEM.

Two different errors are particularly relevant. On the one hand, the discretization error is the most important, but also the most difficult error to estimate [32]. It is defined as the difference between the exact and numerical solutions to the problem and can be approximated by means of solving the discretization error transport equation (DETE) [27], an auxiliary PDE whose approximation involves the investment of further computational resources. Some of the first works using estimations of the local discretization error in high-order methods were proposed by Mavriplis [25, 26], who developed hp-adaptation techniques for the spectral element method, and Casoni et al. [11], who used a similar approach to evaluate where to add artificial viscosity for shock capturing in discontinuous Galerkin discretizations.

On the other hand, the truncation error is defined as the difference between the discrete partial differential operator and the exact partial differential operator,

$$\begin{aligned} \tau (\cdot ) = {\mathcal {R}}^N(\cdot )-{\mathcal {R}}(\cdot ), \end{aligned}$$
(1)

and is usually evaluated for the exact solution of the PDE [19, 20, 32, 42]. The truncation error is related to the discretization error through the DETE [40], where it acts as a local source term. This relation makes it useful as an indicator for mesh adaptation methods [7, 44] since refining the mesh where the truncation error is high reduces the discretization error in all the mesh [42], with an additional advantage: the truncation error estimation requires less computational effort. Furthermore, in hyperbolic problems the discretization error is strongly advected, i.e. it is transmitted downstream from under-resolution areas, but the truncation error is only weakly advected. Therefore, an adaptation procedure based on the truncation error targets specifically the under-resolved areas, whereas one based on the discretization error targets the under-resolved areas and the zones downstream of them [42, 43]. This makes the truncation error more suitable for adaptation purposes than the discretization error. Finally, it has been shown that controlling the truncation error targets the numerical accuracy of all functionals at once [19], ensuring that adapting a mesh using the truncation error leads necessarily to an error decrease in any other functional (e.g. lift or drag). For all these reasons, we focus on truncation error estimators in this paper.

From a practical point of view, the truncation error can be estimated using a hierarchy of meshes. On the one hand, Venditti and Darmofal [47] and Phillips et al. [30, 33] studied the possibility of estimating the truncation error by evaluating a coarse grid solution in the partial differential operator of a fine grid, an approach known as the coarse-to-fine approach. On the other hand, the fine-to-coarse approach, also known as the \(\tau \)-estimation method, was introduced by Brandt [5] and consists in estimating the local truncation error by using a fine grid solution interpolated to the coarse grid. Phillips [31] showed that the fine-to-coarse (\(\tau \)-estimation) method produces more accurate results than the coarse-to-fine approach and, therefore, it is the one retained in this work.

The \(\tau \)-estimation approach has been successfully used for adaptation purposes in low-order finite difference [3] and finite volume schemes [14, 44, 45]. Moreover, Rubio et al. extended it to high-order methods using a continuous Chebyshev collocation method [41] and later the DGSEM [42]. In that work, they studied the quasi-a priori truncation error estimation, which allows estimating the truncation error without having fully converged fine solutions, and introduced the concept of isolated truncation error (valid only for DG formulations), which only considers inner elemental contributions to the error and neglects the upwind contributions. More recently, Kompenhans et al. [19] applied these estimators to perform p-anisotropic adaptation for the Euler and Navier–Stokes equations, and compared \(\tau \)-based to featured based adaption, showing better performance for the former [20]. The adaptation strategy consisted in converging a high order representation (reference mesh) to a specified global residual and then performing a single error estimation followed by a corresponding p-adaptation process. Even though their methodology is very promising, we will show that it produces a large underestimation of the error for polynomial orders that are higher than the ones in the original reference mesh. This fact makes necessary to compute the initial solution in a very refined reference mesh to avoid inaccuracies.

In this paper, we extend the work on high-order \(\tau \)-estimators by Rubio et al. [41,42,43], and formulate a new anisotropic truncation error estimator that exploits the tensor product basis expansion of the traditional DGSEM. The new error estimator is shown to be suitable for performing anisotropic p-adaptation, and to have two main advantages over existing truncation error estimators; first, that it requires fewer operations to estimate the truncation error of all possible combinations of polynomial orders; and second, that it yields more accurate estimations of the truncation error for representations of a higher order than the reference mesh. This feature allows using reference meshes of a lower polynomial order, hence reducing the computational cost. We also analyze the properties of the traditional non-isolated truncation error and the isolated truncation error. To the authors’ knowledge, this is the first time that a high-order truncation error estimator based on the \(\tau \)-estimation method is formulated in an anisotropic/decoupled way, analyzed and tested.

The paper is organized as follows. In Sect. 2, we present the mathematical background. First, the DGSEM is briefly summarized; then, we detail the existing techniques for approximating the truncation error of isotropic and anisotropic representations using the \(\tau \)-estimation method. In Sect. 3, the proposed anisotropic \(\tau \)-estimator is introduced and analyzed. In Sect. 4, we present a validation of the assumptions needed for formulating the new approach and study the properties of the proposed method by means of a manufactured solutions test case of the compressible Navier–Stokes equations. Finally, the conclusions are summarized in Sect. 5.

2 Mathematical Background

In Sect. 2.1, we describe briefly the DGSEM approach. Section 2.2 contains the error definitions that will be used throughout the paper and provides an insight into the convergence properties of the different error measures. In Sect. 2.3, we review the \(\tau \)-estimation method for DGSEM schemes, and then we explain in Sect. 2.4 how it has been used in the literature for obtaining anisotropic error extrapolations.

2.1 The Discontinuous Galerkin Spectral Element Method (DGSEM)

We consider the approximation of systems of conservation laws,

$$\begin{aligned} {\mathbf {q}}_t + \nabla \cdot {\mathscr {F}} = {\mathbf {s}}, \end{aligned}$$
(2)

where \({\mathbf {q}}\) is the vector of conserved variables, \({\mathscr {F}}\) is the flux dyadic tensor which depends on \({\mathbf {q}}\), and \({\mathbf {s}}\) is a source term. This system represents, among others, the compressible Navier–Stokes equations, as detailed in “Appendix C”. Multiplying Eq. 2 by a test function \({\mathbf {v}}\) and integrating by parts over the domain \({\varOmega }\) yields the weak formulation:

$$\begin{aligned} \int _{{\varOmega }} {\mathbf {q}}_t {\mathbf {v}} d {\varOmega } - \int _{{\varOmega }} {\mathscr {F}} \cdot \nabla {\mathbf {v}} d {\varOmega } + \int _{\partial {\varOmega }} {\mathscr {F}} \cdot {\mathbf {n}} {\mathbf {v}} d \sigma = \int _{{\varOmega }} {\mathbf {s}} {\mathbf {v}} d {\varOmega }, \end{aligned}$$
(3)

where \({\mathbf {n}}\) is the normal unit vector on the boundary \(\partial {\varOmega }\). Let the domain \({\varOmega }\) be approximated by a tessellation \({\mathscr {T}} = \lbrace e \rbrace \), a combination of K finite elements e of domain \({\varOmega }^e\) and boundary \(\partial {\varOmega }^e\). Moreover, let \({\mathbf {q}}\), \({\mathbf {s}}\), \({\mathscr {F}}\) and \({\mathbf {v}}\) be approximated by piece-wise polynomial functions (that are continuous in each element) defined in the space of \(L^2\) functions

$$\begin{aligned} {\mathscr {V}}^N = \lbrace {\mathbf {v}}^N \in L^2({\varOmega }) : {\mathbf {v}}^N\vert _{{\varOmega }^e} \in {\mathscr {P}}^N({\varOmega }^e) \ \ \forall \ {\varOmega }^e \in {\mathscr {T}} \rbrace , \end{aligned}$$
(4)

where \({\mathscr {P}}^N({\varOmega }^e)\) is the space of polynomials of degree at most N defined in the domain of the element e. We remark that the functions in \({\mathscr {V}}^N\) may be discontinuous at element interfaces and that the polynomial order N may be different from element to element. Equation 3 can then be rewritten for each element as:

$$\begin{aligned}&\int _{{\varOmega }^e} {{\mathbf {q}}^e_t}^N {{\mathbf {v}}^e}^N d {\varOmega }^e - \int _{{\varOmega }^e} {{\mathscr {F}}^e}^N \cdot \nabla {{\mathbf {v}}^e}^N d {\varOmega }^e \nonumber \\&\quad + \int _{\partial {\varOmega }^e} {{\mathscr {F}}^*} \left( {{\mathbf {q}}^e}^N, {{\mathbf {q}}^-}^N, {\mathbf {n}} \right) {{\mathbf {v}}^e}^N d \sigma ^e = \int _{{\varOmega }^e} {{\mathbf {s}}^e}^N {{\mathbf {v}}^e}^N d {\varOmega }^e, \end{aligned}$$
(5)

where the superindex “e”’ refers to the functions as evaluated inside the element e, i.e. \({{\mathbf {q}}^e}^N = {{\mathbf {q}}^N}|_{{\varOmega }^e}\); whereas the superindex “−” refers to the value of the functions on the external side of the interface \(\partial {\varOmega }^e\). The numerical flux function, \({{\mathscr {F}}^*}\), allows to uniquely define the flux at the element interfaces and to weakly prescribe the boundary data as a function of the conserved variable on both sides of the boundary/interface (\({{\mathbf {q}}^{e}}^N\) and \({{\mathbf {q}}^{-}}^N\)) and the normal vector (\({\mathbf {n}}\)). Multiple choices for the numerical flux functions can be found in the literature [46]. In the present work, we use Roe [39] as the advective Riemann solver and Bassi–Rebay 1 [2] as the diffusive Riemann solver. We remark that the numerical flux must be computed in a specific manner when the representation is non-conforming [23].

Since \({\mathbf {q}}^N\), \({\mathbf {s}}^N\), \({\mathbf {v}}^N\) and \({\mathscr {F}}^N\) belong to the polynomial space \({\mathscr {V}}^N\), it is possible to express them inside every element as a linear combination of basis functions \(\phi _n \in {\mathscr {P}}^N({\varOmega }^e)\),

$$\begin{aligned} {\mathbf {q}}|_{{\varOmega }^e} \approx {{\mathbf {q}}^e}^N = \sum _n {\mathbf {Q}}^e_n \phi ^e_n ({\mathbf {x}}),&\ \ \ \ {\mathbf {s}}|_{{\varOmega }^e} \approx {{\mathbf {s}}^e}^N = \sum _n {\mathbf {S}}^e_n \phi ^e_n ({\mathbf {x}}), \nonumber \\ {\mathbf {v}}|_{{\varOmega }^e} \approx {{\mathbf {v}}^e}^N = \sum _n {\mathbf {V}}^e_n \phi ^e_n ({\mathbf {x}}),&{\mathscr {F}}|_{{\varOmega }^e} \approx {{\mathscr {F}}^e}^N = \sum _n \pmb {{\mathscr {F}}}^e_n \phi ^e_n ({\mathbf {x}}). \end{aligned}$$
(6)

Therefore, Eq. 5 can be expressed in a discrete form as

$$\begin{aligned}{}[{\mathbf {M}}]^e \frac{\partial {\mathbf {Q}}^e}{\partial t} + {\mathbf {F}}^e({\mathbf {Q}}) = [{\mathbf {M}}]^e {\mathbf {S}}^e, \end{aligned}$$
(7)

where \({\mathbf {Q}}^e=({\mathbf {Q}}^e_1, {\mathbf {Q}}^e_2, \ldots , {\mathbf {Q}}^e_n, \ldots )^T\) is the local solution that contains the coefficients of the linear combination for the element e; \({\mathbf {Q}}=({\mathbf {Q}}^1,{\mathbf {Q}}^2, \ldots , {\mathbf {Q}}^K)^T\) is the global solution that contains the information of all elements; \([{\mathbf {M}}]^e\) is known as the elemental mass matrix, and \({\mathbf {F}}^e(\cdot )\) is a nonlinear spatial discrete operator on the element level:

$$\begin{aligned}{}[{\mathbf {M}}]^e_{i,j}&= \int _{{\varOmega }^e} \phi ^e_i \phi ^e_j d {\varOmega }^e \end{aligned}$$
(8)
$$\begin{aligned} {\mathbf {F}}^e({\mathbf {Q}})_j&= \sum _i \left[ - \int _{{\varOmega }^e} \pmb {{\mathscr {F}}}_i^e \cdot \phi ^e_i \nabla \phi ^e_j d {\varOmega }^e \right] + \int _{\partial {\varOmega }^e} {{\mathscr {F}}^*}^N \left( {\mathbf {Q}}^e, {\mathbf {Q}}^{-}, {\mathbf {n}} \right) \phi ^e_j d \sigma ^e. \end{aligned}$$
(9)

Note that the operator \({\mathbf {F}}^e\) is applied on the global solution, since it is the responsible for connecting the elements of the mesh (weakly). Assembling the contributions of all elements into the global system we obtain:

$$\begin{aligned}{}[{\mathbf {M}}] \frac{\partial {\mathbf {Q}}}{\partial t} + {\mathbf {F}}({\mathbf {Q}}) = [{\mathbf {M}}] {\mathbf {S}}. \end{aligned}$$
(10)

In the traditional DGSEM [21], the tesselation is performed with non-overlapping hexahedral elements of order \(N=(N_1,N_2,N_3)\) (independent in every direction) and the integrals are evaluated numerically by means of a Gaussian quadrature that is also of order \(N=(N_1,N_2,N_3)\). For complex geometries, it is most convenient to perform the numerical integration in a reference element and transform the results to the physical space by means of a high-order mapping of order \(M=(M_1,M_2,M_3)\):

$$\begin{aligned} {\mathbf {x}}^e = {\mathbf {x}}^e \left( \pmb {\xi } \right) \in {\mathscr {P}}^M ,&\pmb {\xi } = \left( \xi , \eta , \zeta \right) \in \left[ -1, 1 \right] ^3, \end{aligned}$$
(11)

where the order of \({x}^e_i\) is at most \(N_i^e\) (subparametric or at most isoparametric mapping). The differential operators can be expressed in the reference element in terms of the covariant (\({\mathbf {a}}_i\)) and contravariant (\({\mathbf {a}}^i\)) metric tensors:

$$\begin{aligned} {\mathbf {a}}_i = \frac{\partial {\mathbf {x}}^e}{\partial \xi _i}, \ \ {\mathbf {a}}^i = \nabla \xi _i, \ \ i = 1, 2, 3. \end{aligned}$$
(12)

Under these mappings, the gradient and divergence operators become:

$$\begin{aligned} \nabla q = \frac{1}{J} \sum _{i=1}^d \frac{\partial }{\partial \xi _i} \left( J{\mathbf {a}}^i q \right) , \ \ \nabla \cdot {\mathbf {f}} = \frac{1}{J} \sum _{i=1}^d \frac{\partial }{\partial \xi _i} \left( J{\mathbf {a}}^i \cdot {\mathbf {f}} \right) , \end{aligned}$$
(13)

where the Jacobian of the transformation can be expressed in terms of the covariant metric tensor:

$$\begin{aligned} J = {\mathbf {a}}_i \cdot \left( {\mathbf {a}}_j \times {\mathbf {a}}_k \right) , \ \ \left( i,j,k \right) \ cyclic. \end{aligned}$$
(14)

For details on how to compute the metric terms for 2D and 3D geometries, see [22]. Botti [4] showed that the reference-to-physical mapping deteriorates the convergence rate of a DG representation and suggested the use of physical frame complete polynomial expansion basis functions. However, we retain the reference-to-physical high-order mapping of the traditional DGSEM since the method exposed in this paper exploits that the polynomial basis functions (\(\phi _n\) in Eq. 6) are tensor product reconstructions of Lagrange interpolating polynomials on quadrature points in each of the Cartesian directions of the reference element:

$$\begin{aligned} {\mathbf {q}}^N = \sum _n {\mathbf {Q}}_n \phi _n ({\mathbf {x}}) = \sum _{i=0}^{N_1} \sum _{j=0}^{N_2} \sum _{k=0}^{N_3} {\mathbf {Q}}_{i,j,k} l_i (\xi ) l_j (\eta ) l_k (\zeta ). \end{aligned}$$
(15)

Therefore, \({\mathbf {Q}}_n={\mathbf {Q}}_{i,j,k}\) are simply the nodal values of the solution, and \([{\mathbf {M}}]\) is a diagonal matrix containing the quadrature weights and the mapping terms. In the present work, we make use of the Legendre–Gauss quadrature points [21].

2.2 Definition of Errors

In this section, we define some measures of the error that will be used throughout the paper.

Definition 1

(Interpolation error) The difference between a function and its polynomial interpolant of order N:

$$\begin{aligned} \varepsilon ^N_{{\mathbf {q}}}= {\mathbf {q}} - {\mathbf {I}}^N {\mathbf {q}}, \end{aligned}$$
(16)

where \({\mathbf {I}}^N{\mathbf {q}}\) is the function that can be reconstructed using the polynomial expansion with coefficients \({\mathbf {Q}}_i\) (Eq. 6). For sufficiently smooth functions, in the asymptotic range the interpolation error in an element e behaves as:

$$\begin{aligned} \left|\left| \varepsilon ^N_{{\mathbf {q}}} \bigr |_{{\varOmega }^e}\right|\right|_{\infty } \le C^e_0 e^{-N^e \eta ^e_0}, \end{aligned}$$
(17)

where \(C^e_0\) and \(\eta ^e_0\) are constants that depend on the local smoothness of the function \({\mathbf {q}}\) [6, 18] and \(N^e\) is the local polynomial order in the element e. In the DGSEM, the use of tensor-product bases in d dimensions allows decoupling the interpolation error in directional components, each of which depends solely on the polynomial order in the corresponding direction:

$$\begin{aligned} \varepsilon _{{\mathbf {q}}}^N = \sum _{i=1}^d \varepsilon _{{\mathbf {q}},i}^{N} \ \ \text {such that} \ \ \varepsilon _i = \varepsilon _i (N_i). \end{aligned}$$
(18)

As a consequence, in the p-anisotropic DGSEM, the interpolation error exhibits a tensor-product-type error bound in d dimensions inside every element [42],

$$\begin{aligned} \left|\left| \varepsilon _{{\mathbf {q}}}^N \big |_{{\varOmega }^e} \right|\right|_{\infty } \le \sum _{i=1}^d C^e_{0,i} e^{-N^e_i \eta ^e_{0,i}}. \end{aligned}$$
(19)

Definition 2

(Discretization error) The difference between the exact solution to the problem, \(\bar{{\mathbf {q}}}\), and the one obtained with a discretization of order N, \(\bar{{\mathbf {q}}}^N\):

$$\begin{aligned} \epsilon ^N= \bar{{\mathbf {q}}} - \bar{{\mathbf {q}}}^N. \end{aligned}$$
(20)

The discretization error in an element is influenced by other elements because of the advection properties of the PDE. In fact, we will decouple the discretization error in locally-generated and externally-generated contributions for every element:

$$\begin{aligned} \epsilon ^N \bigr |_{{\varOmega }^e} = \epsilon ^N_{{\varOmega }^e} + \epsilon ^N_{\partial {\varOmega }^e}. \end{aligned}$$
(21)

In the p-isotropic DGSEM, it can be assumed that the discretization error in each element behaves as [42, 43]:

$$\begin{aligned} \left|\left|\epsilon ^N \bigr |_{{\varOmega }^e}\right|\right|_{\infty } \le C^e_{\epsilon } e^{-N^e \eta ^e_{\epsilon }} + \sum _{\begin{array}{c} k=1 \\ k \ne e \end{array}}^K C^{*k}_{\epsilon } e^{-N^k \eta ^{*k}_{\epsilon }}, \end{aligned}$$
(22)

where K is the number of elements, \(C^e_{\epsilon }\) and \(\eta ^e_{\epsilon }\) are constants that depend on the smoothness of the solution in the element e [6, 18], and \(C^{*k}_{\epsilon }\) and \(\eta ^{*k}_{\epsilon }\) are constants that depend both on the smoothness of the solution and the advection properties of the PDE. The first term on the right-hand side corresponds to the bound of the locally-generated discretization error (\(\epsilon ^N_{{\varOmega }}\)), whereas the second term is the bound of the externally-generated discretization error (\(\epsilon ^N_{\partial {\varOmega }}\)) which gathers the errors that are introduced through the Riemann solver. Note that \(\varepsilon ^N\) is the minimum possible (lower bound of) \(\epsilon ^N\). For an anisotropic representation in d dimensions, the expression becomes [15, 42, 43]:

$$\begin{aligned} \left|\left| \epsilon ^N \bigr |_{{\varOmega }^e} \right|\right|_{\infty } \le \sum _{i=1}^d C^e_{\epsilon ,i} e^{-N^e_{i} \eta ^e_{\epsilon ,i}} + \sum _{\begin{array}{c} k=1 \\ k \ne e \end{array}}^K \sum _{i=1}^d C^k_{\epsilon ,i} e^{-N^k_{i} \eta ^k_{\epsilon ,i}}. \end{aligned}$$
(23)

Definition 3

(Quadrature error) The quadrature error, also referred to as the numerical integration error, is the difference between the exact integral of a function and its approximation by a Gaussian quadrature:

$$\begin{aligned} e_{\int }^N = \int _{{\varOmega }} q d{\varOmega } - \int ^N_{{\varOmega }} q d{\varOmega }, \end{aligned}$$
(24)

where the superindex N on the integral indicates that it is approximated using a Gaussian quadrature of order N,

$$\begin{aligned} \int ^N_{{\varOmega }} q d{\varOmega } = \sum _{j=0}^N q_j w_j, \end{aligned}$$
(25)

and \(w_j\) are the quadrature weights.

Definition 4

(Non-isolated truncation error) We define the non-isolated truncation error of a discretization of order N as the difference between the discrete partial differential operator of order N and the exact partial differential operator applied to the exact solution:

$$\begin{aligned} \tau ^N = {\mathcal {R}}^N({\mathbf {I}}^N \bar{{\mathbf {q}}})-{\mathcal {R}}(\bar{{\mathbf {q}}}). \end{aligned}$$
(26)

The exact partial differential operator can be derived from Eq. 2 as

$$\begin{aligned} {\mathcal {R}}({\mathbf {q}}) = {\mathbf {s}} - \nabla \cdot {\mathscr {F}} = {\mathbf {q}}_t, \end{aligned}$$
(27)

and the discrete partial differential operator is obtained from the analysis of Sect. 2.1 as

$$\begin{aligned} {\mathcal {R}}^N ({{\mathbf {q}}}^N) = \int ^N_{{\varOmega }^e} {\mathbf {s}}^N \phi d{\varOmega } + \int ^N_{{\varOmega }^e} {\mathscr {F}}({{\mathbf {q}}}^N) \cdot \nabla \phi d {\varOmega } - \int ^N_{\partial {\varOmega }^e} {\mathscr {F}}^{*}({{\mathbf {q}}}^N,{{\mathbf {q}}}^{\underline{N}},{\mathbf {n}}) \phi d \sigma . \end{aligned}$$
(28)

Since for steady state, \({\mathcal {R}}(\bar{{\mathbf {q}}})=0\), the non-isolated truncation error yields

$$\begin{aligned} \tau ^N = {\mathcal {R}}^N(\bar{{\mathbf {q}}}^N + {\mathbf {I}}^N \epsilon ^N). \end{aligned}$$
(29)

Equation 29 is the discretization error transfer equation (DETE [40]), which for linear operators reduces to

$$\begin{aligned} \tau ^N = {\mathcal {R}}^N({\mathbf {I}}^N \epsilon ^N). \end{aligned}$$
(30)

Notice that the truncation error acts as a source term for the discretization error. The discrete partial differential operator in discrete (sampled) form is derived from Eq. 10 as

$$\begin{aligned} \pmb {{\mathcal {R}}}^N(\pmb {I}^N{\mathbf {q}}) = [{\mathbf {M}}] {\mathbf {S}} - {\mathbf {F}}(\pmb {I}^N{\mathbf {q}}), \end{aligned}$$
(31)

where \(\pmb {{\mathcal {R}}}^N\) contains the sampled values of \({\mathcal {R}}^N\) in all the nodes of the domain and \(\pmb {I}^N\) is a sampling operator. \({\mathcal {R}}^N\) is reconstructed from \(\pmb {{\mathcal {R}}}^N\) element-wise with Eq. 6. The non-isolated truncation error can be then computed inserting Eq. 31 into 26 as

$$\begin{aligned} \pmb {\tau }^N=\pmb {{\mathcal {R}}}^N(\pmb {I}^N\bar{{\mathbf {q}}})=[{\mathbf {M}}] {\mathbf {S}} - {\mathbf {F}}(\pmb {I}^N\bar{{\mathbf {q}}}). \end{aligned}$$
(32)

The dependence of the non-isolated truncation error on the discretization error is obtained by using Definition 2 and expanding Eq. 32 as a Taylor series:

$$\begin{aligned} \pmb {\tau }^N=\frac{\partial \pmb {{\mathcal {R}}}^N}{\partial {\mathbf {Q}}^N} \biggr |_{\bar{{\mathbf {Q}}}^N} \pmb {\epsilon }^N + {\mathcal {O}}\left( \left( \pmb {\epsilon }^N\right) ^2\right) . \end{aligned}$$
(33)

Equation 33 is the DETE in discrete form. Taking into account Eqs. 33 and 23, and based on previous numerical results [42, 43], Kompenhans et al. [19] stated that the truncation error in an element is bounded by

$$\begin{aligned} \left|\left| \tau ^N \bigr |_{{\varOmega }^e} \right|\right|_{\infty } \le \sum _{i=1}^d C^e_{i}e^{-N^e_{i} \eta ^e_{i}} + \left|\left| \tau _{\partial {\varOmega }^e}\right|\right|_{\infty }. \end{aligned}$$
(34)

This expression was validated experimentally [19, 20]. The first term in Eq. 34 is the bound of the locally-generated truncation error, whereas the second term is the bound of the externally-generated truncation error that enters through the Riemann solver and does not depend on the local polynomial orders. The second term is a consequence of the dependence of the discretization error on the solution in other elements.

Definition 5

(Isolated truncation error) The isolated truncation error is defined as [42]

$$\begin{aligned} {{\hat{\tau }}}^N = \mathcal {{\hat{R}}}^N({\mathbf {I}}^N \bar{{\mathbf {q}}}), \end{aligned}$$
(35)

where \(\mathcal {{\hat{R}}}^N(\cdot )\) is the isolated discrete partial differential operator, which is derived in the same manner as \({\mathcal {R}}^N(\cdot )\), but \({\mathscr {F}}\) is not substituted by \({\mathscr {F}}^*\) during the process (Eq. 5). Therefore, the sampled form of the discrete isolated partial differential operator yields

$$\begin{aligned} \hat{ \pmb {\tau }}^N = \hat{ \pmb {{\mathcal {R}}}}^N(\pmb {I}^N \bar{{\mathbf {q}}} )=[{\mathbf {M}}] {\mathbf {S}} - {{\hat{\mathbf{F}}}}(\pmb {I}^N \bar{{\mathbf {q}}} ), \end{aligned}$$
(36)

where the elemental contribution to the nonlinear discrete operator is

$$\begin{aligned} {{\hat{\mathbf{F}}}}^e({\mathbf {Q}}^e)_j = \sum _i \left[ - \int ^N_{{\varOmega }^e} \pmb {{\mathscr {F}}}_i \cdot \phi ^e_i \nabla \phi ^e_j d {\varOmega }^e \right] + \int ^N_{\partial {\varOmega }^e} {\mathscr {F}}^N \cdot {\mathbf {n}} \phi ^e_j d \sigma ^e. \end{aligned}$$
(37)

This change eliminates the influence of the neighboring elements and boundaries in the truncation error of each element. The dependence of the isolated truncation error on the interpolation error of the fluxes inside an element (\(\varepsilon ^N_{{\mathscr {F}},e}\)) can be expressed as (see “Appendix A” and [42]):

$$\begin{aligned} {{\hat{\tau }}}^N \bigr |_{{\varOmega }^e} \approx \left( \nabla \cdot \varepsilon ^N_{{\mathscr {F}}} \bigr |_{{\varOmega }^e}, \phi \right) ^N_{{\varOmega }^e}. \end{aligned}$$
(38)

This shows that \({\hat{\tau }}\) indeed depends only on the discrete representation of the numerical solution in the element e. Rubio et al. [42] pointed out that the isolated truncation error might be a better sensor for adaptation algorithms for hyperbolic PDEs than its non-isolated counterpart or the discretization error, since unlike the last two, the first one is not affected by neighbors’ errors. Notice that Eq. 38 resembles the linear DETE (Eq. 30 [40]). In this case, the isolated truncation error acts as a source term for the interpolation error. In consequence, decreasing the isolated truncation error reduces the interpolation error.

Finally, it is important to note that the spectral convergence of the isolated truncation error is similar to the non-isolated truncation error [42, 43] and can be expressed as

$$\begin{aligned} \left|\left| {\hat{\tau }}_e^N \bigr |_{{\varOmega }^e} \right|\right|_{\infty } \le \sum _{i=1}^d C^e_{i}e^{-N^e_{i} \eta ^e_{i}}. \end{aligned}$$
(39)

Let us remark that, because of the reasons exposed above, in this case there is no externally-generated truncation error. The hat notation will be dropped from now on since, unless explicitly stated, the formulations in this paper are valid for both the non-isolated and the isolated truncation errors.

2.3 \(\tau \)-Estimation Method

Since in general the exact solution to the problem is not available, we are interested in using an estimation for Eqs. 32 and 36. The \(\tau \)-estimation method makes use of an approximate solution on a reference mesh of order \(P>N\) instead of the exact one. The most straightforward methodology is to converge this high-order solution to a low residual near machine round-off, \(\bar{{\mathbf {Q}}}^P\). This is known as the a posteriori approach. In practice, one can also use a non-converged solution, \({{\tilde{\mathbf{Q}}}}^P\). This is known as the quasi-a priori approach. In this paper, we use the following formulation, which is valid for the a posteriori method and the quasi a priori approach without correction:

$$\begin{aligned} \pmb {\tau }_P^N = \pmb {\mathcal {R}}^N(\mathbf {I}_P^N\mathbf {Q}^P) = [\mathbf {M}^N]\mathbf {S}^N- \mathbf {F}^N(\mathbf {I}_P^N \tilde{\mathbf {Q}}^P), \end{aligned}$$
(40)

where \({\mathbf {I}}_P^N\) is an interpolation operator from order P to order N. For compactness, the notation of this work omits the interpolation matrix such that \(\pmb {{\mathcal {R}}}^N\left( {\mathbf {Q}}^P\right) = \pmb {{\mathcal {R}}}^N\left( {\mathbf {I}}_P^N{\mathbf {Q}}^P\right) \). Equation 40 is valid for both the isolated (inserting the hats) and the non-isolated truncation error. Note that the truncation error estimation can be easily performed for anisotropic polynomial representations of d dimensions. For instance, in a 2D anisotropic case, Eq. 40 can be rewritten as:

$$\begin{aligned} \pmb {\tau }_{P_1P_2}^{N_1N_2} = [{\mathbf {M}}^{N_1N_2}]{\mathbf {S}}^{N_1N_2}-{\mathbf {F}}^{N_1N_2}(\tilde{{\mathbf {Q}}}^{P_1P_2}). \end{aligned}$$
(41)

2.4 Low-Order Extrapolation of the Truncation Error Estimations

In this section, we review the method proposed by Kompenhans et al. [19] to extrapolate the \(\tau \)-estimations of anisotropic representations. This method was successfully used to perform a p-adaptation strategy [19, 20]. We will show that their strategy can be classified as a low-order extrapolation. In order to do so, let us first introduce the concept of truncation error map.

Definition 6

(Truncation error map) The graphical representation of the truncation error behavior inside an element with respect to the polynomial order, i.e. a \((d+1)\)-dimensional plot of \(\log \left|\left|\tau ^N\right|\right|_{\infty }\) as a function of the polynomial order in every direction of the reference element \(N=(N_1,\ldots ,N_d)\), where d is the number of dimensions.

We are interested in generating an approximation to the truncation error map with the \(\tau \)-estimation method (Sect. 2.3). Two regions of the estimated map can be distinguished:

Definition 7

(Inner truncation error map) The portion of the truncation error map that is obtained using the \(\tau \)-estimation method. In other words, if a reference mesh of order P is used for the estimation, the inner truncation error map is the region estimated for \(N_i < P_i\).

Definition 8

(Outer truncation error map) The portion of the truncation error map that is obtained using extrapolations of the inner truncation error map. In the case that a reference mesh of order P is used for the estimation, the outer truncation error map is the region estimated for \(N_i \ge P_i\).

Since the numerical solution on a reference mesh of order P involves the investment of computational resources, it is of interest to have an accurate and efficient way of generating the outer truncation error map.

Because of the spectral convergence of the truncation error in the asymptotic range, the one-dimensional (or isotropic d-dimensional) map turns out to be a discrete scatter plot of points that describe a linear function with a negative slope (the convergence rate \(\eta \)), as shown in Fig. 1a.

Fig. 1
figure 1

One- and two-dimensional truncation error maps constructed with \(P=5\) showing estimated and extrapolated values for a toy problem (illustrative). a One-dimensional map. b Two-dimensional map used by Kompenhans et al. [19] (Color figure online)

Kompenhans et al. [19] used the estimated truncation error map to adapt the polynomial orders of a given mesh using a specified maximum permitted error threshold, \(\tau _{max}\). The method for estimating the map consists of four steps:

  1. 1.

    Generate an inner map for \(N_i<P_i\) using Eq. 41. This requires \(n_{eval}\) evaluations of the discrete partial differential operator \({\mathcal {R}}^N\), where

    $$\begin{aligned} n_{eval} = \prod _{i=1}^d (P_i - 1). \end{aligned}$$
    (42)

    The estimated points of the inner map are marked as blue triangles in Fig. 1.

  2. 2.

    Use the inner map to look for a combination of polynomial orders that fulfills the specified error threshold. If a combination fulfills \(\tau _{max}\), adapt the polynomial order and exit the adaptation process. Otherwise, additional considerations are required.

  3. 3.

    Compute \(\log ||\tau ^{N_iN_j}||\) and perform a linear regression analysis in the direction i in order to describe the behavior of \(\log \left|\left|\tau \right|\right|_{\infty }\) as a function of \(N_i\) (\(N_j=P_j-1\)). The result of the linear regression is marked with a dashed line in Fig. 1.

  4. 4.

    Use the linear regression to generate part of the outer truncation error map for \(N_i \ge P_i\), and select the value of \(N_1\) and \(N_2\) independently from these extrapolations. The extrapolated values of the truncation error are marked with red squares in Fig. 1. In other words, \(N_1\) and \(N_2\) are selected so that the values of both red squares fall below the specified threshold, \(\tau _{max}\).

This procedure is performed for every element in all the Cartesian directions to adapt the mesh. For further details, refer to the original paper by Kompenhans et al. [19] and to our example in Sect. 4.2.

2.4.1 Analysis of the Low-Order Extrapolation

Two remarks can be made about the described four-step procedure:

Remark 1

Steps 3 and 4 assume that the spectral convergence observed in 1D extends to higher dimensions along iso-\(N_i\) lines of the truncation error map.

Remark 2

For the non-isolated truncation error, the behavior shown in Fig. 1 can only be expected for the locally-generated component (see Eq. 34). This means that the extrapolation procedure may predict unexpected behaviors if the truncation error in neighboring elements is high, i.e., if the \(\tau \)-estimation procedure is not performed element-wise while keeping the polynomial order in other elements sufficientlyFootnote 1 high.

As stated in the Remark 1, the extrapolation procedure assumes that the truncation error decreases exponentially along iso-\(N_i\) lines of the truncation error map. That is the same as saying that the truncation error map is a plane for \(d=2\), and in general that it is a hyperplane of dimension \(d+1\). In Fig. 2 we present an illustration that resembles the hyperplane behavior in two dimensions for perfect spectral convergence. The described methodology consists in constructing d iso-\(N_i\) lines on the hyperplane, which should contain the values of the truncation error for \(N_j=P_j-1 \ \forall \ N_i\) (red line with triangular markers and black line with circular markers in Fig. 2). In that scenario, selecting \(N_i\) independently can be regarded as a conservative criterion, since in the hyperplane we have:

  • In 2D:

    $$\begin{aligned} \tau ^{N_1N_2}&\le \tau ^{P_1N_2}, \\ \tau ^{N_1N_2}&\le \tau ^{N_1P_2}. \end{aligned}$$
  • In 3D:

    $$\begin{aligned} \tau ^{N_1N_2N_3}&\le \tau ^{P_1N_2N_3}, \\ \tau ^{N_1N_2N_3}&\le \tau ^{N_1P_2N_3}, \\ \tau ^{N_1N_2N_3}&\le \tau ^{N_1N_2P_3}. \end{aligned}$$

for \(N_i \ge P_i\). See Fig. 2.

Fig. 2
figure 2

Hyperplane behavior of the truncation error of a toy problem (illustrative) (Color figure online)

Hereinafter, the method by Kompenhans et al. shall be referred to as the low-order extrapolation method, since it supposes that the truncation error map (\(\log ||\tau ||\)) has a linear behavior. In light of the analysis in Sect. 3, we will be able to formulate a high order extrapolation method that provides extrapolated estimations with increased accuracy.

3 New Anisotropic Truncation Error Estimation

In this section, we present the new anisotropic truncation error estimator, discuss some of its properties and compare them with the error estimators that have been used in the literature for performing anisotropic p-adaptation. The formulation of this new estimator involved a mathematical proof based on specific assumptions that is detailed in Sect. 3.1. In Sect. 3.2, we analyze the convergence behavior of the anisotropic estimator. In Sect. 3.3, we describe how the new estimator can be used for approximating the truncation error of higher-order representations, and prove that it is superior to existing \(\tau \)-estimators at obtaining these approximations.

3.1 Anisotropic \(\tau \)-Estimation

The anisotropic \(\tau \)-estimator is a generalization of the ideas reviewed in Sect. 2.3 and is based on four assumptions that are explained first. For the sake of readability and without loss of generality, all the mathematical statements in this section are for 2D formulations, where \(N=(N_{\xi },N_{\eta }) = (N_1,N_2)\) are the polynomial orders in the 2 directions of the reference element. However, all the statements and proofs can be directly generalized to d dimensions.

3.1.1 Assumptions

Following assumptions are a consequence of the tensor product basis functions of the DGSEM and hold for sufficiently smooth solutions in the asymptotic range. The assumptions are:

  1. (a)

    The truncation error has an anisotropic behavior and, therefore, can be decoupled in its directional components:

    $$\begin{aligned} \tau ^{N_1N_2} \approx \tau _1^{N_1N_2} + \tau _2^{N_1N_2}. \end{aligned}$$
    (43)

    Here, it is important to note that \(\tau _i\) is the projection of the global truncation error, \(\tau \), into the local direction, i.

  2. (b)

    The locally-generated truncation error in each direction depends only on the polynomial order in that direction:

    $$\begin{aligned} \tau _{{\varOmega },i}^{N_1N_2} \approx \tau _{{\varOmega },i}^{N_1N_2}(N_i) \end{aligned}$$
    (44)

Assumptions (a) and (b) follow from the work of Rubio et al. [42, 43]. Furthermore, assumption (b) relates to the anisotropic spectral convergence behavior of the truncation error (Eqs. 34 and 39).

Proposition 1

For sufficiently smooth solutions, the truncation error of a DGSEM discretization of order \((N_1,N_2)\) can be approximated from a semi-converged solution of order \((P_1,P_2)\), such that \(P_i > N_i\), as the sum of the directional \(\tau \)-estimations obtained by coarsening in the different space dimensions:

$$\begin{aligned} \tau ^{N_1N_2} \approx \tau ^{N_1P_2}_{P_1P_2} + \tau ^{P_1N_2}_{P_1P_2} \end{aligned}$$
(45)

Proof

This proof is specific for the isolated truncation error. We refer to “Appendix B” for a brief proof that Proposition 1 also holds for the non-isolated truncation error under additional assumptions.

Let us note that assumptions (a) and (b) are consistent with the dependence of the isolated truncation error on the interpolation error (Eq. 38) and the anisotropic behavior of the latter (Eq. 19).

We start by obtaining the analytical expression for the isolated\(\tau \)-estimation. To that end, we use the same procedure as in “Appendix A”. The estimate of the isolated truncation error in the DGSEM can be expressed for any basis function \(\phi \) in an element e as

$$\begin{aligned} {\hat{\tau }}^N_P \bigr |_{{\varOmega }^e} = \hat{{\mathcal {R}}} ({\mathbf {I}}^N \bar{{\mathbf {q}}}^P) = \int ^N_{{\varOmega }^e} {\mathbf {s}}^N \phi d{\varOmega } + \int ^N_{{\varOmega }^e} {\mathscr {F}}^N (\bar{{\mathbf {q}}}^P) \cdot \nabla \phi d {\varOmega } - \int ^N_{\partial {\varOmega }^e} {\mathscr {F}}^N (\bar{{\mathbf {q}}}^P) \cdot {\mathbf {n}} \phi d \sigma ,\nonumber \\ \end{aligned}$$
(46)

In this case, instead of the exact solution to the problem, \(\bar{{\mathbf {q}}}\), we use a solution on a higher order mesh, \(\bar{{\mathbf {q}}}^P\). Therefore, using the definition of interpolation error (Eq. 16) and discretization error (Eq. 20), the flux is

$$\begin{aligned} {\mathscr {F}}^N = {\mathbf {I}}^N {\mathscr {F}}(\bar{{\mathbf {q}}}^P) = {\mathscr {F}}(\bar{{\mathbf {q}}}^P) - \varepsilon ^N_{{\mathscr {F}}} = {\mathscr {F}}(\bar{{\mathbf {q}}}) + \frac{\partial {\mathscr {F}}}{\partial {\mathbf {q}}} \biggr |_{\bar{{\mathbf {q}}}} {\epsilon ^P} - \varepsilon ^N_{{\mathscr {F}}} + {\mathcal {O}} \left( {(\epsilon ^P)^2} \right) , \end{aligned}$$
(47)

and the source term is

$$\begin{aligned} {\mathbf {s}}^N = {\mathbf {I}}^N {\mathbf {s}} = {\mathbf {s}} - \varepsilon ^N_{{\mathbf {s}}}. \end{aligned}$$
(48)

Inserting Eqs. 47 and 48 into 46, and integrating by parts we obtain

$$\begin{aligned} {\hat{\tau }}_{P}^{N} \biggr |_{{\varOmega }^e} = \left( \nabla \cdot \varepsilon ^{N}_{{\mathscr {F}}} , \phi \right) ^{N}_{{\varOmega }^e} + \left( \nabla \cdot \frac{\partial {\mathscr {F}}}{\partial {\mathbf {q}}} \biggr |_{\bar{{\mathbf {q}}}} \epsilon ^{P} , \phi \right) ^{N}_{{\varOmega }^e} + {\mathcal {O}} \left( (\epsilon ^{P})^2 \right) + {\mathcal {O}} \left( e_{\int }^{N} \right) . \end{aligned}$$
(49)

Let us note that although the isolated truncation error of an element does not depend on external sources, its approximation by \(\tau \)-estimation is affected by the discretization error of the reference mesh, \(\epsilon ^{P}\). This translates into a weak influence of external (upwind) errors transmitted through the Riemann solver. In the two-dimensional case and coarsening in only one direction [here the direction (1)], Eq. 49 becomes

$$\begin{aligned} {\hat{\tau }}_{P_1P_2}^{N_1P_2} \biggr |_{{\varOmega }^e}= & {} \left( \nabla \cdot \varepsilon ^{N_1P_2}_{{\mathscr {F}}} , \phi \right) ^{N_1P_2}_{{\varOmega }^e} + \left( \nabla \cdot \frac{\partial {\mathscr {F}}}{\partial {\mathbf {q}}} \biggr |_{\bar{{\mathbf {q}}}} \epsilon ^{P_1P_2} , \phi \right) ^{N_1P_2}_{{\varOmega }^e} \nonumber \\&+\, {\mathcal {O}} \left( \left( \epsilon ^{P_1P_2}\right) ^2 \right) +\,\, {\mathcal {O}} \left( e_{\int }^{N_1P_2} \right) . \end{aligned}$$
(50)

Now, we rewrite Eq. 50 decoupling the interpolation error in directional components and taking into account that \(\varepsilon _2^{N_1P_2} = \varepsilon _2^{P_1P_2}\) (Eq. 18):

$$\begin{aligned} {\hat{\tau }}_{P_1P_2}^{N_1P_2}= & {} \left( \nabla \cdot \varepsilon ^{N_1P_2}_{{\mathscr {F}},1} , \phi \right) ^{N_1P_2}_{{\varOmega }^e} + \left( \nabla \cdot \varepsilon ^{P_1P_2}_{{\mathscr {F}},2} , \phi \right) ^{N_1P_2}_{{\varOmega }^e} \nonumber \\&+ \left( \nabla \cdot \frac{\partial {\mathscr {F}}}{\partial {\mathbf {q}}} \biggr |_{\bar{{\mathbf {q}}}} \epsilon ^{P_1P_2} , \phi \right) ^{N_1P_2}_{{\varOmega }^e} + {\mathcal {O}} \left( \left( \epsilon ^{P_1P_2}\right) ^2 \right) + {\mathcal {O}} \left( e_{\int }^{N_1P_2} \right) . \end{aligned}$$
(51)

Notice that all terms on the right-hand side, except for the first one and the quadrature error, are of the order of errors on the higher-order mesh. If the solution is smooth, the discretization and interpolation errors on the high order mesh of order P are smaller than the errors on the analyzed mesh N. Therefore, and taking into account that we are coarsening in the direction (1), for sufficiently smooth solutions we can expect the first term on the right-hand side to be the leading term. Simplifying, the directional \({\hat{\tau }}\)-estimation provides

$$\begin{aligned} {\hat{\tau }}_{P_1P_2}^{N_1P_2} \approx \left( \nabla \cdot \varepsilon ^{N_1P_2}_{{\mathscr {F}},1} , \phi \right) ^{N_1P_2}_{{\varOmega }^e}. \end{aligned}$$
(52)

On the other hand, inserting Eq. 18 into 38, the isolated truncation error of a representation of order \(N=(N_1,N_2)\) yields

$$\begin{aligned} {\hat{\tau }}^{N_1N_2} \bigr |_{{\varOmega }^e} \approx \sum _{i=1}^d \left( \nabla \cdot \varepsilon ^{N_1N_2}_{{\mathscr {F}},i} , \phi \right) ^{N_iN_j}_{{\varOmega }^e}. \end{aligned}$$
(53)

Notice, again, that the directional components of the interpolation error only depend on the polynomial order in the corresponding direction (Eq. 18). Therefore, neglecting additional quadrature errors, we recover Eq. 45 for the isolated truncation error by combining Eqs. 52 and 53:

$$\begin{aligned} {\hat{\tau }}^{N_1N_2} \approx {\hat{\tau }}^{N_1P_2}_{P_1P_2} + {\hat{\tau }}^{P_1N_2}_{P_1P_2}. \end{aligned}$$
(54)

\(\square \)

From the previous analysis we can conclude that, when the \(\tau \)-estimation method is performed coarsening only in the direction i, the result is an approximation to the i-directional component of the truncation error, \(\tau _i\). We can also arrive at this conclusion intuitively if we realize that \({\mathbf {Q}}^{P_1P_2}\) cannot be better than \({\mathbf {Q}}^{N_1P_2}\) at describing the solution in the direction (2).

Proposition 1 can be easily generalized to three dimensions to obtain

$$\begin{aligned} \tau ^{N_1N_2N_3}&\approx \tau _1^{N_1N_2N_3} + \tau _2^{N_1N_2N_3} + \tau _3^{N_1N_2N_3} \\ \tau ^{N_1N_2N_3}&\approx \tau _{P_1P_2P_3}^{N_1P_2P_3} + \tau _{P_1P_2P_3}^{P_1N_2P_3} + \tau _{P_1P_2P_3}^{P_1P_2N_3}. \end{aligned}$$

3.2 Convergence Behavior of the Anisotropic Truncation Error

In this section we analyze the convergence properties of the truncation error map using Proposition 1. Let us first consider the directional components of the truncation error.

Proposition 2

The directional components of the locally-generated truncation error exhibit spectral convergence with respect to the polynomial order in the corresponding direction:

$$\begin{aligned} \left|\left|\tau _{{\varOmega }^e,i}\right|\right|_{\infty } \le C^e_{i} e^{-N^e_{i} \eta ^e_{i}} \end{aligned}$$
(55)

Proof

According to assumption (b) (Eq. 44), each directional component of the locally-generated truncation error, \(\tau _{{\varOmega },i}\), depends solely on the polynomial order in the corresponding direction, \(N_i\). If we insert Eq. 44 into Eq. 39 and analyze the dependencies term by term, we recover 55 for the isolated truncation error. In the same way, if we insert Eq. 44 into 34, we recover 55 for the non-isolated truncation error. \(\square \)

Now, we are able to analyze the convergence behavior along lines of the truncation error map, where a line in d dimensions is defined as:

$$\begin{aligned} a_1N_1+a_2N_2+\cdots +a_dN_d=b, \end{aligned}$$
(56)

with \(a_i,b \in \mathbb {R}\).

Proposition 3

The total truncation error does not necessarily decrease exponentially along lines of the truncation error map.

Proof

The corresponding positive statement can be easily proven wrong with a counterexample. Let us consider a 2D anisotropic representation. From Proposition 2, we know that the truncation error of each directional component in an element, \(\tau _i^N\), decreases exponentially when increasing \(N_i\); and that the decreasing rate is \(\eta _i\), a constant that depends on the smoothness of the solution in the direction i. Let us suppose that for a certain element in a mesh, the directional components of the error have the same value for a specific combination of polynomial orders \(({\bar{N}}_1, {\bar{N}}_2)\) in the infinity norm:

$$\begin{aligned} \left|\left|\tau _1^{{\bar{N}}_1{\bar{N}}_2}\right|\right|_{\infty } = \left|\left|\tau _2^{{\bar{N}}_1{\bar{N}}_2}\right|\right|_{\infty } = C. \end{aligned}$$
(57)

Let us analyze the convergence rate along an iso-\(N_i\) line of the truncation error map with constant \(N_1 = {\bar{N}}_1\), i.e. the convergence rate of \(\tau ^{{\bar{N}}_1N_2}\) as a function of \(N_2\). Note that, according to assumption (b), along the line we have

$$\begin{aligned} \tau _1^{{\bar{N}}_1N_2}&\approx \tau _1^{{\bar{N}}_1 {\bar{N}}_2} \nonumber \\ \left|\left|\tau _1^{{\bar{N}}_1N_2}\right|\right|_{\infty }&\approx \left|\left|\tau _1^{{\bar{N}}_1 {\bar{N}}_2}\right|\right|_{\infty } = C. \end{aligned}$$
(58)

Furthermore, assumption (a) states that the total truncation error along the line of the map is:

$$\begin{aligned} \tau ^{{\bar{N}}_1N_2} \approx \tau _1^{{\bar{N}}_1N_2} + \tau _2^{{\bar{N}}_1N_2}. \end{aligned}$$
(59)

Substituting Eq. 58 into 59 and using the triangle inequality yields:

$$\begin{aligned} \left|\left|\tau ^{{\bar{N}}_1N_2}\right|\right|_{\infty } \le C + \left|\left|\tau _2^{{\bar{N}}_1N_2}\right|\right|_{\infty }. \end{aligned}$$
(60)

Remember that the truncation error map is defined as the dependence of \(\log \left|\left|\tau ^{N_1N_2}\right|\right|_{\infty }\) on \((N_1,N_2)\) (Definition 6). Therefore, taking logarithms in both sides and rearranging, Eq. 60 can be rewritten in two equivalent forms:

$$\begin{aligned}&\mathrm{i)} \log \left|\left|\tau ^{{\bar{N}}_1N_2}\right|\right|_{\infty } \le \log \left|\left|\tau _2^{{\bar{N}}_1N_2}\right|\right|_{\infty } + \log \left( 1 + \frac{ C }{\left|\left|\tau _2^{{\bar{N}}_1N_2}\right|\right|_{\infty } } \right) , \end{aligned}$$
(61)
$$\begin{aligned}&\mathrm{ii)} \log \left|\left|\tau ^{{\bar{N}}_1N_2}\right|\right|_{\infty } \le \log (C) + \log \left( 1 + \frac{ \left|\left|\tau _2^{{\bar{N}}_1N_2}\right|\right|_{\infty } }{ C } \right) . \end{aligned}$$
(62)

For \(N_2 \ll {\bar{N}}_2\), the second term on the right-hand side of Eq. 61 vanishes, which indicates that the convergence rate of the truncation error along an iso-\(N_i\) line of constant \(N_1 = {\bar{N}}_1\) tends to \(\eta _2\). On the other hand, for \(N_2 \gg {\bar{N}}_2\), the second term on the right-hand side of Eq. 62 vanishes, which implies that the convergence rate along an iso-\(N_i\) line of constant \(N_1 = {\bar{N}}_1\) tends to zero, since the truncation error is bounded by \(\log (C)\), a constant that does not depend on \(N_2\). In other words, the iso-\(N_i\) line on the hyperplane for \(N_1={\bar{N}}_1\) is not a straight line. \(\square \)

3.3 High-Order Extrapolation of the Truncation Error Estimations

In this section, we present a procedure for extrapolating the truncation error estimations (inner map) that can be obtained by applying Proposition 1. Since Proposition 3 rules out the possibility of extrapolating along iso-\(N_i\) lines of the truncation error map, we take advantage of the anisotropic behavior of the truncation error (Eq. 43) and the spectral convergence of its directional components (Proposition 2). The proposed methodology, which is valid for both the isolated and non-isolated truncation error, can be summarized in three steps:

  1. 1.

    Perform anisotropic coarsening to obtain \(\tau _i\) (Proposition 1) and construct the inner truncation error map directly. In d dimensions, this requires only \(n^{new}_{eval}\) evaluations of the discrete partial differential operator \({\mathcal {R}}^N\), where

    $$\begin{aligned} n^{new}_{eval} = \sum _{i=1}^d (P_i-1). \end{aligned}$$
    (63)
  2. 2.

    Compute \(\log \left|\left|\tau _i\right|\right|_{\infty }\) and perform a linear regression analysis in the direction i in order to describe the behavior of \(\log \left|\left|\tau _i\right|\right|_{\infty }\) as a function of \(N_i\). This is supported on the proved spectral behavior of the directional components of the truncation error (Proposition 2).

  3. 3.

    Construct the outer truncation error map using Eq. 45 and the extrapolated values of \(\log \left|\left|\tau _i\right|\right|_{\infty }\):

    $$\begin{aligned} \log \left|\left|\tau \right|\right|_{\infty } = \log \left|\left|\sum _{i=1}^d \tau _i\right|\right|_{\infty }. \end{aligned}$$
    (64)

We refer to this methodology as high-order extrapolation since it does not suppose that \(\log \left|\left|\tau \right|\right|_{\infty }\) has a linear behavior. On the contrary, it only supposes (based on the Proposition 2) that \(\log \left|\left|\tau _i\right|\right|_{\infty }\) is linear. An example is provided in Sect. 4.

3.4 Theoretical Comparison of the New Anisotropic \(\tau \)-Estimation with Previous Approaches

Figure 3a illustrates the theoretically predicted behavior of the truncation error map that is obtained with the new anisotropic \(\tau \)-estimation method for a toy problem (only illustrative). As noted in the proof of Proposition 3, along an iso-\(N_i\) line, the truncation error firstly decays exponentially for low \(N_{j \ne i}\) and then tends asymptotically to a constant value for high \(N_{j \ne i}\). As can be seen, contrary to the low-order extrapolation, the new anisotropic \(\tau \)-estimation does not assume that the truncation error map has a linear behavior. That is the reason why it is called high-order extrapolation. Figure 3b shows a comparison of the hyperplane behavior with the one obtained using the new anisotropic \(\tau \)-estimation method. As can be seen, the hyperplane tends to underpredict the truncation error for some combinations of polynomial orders as compared to the new truncation error estimator. A comparison of the output of both estimation methods with the exact truncation error in a test case is provided in Sect. 4.2.

Fig. 3
figure 3

Spatial representation of two-dimensional anisotropic truncation error maps. a Behavior predicted by the new anisotropic \(\tau \)-estimation method. b Hyperplane behavior (Fig. 2) overlapped with the values predicted by the new anisotropic \(\tau \)-estimation method

It is noteworthy that even though the method of Kompenhans et al. [19] supposes hyperplane behavior, their strategy of selecting the polynomial order in every direction independently (step 4 of Sect. 2.4) minimizes the error involved in the low-order extrapolation (compare the values of \(\tau \) in Figs. 3a and 2). Furthermore, the authors remark that for \(N_1 \gg N_2\) and \(N_2 \gg N_1\) the new anisotropic estimation tends to have a hyperplane behavior. In fact, Kompenhans et al. [19, Sect. 5.1] state that only the values of the truncation error where \(N_1 \gg N_2\) or \(N_2 \gg N_1\) should be used for the least square fitting. The high-order extrapolation can be seen as a form of bypassing this requirement.

In summary, the main differences between the method of Kompenhans et al. with low-order extrapolation and the new p-anisotropic error estimator with high-order extrapolation are the following:

  • The number of lower-order representations that are needed for generating the inner truncation error map (also, the number of evaluations of the discrete partial differential operator—\({\mathcal {R}}^N\)) in the method of Kompenhans et al. is

    $$\begin{aligned} n_{eval} = \prod _{i=1}^d (P_i-1), \end{aligned}$$
    (65)

    because the solution on the reference mesh must be injected in every single representation of the inner map; whereas in the new p-anisotropic error estimator it is only

    $$\begin{aligned} n_{eval}^{new} = \sum _{i=1}^d (P_i-1), \end{aligned}$$
    (66)

    since only some lower-order representations are needed (Eq. 45).

  • The high-order extrapolation method based on the directional components of the truncation error can provide more accurate estimations of the outer truncation error map for smooth solutions than the low-order extrapolation, which supposes hyperplane behavior. The reason is that, while the high-order extrapolation relies on the spectral convergence of the directional components of the truncation error (see Proposition 2), we already proved that the truncation error map does not have a hyperplane behavior (Proposition 3). As will be seen in Sect. 4, sometimes the low-order extrapolation can be as accurate as its high-order counterpart in some regions of the truncation error map. However, this is highly dependent on the PDE behavior and the retained tessellation (mesh).

  • The price that must be paid for fewer evaluations of the discrete partial differential operator (Eqs. 65 and 66) is a slightly decreased accuracy in the inner truncation error map when using the p-anisotropic error estimator proposed in this paper. The reason is that the \(\tau \)-estimation procedure involves a small error that depends on the discretization and/or interpolation errors on the reference mesh (see Eq. 49 for the isolated truncation error and Eq. 82 for the non-isolated truncation error). When the truncation error is \(\tau \)-estimated for every single combination of polynomial orders (as in Kompenhans et al. [19]), this small error is only added once to the estimated value, whereas it is added d times when using the new p-anisotropic estimator (where d is the number of dimensions of the problem).

3.5 Truncation Error Estimation Under High-Order Mappings

Since in the DGSEM the order of the numerical quadrature is equal to the order of approximation, in order for the method to be free-stream (or constant state) preserving [22], the order of the mapping in every direction (\(M_i\) in Eq. 11) must be at most the order of the DG representation in that same direction, \(N_i\) [22] (isoparametric mappings). For this reason, the lower-order meshes used for estimating the truncation error must be constructed with a lower-order mapping, if we want them to be free-stream preserving. This causes an additional geometry representation error that is quantified in our truncation error estimate. The presented method is still consistent for p-adaptation purposes since the additional geometry representation error would also be present in the p-adapted meshes.

3.6 Truncation Error Estimation When Not in the Asymptotic Regime

As has been pointed out before, the spectral convergence can only be expected when in the asymptotic regime. If the solution is not smooth enough for the analyzed polynomial orders or the selected mesh size, the errors are not expected to decrease exponentially fast when the polynomial order is increased. This is the case when shocks or any other kind of singularities are present in the solution. Under these circumstances, the characteristic negative slope of Fig. 1a may not be observed for the directional components of the truncation error. A positive slope or a very low coefficient of determination in the linear regression, \(R^2\), are signs that the analyzed element is not in the asymptotic regime, and can be used as an indication that h- or r-adaptation should be performed. In such cases and for these particular elements a warning is issued by the solver.

4 Validation of the Anisotropic \(\tau \)-Estimation Method

The compressible Navier–Stokes equations can be written in conservative form (see “Appendix C”) and discretized using the DGSEM, as explained in Sect. 2.1. In order to test the accuracy of the proposed \(\tau \)-estimation method, a 2D manufactured solutions test case is analyzed. The exact solution selected for the problem is

$$\begin{aligned} \rho&= p = e^{-5 \left( 4\left( x-\frac{1}{2}\right) ^2 + \left( y-\frac{1}{2}\right) ^2 \right) } + 1, \nonumber \\ u&= v = 1, \end{aligned}$$
(67)

which is simulated in the unit square, as depicted in Fig. 4. Inserting Eq. 67 into 86, the source term for the 2D compressible Navier–Stokes equations yields

$$\begin{aligned} {\mathbf {s}} = \begin{bmatrix} s_{\rho } \\ s_{\rho u} \\ s_{\rho v} \\ s_{\rho e} \end{bmatrix} = \begin{bmatrix} 40 \left( x-\frac{1}{2}\right) + 10 \left( y-\frac{1}{2}\right) \\ 80 \left( x-\frac{1}{2}\right) + 10 \left( y-\frac{1}{2}\right) \\ 40 \left( x-\frac{1}{2}\right) + 20 \left( y-\frac{1}{2}\right) \\ \left[ 40 \left( x-\frac{1}{2}\right) + 10 \left( y-\frac{1}{2}\right) \right] \left[ \frac{1}{\gamma -1}+2\right] \end{bmatrix} e^{5 \left( 4 (x-\frac{1}{2})^2+(y-\frac{1}{2})^2\right) }. \end{aligned}$$
(68)
Fig. 4
figure 4

Density (\(\rho \)) contours for the proposed manufactured solutions test case

The main interest is to validate the proposed error estimator and compare its outcome with previous works. Since the method of Kompenhans et al. [19] explained in Sect. 2.4 was formulated and used with the non-isolated truncation error, the results that are shown in Sects. 4.1 and 4.2 were obtained for the non-isolated truncation error estimator (\(\tau _P^N\)). However, similar results can be obtained for the isolated truncation error, since its maps exhibit the same behavior as the ones presented here. In addition, in Sect. 4.3 we compare the truncation error estimator with the isolated truncation error estimator when used for driving a p-adaptation procedure.

4.1 Truncation Error Maps and Number of Degrees of Freedom

A fully time-converged solution (\(||{\mathcal {R}}^P||_\infty <10^{-10}\)) of order 5 (\(P=P_1=P_2=5\)) is used to estimate the truncation error using the method of Sect. 3.1. The results for element A are depicted in Fig. 5a. Figure 5b shows the exact truncation error. It can be seen that the proposed method predicts a truncation error map that is very similar to the exact one, even for extrapolated values. Hence, in agreement with the obtained results, the assumptions of Sect. 3.1 are reasonable. These maps can be used for selecting an appropriate combination of polynomial orders such that a maximum truncation error \(\tau _{max}\) is achieved employing a minimum number of degrees of freedom.

Figure 6 shows the map of the number degrees of freedom (DOFs) for every (\(N_1\),\(N_2\))-combination. The polynomial orders that achieve a truncation error \(\tau <\tau _{max}\) are marked with black squares. Let us remark that, although these results are not exactly the same for the estimated and exact truncation error maps, they are very similar. Therefore, we conclude that the proposed estimation method may be used for adaptation purposes. Notice that there are many alternatives that produce a truncation error in the desired range, but there is only one that minimizes the number of degrees of freedom and, therefore, the computational cost.

Fig. 5
figure 5

Truncation error maps for element A (logarithmic scale). a Estimated \(\left|\left|\tau ^{N_1N_2}_{5,5}\right|\right|_{\infty }\) (the black box shows the limit between inner and outer maps). b Exact truncation error, \(\left|\left|\tau ^N\right|\right|_{\infty }\)

Fig. 6
figure 6

Contour of the number of degrees of freedom for every polynomial order considered for performing p-adaptation. The combinations \((N_1,N_2)\) that fulfill the \(\tau _{max}\) threshold are marked with black squares. a\(\tau _{max}=10^{-4}\) (estimation). b\(\tau _{max}=10^{-4}\) (exact). c\(\tau _{max}=10^{-5}\) (estimation). d\(\tau _{max}=10^{-5}\) (exact)

4.2 Comparison with Previous Methodologies

Figure 7 shows the 3D representation of the exact truncation error map (a), the one obtained with the high-order extrapolation (b), and the one obtained with the low-order extrapolation (c)—here, we illustrate the complete hyperplane. The maps were generated with the same fully time-converged solution of order \(P_1=P_2=5\). As can be seen, the truncation error map generated with the high-order extrapolation bears close resemblance to the exact one, whereas the hyperplane underpredicts the truncation error in some regions, as anticipated in Sect. 3.4.

Fig. 7
figure 7

Spatial representation of two-dimensional anisotropic truncation error maps for the manufactured solutions test case. a Exact truncation error map. b New anisotropic \(\tau \)-estimation method with high-order extrapolation. c Conventional \(\tau \)-estimation with low-order extrapolation (complete hyperplane). d Overlapped surfaces

If we generate the truncation error map using the method of Kompenhans et al. [19] (Sect. 2.4), we obtain Fig. 8. We remark that although the method of Kompenhans et al. produces accurate results for \(N_i<P\), it fails to predict the behavior of the truncation error for \(N_i \ge P\). In fact, using this method the full truncation error map is not being generated, but only the extrapolations for the iso-\(N_i\) lines \(N_1 = P_1-1\) and \(N_2=P_2-1\).

Fig. 8
figure 8

Truncation error map (\(\left|\left|\tau ^N_5\right|\right|_{\infty }\)) estimated using the model of Kompenhans et al. [19] (logarithmic scale). Outside the black box are the extrapolated values of the estimated truncation error (Color figure online)

Fig. 9
figure 9

Truncation error estimation for \(N_2=4\) in element A (dotted line of Fig. 8). a Estimated \(\tau _1\), \(\tau _2\) and \(\tau _{5,5}^{Nx,4}\) with \(P_1=P_2=5\) (proposed anisotropic model). b Comparison with values obtained using the model of Kompenhans et al. [19]

Fig. 10
figure 10

Truncation error estimation for \(N_1=4\) in element A (dashed line of Fig. 8). a Estimated \(\tau _1\), \(\tau _2\) and \(\tau _{5,5}^{4,Ny}\) with \(P_1=P_2=5\) (proposed anisotropic model). b Comparison with values obtained using the model of Kompenhans et al. [19]

A close inspection of the values of the truncation error for a fixed polynomial order (dashed and dotted lines of Fig. 8) can reveal details about the extrapolated map. Let us first analyze the truncation error for a fixed \(N_2=4\). In Fig. 9a we illustrate how \(\tau _{5,5}^{N_1,4}\) is obtained using the new methodology of Sect. 3.1: the anisotropic contributions of the truncation error, \(\tau _1\) and \(\tau _2\), are used to generate independent trend lines and their values are then used to compute \(\tau _{5,5}^{N_1,4}\). Figure 9b shows a comparison of this result with the exact truncation error and the one obtained using the method of Kompenhans et al.. It is remarkable that spectral convergence can be observed and both error estimators predict it.

Now, let us analyze the case of a fixed \(N_1=4\). Figure 10a illustrates how \(\tau _{5,5}^{4,N_2}\) is obtained. Notice how, in this case, for \(N_2 \ge 3\) a stagnation in the decreasing rate of the truncation error occurs because

$$\begin{aligned} \left|\left|\tau _2 (N_2 \ge 3)\right|\right|_{\infty } \le \left|\left|\tau _1(N_1=4)\right|\right|_{\infty }. \end{aligned}$$
(69)

Figure 10b shows a comparison of this result with the exact truncation error and the truncation error estimated using the method of Kompenhans et al.. Let us note that the exact truncation error also exhibits the stagnation behavior for \(N_2 \ge 3\), but a linear extrapolation of the values of \(\tau \) would under-predict the truncation error for \(N_2>4\). The reason is that spectral convergence can be expected for the decoupled terms (\(\tau _i\)), but not necessarily for the total truncation error along iso-\(N_i\) lines of the truncation error map (Propositions 2 and 3). In this particular case, it is evidenced that when the assumptions of Remark 1 are violated, the error is underestimated in the outer truncation error map. This simple example shows how the anisotropic error estimator formulated in this paper can generate more accurate representations of the truncation error map for \(N_i \ge P_i\) than previous estimators.

4.3 p-Anisotropic Adaptation Based on the Proposed Non-isolated and Isolated Truncation Error Estimators

As was discussed above, both the non-isolated and the isolated truncation error can be approximated using the anisotropic method introduced in this paper. In this section, we analyze how both estimators perform with the new anisotropic approximation when driving a p-adaptation procedure. The fully converged solution of order \(P_1=P_2=5\) is used as the reference mesh for the anisotropic \(\tau \)-estimation procedure with high-order extrapolation explained in Sect. 3.3. Different truncation error thresholds are set as the target of the p-adaptation procedure in the range \(10^{-7} \le \tau _{max} < 10^{-1}\), and the polynomial order is selected after the estimation so that the number of degrees of freedom is minimized (see Fig. 6). The maximum polynomial order allowed in any direction is selected as \(N_{max}=10\), and the minimum polynomial order as \(N_{min}=1\).

Figure 11a shows the non-isolated truncation error that was achieved after the mesh adaptation as a function of the specified threshold (\(\tau _{max}\)), and Fig. 11(b) illustrates the isolated truncation error that was achieved for different values of \(\tau _{max}\). Two plateaux can be observed in both figures, one for \(\tau _{max} \le 10^{-5}\) and one for \(\tau _{max} \ge 6 \times 10^{-3}\) as a consequence of the limiting polynomial orders. The first plateau corresponds to the minimum \(||\tau ||_{\infty }\) (and \(||{\hat{\tau }}||_{\infty }\)) that can be achieved when \(N_1=N_2=N_{max}=10\), and the second corresponds to the maximum \(||\tau ||_{\infty }\) (and \(||{\hat{\tau }}||_{\infty }\)) that can be achieved when \(N_1=N_2=N_{min}=1\) in every element. For the remaining specified thresholds both estimators perform reasonably well, being the isolated truncation error slightly better. The small gap between the ideal and achieved errors is attributed to small errors in the estimation procedure.

Fig. 11
figure 11

Exact values of the achieved errors after the anisotropic p-adaptation based on non-isolated and isolated truncation error estimators with \(N_{min}=1\) and \(N_{max}=10\). a Achieved non-isolated truncation error. b Achieved isolated truncation error

As these results show, controlling the isolated truncation error of a mesh also controls its non-isolated truncation error: a further advantage of the isolated estimator. In fact, we can write the non-isolated truncation error in terms of the isolated truncation error from the definitions in Sect. 2.2, and “Appendixes A and B”:

$$\begin{aligned} \tau ^N = {\hat{\tau }}^N + \int ^N_{\partial {\varOmega }} \left( {\mathscr {F}}\left( {\mathbf {I}}^N \bar{{\mathbf {q}}}\right) \cdot {\mathbf {n}} - {\mathscr {F}}^{*}\left( {\mathbf {I}}^N \bar{{\mathbf {q}}},{\mathbf {I}}^N \bar{{\mathbf {q}}}^{\underline{\ }},{\mathbf {n}}\right) \right) \phi d \sigma . \end{aligned}$$
(70)

Equation 70 suggests that the isolated truncation error is expected to control the non-isolated truncation error for sufficiently smooth solutions, for an appropriate choice of the numerical flux. This topic will be addressed in detail in future investigations.

Taking into account that the main difference of the non-isolated truncation error is that it is affected by neighboring elements, we can conclude that the isolated estimator is a better driver for p-adaptation methods than the non-isolated truncation error estimator. Namely, because it would be excessively expensive to evaluate every possible combination of polynomial orders for each element of the mesh and its neighbors in order to feed the p-adaptation procedure.

4.4 Anisotropic Error Estimation Under High-Order Mappings

In this section, the accuracy of the proposed error estimator is tested for elements with curved faces and high-order geometry mappings. In order to do so, the same manufactured test case is analyzed in a mesh where all the element faces are sinusoidal functions (see Fig. 12). Following Eq. 11, the reference-to-physical mapping can be approximated with polynomials of order \(1 \le M_i\), where \(M_1=M_2=1\) means that the problem of Fig. 4 is recovered. For higher values of \(M_i\), the sinusoidal function is more accurately represented.

Fig. 12
figure 12

Density (\(\rho \)) contours for the proposed manufactured solutions test case with curved boundaries

As in Sect. 4.1, a fully converged solution on a reference mesh of order \(P_1=P_2=5\) is used to approximate the truncation error using the proposed estimator for \(1 \le N_i \le 7\), and the results are compared with the exact truncation error, which is obtained by injecting the exact solution to the problem (Eq. 67) in the different representations of the truncation error map. Figure 13 shows the estimated and exact truncation errors for element A along two iso-\(N_i\) lines, \(N_1=4\) and \(N_2=4\).

Fig. 13
figure 13

Anisotropic truncation error estimation under high-order mappings and comparison with the exact truncation error in element A for fixed \(N_1=4\) (a, c, e, g) and \(N_2=4\) (b, d, f, h)—logarithmic scale. a\(\tau _{5,5}^{4,N_2}\) and \(\tau ^{4,N_2}\) for \(M=2\). b\(\tau _{5,5}^{N_1,4}\) and \(\tau ^{N_2,4}\) for \(M=2\). c\(\tau _{5,5}^{4,N_2}\) and \(\tau ^{4,N_2}\) for \(M=3\). d\(\tau _{5,5}^{N_1,4}\) and \(\tau ^{N_2,4}\) for \(M=3\). e\(\tau _{5,5}^{4,N_2}\) and \(\tau ^{4,N_2}\) for \(M=4\). f\(\tau _{5,5}^{N_1,4}\) and \(\tau ^{N_2,4}\) for \(M=4\). g\(\tau _{5,5}^{4,N_2}\) and \(\tau ^{4,N_2}\) for \(M=5\). h\(\tau _{5,5}^{N_1,4}\) and \(\tau ^{N_2,4}\) for \(M=5\)

Let us now note that, in order to generate the truncation error map with the method of Sect. 3.3 and a reference solution of order \(P_1=P_2=5\), it is necessary to generate eight additional low-order representations to estimate the error. Furthermore, as was discussed in Sect. 3.5, a DGSEM representation must have \(M_i \le N_i\) to be free-stream preserving [22]. Therefore, for certain values of M, it is possible that the low-order representations require reduced order mappings. For the sake of exposition, Table 1 shows the allowable mapping orders when the geometry is represented with a fourth order polynomial, \(M_1=M_2=4\). As can be seen, only two of the lower-order representations [(5, 4) and (4, 5)] can retain the specified high-order mapping. This could be regarded as a limitation, but, as we will show, it does not pose a problem for the truncation error estimation.

Two important conclusions can be drawn from Fig. 13. First, that the truncation error is higher for higher-order mappings (compare with Figs. 9 and 10). This is consistent with the results reported by Botti [4], where the convergence deteriorates when the mapping order is increased. In the analyzed case, it can be seen that the y-component of the truncation error, \(\tau _2\), is specially dependent on the mapping order for element A. Second, it is shown that the proposed error estimator correlates well with the exact truncation error for the different mapping orders in spite of the apparent limitation shown in Table 1. In fact, a new stagnation in the truncation error is successfully predicted for \(N_1 \ge 5\) when \(M \ge 4\). As mentioned in Sect. 3.5, the extra geometry representation error contained in the lower-order representations is also present in the meshes where the exact truncation error is evaluated.

The accuracy of the DGSEM deteriorates when the mapping order is increased. However, our estimation method still predicts the truncation error (which includes geometrically induced errors) accurately.

5 Conclusions

In this paper, we have studied truncation error estimators, their convergence properties and accuracy. The most important conclusions of this work are:

Table 1 Allowable mapping orders for all the representations needed in an anisotropic error estimation. \(P_1=P_2=5\) and \(M_1=M_2=4\)
  1. 1.

    A new technique for evaluating the truncation error was developed which requires less computational resources in the estimation procedure than previous implementations. Furthermore, this technique allows computing extrapolations of the truncation error with enhanced accuracy compared with previous methods. This enables using coarser reference meshes, hence further improving the computational efficiency.

  2. 2.

    The presented method provides truncation error estimations that are accurate enough for performing p-adaptation, as shown in Sects. 4.1 and 4.3.

  3. 3.

    According to the analyses conducted in this paper, the isolated truncation error is better suited to drive a p-adaptation procedure than its non-isolated counterpart. In the first place, because the non-isolated error is affected by the discretization in other regions. Second, and as stated in Remark 2, the non-isolated truncation error estimator imposes certain requirements for the extrapolation procedure to work well. This translates into a more expensive \(\tau \)-estimation. Furthermore, additional requirements are needed in order for Proposition 1 to hold with the non-isolated truncation error.

  4. 4.

    The method of Kompenhans et al. [19], in which every combination of \(N = (N_1,N_2,\ldots ,N_d)\) is directly evaluated for generating the truncation error map, performs slightly better at estimating the truncation error for \(N_i<P_i\) than the proposed error estimator, but fails to predict the truncation error for \(N_i \ge P_i\) accurately. A good compromise could be to generate the truncation error map for \(N_i<P\) using the method of Kompenhans et al., but then changing to the fully decoupled method for generating the extrapolated map. In this case, however, additional evaluations of the discrete partial differential operator must be performed.