  In this work, we extend the $\tau$-estimation method to unsteady problems and
use it to adapt the polynomial degree for high-order discontinuous Galerkin
simulations of unsteady flows. The adaptation is local and anisotropic and
allows capturing relevant unsteady flow features while enhancing the accuracy
of time evolving functionals (e.g., lift, drag). To achieve an efficient and
unsteady truncation error-based $p$-adaptation scheme, we first revisit the
definition of the truncation error, studying the effect of the treatment of the
mass matrix arising from the temporal term. Secondly, we extend the
$\tau$-estimation strategy to unsteady problems. Finally, we present and
compare two adaptation strategies for unsteady problems: the dynamic and static
$p$-adaptation methods. In the first one (dynamic) the error is measured
periodically during a simulation and the polynomial degree is adapted
immediately after every estimation procedure. In the second one (static) the
error is also measured periodically, but only one $p$-adaptation process is
performed after several estimation stages, using a combination of the periodic
error measures. The static $p$-adaptation strategy is suitable for
time-periodic flows, while the dynamic one can be generalized to any flow
evolution.
  We consider two test cases to evaluate the efficiency of the proposed
$p$-adaptation strategies. The first one considers the compressible Euler
equations to simulate the advection of a density pulse. The second one solves
the compressible Navier-Stokes equations to simulate the flow around a cylinder
at Re=100. The local and anisotropic adaptation enables significant reductions
in the number of degrees of freedom with respect to uniform refinement, leading
to speed-ups of up to $\times4.5$ for the Euler test case and $\times2.2$ for
the Navier-Stokes test case.
