## Body:

Dependable algorithms for nonideal vapor-liquid equilibrium calculations are essential for effective process design, simulation and optimization. Inside-out algorithms [Boston & Britt, 1978] for flash calculations serve as the basis for many of the algorithms used by process simulation software due to their robustness with respect to initialization and inexpensive computational cost. However, if the specified flash conditions imply a single-phase result, the conventional inside-out algorithms fail, as the solution is constrained to obey equilibrium relationships which are only valid in the two-phase region. In this article (click here; free access is provided with limited availability), the classical inside-out algorithms are modified using a nonsmooth equation system in the inner loop to relax equilibrium conditions when necessary, allowing reliable convergence to single-phase results. Numerical results for simulations involving several common flash types and property packages are shown, highlighting the capability of the new nonsmooth algorithms for handling both two-phase and single-phase behavior robustly and efficiently.