SUMMARYDirect simulation Monte Carlo (DSMC) method has been widely used to study gaseous flow and heat transfer in micro-fluidic devices. For flows associated with microelectromechanical systems (MEMS), the heat-flux-specified (HFS) boundary condition broadly exists. However, problems with HFS boundary have not been realized in the simulation of microchannel flows with DSMC method. To overcome this problem, a new technique named as inverse temperature sampling (ITS) is developed. This technique provides an approach to calculate the molecular reflective characteristic temperature from the specified heat flux at the wall boundary. Coupling with DSMC method, the ITS technique can treat the HFS boundary condition in DSMC method for both simple gas and gas mixtures. For validation, heat flux obtained from twodimensional Poiseuille flows with wall-temperature-specified (WTS) boundary condition is employed as the initial thermal boundary condition of our new method. Sampled wall temperature by the ITS method agrees well with the expected value. Pressure, velocity and temperature distributions under these two thermal boundary conditions (WTS and HFS) are compared. Effects of molecule collision model and gas-surface interaction model are also investigated. Results show that the proposed ITS method could accurately simulate gaseous flow and heat transfer in MEMS.