Model for gas sweep with foam