code: def diam_pipemajor(FlowRate, HeadLossFric, Length, Nu, PipeRough):
      
      #Inputs do not need to be checked here because they are checked by
      #functions this function calls.
      DiamLaminar = diam_hagen(FlowRate, HeadLossFric, Length, Nu).magnitude
      if re_pipe(FlowRate, DiamLaminar, Nu) <= RE_TRANSITION_PIPE:
          return DiamLaminar
      else:
          return diam_swamee(FlowRate, HeadLossFric, Length,
                             Nu, PipeRough).magnitude
docs: Return the pipe IDiam that would result in given major losses.
      This function applies to both laminar and turbulent flow.