1 Introduction

For non-linear hyperbolic problems, such as the compressible Euler equations, there are two major sources of instabilities when applying discontinuous Galerkin (DG) methods as a high-order spatial discretization. (i) Aliasing is caused by under-resolution of, e.g., turbulent vortical structures and can lead to instabilities that may even crash the code. As a cure, de-aliasing mechanisms are introduced in the DG methodology based on, e.g., filtering [29, 30], polynomial de-aliasing [35, 36, 57] or analytical integration [23, 31], split forms of the non-linear terms that for instance preserve kinetic energy [17, 22, 26, 61], and entropy stability [3, 5,6,7, 19, 21, 25, 42,43,44,45,46, 60]. (ii) The second major source of instabilities is the Gibbs phenomenon, i.e., oscillations at discontinuities. It is well known that solutions of non-linear hyperbolic problems may develop discontinuities in finite time, so-called shocks. While aliasing issues can be mostly attributed to variational crimes, i.e., a bad design and implementation of the numerical discretization with simplifications that affects aliasing (e.g., collocation), oscillations at discontinuities have their root deeper in the innards of the high-order DG approach and are unfortunately an inherent property of the high-order polynomial approximation space. Oscillations are fatal when physical constraints and bounds on the solution exist that then break because of over- and undershoots, resulting in nonphysical solutions such as negative density or pressure.

In this work, we focus on a remedy for the second major stability issue, often referred to as shock capturing. There are many shock capturing approaches available in the DG literature, for instance based on slope limiters [10, 11, 40] or (H)WENO limiters [27, 50, 65], filtering [2], and artificial viscosity [9, 47]. Slope limiters or (H)WENO limiters are always applied in combination with troubled cell indicators that detect shocks and only flag the DG elements that are affected by oscillations. Only in these elements, the DG polynomial is replaced by an oscillation-free reconstruction using data from neighboring elements. Element-based slope limiting, e.g., with TVB limiters, is effective for low-order DG discretizations only, as its accuracy strongly degrades when increasing the polynomial order N, as in some sense, the size of the DG elements \(\Delta x\) gets larger and larger with higher polynomial degree N. The accuracy of the slope limiters is not based on the DG resolution \(\sim \frac{\Delta x}{N}\), but only on the element size \(\Delta x\). Considering that a finite volume (FV) discretization with high-order reconstructions and limiters typically resolve a shock within about 2–3 cells, the shock width for high-order DG schemes with large elements would be very wide when relying on element-based limited reconstructions. The same behavior is still an issue for high-order reconstruction-based limiters such as the (H)WENO methodology. While these formally use high-order reconstructions, its leading discretization parameter is still \(\Delta x\) and not \(\frac{\Delta x}{N}\), and hence, the shock width still scales with \(\Delta x\).

Sub-element resolution, i.e., a numerical shock width that scales proportional to \(\frac{\Delta x}{N}\), can be achieved with, e.g., artificial viscosity. The idea is to widen the discontinuity into a sharp, but smooth profile, such that high-order polynomials can resolve it. Again, some form of troubled cell indicator is introduced to not only flag the element that contains the shock (or that oscillates), but also determine the amount of necessary viscosity, e.g., based on local entropy production [66]. It is interesting that less viscosity is needed, i.e., the sharper shock profiles are possible, the higher the polynomial degree of the DG discretization. Shocks can be captured in a single DG element if the polynomial order is high enough [47]. An issue of artificial dissipation is that a high amount of artificial viscosity is needed for very strong shocks, which makes the overall discretization very stiff with a very small explicit time-step restriction. Local time-stepping can be used to reduce this issue [24] or specialized many stage Runge-Kutta schemes with optimized coefficients for strongly dissipative operators [32].

An alternative idea to achieve sub-element resolution is to actually replace the elements by sub-elements (lower order DG on finer grid) or maybe even FV subcells. A straight forward, maybe even a natural idea in the DG methodology is to use the hp-adaptivity, where the polynomial degree is reduced, and simultaneously, the grid resolution is increased close to discontinuities. When switching to the lowest order DG, i.e., a first-order DG, which is nothing but a first-order FV method, it is assumed that the inherent artificial dissipation of the first-order FV scheme is enough to clear all oscillations at even the strongest shocks. The low accuracy of the first-order FV method is compensated by a respective (very strong) increase in local grid resolution through the h-adaptivity. An obvious downside to the hp-adaptivity approach is the strong dynamic change of the approximation space during the simulation and the associated strong change of the underlying data structures.

Thus, as a simpler alternative, subcell-based FV discretizations with a first-order, second-order TVD, or high-order WENO reconstruction were introduced, e.g., in [13, 14, 56, 59, 62]. The idea is to completely switch the troubled DG element to a robust FV discretization on a fine subcell grid. This approach keeps the change of the data local to the affected DG element and helps to streamline the implementation. The robust and essential oscillation-free FV scheme on the finer subcell grid in the DG element is constructed based on the available DG data. This helps to keep the data structures feasible and reduces the shock capturing again to an element local technique instead of changing the global mesh topology and approximation space. Consequently, this again allows to combine the approach with the idea of a troubled cell mechanism to identify the oscillatory DG elements and replace the high-order DG update with the robust FV update. As noted, there are many different variants for the FV subcell scheme with the high-order WENO [13, 14, 56, 59, 62] variant being especially interesting, as it alleviates the “stress” on the troubled cell indicator. When accidentally switching the whole high-order DG element to the subcell FV scheme in smooth parts of the solution, accuracy may strongly degrade. A first-order FV scheme, even on the fine subcell grid, would wash away all fine structure details that the high-order DG approach simulated. Thus, from this point of view, a high-order subcell WENO FV scheme is highly desired in this context. A downside of a subcell WENO FV scheme is the non-locality of the data dependence due to the high-order reconstruction stencils. This is especially cumbersome close to the interface of the high-order DG elements, where the reconstruction stencils reach into the neighboring DG elements and thus fundamentally change the data dependency footprint of the resulting implementation, that consequently has a direct impact on the parallelization of the code.

In this paper, the goal is to augment a high-order DG method with sub-element shock capturing capabilities to allow the robust simulation of highly supersonic turbulent flows which feature strong shocks, as, e.g., in astrophysics, without changing the data dependency footprint. Instead of flagging an element and completely switching from the high-order DG scheme to the subcell FV scheme, we aim to smoothly combine different schemes in the flagged element. To achieve this, we first interpret the DG element as a collection of available mean value data. As depicted in Fig. 1, local reconstructions allow to define a hierarchy of approximation spaces, from pure piecewise constant approximations (subcell FV) up to a smooth global high-order polynomial (DG element), with all piecewise polynomial combinations (sub-element DG) in between. We then associate each possible approximation space with the corresponding FV or DG discretization to define a hierarchy of schemes that is available for the given collection of data.

Fig. 1
figure 1

Sketch of the main idea in a 1D setting. Starting with eight mean values (red), we interpret them as a collection of available data. We construct four different approximation spaces (blue): piecewise constant on a subcell grid, piecewise linear and piecewise cubic on a sub-element grid, and the full seventh-degree polynomial on the element

Instead of switching between these different schemes, we aim to smoothly blend them to achieve the highest possible accuracy in every DG element. Assuming that the first-order subcell FV approximation has enough inherent dissipation to capture shocks in an oscillation-free manner, the goal is to give the FV discretization a high enough weight at a shock and then smoothly transition to higher order (sub-element) DG away from the shock. In contrast to the common approaches, where one indicator is used for the whole DG element, we aim to introduce sub-element indicators that are adaptively adjusted inside the DG element. A difficulty that arises when using sub-element indicators and an adaptive blending approach is to retain conservation of the final discretization for arbitrary combinations of blending weights.

The final discretization is a blended scheme, where the weights of the different discretizations may vary inside the DG element. To demonstrate this idea, the resulting behavior of the new approach is depicted in Fig. 2 for the example of a Sedov blast wave in 2D. In this particular setup, we start with the eighth-order DG as our baseline high-order discretization. The gray grid lines indicate the eighth-order DG element borders. Re-interpreting the 2D eighth-order DG element as \(8^2\) mean value data, we can construct either a first-order FV scheme on \(8^2\) subcells, a fourth-order DG scheme on \(2^2\), or a second-order DG scheme on \(4^2\) sub-elements. The blending of the four available discretizations is visualized via a weighted blending factor (introduced in (57)) in Fig. 2 ranging from 1 (dark red, basically pure first-order FV) up to 8 (dark blue, basically pure eighth-order DG) and all combinations in between.

Fig. 2
figure 2

Visualization of the sub-element adaptive blending approach for the 2D Sedov blast wave, see Sect. 3 for a detailed discussion. The gray grid lines represent the eighth-order DG elements. The color represents the blending process, where dark red (value 1) corresponds to pure first-order FV and dark blue (value 8) corresponds to the pure eighth-order DG scheme, with all combination in between. Note that the plotted value is only for illustration and does not correspond to an actual mixed mathematical order of the final discretization. However, the value nicely illustrates how even inside a DG element, the discretization is adaptively adjusted

Clearly, the new approach adaptively changes on a sub-element level with a very localized low order near the shock front, while a substantial part of the high-order DG approximation is recovered away from the shock. We refer to the validation and application sections, Sects. 3 and 4, for a more detailed discussion.

The remainder of the paper is organized as follows: in Sect. 2, we introduce the numerical scheme with the blending of the different discretizations. Section 3 includes numerical validations and Sect. 4 shows an application of the presented approach with the conclusion given in the last section.

2 The Sub-element Adaptive Blending Approach

The derivations in Sects. 2.12.6 are done in 1D, where the domain \(\varOmega \) is divided into Q non-overlapping elements. Each element q with midpoint \(x_q\) and size \(\Delta x_q\) is mapped to the reference space as

$$\begin{aligned} x(\chi ) = x_q + \chi \,\Delta x_q\,,\quad \chi \in \left[ -\frac{1}{2},\frac{1}{2}\right] . \end{aligned}$$
(1)

Each element holds a total number of degrees of freedom (DOF) N, where we require \(N \in \{2^r,r\in \mathbb {N}\}\). For the FV method, the element is divided into N subcells of size \(\frac{\Delta x_q}{N}\) leading to a uniform grid with midpoints \(\mu _i\) and interfaces \( \mu _{i\pm \frac{1}{2}}\) in the reference space at

$$\begin{aligned} \mu _i = -\frac{1}{2} + \frac{i}{N} - \frac{1}{2\,N} \quad \text {and} \quad \mu _{i\pm \frac{1}{2}} = \mu _i \pm \frac{1}{2\,N},\quad i = 1,\cdots ,N. \end{aligned}$$
(2)

For the sub-element DG scheme of order \(n=2^r < N, r\in \mathbb {N}\), the element is divided into \(\frac{N}{n}\) uniform sub-elements of size \(\frac{n\Delta x_q}{N}\), and the mapping of each sub-element s to its (sub-)reference space reads as

$$\begin{aligned} \chi (\xi )_s^{\mathcal {O}(n)} = -\frac{1}{2} + \frac{s\,n}{N} - \frac{n}{2\,N} + \frac{n}{N}\xi , \quad s = 1,\cdots ,\frac{N}{n},\; \xi \in \left[ -\frac{1}{2},\frac{1}{2}\right] . \end{aligned}$$
(3)

Figure A1 in Appendix A provides a visual representation of the reference element and its hierarchical decomposition into sub-elements and subcells.

2.1 Finite Volume Method

Consider the general 1D conservation law

$$\begin{aligned} \partial _t u + \partial _x f(u) = 0. \end{aligned}$$
(4)

We approximate the exact solution u(x) in element q with N mean values:

$$\begin{aligned} \varvec{\bar{u}}_q = (\bar{u}_1,\cdots ,\bar{u}_N)_q^{\text {T}} \; \in \mathbb {R}^N, \end{aligned}$$
(5)

residing on the uniform subcell grid (2). Then, the 1D FV semi-discretization on subcell i reads

$$\begin{aligned} \big (\partial _t \bar{u}_{i}\big )_q = -\frac{N}{\Delta x_q} \, \Big (f^*\big ((\bar{u_{i}})_q,(\bar{u}_{i+1})_q\big ) - f^*\big ((\bar{u}_{i-1})_q,(\bar{u}_{i})_q\big )\Big ), \quad i \in 1,\cdots ,N, \end{aligned}$$
(6)

where \(f^*\) denotes a consistent numerical two-point flux. The adjacent values from neighboring elements \(q-1\) and \(q+1\) are given by \((\bar{u}_0)_q := (\bar{u}_N)_{q-1}\) and \((\bar{u}_{N+1})_q := (\bar{u}_1)_{q+1}\). We define the FV difference matrix

$$\begin{aligned} \varvec{\Delta }:= \begin{pmatrix} -1 &{} 1 &{} 0 &{} \cdots &{} 0 \\ 0 &{} -1 &{} 1 &{} \ddots &{} \vdots \\ \vdots &{} \ddots &{} \ddots &{} \ddots &{} 0 \\ 0 &{} \cdots &{} 0 &{} -1 &{} 1 \end{pmatrix} \in \mathbb {R}^{N \times (N+1)}, \end{aligned}$$
(7)

and rewrite (6) in compact matrix form

$$\begin{aligned} \partial _t \varvec{\bar{u}}_q = -\frac{N}{\Delta x_q} \, \varvec{\Delta }\,\varvec{f}_q^{*} \end{aligned}$$
(8)

with the numerical flux vector \(\varvec{f}_q^* \in \mathbb {R}^{N+1}\). For later use, we split \(\varvec{\Delta }\) into a volume and a surface operator:

$$\begin{aligned} \varvec{\Delta }= \varvec{\Delta }^{(\mathrm V)} + \varvec{\Delta }^{(\mathrm S)} = \begin{pmatrix} 0 &{} 1 &{} 0 &{} \cdots &{} 0 \\ 0 &{} -1 &{} 1 &{} \ddots &{} \vdots \\ \vdots &{} \ddots &{} \ddots &{} \ddots &{} 0 \\ 0 &{} \cdots &{} 0 &{} -1 &{} 0 \end{pmatrix} + \begin{pmatrix} -1 &{} 0 &{} 0 &{} \cdots &{} 0 \\ 0 &{} 0 &{} 0 &{} \ddots &{} \vdots \\ \vdots &{} \ddots &{} \ddots &{} \ddots &{} 0 \\ 0 &{} \cdots &{} 0 &{} 0 &{} 1 \end{pmatrix}. \end{aligned}$$
(9)

Remark 1

The FV volume operator vanishes when summed along columns, that is

$$\begin{aligned} \varvec{1}^{\text {T}} \, \varvec{\Delta }^{(\mathrm{V})} = \varvec{0}^{\text {T}}, \end{aligned}$$
(10)

where \(\varvec{1} = (1,\cdots ,1)^{\text {T}} \in \mathbb {R}^N\) is the vector of ones.

2.2 DG Method

In this section, we briefly outline the discontinuous Galerkin spectral element method (DGSEM) [1, 34]. To derive the nth-order DG scheme within sub-element s ((3)), residing inside element q, we first rewrite the conservation law (4) into variational form with a test function \(\phi \) and apply spatial integration-by-parts to the flux divergence:

$$\begin{aligned} \int _{\varOmega _s} \partial _t u_q\,\phi \, {\text {d}}\xi = \frac{N}{n\,\Delta x_q}\left( \int _{\varOmega _s} f(u_q)\,\partial _{\xi }\phi \, {\text {d}}\xi - f^*(u_q)\,\phi \big |_{\partial \varOmega _s} \right) . \end{aligned}$$
(11)

We choose the test functions \(\phi \) as Lagrange functions:

$$\begin{aligned} \ell _i(\xi ) = \prod ^n_{k=1,k\ne i} \frac{\xi -\xi _k}{\xi _i-\xi _k}, \quad i = 1,\cdots ,n, \end{aligned}$$
(12)

spanned with the collocation nodes \(\xi _i \in \left[ -\tfrac{1}{2},\tfrac{1}{2}\right] \), and use the polynomial ansatz

$$\begin{aligned} u(t;\xi ) \approx \sum _{i=1}^{n} \tilde{u}_{i}(t) \, \ell _i(\xi ) = \varvec{\tilde{u}}^{\text {T}}(t)\,\varvec{\ell }(\xi ), \end{aligned}$$
(13)

where

$$\begin{aligned} \varvec{\tilde{u}}(t) = \big (\tilde{u}_1(t),\cdots ,\tilde{u}_n(t)\big )^{\text {T}} \quad \text {and}\quad \varvec{\ell }(\xi ) = \big (\ell _1(\xi ),\cdots ,\ell _n(\xi )\big )^{\text {T}} \end{aligned}$$
(14)

are the vectors of nodal coefficients and Lagrange polynomials. We use collocation of the non-linear flux functions with the same polynomial approximation. Numerical quadrature is collocated, as well. The nodes are the Gauss-Legendre quadrature nodes. These quadrature nodes and the interpolation polynomials are also illustrated in Fig. A1 in Appendix  A.

Inserting everything into (11) gives the semi-discrete weak-form DG scheme

$$\begin{aligned} \varvec{\mathcal {M}}\, \partial _t \varvec{\tilde{u}}_s = \frac{N}{n\,\Delta x_q}\left( \varvec{\mathcal {D}}^{\text {T}}\varvec{\mathcal {M}}\,\varvec{\tilde{f}}_s - \varvec{\mathcal {B}}\,\varvec{f}_s^* \right) . \end{aligned}$$
(15)

The diagonal mass matrix is

$$\begin{aligned} \left( \varvec{\mathcal {M}}\right) _{ij} = \delta _{ij}\,\omega _i \end{aligned}$$
(16)

with associated numerical quadrature weights \(\omega _i\), and the differentiation matrix is

$$\begin{aligned} \left( \varvec{\mathcal {D}}\right) _{ij} = \partial _{\xi } \ell _j(\xi )\big |_{\xi _i}. \end{aligned}$$
(17)

The DG volume flux \(\varvec{\tilde{f}}_s\) is computed directly with the nodal values \(\varvec{\tilde{u}}_s\) of the polynomial ansatz (13)

$$\begin{aligned} \varvec{\tilde{f}}_s = f\left( \varvec{\tilde{u}}_s\right) := \Big (f\big ((\tilde{u}_1)_s\big ),\cdots ,f\big ((\tilde{u}_n)_s\big )\Big )^{\text {T}}\; \in \mathbb {R}^{n}, \end{aligned}$$
(18)

and the surface flux vector

$$\begin{aligned} \varvec{f}_s^* = \Big (f^*(\underbrace{\tilde{u}_{s-1}^+,\tilde{u}_s^-}_{{\begin{array}{c} \text {left sub-element}\\ \text {interface} \end{array}}}),0,\cdots ,0, f^*(\underbrace{\tilde{u}_{s}^+,\tilde{u}_{s+1}^-}_{{\begin{array}{c} \text {right sub-element}\\ \text {interface} \end{array}}})\Big )^{\text {T}} \; \in \mathbb {R}^n \end{aligned}$$
(19)

is constructed with the numerical flux evaluated at DG sub-element boundaries

$$\begin{aligned} \tilde{u}_s^+ = (\varvec{b}^+)^{\text {T}}\,\varvec{\tilde{u}}_s \quad \text {and} \quad \tilde{u}_s^- = (\varvec{b}^-)^{\text {T}}\,\varvec{\tilde{u}}_s, \end{aligned}$$
(20)

where \(\varvec{b}^\pm \) are the boundary interpolation operators

$$\begin{aligned} \varvec{b}^\pm = \Big (\ell _1\big (\pm \tfrac{1}{2}\big ),\cdots ,\ell _n\big (\pm \tfrac{1}{2}\big )\Big )^{\text {T}} \; \in \mathbb {R}^{n}. \end{aligned}$$
(21)

The boundary evaluation operator can be compactly written as

$$\begin{aligned} \varvec{\mathcal {B}}= \begin{pmatrix} -\ell _1(-\tfrac{1}{2}) &{} 0 &{} \cdots &{} 0 &{} \ell _1(\tfrac{1}{2}) \\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots \\ -\ell _n(-\tfrac{1}{2}) &{} 0 &{} \cdots &{} 0 &{} \ell _n(\tfrac{1}{2}) \\ \end{pmatrix} \; \in \mathbb {R}^{n \times n}. \end{aligned}$$
(22)

We rewrite (15) and arrive at

$$\begin{aligned} \partial _t \varvec{\tilde{u}}_s = \frac{N}{n\,\Delta x_q}\left( \varvec{D}\,\varvec{\tilde{f}}_s - \varvec{B}\, \varvec{f}_s^{*}\right) \end{aligned}$$
(23)

with \(\varvec{D} := \varvec{\mathcal {M}}^{-1}\,\varvec{\mathcal {D}}^{\text {T}}\,\varvec{\mathcal {M}}\) and \(\varvec{B}:= \varvec{\mathcal {M}}^{-1}\varvec{\mathcal {B}}\).

Remark 2

The DG volume operator \(\varvec{D}\) vanishes when contracted with the vector of quadrature weights \(\varvec{\omega }^{\text {T}} := (\omega _1,\cdots ,\omega _n)^{\text {T}} = \varvec{1}^{\text {T}} \, \varvec{\mathcal {M}}\),

$$\begin{aligned} \varvec{\omega }^{\text {T}} \, \varvec{D}= \varvec{0}^{\text {T}}. \end{aligned}$$
(24)

Proof

$$\begin{aligned} \varvec{\omega }^{\text {T}} \, \varvec{D}= \varvec{1}^{\text {T}}\,\varvec{\mathcal {M}}\, \varvec{\mathcal {M}}^{-1}\,\varvec{\mathcal {D}}^{\text {T}}\,\varvec{\mathcal {M}}= \varvec{1}^{\text {T}}\,\varvec{\mathcal {D}}^{\text {T}}\,\varvec{\mathcal {M}}= (\varvec{\mathcal {D}}\,\varvec{1})^{\text {T}}\,\varvec{\mathcal {M}}= \varvec{0}. \end{aligned}$$

Here, we use the fact that \(\varvec{\mathcal {D}}\,\varvec{1} = \varvec{0}\) is equivalent to taking the derivative of the constant function \(u(x) = 1\), i.e., \(\partial _x u(x) = \partial _x 1 = 0\).

2.3 Projection Operator

We consider a given polynomial of degree \(n-1\) with its nodal data \(\varvec{\tilde{u}} \in \mathbb {R}^{n}\) in a (sub-)element, which we want to project to \(n_{\mu }\) mean values on regular subcells. We define the projection operator \(\varvec{P}^{(n \rightarrow n_{\mu })} \in \mathbb {R}^{n_{\mu } \times n}\) component-wise via the mean value of the polynomial in the interval of subcell \(\mu _i\):

$$\begin{aligned} \bar{u}_i = n_{\mu }\int _{\mu _{i-\frac{1}{2}}}^{\mu _{i+\frac{1}{2}}} \tilde{u}(\xi ) \, {\text {d}}\xi = \sum _{j=1}^n \tilde{u}_j \underbrace{n_{\mu }\int _{\mu _{i-\frac{1}{2}}}^{\mu _{i+\frac{1}{2}}} \ell _j(\xi )\,{\text {d}}\xi }_{:= P_{ij}^{(n\rightarrow n_{\mu })}}, \quad i = 1,\cdots ,n_{\mu }. \end{aligned}$$
(25)

The integration of the Lagrange polynomial is done exactly with an appropriate quadrature rule.

Remark 3

Contracting the projection operator \(\varvec{P}^{(n \rightarrow n_{\mu })}\) with \(\varvec{1}_{n_{\mu }} := (1,\cdots ,1)^{\text {T}} \in \mathbb {R}^{n_{\mu }}\) gives

$$\begin{aligned} \varvec{1}_{n_{\mu }}^{\text {T}}\,\varvec{P}^{(n \rightarrow n_{\mu })} = n_{\mu }\,\varvec{\omega }^{\text {T}}. \end{aligned}$$
(26)

Proof

$$\begin{aligned} \sum _{i=1}^{n_{\mu }} P_{ij} = n_{\mu }\sum _{i=1}^{n_{\mu }} \int _{\mu _{i-\frac{1}{2}}}^{\mu _{i+\frac{1}{2}}} \ell _j(\xi )\,{\text {d}}\xi = n_{\mu }\int _{\mu _{1-\frac{1}{2}}}^{\mu _{n_{\mu }+\frac{1}{2}}} \ell _j(\xi )\,{\text {d}}\xi = n_{\mu }\int _{-\frac{1}{2}}^{\frac{1}{2}} \ell _j(\xi )\,{\text {d}}\xi = n_{\mu } \omega _j. \end{aligned}$$
(27)

Remark 4

When \(n = n_{\mu }\), we succinctly write \(\varvec{P}:= \varvec{P}^{(n \rightarrow n)}\).

2.4 Reconstruction Operator

The inverse of the quadratic non-singular projection matrix \(\varvec{P}^{(n \rightarrow n)}\) can be interpreted as a reconstruction operator from n mean values to n nodal values of a polynomial with degree \(n-1\):

$$\begin{aligned} \varvec{\tilde{u}} = \varvec{P}^{-1} \,\varvec{\bar{u}} := \varvec{R}\, \varvec{\bar{u}}. \end{aligned}$$
(28)

However, the naïve reconstruction (28) can lead to invalid data such as negative density or energy. Considering a convex set of permissible states for a given conservation law [64], we want to have a limiting procedure which recovers permissible states while still conserving the element mean value. Provided that the element average is a valid state

$$\begin{aligned} \langle \varvec{u}\rangle := \frac{1}{n} \, \varvec{1}^{\text {T}} \varvec{\bar{u}} \;\; \in \big \{\text {permissible states}\big \}, \end{aligned}$$
(29)

we expand the reconstruction process (28) by the following limiting procedure:

$$\begin{aligned} \varvec{R}^{(\beta )} = \frac{1-\beta }{n} \, \varvec{1} \otimes \varvec{1}^{\text {T}} + \beta \, \varvec{R}, \end{aligned}$$
(30)

with the dyadic product \(\varvec{1} \otimes \varvec{1}^{\text {T}} \in \mathbb {R}^{n \times n}\) and the “squeezing” parameter \(\beta \in [0,1]\) chosen such that

$$\begin{aligned} \big \{ \underbrace{\varvec{\tilde{u}}^{(\beta )}}_{\text {node values}},\; \underbrace{\big (\varvec{b}^+\big )^{\text {T}}\,\varvec{\tilde{u}}^{(\beta )}}_{\text {left boundary}}, \; \underbrace{\big (\varvec{b}^-\big )^{\text {T}}\,\varvec{\tilde{u}}^{(\beta )}}_{\text {right boundary}}\big \} \subset \big \{\text {permissible states}\big \}, \end{aligned}$$
(31)

where

$$\begin{aligned} \varvec{\tilde{u}}^{(\beta )} = \varvec{R}^{(\beta )}\,\varvec{\bar{u}} = \left( \frac{1-\beta }{n}\, \varvec{1} \otimes \varvec{1}^{\text {T}} + \beta \, \varvec{R}\right) \varvec{\bar{u}} = (1-\beta )\,\varvec{1}\,\langle \varvec{u}\rangle + \beta \, \varvec{\tilde{u}}, \end{aligned}$$
(32)

which shows that the extended reconstruction operator preserves the original element average, that is

$$\begin{aligned} \langle \varvec{\tilde{u}}^{(\beta )}\rangle = \langle \varvec{\tilde{u}}\rangle . \end{aligned}$$

Remark 5

The expanded reconstruction operator fulfills the following relationships:

$$\begin{aligned} \varvec{\omega }^{\text {T}}\,\varvec{R}^{(\beta )} = \varvec{\omega }^{\text {T}}\,\varvec{R}= \frac{1}{n}\,\varvec{1}^{\text {T}}. \end{aligned}$$
(33)

Proof

We begin with the second relation. From Eq. (26), we know

$$\begin{aligned} \varvec{1}^{\text {T}}\,\varvec{P}&= n\,\varvec{\omega }^{\text {T}}, \\ \varvec{1}^{\text {T}}\,\varvec{P}\, \varvec{P}^{-1}&= n\,\varvec{\omega }^{\text {T}}\varvec{P}^{-1} = n\,\varvec{\omega }^{\text {T}}\varvec{R},\\ \frac{1}{n}\,\varvec{1}^{\text {T}}&= \varvec{\omega }^{\text {T}}\varvec{R}. \end{aligned}$$

The first relation follows as

$$\begin{aligned} \varvec{\omega }^{\text {T}}\,\varvec{R}^{(\beta )} = \frac{1-\beta }{n}\, \underbrace{\varvec{\omega }^{\text {T}}\, \varvec{1}}_{= 1} \otimes \varvec{1}^{\text {T}} + \beta \, \underbrace{\varvec{\omega }^{\text {T}}\, \varvec{R}}_{= \frac{1}{n}\,\varvec{1}^{\text {T}}} = \frac{1}{n}\,\varvec{1}^{\text {T}} = \varvec{\omega }^{\text {T}}\,\varvec{R}. \end{aligned}$$

The specific calculation of the parameter \(\beta \) depends on the permissibility constraints of the conservation law at hand. In Sect. 3.1, we solve the compressible Euler equations where the density \(\rho \) and pressure p are positive values. Based on [64], we calculate the squeezing parameter \(\beta \) as

$$\begin{aligned} \beta = \min \left( \frac{\langle \rho \rangle - \epsilon }{\langle \rho \rangle - \rho _{\text {min}}},\frac{\langle p \rangle - \epsilon }{\langle p \rangle - p_{\text {min}}},1\right) , \end{aligned}$$
(34)

where \(\langle \rho \rangle \) and \(\langle p \rangle \) are the element averages (29), and \(\rho _{\text {min}}\) and \(p_{\text {min}}\) are the minimum values of the unlimited polynomial given in (31) and \(\epsilon = \min (10^{-20},\langle \rho \rangle ,\langle p \rangle )\).

Remark 6

We observed that the indispensable positivity limiting can have a potential negative impact on the robustness of the high-order DG scheme, especially for high polynomial degrees. It seems that huge artificial jumps and gradients can be generated at element interfaces. To alleviate this problem, it is advisable to only allow small squeezing margins between 5% and 10%. If, for example, the squeezing parameter \(\beta \) falls below 0.95, the reconstructed high-order polynomial is decided un-salvageable and the next lower order scheme is considered.

2.5 Single-Level Blending

We first focus on the case where only two different discretizations per element q are blended: a single-level blending of the low-order FV scheme and the high-order DG scheme,

$$\begin{aligned} \partial _t u_{q} = (1-\alpha _{q})\,\partial _t u_{q}^{(\text {low})} + \alpha _{q}\,\partial _t u_{q}^{(\text {high})}. \end{aligned}$$

Note that we do not blend the solutions, but directly the discretizations themselves, i.e., the right-hand sides which we denote by \(\partial _t u_{q}\). If both schemes operate with different data representations, appropriate transformations ensure the compatibility during the blending process. In our case, we use the projection operator \(\varvec{P}^{(N \rightarrow N)}\) introduced in Sect. 2.3 to transfer the nodal output of the DG operator to subcell mean values. The inputs for the DG scheme on the other hand, i.e., the nodal coefficients \(\varvec{\tilde{u}}_q \in \mathbb {R}^N\), are reconstructed from the given mean values \(\varvec{\bar{u}}_q \in \mathbb {R}^N\) as described in Sect. 2.4. The naïve single-level blended discretization reads as

$$\begin{aligned} \partial _t \varvec{\bar{u}}_{q} = (1-\alpha _{q})\;\partial _t \varvec{\bar{u}}_{q}^{(\text {FV})} + \alpha _{q}\;\varvec{P}\,\partial _t \varvec{\tilde{u}}_{q}^{(\text {DG})}. \end{aligned}$$

Inserting (8) and (23) gives

$$\begin{aligned} \partial _t \varvec{\bar{u}}_{q} = (1-\alpha _{q}) \, \frac{-N}{\Delta x_q} \, \varvec{\Delta }\,\varvec{f}_{q}^{*(\text {FV})} + \alpha _{q} \,\frac{1}{\Delta x_q}\varvec{P}\,\left( \varvec{D}\,\varvec{\tilde{f}}_{q} - \varvec{B}\,\varvec{f}_{q}^{*(\text {DG})} \right) . \end{aligned}$$
(35)

The fundamental issue of the naïve single-level blending discretization (35) is that it is not conservative if the blending parameter \(\alpha _{q}\) varies from element to element. It turns out that the direct blending of the surface fluxes of both discretizations, namely \(\varvec{f}_{q}^{*(\text {FV})}\) and \(\varvec{f}_{q}^{*(\text {DG})}\), leads to a non-conservative balance of the net fluxes across element interfaces. To remedy this issue, the goal is to define unique surface fluxes common to both, the low-order and the high-order discretization, such that they can be directly blended. We thus compute a blending of the reconstructed interface values to evaluate a unique common surface flux \(\varvec{f}_{q}^{*}\). First, we define two interface vectors of length \(N+1\) as follows:

$$\begin{aligned} \varvec{u}_{q}^+ := \big (\underbrace{u_{q-\frac{1}{2}}^+, (\bar{u}_{1})_q, \cdots , (\bar{u}_{N-1})_q, u_{q+\frac{1}{2}}^+}_{\begin{array}{c} \text {prolongated states at} \\ \text {FV subcell interfaces} \end{array}} \big )^{\text {T}} \;\text {and}\; \varvec{u}_{q}^- := \big (\underbrace{u_{q-\frac{1}{2}}^-, (\bar{u}_{2})_q, \cdots , (\bar{u}_{N})_q, u_{q+\frac{1}{2}}^-}_{\begin{array}{c} \text {prolongated states at} \\ \text {FV subcell interfaces} \end{array}} \big )^{\text {T}}, \end{aligned}$$
(36)

where the outermost interface values are given by

$$\begin{aligned} u_{q-\frac{1}{2}}^- = (1-\alpha _{q})\,(\bar{u}_{1})_q + \alpha _{q} \,\tilde{u}_{q}^- \quad \text {and} \quad u_{q+\frac{1}{2}}^+ = (1-\alpha _{q})\,(\bar{u}_{N})_q + \alpha _{q} \,\tilde{u}_{q}^+. \end{aligned}$$
(37)

A concrete example for the blended boundary values \(u_{q\pm \frac{1}{2}}^{\pm }\) is shown in Fig. 3.

Fig. 3
figure 3

Schematic of four (\(N = 4\)) mean values and the reconstructed polynomial on the reference element. The cell boundary values \(u_{q-\frac{1}{2}}^-\) and \(u_{q+\frac{1}{2}}^+\) were calculated with (37) where we assumed a blending factor of \(\alpha = 0.75\)

The common surface flux \(\varvec{f}_q^{*}\) is then evaluated with the interface vectors \(\varvec{u}_{q}^+\) and \(\varvec{u}_{q}^-\) as

$$\begin{aligned} \varvec{f}_{q}^* = f^*\left( \varvec{u}_{q}^+,\varvec{u}_{q}^-\right) \; \in \mathbb {R}^{N+1}. \end{aligned}$$
(38)

To make the DG surface operator \(\varvec{B}\) compatible with \(\varvec{f}_{q}^*\), we adapt the notation by inserting an additional column of zeros:

$$\begin{aligned} \varvec{B}^{(0)} = \begin{pmatrix} B_{11} &{} 0 &{} \cdots &{} 0 &{} \cdots &{} 0 &{} B_{1N} \\ B_{21} &{} 0 &{} \cdots &{} 0 &{} \cdots &{} 0 &{} B_{2N} \\ \vdots &{} \vdots &{} \ddots &{} \vdots &{} \ddots &{} \vdots &{} \vdots \\ B_{N1} &{} 0 &{} \cdots &{} 0 &{} \cdots &{} 0 &{} B_{NN} \\ \end{pmatrix} \; \in \mathbb {R}^{N \times (N+1)}. \end{aligned}$$
(39)

Corollary 1

Contracting the DG surface operator \(\varvec{B}^{(0)}\) with the quadrature weights \(\varvec{\omega }\) is equivalent to the contraction of the FV surface operator, that is

$$\begin{aligned} \varvec{\omega }^{\mathrm{T}} \, \varvec{B}^{(0)} = \varvec{1}^{\mathrm{T}}\,\varvec{\Delta }^{(\mathrm S)}. \end{aligned}$$
(40)

Proof

We expand the left side of (40) and write

$$\begin{aligned} \varvec{\omega }^{\text {T}} \, \varvec{B}^{(0)}&= \left( -\sum _{i=1}^{N} \omega _i \frac{\ell _i(-\tfrac{1}{2})}{\omega _i},0,\cdots ,0,\sum _{i=1}^{N} \omega _i \frac{\ell _i(\tfrac{1}{2})}{\omega _i}\right) \\&= \left( -\sum _{i=1}^{N} \ell _i(-\tfrac{1}{2}),0,\cdots ,0,\sum _{i=1}^{N} \ell _i(\tfrac{1}{2})\right) = \left( -1,0,\cdots ,0,1\right) = \varvec{1}^{\text {T}}\,\varvec{\Delta }^{(\mathrm S)}. \end{aligned}$$

We replace \(\varvec{f}_{q}^{*(\text {FV})}\) and \(\varvec{f}_{q}^{*(\text {DG})}\) in (35) with \(\varvec{f}_{q}^{*}\), and additionally, write the DG operators compactly, including the projection operator, as

$$\begin{aligned} \hat{\varvec{D}}= \varvec{P}\,\varvec{D}\quad \text {and} \quad \hat{\varvec{B}}= \varvec{P}\,\varvec{B}^{(0)}. \end{aligned}$$
(41)

The final form of the single-level blended discretization is

$$\begin{aligned} \partial _t \varvec{\bar{u}}_{q} = (1-\alpha _{q}) \, \frac{-N}{\Delta x} \, \varvec{\Delta }\,\varvec{f}_{q}^* + \alpha _{q} \,\frac{1}{\Delta x}\,\left( \hat{\varvec{D}}\,\varvec{\tilde{f}}_{q} - \hat{\varvec{B}}\,\varvec{f}_{q}^* \right) . \end{aligned}$$
(42)

Remark 7

It is easy to see that with \(\alpha _{q} = 0\) for all elements q, the pure subcell FV discretization is recovered, and with \(\alpha _{q} = 1\) for all elements, the blending scheme recovers the pure high-order DG method.

Lemma 1

Given arbitrary blending factors \(\alpha _{q} \in \mathbb {R}\) for each element q, then the blending scheme (42) is conservative.

Proof

We discretely integrate the single-level blended discretization over all elements q with a total number of Q:

$$\begin{aligned} \sum _{q}^Q \Delta x_q \, \varvec{1}^{\text {T}} \partial _t \varvec{\bar{u}}_q = \sum _{q}^Q \Delta x_q \, \varvec{1}^{\text {T}} \Big [(1-\alpha _q) \, \frac{-N}{\Delta x_q} \, \varvec{\Delta }\,\varvec{f}^*_q + \alpha _q \,\frac{1}{\Delta x_q}\left( \hat{\varvec{D}}\,\varvec{\tilde{f}}_q - \hat{\varvec{B}}\,\varvec{f}^*_q \right) \Big ]. \end{aligned}$$

With (9) and (41), we get

$$\begin{aligned} \sum _{q}^Q \Delta x_q \, \varvec{1}^{\text {T}} \partial _t \varvec{\bar{u}}_q = \sum _{q}^Q \varvec{1}^{\text {T}} \Big [-(1-\alpha _q) \, N \, \big (\varvec{\Delta }^{(\mathrm{V})} + \varvec{\Delta }^{(\mathrm{S})}\big )\,\varvec{f}^*_q + \alpha _q \,\left( \varvec{P}\, \varvec{D}\,\varvec{\tilde{f}}_q - \varvec{P}\, \varvec{B}^{(0)}\,\varvec{f}^*_q \right) \Big ]. \end{aligned}$$

With properties (10), (24), and (26) the volume terms vanish, that is

$$\begin{aligned} \varvec{1}^{\text {T}} \, \varvec{\Delta }^{(\mathrm{V})} = \varvec{0}^{\text {T}} \quad \text {and} \quad \varvec{1}^{\text {T}} \, \varvec{P}\, \varvec{D}= N\,\varvec{\omega }^{\text {T}} \, \varvec{D}= \varvec{0}^{\text {T}}. \end{aligned}$$

We reformulate the DG surface term with (26) and (40) as

$$\begin{aligned} \varvec{1}^{\text {T}} \, \varvec{P}\, \varvec{B}^{(0)} = N \, \varvec{\omega }^{\text {T}} \, \varvec{B}^{(0)} = N \, \varvec{1}^{\text {T}} \varvec{\Delta }^{(\mathrm{S})}. \end{aligned}$$

The expansion of the telescopic sum only leaves the outermost surface fluxes:

$$\begin{aligned}&\sum _{q}^Q \Big [-(1-\alpha _q) \, N \, \varvec{1}^{\text {T}} \varvec{\Delta }^{(\mathrm S)} - \alpha _q \,N \, \varvec{1}^{\text {T}} \varvec{\Delta }^{(\mathrm S)}\Big ] \, \varvec{f}^*_q = \sum _{q}^Q -N \, \varvec{1}^{\text {T}} \varvec{\Delta }^{(\mathrm S)} \, \varvec{f}^*_q \\&= -N\,\Big (\big (-f^*_{1}\big )_{1} + \big (f^*_{N+1}\big )_{Q}\Big ) = 0, \end{aligned}$$

which represent the change due to physical boundary conditions. For instance in case of periodic boundary conditions, these two fluxes would cancel to zero.

This concludes the description of the single-level blending scheme.

2.6 Multi-level Blending

As mentioned in the introduction, the general idea is the construction of a hierarchy of discretizations, with lower order DG schemes on sub-elements. In principle, it is thus possible to define a multi-level blending discretization, where the low-order FV scheme is blended with DG variants of different approximation orders. This multi-level extension is driven by the desire to retain as much “high order DG accuracy” as possible, especially on a sub-element level.

For the discussion, we consider a specific example setup with a DG element with polynomial degree \(N_p=7\). The data of this DG element are collected in form of \(N=8\) mean values on a regular subcell grid. Our goal is to blend a first-order subcell FV scheme, a second- and fourth-order sub-element DG scheme, and the full eighth-order DG scheme. The construction of the individual schemes follows the discussion in Sects. 2.1, 2.2, and 2.5. In this section, the extension to a multi-level blending approach is presented.

We get the first data interpretation and its corresponding discretization by directly using the mean values of element q as a first-order approximation space with no reconstruction at all:

$$\begin{aligned} \varvec{\bar{u}}_q^{\mathcal {O}(1)} := \varvec{\bar{u}}_q = (\bar{u}_1,\bar{u}_2,\cdots ,\bar{u}_8)_q^{\text {T}}. \end{aligned}$$

Next, we interpret the eight mean values as four second-order DG sub-elements. The reconstruction matrix \(\varvec{R}^{\mathcal {O}(2)} \in \mathbb {R}^{2 \times 2}\) transforms two adjacent mean values to two nodal values:

$$\begin{aligned} \varvec{\tilde{u}}_q^{\mathcal {O}(2)} = \Big (\underbrace{\left( \tilde{u}_1\right) _1^{\mathcal {O}(2)},\left( \tilde{u}_2\right) _1^{\mathcal {O}(2)}}_{\mathcal {O}(2)-\text {sub-element}},\cdots ,\underbrace{\left( \tilde{u}_1\right) _4^{\mathcal {O}(2)},\left( \tilde{u}_2\right) _4^{\mathcal {O}(2)}}_{\mathcal {O}(2)-\text {sub-element}}\Big )_q^{\text {T}} = \left[ \varvec{\mathbb {1}}_4 \otimes \varvec{R}^{\mathcal {O}(2)} \right] \, \varvec{\bar{u}}_q. \end{aligned}$$
(43)

The fourth- and eighth-order approximations are constructed analogously as

$$\begin{aligned} \varvec{\tilde{u}}_q^{\mathcal {O}(4)} = \Big (\underbrace{\left( \tilde{u}_1\right) _1^{\mathcal {O}(4)},\cdots ,\left( \tilde{u}_4\right) _1^{\mathcal {O}(4)}}_{\mathcal {O}(4)-\text {sub-element}}, \underbrace{\left( \tilde{u}_1\right) _2^{\mathcal {O}(4)},\cdots ,\left( \tilde{u}_4\right) _2^{\mathcal {O}(4)}}_{\mathcal {O}(4)-\text {sub-element}}\Big )_q^{\text {T}} = \left[ \varvec{\mathbb {1}}_2 \otimes \varvec{R}^{\mathcal {O}(4)} \right] \, \varvec{\bar{u}}_q, \end{aligned}$$
(44)

and

$$\begin{aligned} \varvec{\tilde{u}}_q^{\mathcal {O}(8)} = \Big (\underbrace{\tilde{u}_1^{\mathcal {O}(8)},\cdots ,\tilde{u}_8^{\mathcal {O}(8)}}_{\mathcal {O}(8)-\text {sub-element}}\Big )_q^{\text {T}} = \left[ \varvec{\mathbb {1}}_1 \otimes \varvec{R}^{\mathcal {O}(8)}\right] \,\varvec{\bar{u}}_q \end{aligned}$$
(45)

with \(\varvec{R}^{\mathcal {O}(4)} \in \mathbb {R}^{4\times 4}\) and \(\varvec{R}^{\mathcal {O}(8)} \in \mathbb {R}^{8\times 8}\). Here, we used the Kronecker product \(\otimes \) in conjunction with the identity matrix \(\varvec{\mathbb {1}}_n = \text {diag}(1,\cdots ,1) \in \mathbb {R}^{n \times n}\) to generate appropriate block-diagonal matrices. Figure A1 in Appendix A illustrates the hierarchy of the approximation spaces for this example.

We correspond the approximation spaces with the respective discretizations:

$$\begin{aligned} \left\{ \begin{array}{l} \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(1)} = -\frac{8}{\Delta x_q} \; \varvec{\Delta }\,\varvec{f}^{*}, \\ \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(2)} = \,\;\; \frac{4}{\Delta x_q} \left\{ \left[ \varvec{\mathbb {1}}_4 \otimes \hat{\varvec{D}}^{\mathcal {O}(2)}\right] \varvec{\tilde{f}}_q^{\mathcal {O}(2)} - \left[ \varvec{\mathbb {1}}_4 \otimes \hat{\varvec{B}}^{\mathcal {O}(2)}\right] ^{(0)}\varvec{f}_q^* \right\} , \\ \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(4)} = \,\;\; \frac{2}{\Delta x_q} \left\{ \left[ \varvec{\mathbb {1}}_2 \otimes \hat{\varvec{D}}^{\mathcal {O}(4)}\right] \varvec{\tilde{f}}_q^{\mathcal {O}(4)} - \left[ \varvec{\mathbb {1}}_2 \otimes \hat{\varvec{B}}^{\mathcal {O}(4)}\right] ^{(0)}\varvec{f}_q^* \right\} , \\ \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(8)} = \,\;\; \frac{1}{\Delta x_q} \left\{ \left[ \varvec{\mathbb {1}}_1 \otimes \hat{\varvec{D}}^{\mathcal {O}(8)}\right] \varvec{\tilde{f}}_q^{\mathcal {O}(8)} - \left[ \varvec{\mathbb {1}}_1 \otimes \hat{\varvec{B}}^{\mathcal {O}(8)}\right] ^{(0)}\varvec{f}_q^* \right\} , \end{array}\right. \end{aligned}$$
(46)

where the DG volume fluxes are computed with the respective polynomial (sub-)element reconstructions of orders \(n=\{2,4,8\}\):

$$\begin{aligned} \varvec{\tilde{f}}_q^{\mathcal {O}(n)} = f\left( \varvec{\tilde{u}}_q^{\mathcal {O}(n)}\right) . \end{aligned}$$

Similar to (39), the DG surface operators \(\big [\varvec{\mathbb {1}}_{N/n} \otimes \hat{\varvec{B}}^{\mathcal {O}(n)}\big ]\) have to be slightly adapted to be compatible with the common surface flux \(\varvec{f}^{*}\). We list the modified boundary evaluation matrices in Appendix A. Finally, all four candidate discretizations are blended starting from the lowest order up to the highest order discretization:

$$\begin{aligned} \left\{ \begin{array}{l} \partial _t \varvec{\bar{u}}_q^{'''} := \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(1)}, \\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q^{''} = \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(2)}\right) \odot \partial _t \varvec{\bar{u}}_q^{'''} + \varvec{\alpha }_q^{\mathcal {O}(2)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(2)}, \\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q^{'} = \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(4)}\right) \odot \partial _t \varvec{\bar{u}}_q^{''} + \varvec{\alpha }_q^{\mathcal {O}(4)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(4)}, \\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q = \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right) \odot \partial _t \varvec{\bar{u}}_q^{'} + \varvec{\alpha }_q^{\mathcal {O}(8)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(8)}, \end{array}\right. \end{aligned}$$
(47)

where \(\odot \) denotes the component-wise multiplication with the vector of blending parameters. Each DG sub-element computes its own blending factor according to the local data, i.e., we get four blending factors for the \(\mathcal {O}(2)\) variant, two blending factors for \(\mathcal {O}(4)\), and one for \(\mathcal {O}(8)\):

$$\begin{aligned} \varvec{\alpha }_q^{\mathcal {O}(2)}= & {} \left( \alpha _1^{\mathcal {O}(2)},\alpha _{2}^{\mathcal {O}(2)},\alpha _{3}^{\mathcal {O}(2)},\alpha _{4}^{\mathcal {O}(2)}\right) _q^{\text {T}} \otimes (1,1)^{\text {T}},\\ \varvec{\alpha }_q^{\mathcal {O}(4)}= & {} \left( \alpha _1^{\mathcal {O}(4)},\alpha _{2}^{\mathcal {O}(4)}\right) _q^{\text {T}} \otimes (1,1,1,1)^{\text {T}},\\ \varvec{\alpha }_q^{\mathcal {O}(8)}= & {} \left( \alpha ^{\mathcal {O}(8)}\right) _q^{\text {T}} \otimes (1,1,1,1,1,1,1,1)^{\text {T}}. \end{aligned}$$

The actual strategy for the blending factors is described in Sect. 2.7.

Again, as discussed in the case of a single-blending approach in Sect. 2.5, a special care is needed to preserve the conservation of the final discretization. Expanding on the idea in the single-level case, we aim to compute unique surface fluxes for each discretization with a uniquely defined interface value at sub-element or subcell interfaces. We evaluate all high-order DG polynomials at the FV subcell interfaces \(\varvec{u}_q^{\pm \mathcal {O}(n)} \in \mathbb {R}^{N}\):

where the interpolation operator \(\varvec{I}^{\pm \mathcal {O}(n)} \in \mathbb {R}^{n \times n}\) prolongates to the embedded FV subcell interfaces \(\mu ^{\mathcal {O}(n)}_{i\pm 1/2}\) of the respective DG sub-element, that is

$$\begin{aligned} \left( \varvec{I}^{\pm \mathcal {O}(n)}\right) _{ij} = \ell ^{\mathcal {O}(n)}_j\left( \mu ^{\mathcal {O}(n)}_{i\pm 1/2}\right) , \quad i,j = 1,\cdots ,n. \end{aligned}$$
(48)

In Fig. A1 in Appendix A, two representatives of \(\mu ^{\mathcal {O}(n)}_{i\pm 1/2}\) are shown which are aligned at the dotted vertical lines, indicating the interfaces of the FV subcells.

We start with the first-order interpolation and stack on top of the next levels of orders via convex blending:

$$\begin{aligned} \left( \varvec{u}_q^\pm \right) ^{''''}&:= \varvec{u}_q^{\pm \mathcal {O}(1)},\\ \hookrightarrow \; \left( \varvec{u}_q^\pm \right) ^{'''}&= \left[ \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(2)}\right] \odot \left( \varvec{u}_q^\pm \right) ^{''''} + \varvec{\alpha }_q^{\mathcal {O}(2)} \odot \varvec{u}_q^{\pm \mathcal {O}(2)}, \\ \hookrightarrow \, \left( \varvec{u}_q^\pm \right) ^{''}&= \left[ \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(4)}\right] \odot \left( \varvec{u}_q^\pm \right) ^{'''} + \varvec{\alpha }_q^{\mathcal {O}(4)} \odot \varvec{u}_q^{\pm \mathcal {O}(4)}, \\ \hookrightarrow \, \left( \varvec{u}_q^\pm \right) ^{'}&= \left[ \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right] \odot \left( \varvec{u}_q^\pm \right) ^{''} + \varvec{\alpha }_q^{\mathcal {O}(8)} \odot \varvec{u}_q^{\pm \mathcal {O}(8)}. \end{aligned}$$

To arrive at a complete vector of interface values, we append the element interface values from the left and right neighbors \(q-1\) and \(q+1\):

$$\begin{aligned} \varvec{u}_q^+&= \Big ( \overbrace{\left( u^+_{N}\right) _{q-1}^{'},}^{\text {left neighbor}} \quad \overbrace{\left( u^+_{1}, \cdots , u^+_{N}\right) _q^{'}}^{\text {internal boundaries}}\Big )^{\text {T}},\\ \varvec{u}_q^-&= \Big (\underbrace{\left( u^-_{1}, \cdots , u^-_{N}\right) _q^{'},}_{\text {internal boundaries}} \quad \underbrace{\left( u^-_{1}\right) _{q+1}^{'}}_{\text {right neighbor}}\Big )^{\text {T}}. \end{aligned}$$

These new common interface values allow us to evaluate a common surface flux (38) at each interface, which is again the key to preserve conservation in the final discretization. This concludes the description of the multi-level blending scheme.

2.7 Calculation of the Blending Factor \(\alpha \)

A good shock indicator for high-order methods is supposed to recognize discontinuities, such as weak and strong shocks, in the solution early on and mark the affected elements for proper shock capturing. On the other hand, the indicator should avoid to flag non-shock-related fluid features such as shear layers and turbulent flows. There are numerous indicators available for DG schemes [2, 13, 14, 47, 59, 65].

In this work, we want to construct an a-priori indicator which relies on the readily available information within each element provided by the multi-level blending framework introduced in Sect. 2.6. The principal idea is to compare a measure of smoothness of the different order reconstructions with each other. Smooth, well-resolved flows are expected to yield rather similar solution profiles compared to data that contain strong variations.

The smoothness measure \(\sigma _q^{\mathcal {O}(n)}\) within element q of the nth-order reconstruction \(\tilde{u}_q^{\mathcal {O}(n)}\) is inferred from the \(L^1\)-norm of its first derivative. For example, if we want to calculate the blending factor \(\alpha _q^{\mathcal {O}(8)}\) for the eighth order, we compute

$$\begin{aligned} \sigma _q^{\mathcal {O}(8)} = \int _{-\frac{1}{2}}^{\frac{1}{2}} \left| \partial _{\xi } \tilde{u}_q^{\mathcal {O}(8)}(\xi ) \right| {\text {d}}\xi \end{aligned}$$
(49)

and

$$\begin{aligned} \sigma _q^{\mathcal {O}(4)} = \left( \sigma _1^{\mathcal {O}(4)}\right) _q + \left( \sigma _2^{\mathcal {O}(4)}\right) _q = \int _{-\frac{1}{2}}^{0} \left| \partial _{\xi } \left( \tilde{u}_1^{\mathcal {O}(4)}\right) _q(\xi ) \right| {\text {d}}\xi + \int _{0}^{\frac{1}{2}} \left| \partial _{\xi } \left( \tilde{u}_2^{\mathcal {O}(4)}\right) _q(\xi ) \right| {\text {d}}\xi \end{aligned}$$

utilizing information from the top-level eighth-order element and its two fourth-order sub-elements. The integrals are evaluated with appropriate quadrature rules. Then, the blending factor is calculated by comparing the smoothness of the different orders as

$$\begin{aligned} \alpha _q^{\mathcal {O}(8)} = 1 - \text {cutoff}\left( 0, \tau _A \, \left( \frac{\left| \sigma _q^{\mathcal {O}(8)} - \sigma _q^{\mathcal {O}(4)}\right| }{\max \big (\sigma _q^{\mathcal {O}(4)},\sigma _q^{\mathcal {O}(8)},1\big )} - \tau _S\right) , 1\right) , \end{aligned}$$
(50)

where \(\text {cutoff}(x_{\text {lower}},x,x_{\text {upper}}) = \min (\max (x_{\text {lower}},x),x_{\text {upper}})\) and with two parameters \(\tau _A, \tau _S > 0.\) The design of (50) ensures that \(\alpha _q^{\mathcal {O}(n)}\) is always within the unit interval, and that for very small \(\sigma _q^{\mathcal {O}(n)}\), the indicator does not get hypersensitive due to floating point truncation. If not noted otherwise, we set the amplification parameter to \(\tau _A = 100\) and the sensitivity parameter \(\tau _S = 0.05\). The latter parameter has the biggest influence on the behavior of the indicator and its value demarcates the lower bound where it does not interfere with the convergence tests conducted in Sect. 3. To capture all troubling flow features, we independently apply the indicator (50) on all primitive state variables and select the smallest of the resulting blending factors. The calculations of the two fourth-order blending factors \(\left( \alpha _1^{\mathcal {O}(4)}\right) _q\) and \(\left( \alpha _2^{\mathcal {O}(4)}\right) _q\) are done within each sub-element independently together with their respective second-order smoothness measures \(\left( \sigma _s^{\mathcal {O}(2)}\right) _q\), \(s = 1,\cdots ,4\).

For piecewise linear polynomials, the indicator (50) is not applicable. Instead, we directly use the squeezing parameter \(\beta \) obtained from the positivity limiter in (30), i.e., \(\alpha _s^{\mathcal {O}(2)} := \beta _s^{\mathcal {O}(2)}\), \(s = 1,\cdots ,4\).

Remark

8 The indicator (50) is also used for the single-level blending scheme.

2.8 Sketch of the Algorithm

In the last part of this section, a sketch of the algorithm for the blending framework is presented. We present a general outline of the necessary steps for the 1D single-blending scheme evolved with a multi-stage Runge-Kutta time-stepping method. We enter at the beginning of a Runge-Kutta cycle and do the following.

  1. (I)

    Reconstruct the polynomial \(\varvec{\tilde{u}}_q\) from the given mean values \(\varvec{\bar{u}}_q\) for each element q as in (28).

  2. (II)

    If the reconstructed polynomial \(\varvec{\tilde{u}}_q\) contains non-permissible states, see (31), then calculate the limited version \(\varvec{\tilde{u}}_q^{(\beta )}\) as in (30).

  3. (III)

    If the squeezing parameter \(\beta _q\) is below \(\beta _L\), then set \(\alpha _q := 0\) else compute the blending factor \(\alpha _q\) via (50) from the unlimited polynomial \(\varvec{\tilde{u}}_q\).

  4. (IV)

    Compute the boundary values \(u_{q}^{\pm }\) via (37) and exchange alongside zone boundaries in case of distributed computing.

  5. (V)

    Determine the common surface flux \(\varvec{f}_{q}^*\) via (38).

  6. (VI)

    Calculate the right-hand side \(\partial _t \varvec{\bar{u}}_q\):

    • if the blending factor \(\alpha _q\) above \(\alpha _H\), then compute \(\partial _t \varvec{\bar{u}}_q\) with the DG-only scheme;

    • else if the blending factor \(\alpha _q\) below \(\alpha _L\), then compute \(\partial _t \varvec{\bar{u}}_q\) with the FV-only scheme;

    • else compute \(\partial _t \varvec{\bar{u}}_q\) with the single-level blending scheme (42).

  7. (VII)

    Forward in time to the next Runge-Kutta stage and return to step (I).

The switching thresholds are set to \(\alpha _H := 0.99\) and \(\alpha _L := 0.01\) and the limiter threshold to \(\beta _L := 0.95\). Note that the algorithm only applies the blending procedure where necessary to maintain the overall performance of the scheme.

This concludes the presentation of the 1D blending scheme. The description of the blending scheme on 3D Cartesian meshes as well as the algorithm outline for the multi-level blending scheme can be found in Appendixes A.3 and A.4.

3 Validation

For the computational investigations, the multi-level algorithm with the explicit SSP-RK(5, 4) time integrator [58] is implemented in a Fortran-2008 prototype code with a hybrid parallelization strategy based on MPI and OpenMP. Management of the AMR and load balancing is provided by p4est, a highly efficient Octree library [4]. The maximal time-step for dimensions \(d = 1,2,3\) is estimated by the CFL condition:

$$\begin{aligned} \Delta t := {\text {CFL}} \, \min _q\;\frac{\Delta x_q}{2^{d-1}(2\,N-1)\,\bar{\lambda }_{q,\text {max}}}, \end{aligned}$$
(51)

where \({\text {CFL}} := 0.8\), \(N := 8\) is the number of mean values in each direction of the element q, and \(\bar{\lambda }_{q,\text {max}}\) is an estimate of the maximum eigenvalue given in (55). For the numerical interface fluxes \(f^*\), we use the Harten-Lax-Leer (HLL) approximate Riemann solver [28] with Einfeldt signal speed estimates [15].

3.1 Governing Equations

We consider the compressible Euler equations:

$$\begin{aligned} \left\{ \begin{array}{l} \partial _t\rho + \nabla \cdot (\rho \,\varvec{v}) = 0, \\ \partial _t(\rho \,\varvec{v}) + \nabla \cdot \left( \rho \,\varvec{v}\varvec{v}^{\text {T}} + p\,\varvec{\mathbb {1}}\right) = \varvec{0},\\ \partial _t \mathcal {E}+ \nabla \cdot \Big (\varvec{v}\,(\mathcal {E}+ p)\Big ) = 0, \end{array}\right. \end{aligned}$$
(52)

with the vector of conserved quantities \(\varvec{u} = (\rho ,\rho \,\varvec{v}, \mathcal {E})^{\text {T}}\), where \(\rho \) denotes the density, \(\varvec{v}\) the velocity, and \(\mathcal {E}\) the total energy. We assume a perfect gas equation of state and compute the pressure as:

$$\begin{aligned} p(\varvec{u}) = (\gamma - 1)\,\left[ \mathcal {E}- \frac{\rho }{2}\,\varvec{v}^{\text {T}}\varvec{v}\right] . \end{aligned}$$
(53)

If not stated otherwise, we choose \(\gamma = 1.4\). The set of permissible states is given by

$$\begin{aligned} \big \{\text {permissible states}\big \} = \big \{\forall \,\varvec{u} \; \big | \; \rho> 0 \wedge p(\varvec{u}) > 0\big \}. \end{aligned}$$
(54)

For the CFL condition (51), the maximum eigenvalue is evaluated on all mean values \(\varvec{\bar{u}}_q\) of element q. Given dimension \(d = \{1,2,3\}\), it reads as

$$\begin{aligned} \bar{\lambda }_{q,\text {max}} = \max _{i,d} \left( \big |(\bar{v}_d)_i\big | + \sqrt{\gamma \,\frac{\bar{p}_i}{\bar{\rho }_i}}\right) , \quad i = 1,\cdots ,N^{d_{\text {max}}}. \end{aligned}$$
(55)

3.2 Convergence Test

We use the manufactured solution method [51] and validate the 3D multi-level blending scheme on a periodic cube of unit length (\(L = 1\)) where the resolution of the mesh is incrementally doubled. We define our manufactured solution in primitive state variables as

$$\begin{aligned} \left\{ \begin{array}{l} \rho (t; x,y,z) = 1.0 + 0.35 \, \sin \left( \frac{2\,\uppi \,(x-t)}{L}\right) \!+\! 0.24 \,\cos \left( \frac{2\,\uppi \,(y-t)}{L}\right) \!+\! 0.1 \,\sin \left( \frac{2\,\uppi \,(z-t)}{L}\right) , \\ \varvec{v}(t; x,y,z) = (0.1,0.2,0.3)^{\text {T}}, \\ p(t; x,y,z) = 1.0 + 0.23 \, \cos \left( \frac{2\,\uppi \,(x-t)}{L}\right) \\ \qquad \qquad \quad \qquad \,\,+0.19\,\sin \left( \frac{2\,\uppi \,(y-t)}{L}\right) + 0.2 \,\cos \left( \frac{2\,\uppi \,(z-t)}{L}\right) . \end{array}\right. \end{aligned}$$
(56)

The final time of the simulation is \(T = 2\) and the center of the domain is refined to introduce non-conforming interfaces in the computational domain. We determine the \(L^{\infty }\)- and \(L^2\)-norms of the errors in the density and total energy. Tables 1, 2, 3, and 4 list the results for the first-, second-, fourth-, and eighth-order multi-level blending schemes. The initial conditions and the source term of our manufactured solution (56) are in all cases evaluated and applied on the mean values via an appropriate quadrature rule to maintain high order. The results confirm that the discretizations behave as designed in this assessment.

Table 1 Experimental order of convergence of the first-order FV variant within the 3D multi-level blending framework
Table 2 Experimental order of convergence of the second-order DG variant within the 3D multi-level blending framework
Table 3 Experimental order of convergence of the fourth-order DG variant within the 3D multi-level blending framework

3.3 Conservation Test

The goal in this assessment is to demonstrate that the multi-level-blending discretization is conservative for all choices of blending factors. To do so, we adapt the same setup as in Sect. 3.2, but deactivate the source term. The center of the domain is refined to introduce non-conforming interfaces in the computational domain. Additionally, as a stress test, the blending factors are randomly chosen and changed after each Runge-Kutta stage. As there are multiple blending factors at a given spatial location, we consider the following weighted blending factor:

$$\begin{aligned} \bar{\alpha } = \left\{ \left[ \left( 1-\alpha ^{\mathcal {O}(2)}\right) + 2\,\alpha ^{\mathcal {O}(2)}\right] \,\left( 1-\alpha ^{\mathcal {O}(4)}\right) + 4\,\alpha ^{\mathcal {O}(4)}\right\} \,\left( 1-\alpha ^{\mathcal {O}(8)}\right) + 8\,\alpha ^{\mathcal {O}(8)}, \end{aligned}$$
(57)

to illustrate the distribution of the blending factors in Fig. 4. Note the limiting cases \(\bar{\alpha }=1\) for pure FV and \(\bar{\alpha }=8\) for the eighth-order DG scheme.

Table 4 Experimental order of convergence of the eighth-order DG variant within the 3D multi-level blending framework. Here, we set \({\text {CFL}} := 0.1\), as the time integration method is only fourth-order accurate

The simulation runs to \(T=300\) performing more than a quarter million timesteps. The result of the test is shown in Fig. 5 where we plot in log-scale the absolute value of the change of bulk , integrated over the whole domain:

(58)

Q is the total number of elements and \(|\varOmega _q| = \Delta x_q\Delta y_q\Delta z_q\) is the volume per element. The results show that the conservation error lies within the range of 64 bit (double precision) floating point truncation and hence confirm that the multi-level blending discretization is fully conservative up to machine precision errors.

3.4 1D Shock Tube Problems

We validate the multi-level blending scheme with three well-established 1D problems, namely Sod, Lax, and Shu-Osher shock tubes. However, first, to gain insights into the individual contributions of the different schemes, we introduce a more intuitive reformulation of the blending factors \(\alpha ^{\mathcal {O}(n)}\). The multi-level blending operation (47) within element q can be interpreted as a linear superposition of four numerical schemes. For that, we collapse the following relations:

$$\begin{aligned} \partial _t \varvec{\bar{u}}_q^{'''}&:= \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(1)}, \\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q^{''}&= \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(2)}\right) \odot \partial _t \varvec{\bar{u}}_q^{'''} + \varvec{\alpha }_q^{\mathcal {O}(2)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(2)}, \\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q^{'}&= \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(4)}\right) \odot \partial _t \varvec{\bar{u}}_q^{''} + \varvec{\alpha }_q^{\mathcal {O}(4)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(4)},\\ \hookrightarrow \; \partial _t \varvec{\bar{u}}_q&= \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right) \odot \partial _t \varvec{\bar{u}}_q^{'} + \varvec{\alpha }_q^{\mathcal {O}(8)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(8)}, \end{aligned}$$

into one single term and define blending weights \(\theta ^{\mathcal {O}(n)}\), that is

$$\begin{aligned} \partial _t \varvec{\bar{u}}_q = \varvec{\theta }_q^{\mathcal {O}(1)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(1)} + \varvec{\theta }_q^{\mathcal {O}(2)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(2)} + \varvec{\theta }_q^{\mathcal {O}(4)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(4)} + \varvec{\theta }_q^{\mathcal {O}(8)} \odot \partial _t \varvec{\bar{u}}_q^{\mathcal {O}(8)}, \end{aligned}$$

where

Fig. 4
figure 4

Conservation test of the 3D multi-level blending scheme: slice through the computational domain showing weighted blending factor \(\bar{\alpha }\) according to (57) on a Cartesian non-conforming mesh with refinement levels 3–5. The black lines depict the boundaries of the corresponding 8th order DG elements

Fig. 5
figure 5

Conservation test of the 3D multi-level blending scheme: evolution of the integrated change of bulk (Eq. (58)) of each conservative state variable

$$\begin{aligned} \left\{ \begin{array}{l} \varvec{\theta }_q^{\mathcal {O}(1)} := \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right) \odot \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(4)}\right) \odot \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(2)}\right) , \\ \varvec{\theta }_q^{\mathcal {O}(2)} := \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right) \odot \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(4)}\right) \odot \varvec{\alpha }_q^{\mathcal {O}(2)}, \\ \varvec{\theta }_q^{\mathcal {O}(4)} := \left( \varvec{1}-\varvec{\alpha }_q^{\mathcal {O}(8)}\right) \odot \varvec{\alpha }_q^{\mathcal {O}(4)}, \\ \varvec{\theta }_q^{\mathcal {O}(8)} := \varvec{\alpha }_q^{\mathcal {O}(8)}. \end{array}\right. \end{aligned}$$
(59)

By construction, the blending weights have the following property:

$$\begin{aligned} \varvec{\theta }_q^{\mathcal {O}(1)} + \varvec{\theta }_q^{\mathcal {O}(2)} + \varvec{\theta }_q^{\mathcal {O}(4)} + \varvec{\theta }_q^{\mathcal {O}(8)} = \varvec{1}, \end{aligned}$$
(60)

and thus give a proper fraction of each contribution.

The first shock tube problem is the Sod shock tube [55]. It is defined on the unit interval \(\varOmega = [0,1]\) with a diaphragm located at \(x_D = 0.5\). The initial condition in primitive state variables reads

$$\begin{aligned} \big (\rho _0(x),v_0(x),p_0(x)\big ) = {\left\{ \begin{array}{ll} \big (1, 0, 1\big ), \quad x < x_D,\\ \big (0.125, 0, 0. 1\big ), \quad x \hbox {\,\char 062\,}x_D. \end{array}\right. } \end{aligned}$$

The resolution is set to 32 elements of \(N = 8\) mean values each. This amounts to 256 total DOF. The result for the density profile (top row) at the final simulation time \(T = 0.2\) is presented in Fig. 6 together with the exact solution. It shows the correct approximation of the rarefaction wave, contact discontinuity, and the forward facing shock front. As designed, only at the shock front, the blending scheme gets triggered, which is visible in the bottom row of the plot. The stacked bar chart directly corresponds to the blending weights \(\theta ^{\mathcal {O}(n)}\) in (59). The vertical dimension of the stacked bars completely fill the unit interval mirroring property (60).

Fig. 6
figure 6

Sod shock tube problem: numerical solution of the density profile (top row) with the DGFV8 multi-level blending scheme together with the exact solution at the final simulation time \(T = 0.2\). The bottom row shows the blending weights \(\theta ^{\mathcal {O}(n)}\) (Eq. (59)) encoded by stacked bars in different colors. The light gray vertical grid lines depict the element boundaries

The second test case is the Lax shock tube [48] with initial data set to

$$\begin{aligned} \big (\rho _0(x),v_0(x),p_0(x)\big ) = {\left\{ \begin{array}{ll} \big (0.445, 0.689,3.528\big ), \quad x < x_D,\\ \big (0.5,0,0.571\big ), \quad x \hbox {\,\char 062\,}x_D. \end{array}\right. } \end{aligned}$$

All other simulation parameters as well as the resolution are the same as in the Sod test case. The result for the density profile (top row) at the final simulation time \(T = 0.15\) is presented in Fig. 7 together with reference solution on a finer grid of 1 024 DOF with the third-order piecewise parabolic method (PPM) [49] implemented in the astrophysics code FLASH (version 4.6, March 2019), see, e.g., [20]. For comparison, we also include the solution of the PPM with the same grid resolution of 256 DOF. All flow features are resolved correctly and the blending scheme is only triggered in the region around the forward facing shock. Furthermore, this example clearly reveals the adaptive blending on the sub-element level.

Fig. 7
figure 7

Lax shock tube problem: numerical solution of the density profile (top row) with the DGFV8 (256 DOF) multi-level blending scheme together with the reference solution (PPM, 1 024 DOF) and PPM (256 DOF) at the final simulation time \(T = 0.2\). The bottom row shows the blending weights \(\theta ^{\mathcal {O}(n)}\) (Eq. (59)) encoded by stacked bars in different colors. The vertical grid lines depict the element boundaries

The third shock tube, the Shu-Osher test [54], is a Mach three shock interacting with a sinusoidal density wave. It reveals the scheme’s capability of capturing both, discontinuous and smooth parts of the flow. The computational domain in 1D is set to \(\varOmega = [-4.5,4.5]\), the final simulation time is \(T = 1.8\), and the primitive variables are initialized as

$$\begin{aligned} \big (\rho _0(x),v_0(x),p_0(x)\big ) = {\left\{ \begin{array}{ll} \big (3.856~714~3, 2.629~369, 10.333~33\big ), \quad x < -4,\\ \big (1 + 0.2\,\sin (5\,x), 0, 1\big ), \quad x \hbox {\,\char 062\,}-4. \end{array}\right. } \end{aligned}$$

Here, we compare the results of the multi-level blending DGFV8 to PPM. To investigate the importance of the multi-level approach on the accuracy of the DGFV8 result, we additionally perform a simulation where we intentionally deactivate the sub-elements, i.e., \(\varvec{\alpha }^{\mathcal {O}(2)} := 0\) and \(\varvec{\alpha }^{\mathcal {O}(4)} := 0\). This is identical to the single-level blending approach presented in Sect. 2.5, where only the first-order FV scheme is blended with the eighth-order DG scheme. The resolution is as before 256 total DOF, whereas the reference solution is computed with PPM on a much finer grid of 2 048 DOF. The numerical experiments shown in Fig. 8 nicely demonstrate the benefit of using the multi-level approach. Whereas the shocks are about equally resolved, the multi-level blending variant gives the best results in the smooth parts of the solution. Since the resolution is not very high, non-shock related small scale flow features cannot always be resolved by the eighth-order DG scheme. This is especially visible in the range \(x = [1.688,2.25]\) where the lower order scheme has to completely or at least partially take over.

Fig. 8
figure 8

Shu-Osher shock tube problem: numerical solution of the density profile (top row) with the DGFV8 multi-level blending scheme together with the reference solution (PPM on 2 048 DOF), PPM, and single-level blending scheme all using 256 DOF. The center row shows the blending weights \(\theta ^{\mathcal {O}(n)}\) Eq. (59) for the single-level blending, while the bottom row shows the multi-level blending. The vertical grid lines depict the element boundaries

3.5 2D Riemann Problems

In this section, we present a selection of three 2D Riemann problems [39, 41, 52]. The domain for all simulations is set to \(\varOmega = [-0.5,0.5]^2\) with a uniform grid resolution of \(64^2\) elements, respectively, and \(512^2\) DOF. The setup consists of the four quadrants each initialized with their own constant states. The exact parameters of each Riemann problem are given in [41] where they are addressed with a fixed configuration number. For brevity, we omit the setup parameters and refer to [41]. In this work, we show configurations 3, 4, and 6. We are interested in the change of the numerical solution when we incrementally add one level of blending order from one run to the next. Hence, we present three solutions for each 2D Riemann problem denoted by their respective multi-level schemes: DGFV2, DGFV4, and DGFV8. Note that the schemes are implemented in such a way that they operate on the same element size of \(N^2 = 8^2\) mean values. The results are shown in Fig. 9, 10 and 11. The left column shows the density contour and the right column shows the weighted blending factors as in (57). The general observation is that with increasing order, there is more structure visible in the density plots and the blending patterns get more nuanced in tracing the flow structures.

Fig. 9
figure 9

2D Riemann problem (configuration 3, see [41]) computed with the (from top to bottom) DGFV2, DGFV4, and DGFV8 scheme. The resolution of \(512^2\) DOF is the same for all runs. Left: density contours at final time \(T = 0.3\). Right: weighted blending factors as defined in (57). Dark blue represents the full eighth-order DG and dark red the full first-order FV scheme

Fig. 10
figure 10

2D Riemann problem (configuration 4, see [41]) computed with the (from top to bottom) DGFV2, DGFV4 and DGFV8 scheme. The resolution of \(512^2\) DOF is the same for all runs. Left: density contours at final time \(T = 0.25\). Right: weighted blending factors as defined in (57). Dark blue represents the full eighth-order DG and dark red represents the full first-order FV scheme

Fig. 11
figure 11

2D Riemann problem (configuration 6, see [41]) computed with the (from top to bottom) DGFV2, DGFV4, and DGFV8 scheme. The resolution of \(512^2\) DOF is the same for all runs. Left: density contours in log-scale at final time \(T = 0.3\). Right: weighted blending factors as defined in (57). Dark blue represents the full eighth-order DG and dark red the full first-order FV scheme

3.6 2D Sedov Blast

The Sedov blast problem [12, 63, 64] describes the self-similar evolution of a radially symmetrical blast wave from an initial pressure point (delta distribution) at the center into the surrounding, homogeneous medium. The analytical solution is given in [38, 53]. In our setup, we approximate the initial pressure point with a smooth Gaussian distribution:

$$\begin{aligned} \mathcal {E}_0(\varvec{x}) = \frac{p_0}{\gamma -1} + \frac{E}{(2\uppi \,\sigma ^2)^{d/2}} \, \exp {\Big (-\frac{1}{2}\,\frac{\varvec{x}^{\text {T}}\varvec{x}}{\sigma ^2}\Big )}, \end{aligned}$$
(61)

with the spatial dimension \(d = 2\), the blast energy \(E = 1\), and the width \(\sigma \), such that the initial Gaussian is reasonably resolved. The surrounding medium is initialized with \(\rho _0 = 1\) and \(p_0 = 10^{-14}\). Dimensional analysis [53] reveals that the analytical solution of the density right at the shock front is determined by

$$\begin{aligned} \rho _{\text {shock}} = \frac{\gamma + 1}{\gamma -1}\,\rho _0. \end{aligned}$$

With the adiabatic coefficient \(\gamma =1.4\), we investigate how close the numerical results match \(\rho _{\text {shock}} = 6\). The Cartesian mesh has an FV equivalent uniform grid resolution of \(512^2\) DOF, i.e., when computing with the full eighth-order DG approximation space, the total number of DG elements is \(64^2\). The spatial domain is \(\varOmega \in [-0.25,0.25]^2\) with the initial blast width \(\sigma = 5\times 10^{-3}\). We compare the accuracy of the results obtained with the single-level and the multi-level (DGFV8) blending discretizations as well as the PPM. Figure 12 shows the shell-averaged density and pressure profiles at final time \(T = 0.05\). Figure 13 presents the numerical solution over the whole domain as computed with the multi-level DGFV8. To further illustrate the behavior of the multi-level and single-level blending approach, we also show in Fig. 14 the weighted blending factors along the x-axis. The shock front is much sharper for the multi-level blending compared to the single-level blending. It can be observed how the weighted blending factor is dominated by the first-order FV scheme (\(\bar{\alpha }\approx 1\)) directly at the shock, but transitions quickly to a blended discretization (\(1<\bar{\alpha }<8\)) up to the full eighth-order DG (\(\bar{\alpha }\approx 8\)) away from the shock, even within a single DG element. This behavior demonstrates the sub-element adaptivity of our novel approach. Again, similarly to the shock tube Sect. 3.4 and the 2D Riemann problem Sect. 3.5, the results for the 2D Sedov blast wave show the benefit of the multi-level approach, with the numerical profiles even slightly closer to \(\rho _{\text {shock}} = 6\) compared to the PPM with equal resolution of \(512^2\) DOF.

Fig. 12
figure 12

2D Sedov blast: shell-averaged density and pressure profiles at final simulation time \(T = 0.05\) computed with the single-/multi-level blending scheme (DGFV8) and PPM on an FV equivalent uniform grid resolution of \(512^2\) DOF. The vertical grid lines depict the element boundaries

Fig. 13
figure 13

2D Sedov blast: numerical solution computed with DGFV8 at final simulation time \(T = 0.05\). Left: density contours. Right: weighted blending factors as defined in (57). Dark blue represents the full eighth-order DG and dark red represents the full first-order FV scheme

Fig. 14
figure 14

2D Sedov blast: we compare the blending factor profiles along the x-axis of the single- and multi-level blending schemes at final time \(T = 0.05\). The blending weights \(\theta ^{\mathcal {O}(n)}\) (Eq. (59)) are encoded with stacked bars in their respective colors. The vertical grid lines highlight the eighth-order DG element boundaries. For reference, the scaled density (\(\rho /6\)) and scaled pressure (p/5) are included

4 Simulation of a Young Supernova Remnant

Supernova models have been analyzed and discussed for many decades and since they unite a broad range of features such as strong shocks, instabilities, and turbulence, they resemble a good test bed for our novel shock capturing approach in combination with AMR.

The general sequence of events of the presented supernova simulation is like this: we start with a constant distribution of very-low-density resembling interstellar media (ISM) that typically fills the space between stars. When a star explodes by turning into a supernova, it ejects its own mass at very high speeds into the ISM preceded by a strong shock front heating up the ISM. The ejected mass is rapidly decelerated by the swept-up ISM giving rise to a so-called reverse shock that travels backward to the center. The interface, or more precisely the contact discontinuity, between shocked ejecta and shocked ISM is unstable and leads to a layer of slowly growing Rayleigh-Taylor instabilities. This gradually expanding layer, called supernova remnant, is of special interest, since this is where astronomical observations reveal a lot of ongoing physics and chemistry, especially driven by mixing and turbulence.

Table 5 Conversion from cgs units to simulation units
Table 6 Hydrodynamical parameters in cgs units and simulation units
Fig. 15
figure 15

Computational domain (cubic box) covering one octant of the supernova model. The faces at the coordinate axes are set to reflecting walls, while the opposite sides are set to outflow

Fig. 16
figure 16

Left column: 2D density slice (see Fig. 15) showing the instability region, respectively, remnant of the supernova at \(T = 500\,\)years simulated with the (from top to bottom) DGFV2, DGFV4, and DGFV8 scheme. Right column: 2D slice of the weighted blending factors of the respective blending schemes at \(T = 500\,\)years. The black lines correspond to the element boundaries of the Cartesian non-conforming mesh

Fig. 17
figure 17

3D density contour rendering showing the instability region, respectively, remnant of the supernova at the final simulation time \(T = 500\,\)years simulated with the DGFV8 scheme

We adapt the setup descriptions in [8, 16, 18] where we have the initial (internal) blast energy E and the ejecta mass M given in cgs (centimeter-gram-seconds) units. It is beneficial to convert the given units to convenient simulation units reflecting characteristic dimensions of the physical model at hand. Table 5 lists the conversion between cgs and simulation units, and Table 6 lists the initial parameters used in this simulation. The ambient density \(\rho _a\) is related to the mono-atomic particle (hydrogen) density \(n_H\) via \(\rho _a = m_u \, n_H\), where \(m_u\) is \(\frac{1}{12}\) of the mass of a carbon-12 atom. The ambient pressure \(p_a\) is calculated from the ideal gas law, i.e., \(p_a = n_H\,k_B\,T\) with the Boltzmann constant \(k_B\). There is some ambiguity regarding the ambient gas temperature T. The literature mentions a warm and neutral interstellar medium which is attributed to temperatures between \(6\times 10^3\,\text {K}\) and \(10^4\,\text {K}\). The heat capacity ratio is fixed to \(\gamma = 5/3\). The simulation time spans a period from \(t_0 = 10\,\)years to \(T = 500\,\)years. The expansion of the forward shock (64) is then expected to approximately reach \(R_{\text {FS}} = 5\,\text {pc}\), which determines the size of the computational domain \(L := 5\,\text {pc}\). Figure 15 depicts a schematic of the simulation setup. Due to the rotational symmetry of the setup, it is sufficient to simulate just one octant of the supernova. The following formulas have been derived in [8] and were adapted to the current setup, i.e., power law indices of \((s,n) = (0,7)\). The self-similar solution at the initial time \(t_0 = 10\,\text {yr}\) within the power law region and, respectively, the blast center, is given by

$$\begin{aligned} r(t) = t \; \sqrt{\frac{5}{3}\,\frac{E}{M}} \quad \text {and}\quad \rho (t) = \frac{25}{21\uppi } \; \frac{E^2}{M} \, t^4 \, r(t)^{-7}. \end{aligned}$$
(62)

We initialize the density as

$$\begin{aligned} \rho _0(\varvec{x}) = \rho _a + \rho (t_0) \cdot {\left\{ \;\begin{aligned}&\quad \;\;\; 1,&\quad |\varvec{x}| \hbox {\,\char 054\,}r(t_0), \\&\left( \frac{|\varvec{x}|}{r(t_0)}\right) ^{-7},&\quad |\varvec{x}| > r(t_0), \end{aligned}\right. } \end{aligned}$$
(63)

and the total energy with (61) where \(p_0 = p_a\), \(d = 3\), and \(\sigma = \frac{3}{4}\,r(t_0)\). The initial momentum is \((\rho \,\varvec{v})_0 = \varvec{0}\). Since we are only interested in the evolution of the instability layer of the supernova, we apply the following rules for mesh refinement and coarsening. The expansion radius of the forward shock over time is given by

$$\begin{aligned} R_{\text {FS}}(t) = 1.06 \left( \frac{E^2}{M\,\rho _{a}}\right) ^{1/7} \, t^{4/7}. \end{aligned}$$
(64)

This allows us to assign an adaptive, high-resolution shell of maximal refined elements following the remnant as it expands into the computational domain. The inner and outer radii of the shell are estimated as

$$\begin{aligned} R_{\text {inner}}(t) = 0.7\,R_{\text {FS}}(t) \quad \text {and}\quad R_{\text {outer}}(t) = 1.15\,R_{\text {FS}}(t), \end{aligned}$$
(65)

which have been found adequate via numerical experimentation. Moreover, up to \(t = 200\,\)years, we enforce \(R_{\text {inner}} = 0\), which ensures that the first phase of the explosion is well resolved in any case. The refinement levels range from 2 to 6, which translates to an FV equivalent resolution from \(2^2\cdot 8 = 32\) up to \(2^6\cdot 8 = 512\) cells in each spatial direction.

We perform three simulations with the 3D multi-level blending schemes DGFV2, DGFV4, and DGFV8, analog to the 2D Riemann problems discussed in Sect. 3.5. Figure 16 shows the density slice (left column) sketched in Fig. 15 at the final simulation time of \(T = 500\,\)years, while Fig. 17 shows the corresponding 3D density contour rendering of the DGFV8 solution. The shock front partially left the domain, which is not considered a problem since the region of interest, namely the instability layer, is still completely covered. The areas of no interest, i.e., the outer region as well as the center, are only coarsely resolved by the AMR scheme. Clearly, an increase in order leads to a much more detailed remnant structure emphasizing the advantage of higher order schemes in resolving small-scale turbulence driven by Rayleigh-Taylor instability, see [8]. The weighted blending factor is shown in the right column of Fig. 16. The band of highly refined elements is clearly visible following the remnant as intended. Two distinctive lines of blending activity trace the front and reverse shocks. The plots also show a strong qualitative difference of the amount of scales in the instability layer for DGFV2 and DGFV4. Clearly, the DGFV4 result features more scales and finer structures as the DGFV2 simulation with the same FV equivalent grid resolution. The difference in scales between DGFV4 and DGFV8 is less pronounced which is probably related to the extensive blending activity with O4 inside the instability layer of the DGFV8 simulation. In this turbulent part, we suspect that the standard collocation eighth-order DG scheme might face aliasing instability issues as described in the introduction. There are techniques to reduce aliasing issues available, such as filtering, consistent integration, and split forms. However, this aspect is not the main topic of the paper and it is interesting to see that the multi-level blending automatically adjusts to cope with these issues, as well.

5 Conclusion

In this work, we introduce an adaptive sub-element-based shock capturing approach for DG methods. We interpret an element first as a collection of piecewise constant data. This set of piecewise constant data can be interpreted and reconstructed in a variety of ways. We focus on piecewise polynomial approximation spaces, starting from a pure piecewise constant FV-type interpretation (no reconstruction) up to the fully maximum order polynomial reconstruction and every combination in-between, e.g., piecewise linear and piecewise cubic reconstructions. In a second step, we link the data interpretation to a corresponding (high order) DG discretization. Thus, we get a hierarchy of discretizations acting on the same set of data.

The idea is then to adaptively blend this hierarchy of different discretization, where the low-order variants are chosen close to discontinuities and the high-order variants in smooth or turbulent parts of the simulation. Instead of having an element-based troubled cell indicator approach, we use the different data interpretations again to compute sub-element localized indicators, which allows for a sub-element adaptive blending of the discretizations. When the blending can change throughout the element, a special care is necessary to preserve exact conservation of the resulting multi-level blended discretization. We achieve exact conservation, by introducing unique, blended reconstruction states at subcell and sub-element interfaces.

In our prototype implementation, we further demonstrate that a natural combination of this sub-element adaptive approach is with adaptive mesh refinement. We base the AMR implementation on the p4est Octree library, which allows for a straight forward parallelization of the whole computational framework.

Fig. 18
figure 18

Schematic of eight (\(N = 8\)) mean values and its four levels of data interpretation. The values \(\mu _{7\pm 1/2}^{\mathcal {O}(8)}\) indicate the location of the interpolation nodes in (48) of the FV subcell interpolation operator \(\varvec{I}^{\pm \mathcal {O}(n)}\), \(n = 2,4,8\)

Fig. 19
figure 19

Schematic of conforming interface \(q-\frac{1}{2}\) with 1:1 adjacent elements \(q-1\) and q for \(N = 4\). The two kinds of boundary values occurring in (A6) are illustrated

We show standard numerical test cases to validate the new approach and a simplified model of a supernova remnant to highlight its high accuracy for challenging test cases with strong shocks and turbulence like structures.