Computing the near-wall region in gas micro- and nanofluidics: Critical Knudsen layer phenomena