Mechanics Of Foam Flow In Porous Media And Applications