A Thermodynamic Analysis of Three-Phase Equilibria in Binary and Ternary Systems for Applications in Rapid Expansion of a Supercritical Solution (RESS), Particles from Gas-Saturated Solutions (PGSS), and Supercritical Antisolvent (SAS)