Optimisation of flow chemistry: tools and algorithms