A finite element method for Burgers' equation in hydrodynamics