Numerical simulation of the transition to turbulence in subsonic and transonic flows