Rarefied gas flow through a channel of finite length into a vacuum