code: def fric_general(Area, PerimWetted, Vel, Nu, PipeRough):
      
      #Checking input validity - inputs not checked here are checked by
      #functions this function calls.
      ut.check_range([PipeRough, "0-1", "Pipe roughness"])
      if re_general(Vel, Area, PerimWetted, Nu) >= RE_TRANSITION_PIPE:
          #Swamee-Jain friction factor adapted for any cross-section.
          #Diam = 4*R*h
          f= (0.25 /
              (np.log10((PipeRough
                         / (3.7 * 4
                            * radius_hydraulic_general(Area, PerimWetted).magnitude
                            )
                         )
                        + (5.74
                           / re_general(Vel, Area, PerimWetted, Nu) ** 0.9
                           )
                        )
               ) ** 2
              )
      else:
          f = 64 / re_general(Vel, Area, PerimWetted, Nu)
      return f
docs: Return the friction factor for a general channel.