## 2 The Numerical Framework
### p-Adaptation Strategy  
Polynomial functions are adopted in DG methods to represent the numerical solution inside the elements of the mesh with no continuity requirements at the cells interfaces. As a consequence, the order of accuracy can be varied locally by using a different degree of the polynomial representation (see Figure 1) according to some error indicator. In literature this approach is known as \(p\)-adaptation [32; 33; 34; 35; 36] and allows for the capture of the flow features by changing locally the solution accuracy.  
The time-averaged solution is used to compute the error estimator, as statistically stationary unsteady flow problems are the objective of this work. The estimator combines two contributions: (_i_) a measure of the solution jumps at grid cells interfaces [37; 38]; (_ii_) the decay rate of the modal coefficients of the polynomial expansion [39]. Both indicators aim at revealing a lack/excess of spatial accuracy in the numerical discretization and are here applied to the pressure variable. For a comprehensive discussion on the error estimator implementation see [14]. This strategy can be used in parallel only with a balanced re-partitioning of the computational grid after each adaptation cycle, to overcome the natural imbalance of floating point operations per domain induced by the adaptation. The flow chart of the solution strategy is reported in Figure 2. The adaptation process is triggered by a simple indicator, _trg_, defined as the norm of the relative increment, computed at each time step, of the vector of the degrees of freedom of the time-averaged solution at run-time \(\overline{\mathbf{U}}\). \(l\) is the index denoting the \(l\)-th adaptive cycle, \(i\) denotes the \(i\)-th time-step, while \(j\) denotes the \(j\)-th iteration between two adaptation cycles. The user-defined parameters for the simulation are: the number of adaptation cycles \(n_{adp}\), the threshold tolerance for the activation of the adaptation process \(tol_{trg}\) and the minimum number of time steps between two adaptation cycles \(\mathcal{N}_{adp}\). At each adaptation cycle, only 20% of elements with the higher estimated error are marked for refinement, while the coarsening is disabled. This choice is motivated by the use of coarse meshes for the simulations.  
The \(p\) refinement allows also for the simplification of the mesh generation process, as the typical a priori mesh refinement required capturing the known flow features, such as wakes or detachments, is avoided. Moreover, in this work an approach to locally adapt the degree of exactness of quadrature rules according to the mesh characteristics is adopted, to avoid the over-integration of straight-sided elements, which appear in regions far from the walls. Finally, a multilevel preconditioner is used to strongly reduce the memory requirements and the operation count [26]. This preconditioner speeds up the linear systems solution, here performed via the memory-saving matrix-free FGMRES method, by solving coarse problems and moving along a given path, e.g., a V-cycle. These coarse problems are defined as a sequence of reduced polynomial degree discretizations and use GMRES as a smoother on each level. On each level, except the coarsest, the smoothers use a cheap matrix-based preconditioner built by a simply neglecting the off-diagonal blocks of the restricted implicit operator. All the details of this preconditioning technique and its use in the order adaptive framework are presented in [14; 26].