Multiphase isenthalpic flash integrated with stability analysis