Computational algorithms for multicomponent phase equilibria and distillation