This paper describes in detail computational techniques and formulations for constructing a phase envelope and/or subsequent isenthalpic/isothermal flash calculations that are practical for multiphase fluids in a non-isothermal environment. These methods were designed especially for heavy oil applications and use in numerical simulators. The methods are based on a fluid characterized by pressure and temperature dependent K-values. Although these procedures may be extended to more general N-phase systems, the paper gives full details for a 3-phase oil/gas/water system. Any number of hydrocarbon components may be present and water may exist as a liquid and/or a vapor. The presence of non-volatile and/or non-condensable hydrocarbon components is treated.