Numerical Simulation of Foam Flow in Porous Media