The governing compressible Navier-Stokes equations, representing conservation of mass, momentum and energy, can be written in abridged form as
$$\begin{aligned} \frac{\partial \mathbf{U} }{\partial t} = \textit{L}\left( \mathbf{U} \right) = - \sum _{i=1}^d \frac{\partial \mathbf{H} _{i}}{\partial \mathbf{x} _{i}}\; ; \qquad \mathbf{H} _{i} = \mathbf{F} _{i}(\mathbf{U} ) - \mathbf{G} _{i}(\mathbf{U} ,\nabla \mathbf{U} ), \end{aligned}$$
(1)
where \(\textit{L}\) is the analytical nonlinear spatial operator, d is the number of dimensions of the problem, and \(\mathbf{U} =[\rho ,\rho u_{1}, \cdots, \rho u_{d},E]^{{\rm T}}\) is the vector of conservative variables. The inviscid flux, \(\mathbf{F} =\mathbf{F} (\mathbf{U} )\), and the viscous flux, \(\mathbf{G} =\mathbf{G} (\mathbf{U} ,\nabla \mathbf{U} )\), in the ith direction are given by
$$\begin{aligned} \mathbf{F} _{i}= \begin{bmatrix} \rho \,u_{i}\\ \rho \,u_{1}u_{i}+p \, \delta _{1,i}\\ \vdots \\ \rho \, u_{d}u_{i}+p \, \delta _{d,i}\\ u_{i}(E+p) \end{bmatrix} , \qquad \mathbf{G} _{i}= \begin{bmatrix} 0\\ \tau _{i1}\\ \vdots \\ \tau _{id}\\ \sum \limits _{j=1}^{d}{u_{j}\tau _{ij}}-q_{i} \end{bmatrix}. \end{aligned}$$
(2)
Here, \(E=\rho (C_{v}T+u_{i}u_{i}/2)\) is the total energy in which \(C_{v}\) is the specific heat capability with constant volume, \(p=(\gamma -1)(E-\rho u_{i}u_{i}/2)\) is the pressure, \(\gamma\) is the specific heat ratio, \(\tau _{ij}=\mu (\frac{\partial u_{i}}{\partial \mathbf{x} _{j}}+\frac{\partial u_{j}}{\partial \mathbf{x} _{i}}-\frac{2}{3}\frac{\partial u_{i}}{\partial \mathbf{x} _{i}}\delta _{ij})\) is the viscous tensor, \(q_{i}=-\kappa \frac{\partial T}{\partial \mathbf{x} _{i}}\) is the heat flux, \(\mu\) is the dynamic viscosity, and \(\kappa\) is the thermal conductivity.
In what follows we briefly outline the formulation of a compressible flow solver based on a discontinuous Galerkin (DG) spatial discretization [13], an implicit time integration via ESDIRK temporal discretization schemes [17] and a JFNK method [16]. Further details of the solver can be found in reference [29].
Discretizations and Error Estimate
Spatial Discretization
In DG methods, the computational domain is divided into non-overlapping elements and a polynomial space is defined on each element. Performing integration by parts after multiplying the test function \(\phi _{p}\) to Eq. (1), we get the weak form of Eq. (1) in element e:
$$ \intop _{\varOmega _{e}}\frac{\partial {\mathbf {U}}}{\partial t}\phi _{p}\mathrm{d}\varOmega _{e}=\intop _{\varOmega _{e}}\mathbf {\nabla }\phi _{p}\cdot {\mathbf {H}}\mathrm{d}\varOmega _{e}-\intop _{\Gamma _{e}}\phi _{p}{\mathbf {H}}^{n}\mathrm{d}\varGamma _{e}, $$
(3)
where \(\varGamma _{e}\) is the element boundary, and \({\mathbf {H}}^{n}\) is the boundary flux on the elemental outward normal direction (\({\mathbf {n}}\)). Furthermore, the vector of conserved variables \(\mathbf{U}\) is expressed in the polynomial space as
$$\begin{aligned} \mathbf{U} _{\delta }\left( \mathbf{x} , t\right) \approx \sum ^{N_P}_{p=0}\phi _{p}(\mathbf{x} ) \mathbf{u} _{p}(t) \end{aligned}$$
(4)
on each computational element. Here, \(\mathbf{u} _{p}\) is the coefficient of the pth basis function and \(N_P+1\) is the number of basis functions. To discretize Eq. (3), a quadrature rule is adopted to approximate the integration. The \(\mathbf{U}\) on these quadrature points can be calculated by
$$\begin{aligned} \mathbf{U} _{\delta , i} = \sum ^{N_P}_{p=0}\phi _{p}(\mathbf{x} _i) \mathbf{u} _{p}(t) = \sum ^{N_P}_{p=0}{} \mathbf{B} _{i,p} \mathbf{u} _{p}(t), \end{aligned}$$
(5)
where the subscript i indicates values on the ith quadrature point, and \(\mathbf{B}\) is the backward transform matrix. Using the Roe’s Riemann flux [26] and the symmetric interior penalty DG (SIPG) method [10] to approximate the advective numerical flux and the viscous numerical fluxes, respectively, the semi-discrete equation can be expressed as
$$\begin{aligned}\frac{\mathrm{d}{\mathbf {u}}}{\mathrm{d}t}&= {\mathcal {L}}_{\delta }\left( \mathbf{u} \right) \\&= {\mathbf {M}}^{-1} \sum _{j=1}^{d}{\mathbf {B}}^{{\rm T}}{\mathbf {D}}_{j}^{{\rm T}}\mathbf {\varLambda }\left( wJ\right) {\mathbf {H}}_{j} \\&\quad-{\mathbf {M}}^{-1} \left( {\mathbf {B}}^{\varGamma }\mathbf {M_{c}}\right) ^{{\rm T}}\mathbf {\varLambda }\left( w^{\varGamma }J^{\varGamma }\right) \hat{{\mathbf {H}}}^{n} \\&\quad-{\mathbf {M}}^{-1} \sum _{j=1}^{d}{\mathbf {B}}^{{\rm T}}{\mathbf {D}}_{j}^{{\rm T}}{\mathbf {J}}^{{\rm T}}\mathbf {\varLambda }\left( w^{\varGamma }J^{\varGamma }\right) \hat{{\mathbf {S}}}^{n}_{j}, \end{aligned}$$
(6)
where w is the quadrature weight, J is the grid metric Jacobian, \(\mathbf {\varLambda }\) represents a diagonal matrix, \({\mathbf {M}}={\mathbf {B}}^{{\rm T}}\mathbf {\varLambda }\left( wJ\right) {\mathbf {B}}\) is the mass matrix, \({\mathbf {D}}_{j}\) is the derivative matrix in the jth direction, the superscript \(\varGamma\) represents the corresponding matrices or variables on element boundaries, \(\hat{{\mathbf {S}}}^{n}_{j}\) is a symmetric flux from the SIPG method, \(\mathbf {M_{c}}\) is the mapping matrix between \(\phi ^{\varGamma }\) and \(\phi\), and \({\mathbf {J}}\) is the interpolation matrix from quadrature points of an element to quadrature points of its element boundaries. Details of the spatial discretization can be found in reference [29].
The corresponding semi-discrete equation for the vector \(\mathbf{U} _{\delta }\) can be obtained using relation of Eq. (5) and
$$\begin{aligned} L_{\delta }\left( \mathbf{U} \left( \mathbf{u} \right) \right) = \mathbf{B} {\mathcal {L}}_{\delta }\left( \mathbf{u} \right) , \end{aligned}$$
(7)
which is written as
$$\begin{aligned} \frac{\partial \mathbf{U} _{\delta }}{\partial t} = \textit{L}_\delta \left( \mathbf{U} _{\delta }\right) . \end{aligned}$$
(8)
The spatial truncation error can be expressed as
$$\begin{aligned} \mathbf{E} _s(\mathbf{U} _{\delta }) = L_{\delta }\left( \mathbf{U} _{\delta }\right) -L\left( \mathbf{U} \right) = C_sD_s(\mathbf{U} )h^{P+1} + O(h^{P+2}), \end{aligned}$$
(9)
where \(C_s\) is a coefficient related to the discretization scheme but independent of \(\mathbf{U}\), \(D_s(\mathbf{U} )\) is a spatial derivative term dependent on \(\mathbf{U}\) and P is the polynomial order of the basis functions in Eq. (5).
Temporal Discretization
An embedded version of the ESDIRK method [17] is adopted to discretize Eq. (3) in time. The ith stages of the process of ESDIRK are
$$\begin{aligned} \mathbf{U} ^{(0)}= & {} \mathbf{U} ^{n}, \end{aligned}$$
(10)
$$\mathbf{S} ^{(i)}= {} \mathbf{U} ^{n}+\Delta t \sum ^{i-1}_{j=1}{a_{ij}{} \textit{L}\left( \mathbf{U} ^{(j)}\right) } , i=1,2,\cdots, S,$$
(11)
$$\mathbf{U} ^{(i)}= {} \mathbf{S} ^{(i)}+\Delta t a_{ii} \textit{L}\left( \mathbf{U} ^{(i)}\right) , i=1,2,\cdots, S, $$
(12)
$$\mathbf{U} ^{n+1}= {} \mathbf{U} ^{n}+\Delta t\sum ^{S}_{i=1}{b_{i} \textit{L}\left( \mathbf{U} ^{(i)}\right) } , $$
(13)
$$\hat{\mathbf{U }}^{n+1}= {} \mathbf{U} ^{n}+\Delta t\sum ^{S+1}_{i=1}{{\hat{b}}_{i} \textit{L}\left( \mathbf{U} ^{(i)}\right) } , $$
(14)
where \(a_{ij}\), \(b_i\) and \({\hat{b}}_{i}\) are coefficients of the Butcher tableaus on the ith RK stage which can be found in Appendix A and in reference [17]. \(\mathbf{U} ^{n+1}\) is the approximation at time step \(n+1\). \(\hat{\mathbf{U }}^{n+1}\) is the embedded solution for temporal error estimate at the cost of one extra implicit stage. For the embedded ESDIRK schemes adopted, \(\hat{\mathbf{U }}^{n+1}\) is one order higher than \(\mathbf{U} ^{n+1}\). Thus, the leading term of the temporal error of \(\mathbf{U} ^{n+1}\) can be accurately estimated as
$$ \begin{aligned} \mathbf{E} _t^{n+1}&= \mathbf{U} ^{n+1} - \hat{\mathbf{U }}^{n+1} \\&= \Delta t\sum ^{S+1}_{i=1}{(b_{i} - {\hat{b}}_{i}) \textit{L}\left( \mathbf{U} ^{(i)}\right) } \\&= C_tD_t(\mathbf{U} )\Delta t^{N+1} + O(\Delta t^{N+2}), \end{aligned} $$
(15)
where \(b_{S+1}\) is always zero in the ESDIRK schemes adopted, \(C_t\) is a coefficient related to the ESDIRK scheme adopted but independent of \(\mathbf{U}\), \(D_t(\mathbf{U} )\) is a problem dependent temporal derivative term, and N is the order of accuracy of the ESDIRK scheme. In the derivation of Eq. (15), the analytical equations, Eq. (1), have been adopted to replace the spatial operator with the temporal derivatives, thus spatial error is not included. The estimation also excludes the temporal errors from previous time steps and will be referred to as the local temporal error in this paper.
Discrete Formulation
The discrete formulation of the governing equations is obtained by replacing \(\mathbf{U}\) and \(\textit{L}\) in Eqs. (10)–(14) with their discrete counterparts (\(\mathbf{U} _{\delta }\) and \(\textit{L}_{\delta }\)). To reduce the size of the nonlinear system for implicit stages (\(a_{ii} \ne 0\)), we choose to rewrite the discrete counterparts of Eqs. (11)–(12) as
$$\mathbf{s} ^{(i)}= {} \mathbf{u}_{\delta } ^{n}+\Delta t \sum ^{i-1}_{j=1}{a_{ij}{\mathcal {L}}_\delta \left( \mathbf{u} _{\delta }^{(j)}\right) } , i=1,2,\cdots, S, $$
(16)
$$\mathbf{u}_{\delta } ^{(i)}= {} \mathbf{s} ^{(i)}+\Delta t a_{ii} {\mathcal {L}}_\delta \left( \mathbf{u}_{\delta } ^{(i)}\right) , i=1,2,\cdots, S, $$
(17)
$$\mathbf{U} _{\delta }^{(i)}= {} \mathbf{B} \mathbf{u}_{\delta } ^{(i)},$$
(18)
since the length of \(\mathbf{u}_{\delta }\) is usually smaller than that of \(\mathbf{U} _{\delta }\). In rewriting the above equations, the relations of Eqs. (5) and (7) are used.
JFNK Method
Equation (17) of the implicit stages (\(a_{ii} \ne 0\)) can be written as the nonlinear system
$$\begin{aligned} \mathbf{N} (\mathbf{u} _{\delta }^{(i)})=\mathbf{u} _{\delta }^{(i)} - \mathbf{s} ^{(i)}-\Delta t a_{ii} {\mathcal {L}}_\delta \left( \mathbf{u} _{\delta }^{(i)}\right) = \mathbf{0} . \end{aligned}$$
(19)
This system is iteratively solved by Newton’s method with an initial guess \(\mathbf{v} ^{0} = \mathbf{s} ^{(i)}\). The Newton step, \(\Delta \mathbf{v} =\mathbf{v} ^{k+1}-\mathbf{v} ^{k}\), is updated through the solution of the linear system
$$\begin{aligned} \frac{\partial \mathbf{N} (\mathbf{v} ^{k})}{\partial \mathbf{v} }\Delta \mathbf{v} =-\mathbf{N} (\mathbf{v} ^{k}). \end{aligned}$$
(20)
A preconditioned GMRES iterative solver is adopted here to solve the unsymmetric system of Eq. (20). A Jacobian-free method is further adopted in the GMRES to approximate the Jacobian matrix and a vector inner product operator using a finite difference approximation, that is
$$\begin{aligned} \frac{\partial \mathbf{N }(\mathbf{v }^{k})}{\partial \mathbf{v }}\mathbf{q }_{i}=\frac{\mathbf{N }(\mathbf{v }^{k}+\xi \mathbf{q }_{i})-\mathbf{N }(\mathbf{v }^{k})}{\xi }, \end{aligned}$$
(21)
where \(\mathbf{q} _i\) is a set of orthogonal vectors in the Krylov space, the expression of \(\xi\) can be found in references [16, 29]. A low memory block relaxed Jacobi iterative preconditioner is used in the GMRES solver to speedup the simulation [29]. The GMRES tolerance of \(0.05\Vert \mathbf{N} (\mathbf{v} ^{k}) \Vert\) adopted here has no influence on the temporal accuracy but affects its efficiency. Other choices of the GMRES tolerance can be found in references [8, 14].
When the Newton residual is smaller than the convergence tolerance of the Newton iterations \(\tau\), which is
$$\begin{aligned} \Vert \mathbf{N} (\mathbf{v} ^{k}) \Vert = \Vert \mathbf{R} (\mathbf{v} ^{k}) \Vert \leqslant \tau , \end{aligned}$$
(22)
\(\mathbf{u} _{it}^{(i)} = \mathbf{v} ^{k}\) is regarded as the approximate solution of the nonlinear system, where \(\mathbf{R}\) is the remaining Newton residual vector \(\mathbf{N} (\mathbf{u} ^{(i)}_{it})\) after convergence. A proper choice of \(\tau\) is important because it determines the magnitude of the iterative error introduced by the iterative solver, which may degrade the overall error and the convergence order of accuracy [22]. Assume \(\mathbf{u} ^{(i)}_{\delta }\) is the exact solution of the nonlinear system and \(\mathbf{u} ^{(i)}_{it}\) is the iterative approximation, we can get \(\mathbf{N} (\mathbf{u} ^{(i)}_{\delta })=\mathbf{0}\) and \(\mathbf{N} (\mathbf{u} ^{(i)}_{it})=\mathbf{R} ^{(i)}\). Thus,
$$\begin{aligned} \mathbf{N} (\mathbf{u} ^{(i)}_{it}) - \mathbf{N} (\mathbf{u} ^{(i)}_{\delta })= (\mathbf{u} _{it}^{(i)} - \mathbf{u} _{\delta }^{(i)} )-\Delta t a_{ii} \left( {\mathcal {L}}_\delta \left( \mathbf{u} _{it}^{(i)}\right) - {\mathcal {L}}_\delta \left( \mathbf{u} _{\delta }^{(i)}\right) \right) = \mathbf{R} ^{(i)}. \end{aligned}$$
(23)
The contribution of the iterative error to the total discretization error will be discussed in the following.
Error Estimate
In this section, the local discretization errors introduced at time step \(n+1\) are estimated, which mainly consist of the spatial error, temporal error and iterative error. The accumulation of these errors, which we refer to as global errors, is more difficult to estimate and will not be considered in this paper. Studies considering the global errors can be found in reference [19].
We recall that the numerical solution at the time step \(n+1\) is calculated by
$$ \mathbf{U} _{it}^{n+1} = \mathbf{U} ^{n}+\Delta t\sum ^{S}_{i=1}{b_{i} \textit{L}_{\delta }\left( \mathbf{U} ^{(i)}_{it}\right) } , $$
(24)
and the exact solution at \(n+1\), \(\mathbf{U} (t^{n+1})\), based on \(\mathbf{U} ^{n}\) can be expressed as
$$\begin{aligned} \mathbf{U} (t^{n+1})&= \hat{\mathbf{U }}^{n+1}+O(\Delta t^{N+2}) \\&= \mathbf{U} ^{n}+\Delta t\sum ^{S+1}_{i=1}{{\hat{b}}_{i} \textit{L}\left( \mathbf{U} ^{(i)}\right) }+O(\Delta t^{N+2}) , \end{aligned}$$
(25)
where \(O(\Delta t^{N+2})\) represents all the high-order truncation terms and is not detailed here. Subtracting Eq. (24) by Eq. (25) and ignoring the high-order truncation terms of \(O(\Delta t^{N+2})\), the leading terms of the local discretization error can be expressed as
$$\mathbf{U} _{it}^{n+1} - \mathbf{U} (t^{n+1}) \approx\Delta t\sum ^{S}_{i=1}{b_{i} \textit{L}_{\delta }\left( \mathbf{U} ^{(i)}_{it}\right) } - \Delta t\sum ^{S+1}_{i=1}{{\hat{b}}_{i} \textit{L}\left( \mathbf{U} ^{(i)}\right) }.$$
(26)
If we now add and subtract the summation terms of \(\Delta t\sum ^{S+1}_{i=1}{b_{i} \textit{L}\left( \mathbf{U} ^{(i)}\right) }\) and \(\Delta t\sum ^{S}_{i=1}{b_{i} \textit{L}_{\delta }\left( \mathbf{U} _{\delta }^{(i)}\right) }\) to the right-hand side of Eq. (26), we obtain
$$ \begin{aligned} \mathbf{U} _{it}^{n+1} - \mathbf{U} (t^{n+1}) \approx&\Delta t\sum ^{S+1}_{i=1}{(b_{i}-{\hat{b}}_{i}) \textit{L}\left( \mathbf{U} ^{(i)}\right) } + \Delta t\sum ^{S}_{i=1}{b_{i} \left( \textit{L}_{\delta }\left( \mathbf{U} _{\delta }^{(i)}\right) - \textit{L}\left( \mathbf{U} ^{(i)}\right) \right) } \\&+ \Delta t\sum ^{S}_{i=1}{b_{i} \left( \textit{L}_{\delta }\left( \mathbf{U} _{it}^{(i)}\right) - \textit{L}_{\delta }\left( \mathbf{U} _{\delta }^{(i)}\right) \right) } , \end{aligned} $$
(27)
where \(b_{S+1}\) is always zero in the ESDIRK schemes adopted. The \(\textit{L}_{\delta }\left( \mathbf{U} _{it}^{(i)}\right) - \textit{L}_{\delta }\left( \mathbf{U} _{\delta }^{(i)}\right)\) in the last term of Eq. (27) is related to Eq. (23) and can be considered as the iterative error \(\mathbf{E} ^{(i)}_{it}\). Using the relations of Eqs. (9) and (15) and ignoring high-order terms of \(O(h^{P+2})\), we can now rewrite each term as
$$\begin{aligned} \mathbf{U} _{it}^{n+1} - \mathbf{U} (t^{n+1}) &\approx C_tD_t(\mathbf{U} )(\Delta t)^{N+1} + \Delta t C_s \bar{D_s}(\mathbf{U} ) h^{P+1} + \Delta t \bar{\mathbf{E }}_{it} \\&= \mathbf{E} _t^{n+1} + \Delta t \bar{\mathbf{E }}_s + \Delta t \bar{\mathbf{E }}_{it} \\ & =\mathbf{B} \left( \mathbf{e} _t^{n+1} + \Delta t \bar{\mathbf{e }}_s + \Delta t \bar{\mathbf{e }}_{it}\right) , \end{aligned}$$
(28)
where we have used the overbar to denote summations of the form \({\bar{\psi }} = \sum ^{S}_{i=1}{b_{i}\psi ^{(i)}}\), which is a weighted average of \(\psi\) because \(\sum ^{S}_{i=1}{b_{i}} = 1\).
Equation (28) suggests that the error generated in one time step is the sum of the local temporal error, averaged spatial error and averaged iterative error. This indicates that to decrease the total error one should decrease these three errors simultaneously and it will not help much if one of them is decreased much smaller than the largest of the three terms.
Based on this observation, an adaptive time-stepping strategy and an adaptive Newton tolerance are developed as follows in Sects. 2.2 and 2.3, respectively. The basic idea is to choose a time step and a Newton tolerance such that the temporal and iterative errors are smaller than the spatial error. In Sect. 2.2, the iterative error is assumed to be negligible compared with the spatial and temporal errors, which can be achieved as long as Eq. (19) converges to a sufficiently small level. The method to control the iterative error will be discussed in Sect. 2.3.
Adaptive Time-Stepping Strategy
Based on the error estimate, a time step adaptation method is proposed with the basic idea that the time step should be the maximum value without obviously influencing the total discretization error. With the spatial error fixed in a specific simulation, this implies that
$$\begin{aligned} \Vert \mathbf{E} _t^{n+1} \Vert = \beta \Delta t \Vert \bar{\mathbf{E }}_s \Vert \end{aligned}$$
(29)
with \(\beta <1.0\) and a proper defined norm. When \(\Vert \mathbf{E} _t^{n+1} \Vert\) is orders of magnitude smaller than \(\Delta t \Vert \bar{\mathbf{E }}_s \Vert\), the total error will be dominated by the spatial error and further decreasing the time step (thus the temporal error) will not improve the solution much.
To maintain Eq. (29) is satisfied, spatial and temporal errors need to be estimated. The embedded ESDIRK scheme offers an accurate estimate of temporal error \(\mathbf{E} _t^{n+1}\) using Eq. (15). As for the spatial truncation error \(\bar{\mathbf{E }}_s\), it is estimated using a one order higher approximation at the end of each time step, that is
$$\begin{aligned} \bar{\mathbf{E }}_s \approx L_{\delta }^{P+1}\left( \mathbf{U} _{it}^{n+1}\right) - L_{\delta }^{P}\left( \mathbf{U} _{it}^{n+1}\right) = C_sD_s(\mathbf{U} )h^{P+1} + O(h^{P+2}) , \end{aligned}$$
(30)
the leading term of which is the same as that in Eq. (9). Equation (29) implies that the desired time step (\(\Delta {\hat{t}}\)) should satisfy that
$$\begin{aligned} \Vert \mathbf{E} _t^{n+1}(\Delta {\hat{t}}) \Vert \approx \Vert C_tD_t(\mathbf{U} )\Delta {\hat{t}}^{N+1} \Vert = \beta \Delta {\hat{t}} \Vert \bar{\mathbf{E }}_s \Vert . \end{aligned}$$
(31)
Dividing Eq. (31) by Eq. (15), time step \(\Delta {\hat{t}}\) can be calculated by
$$\begin{aligned} \Delta {\hat{t}}= \Delta t^{n} \left( \frac{\beta \Delta t \Vert \bar{\mathbf{E }}_s\Vert }{\Vert \mathbf{E} _{t} \Vert }\right) ^{1/N} , \end{aligned}$$
(32)
which can be used as the time step for the next time step. The simplest elementary controller [25] is adopted here in determining the time step and other choices are also possible [25]. In the derivation of Eqs. (30), (31) and (32), the change of \(D_t(\mathbf{u} )\) is assumed to be small throughout the step.
In the designs of adaptive time-stepping methods in references [5, 22], an \(L_2\) norm of the \(\mathbf{E} _t^{n+1}\) for all the variables throughout the flow field is adopted as the norm in their adaptive strategy. However, the norm of the error with this choice may be dominated by a specific variable or the large scale unsteady structures. As a result, the adapted time step may be determined by one of the variables and/or the dominating unsteady structure in the flow field, which could be too large for the small unsteady structures of interest.
To avoid these problems, the norm is defined in each element. The \(L_2\) norms of \(\mathbf{E} _t^{n+1}\) and \(\bar{\mathbf{E }}_s\) are calculated in element e for variable m and the elemental time step is calculated using
$$\begin{aligned} \Delta t_{e,m}^{n+1}= \Delta t^{n} \left( \frac{\beta \Delta t \Vert \bar{\mathbf{E }}_s\Vert _{e,m}+1.5^{N}\epsilon _m}{\Vert \mathbf{E} _{t} \Vert _{e,m}+\epsilon _m}\right) ^{1/N} . \end{aligned}$$
(33)
Here, the \(\epsilon _m\) is added to the denominator to avoid division by zero. But it also serves as a threshold of the error magnitude of interest. If the local temporal error magnitudes are much smaller than \(\epsilon _m\), the local unsteady structures are either too weak to be of interest, or are already accurately captured, which indicates the current time step choice is already excessively accurate in that element. Thus, a \(1.5^{N}\epsilon _m\) is added to the numerator to maintain the elemental and the time step will at least grow by 1.5 times. The choice of 1.5, which is not optimized, ensures that the time step will increase but not too fast.
The value of \(\epsilon _m\) adopted here is
$$\begin{aligned} \epsilon _m = 10^{-12}{} \mathbf{U} _{it,m}^{\text {rms}}, \end{aligned}$$
(34)
where \(\mathbf{U} _{it,m}^{\text {rms}}\) denotes the root mean square value over the whole flow field of the mass, momentum magnitude and energy variables. Such a threshold value is based on the rounding error of the mth variable. One purpose of introducing this term is to avoid noisy elemental time steps caused by rounding errors in uniform flow areas.
With elemental time steps \(\Delta t_{e,m}^{n+1}\), the time step for variable m can be calculated using different strategies. For example, a minimum of \(\Delta t_{e,m}^{n+1}\) would maintain that Eq. (29) is satisfied in every element. Here we choose to calculate it by a weighted average of \(\Delta t_{e,m}^{n+1}\) as
$$\begin{aligned} \Delta t_{m}^{n+1}= \sum ^{N_e}_{e=1}{\Vert \mathbf{E} _{t} \Vert ^r_{e,m}\Delta t_{e,m}^{n+1}}/\sum ^{N_e}_{e=1}{\Vert \mathbf{E} _{t} \Vert ^r_{e,m}} . \end{aligned}$$
(35)
The temporal error \(\Vert \mathbf{E} _{t} \Vert ^r_{e,m}\) is used as the weights such that elements with larger temporal errors have larger contributions to the global time step. The \(r \in [0,\infty )\) can be chosen based on the smallest temporal structure of interest in the simulations, a larger value of which would lead to a larger contribution from elements with large temporal errors. In this paper, \(r=1\) is used. This weighted averaging helps maintain a relatively smooth change of the time step. At last, the time step \(\Delta t^{n+1}\) is calculated by
$$\begin{aligned} \Delta t^{n+1}= \text {min}(\Delta t_{m}^{n+1}) . \end{aligned}$$
(36)
Adaptive Newton Tolerance
A similar idea as the time step adaptation can be adopted here in choosing the Newton tolerance so that the iterative error is smaller than temporal error to avoid affecting the temporal accuracy. In references [5, 21], a Newton tolerance \(\tau\) in Eq. (22) is proposed by directly relating the Newton tolerance to the temporal error, that has the form
$$\begin{aligned} \tau = \eta \Vert \mathbf{e} _{t} \Vert \end{aligned}$$
(37)
with \(\eta =0.1\). However, the relation between the Newton residual vector, \(\mathbf{R}\), and the iteration error, \(\Delta t \, \bar{\mathbf{e }}_{it}\), introduced into Eq. (28) is not trivial. In the following this relation is estimated to illustrate the assumptions made in choosing the Newton tolerance of Eq. (37).
Considering that
$$\Delta t \Vert \bar{\mathbf{e }}_{it} \Vert = \Delta t \Vert \sum ^{S}_{i=1}{b_{i}{} \mathbf{e} ^{(i)}_{it}} \Vert \leqslant \Delta t \sum ^{S}_{i=1}{b_{i}\Vert \mathbf{e} ^{(i)}_{it} \Vert } , $$
(38)
and \(\sum ^{S}_{i=1}{b_{i}} = 1\), a sufficient condition for
$$\begin{aligned} \Delta t \Vert \bar{\mathbf{e }}_{it} \Vert \leqslant \eta \Vert \mathbf{e} _{t} \Vert \end{aligned}$$
(39)
is that
$$\begin{aligned} \Delta t \Vert \mathbf{e} ^{(i)}_{it} \Vert \leqslant \eta \Vert \mathbf{e} _{t} \Vert , \end{aligned}$$
(40)
which maintains that the iterative error is smaller than the temporal error in Eq. (28) with \(\eta < 1.0\).
The relation between \(\Delta t \mathbf{e} ^{(i)}_{it}\) and \(\mathbf{R} ^{(i)}\) is estimated in the following. The \(\mathbf{R} ^{(i)}\) can be expressed as
$$\begin{aligned} \mathbf{R} ^{(i)} = \mathbf{N} (\mathbf{u} ^{(i)}_{it}) - \mathbf{N} (\mathbf{u} ^{(i)}_{\delta }) = \mathbf{N} '(\mathbf{u} ^{(i)}_{it})\left( \mathbf{u} ^{(i)}_{it}-\mathbf{u} ^{(i)}_{\delta }\right) + O\left( \Delta \mathbf{u} ^2 \right) , \end{aligned}$$
(41)
where \(\Delta \mathbf{u} = \mathbf{u} ^{(i)}_{it}-\mathbf{u} ^{(i)}_{\delta }\). Therefore, the iterative error of the solution \(\mathbf{u} _{it}^{(i)}\) can be approximated as
$$\begin{aligned} \begin{aligned} \mathbf{u} _{it}^{(i)}-\mathbf{u} _{\delta }^{(i)}&= \left( \mathbf{N} '\right) ^{-1}\left( \mathbf{R} ^{(i)} - O\left( \Delta \mathbf{u} ^2 \right) \right) \\&= \left( \mathbf{I} -\Delta t a_{ii} {\mathcal {L}}'_{\delta }\left( \mathbf{u} _{it}^{(i)}\right) \right) ^{-1}\left( \mathbf{R} ^{(i)} - O\left( \Delta \mathbf{u} ^2 \right) \right) . \end{aligned} \end{aligned}$$
(42)
Subtracting Eq. (42) by Eq. (23) and ignoring high-order terms of \(O\left( \Delta \mathbf{u} ^2 \right)\), we can further deduce the relation between \(\Delta t \mathbf{e} _{it}\) and \(\mathbf{R}\) as
$$\begin{aligned} \begin{aligned} \Delta t \mathbf{e} _{it}^{(i)}&= \Delta t \left( {\mathcal {L}}_{\delta }\left( \mathbf{u} ^{(i)}_{it}\right) -{\mathcal {L}}_{\delta }\left( \mathbf{u} ^{(i)}_{\delta }\right) \right) \\&= \Delta t {\mathcal {L}}'_{\delta }\left( \mathbf{u} _{it}^{(i)}\right) \left( \mathbf{N} '\right) ^{-1}{} \mathbf{R} ^{(i)} . \end{aligned} \end{aligned}$$
(43)
Substituting Eq. (43) into Eq. (40), we can get
$$\begin{aligned} \begin{aligned} \Vert {\mathcal {L}}'_{\delta } \left( \mathbf{I} /\Delta t- a_{ii} {\mathcal {L}}'_{\delta }\right) ^{-1}{} \mathbf{R} ^{(i)} \Vert \leqslant \eta \Vert \mathbf{e} _{t} \Vert . \end{aligned} \end{aligned}$$
(44)
The presence of \({\mathcal {L}}'_{\delta } \left( \mathbf{I} /\Delta t- a_{ii} {\mathcal {L}}'_{\delta }\right) ^{-1}\), which is difficult or expensive to estimate accurately, makes the relation between \(\Delta t \mathbf{e} _{it}\) and \(\mathbf{R}\) problem dependent and difficult to evaluate. As \(\Delta t\) becomes larger \({\mathcal {L}}'_{\delta } \left( \mathbf{I} /\Delta t- a_{ii} {\mathcal {L}}'_{\delta }\right) ^{-1}\) becomes closer and closer to a diagonal matrix with diagonal values of \(1/a_{ii}\) and at the limit of \(\Delta t \rightarrow \infty\), Eq. (44) becomes
$$\begin{aligned} \begin{aligned} \Vert \mathbf{R} ^{(i)} \Vert \leqslant \eta a_{ii} \Vert \mathbf{e} _{t} \Vert \end{aligned} \end{aligned}$$
(45)
with \(0.25<a_{ii}<0.45\) in the ESDIRK schemes adopted. When \(\Delta t\) becomes smaller and smaller, the entities of the matrix \({\mathcal {L}}'_{\delta } \left( \mathbf{I} /\Delta t- a_{ii} {\mathcal {L}}'_{\delta }\right) ^{-1}\) will tend to zeros. Therefore, an even larger Newton tolerance will maintain that Eq. (44) is satisfied. Overall, Eq. (45) appears to provide a good estimate of the convergence upper bound at least at the limits of \(\Delta t \rightarrow \infty\) and \(\Delta t \rightarrow 0\). Based on numerical experiments we observe that the Newton tolerance of Eq. (37) seems good enough to maintain temporal convergence accuracy, as will be shown in Sect. 3.1. However, the assumptions made in the derivation of the Newton tolerance may be invalid in some simulations, and if accurate estimate of Newton tolerance are needed, \({\mathcal {L}}'_{\delta } (\mathbf{I} /\Delta t- a_{ii} {\mathcal {L}}'_{\delta })^{-1}\) can be estimated using the Jacobian matrix or simply by a calibration for a specific problem.
Although based on some assumptions, Eq. (37) is still much less problem dependent compared with Newton tolerances commonly used such as
$$\left\{\begin{array}{ll} \tau _1= \theta _1 \Vert \mathbf{v} ^{0} \Vert , \\ \tau _2= \theta _2 \Vert \mathbf{N} (\mathbf{v} ^{0}) \Vert , \end{array}\right.$$
(46)
as is shown in references [5, 21, 22] and will be shown in Sect. 3.1. It will also change in a more consistent manner with the temporal error when \(\Delta t\) changes. For simulations not using the adaptive Newton tolerance in the following, \(\theta _2 = 10^{-3}\) in Eq. (46) is adopted unless otherwise specified.
Summary of the Adaptive Strategy and Discussion
The basic idea behind the time step adaptation strategy proposed in Sect. 2.2 is the relation between temporal and spatial errors that is sufficient for maintaining temporal accuracy in unsteady simulations. Here, we give a brief discussion to illustrate that it is a rational choice because it shares a very similar logic behind the convergence tests in CFD, which is also a key point in maintaining the high efficiency of implicit time integration methods.
The implicit time integration methods could be more efficient that the explicit methods in some stiff problems such as problems with low Mach number, high Reynolds number and highly stretched grids [2, 21, 22, 27, 29]. The assumption behind this conclusion is that we can safely increase the time steps and temporal errors when using implicit time integration methods without obviously degrading the simulation results. In another word, the comparison of implicit and explicit time integration in efficiency is not based on the computation time of the same temporal error level as is done in most studies of time integrations methods [3, 11] but is based on the computation time as long as the results are sufficiently accurateFootnote 1. This implicitly defined sufficiently accurate condition is the maximum error level without obviously degrading the target quantity of interest, which is the one we are seeking when performing convergence tests in CFD simulations. However, this condition usually depends on the unsteady properties of the problem (the magnitude and frequency of the unsteady waves), the scale of interest, the acceptable error level, etc, and is not known before an accurate simulation result is obtained.
Similarly, the error condition behind the time adaptation strategy in Sect. 2.2, is the maximum temporal error level without obviously degrading the results of the discrete partial differential equation (PDE) system. Although, convergence tests are still needed to maintain the accuracy physically, the strategy avoids improper error relations, which may seriously lower the efficiency without obviously improving the results. In a case presented in reference [21], the improper relations of the spatial and temporal errors can increase the CPU time by about 20 times without obviously improving the results.
In some adaptive time-stepping strategies, the adapted time step is limited to be no larger than a time step \(\Delta t_{\text {limit}}\), which is user defined based on their understanding of the physical time scale to be resolved as in reference [22]. However, Eqs. (28) and (29) indicate that limiting the time step will not improve the results but possibly will increase the computational costs. Instead, refining the spatial grid will be much more efficient in improving the results. Therefore, it is advised to refine the mesh instead of limiting the time step to improve the computation accuracy in our time adapting strategy when the adaptive time step is obviously too large to capture the unsteady flow.
As a by-product of this observation, the adapted time step can also serve as a good indicator of mesh refinement if the temporal scale of interest is well defined and the properties of the ODE solver (ESDIRK in this paper) are well understood. For a specific ODE solver, such as DIRK, we can assess the ODE solver in predicting a single wave at a specific time with a given time step [11]. If the unsteady flow scale (unsteady frequency) of interest is clearly defined in our simulations, this allows us to determine if the unsteady flow scale is satisfactorily captured with the ODE solver and the adapted \(\Delta t\). If the temporal error is too large to be satisfactory, the relation (29) tells us that decreasing the time step cannot improve the results, and that a more efficient way to increase accuracy is to refine the spatial mesh instead. Therefore, we can use the adaptive time steps as a criteria for spatial mesh refinement.
In the adaptative strategy, extra computational costs are required to estimate spatial and temporal errors. The embedded scheme of Eq. (14) requires an extra implicit RK stage, which will approximately increase the computational cost by \(1/(S-1)\), where S is the number of stages of the main ESDIRK scheme with values of 3, 4 and 6 for the second, third and fourth order ESDIRK schemes adopted, respectively. Similarly, the spatial error estimation in Eq. (30) requires the calculation of a higher order spatial discretization operator \(L_{\delta }^{P+1}\left( \mathbf{u} _{it}^{n+1}\right)\). The extra cost from spatial error estimation is relatively lower than those of temporal error estimation for stiff problems since up to an order of magnitude or more \(L_{\delta }\) operations are needed in one implicit RK stage. For example, in simulations of \(P=2\) and \(P=3\), the extra cost of \(L_{\delta }^{P+1}\left( \mathbf{u} _{it}^{n+1}\right)\) is only about 1.5 times the cost of \(L_{\delta }^{P}\left( \mathbf{u} _{it}^{n+1}\right)\), while the extra cost in temporal error estimating is more 10 times of that. Therefore, we can roughly estimate the extra cost to be \(100/(S-1) \%\). For simulations with little or slow time scale changes, a freezing of the adapted time step can be adopted to lower the additional costs.
Compared with adaptive time-stepping strategies in references [4, 5, 21, 22], the current strategy is different in the following ways.
-
The adaptive time step is determined by the relation between the temporal and spatial errors instead of a user defined temporal error level. Therefore, highly problem dependent user defined tolerances are avoided.
-
An embedded ESDIRK scheme with an order of \(N+1\) is employed instead of schemes of \((N-1)\)th order, which predicts the temporal error more accurately. This also helps avoid problem dependent calibration parameters of the estimated errors.
-
The adaptation is determined element by element first instead of using the \(L_2\) norm of the temporal error of the whole flow field. Therefore, it has the potential to avoid time step being determined primarily by the large scale unsteady structures and avoid small-scale unsteady structures being under-resolved.