code: def headloss_exp(FlowRate, Diam, KMinor):
      
      #Checking input validity
      ut.check_range([FlowRate, ">0", "Flow rate"], [Diam, ">0", "Diameter"],
                     [KMinor, ">=0", "K minor"])
      return KMinor * 8 / (gravity.magnitude * np.pi**2) * FlowRate**2 / Diam**4
docs: Return the minor head loss (due to expansions) in a pipe.
  
      This equation applies to both laminar and turbulent flows.