Velocity distribution and discharge calculation at a sharp-crested weir