Second-law analysis of heat and fluid flow in microscale geometries