Computing particle motions in fluid flows