Flow in pipes with non-uniform curvature and torsion