At INP SB RAS, various mechanisms for the erosion of tungsten samples during the pulsed heating were studied. Data were obtained that made it possible to analyze the experimental results of the surface temperature dynamics taking into account the cooling due to the vaporation in vacuum. A numerical model was developed for the effect of a powerful pulsed electron beam on tungsten, which includes the Stefan problem for determining the temperature distribution in a sample and the system of gas dynamics equations. The gas dynamics system is implemented by the two methods of first order of accuracy: the upwind scheme and Belotserkovsky's coarse particle method. For the program verification, a test solution of the gas decay was used. In the process of calculating the problem in a complete statement, an analysis of the residual was carried out.