${\mathrm{H}}^{\ensuremath{-}}$ stripping injection into the Fermilab recycler ring, combined with a beam phase painting technique, has been considered. The multiparticle three-dimensional beam dynamics with space charge has been studied numerically, using STRUCT and ORBIT codes, for different painting scenarios. In order to achieve a uniform (quasi-KV) phase-space distribution and to reduce the foil heating, the following parameters were investigated: the number of turns, strengths and temporal forms of kicker magnets, and foil geometry. Performance of the stripping foil is a crucial parameter of the whole injection scheme, so that the latter has been designed to minimize the hit number on the foil. The temperature regime has been evaluated both semianalytically and numerically using Monte Carlo codes MARS and MCNPX, with radiation cooling and transport of $\ensuremath{\delta}$ electrons taken into account. That all results agreed well proves the consistency of the models. It has been shown that the stripping foil can survive during injection with the parameters chosen for Project X at Fermilab.