flow function

Convert distance to flow