Surface melting of tungsten under exposure to a pulsed electron beam was simulated numerically, the evaporation process taken into account. The calculation is based on the experimental time dependence of the total beam power. The model of the tungsten heating process is based on solving the two-phase Stefan problem. The position of the phase boundary depends on discontinuous nonlinear coefficients. The aim of the study is to provide a detailed resolution of the heat flow deep into the material with a fine spatial grid step. As compared with the size of the tungsten plate, the heating depth is very small. The problem statement under consideration is multiscale. Further expansion of the model involves gas dynamics equations to simulate the dynamics of the liquid and gaseous phases of the metal. Two approaches to solving the equation for temperature are considered: the implicit run method and the explicitly solvable Konovalov-Popov model. The results of calculations correlate with the experimental data obtained at the experimental stand Beam of Electrons for materials Test Applications (BETA) at Budker Institute of Nuclear Physics (BINP) of the SB RAS.