Flows through channels of various cross sections in the whole range of the Knudsen number using deterministic and stochastic approaches