An adaptive multigrid upwind solver for two- and three-dimensional viscous flows