Spectral evolution of flaring blazars from numerical simulations