Simulation and Optimisation of Fluid Flow