The angle of internal friction as a measure of work loss in granular material flow