Simulations of bubble division in the flow of a foam past an obstacle in a narrow channel