The paper is devoted to the numerical implementation of a model of the dynamics of the tungsten vapors flow evaporating from the sample surface. To calculate the speed and mass flow rate of the substance evaporating from the sample surface, a system of gas dynamics equations is numerically solved. The boundary conditions for the gas velocity and density on the heated surface have a great influence on the solution of the problem. Boundary conditions for temperature are obtained as a result of solving the two-phase Stefan problem in a cross-section of the sample. The aim of the study is to model the erosion of the sample surface and penetration of heat flow into the material. © Published under licence by IOP Publishing Ltd.