Friction losses for power-law and viscoplastic materials in an entrance of a tube and an abrupt contraction