Analysis of the inelastic behavior of foams with numerical models obtained from X-ray tomography