We present a new simulation method to predict the maximum possible yield of X-rays produced by electron beams accelerated by petawatt lasers irradiating thick solid targets. The novelty of the method lies in the simulation of the electron refiluxing inside the target implemented with the Monte Carlo code Fluka. The mechanism uses initial theoretical electron spectra, cold targets and refiluxing electrons forced to re-enter the target iteratively. Collective beam plasma effects are not implemented in the simulation. Considering the maximum X-ray yield obtained for a given target thickness and material, the relationship between the irradiated target mass thickness and the initial electron temperature is determined, as well as the effect of the refiluxing on X-ray yield. The presented study helps to understand which electron temperature should be produced in order to generate a particular X-ray beam. Several applications, including medical and security imaging, could benefit from laser generated X-ray beams, so an understanding of the material and the thickness maximizing the yields or producing particular spectral characteristics is necessary. On the other more immediate hand, if this study is experimentally reproduced at the beginning of an experiment in which there is an interest in laser-driven electron and/or photon beams, it can be used to check that the electron temperature is as expected according to the laser parameters.