Generation of the bubble-free layer during the metal foaming process