Flow and jam of granular particles in a two-dimensional hopper