Solidification of metal foams