code: def fric_rect(FlowRate, Width, DistCenter, Nu, PipeRough, openchannel):
      
      #Checking input validity - inputs not checked here are checked by
      #functions this function calls.
      ut.check_range([PipeRough, "0-1", "Pipe roughness"])
      if re_rect(FlowRate,Width,DistCenter,Nu,openchannel) >= RE_TRANSITION_PIPE:
          #Swamee-Jain friction factor adapted for rectangular channel.
          #Diam = 4*R_h in this case.
          return (0.25
                  / (np.log10((PipeRough
                               / (3.7 * 4
                                  * radius_hydraulic(Width, DistCenter,
                                                     openchannel).magnitude
                                  )
                               )
                              + (5.74 / (re_rect(FlowRate, Width, DistCenter,
                                                 Nu, openchannel) ** 0.9)
                                 )
                              )
                      ) ** 2
                  )
      else:
          return 64 / re_rect(FlowRate, Width, DistCenter, Nu, openchannel)
docs: Return the friction factor for a rectangular channel.