The fluid dynamics of foams