Three-dimensional boundary conditions for direct and large-eddy simulation of compressible viscous flows