Enhanced-oil-recovery (EOR) processes involve complex flow, transport, and thermodynamic interactions; as a result, compositional simulation is necessary for accurate representation of the physics. Flow simulation of compositional systems with high-resolution reservoir models is computationally intensive because of the large number of unknowns and the strong nonlinear interactions. Thus, there is a great need for upscaling methods of compositional processes. The complex multiscale interactions between the phase behavior and the heterogeneities lie at the core of the difficulty in constructing consistent upscaling procedures. We use a mass-conservative formulation and introduce upscaled phase-molar-mobility functions for coarse-scale modeling of multiphase flow. These upscaled flow functions account for the subgrid effects caused by the absolute permeability and relative permeability variations, as well as the effects of compressibility. Upscaling of the phase behavior is performed as follows. We assume that instantaneous thermodynamic equilibrium is valid on the fine scale, and we derive coarse-scale equations in which the phase behavior may not necessarily be at equilibrium. The upscaled thermodynamic functions, which represent differences in the component fugacities, are used to account for the nonequilibrium effects on the coarse scale. We demonstrate that the upscaled phase-behavior functions transform the equilibrium phase space on the fine scale to a region of similar shape, but with tilted tie-lines on the coarse space. The numerical framework uses K-values that depend on the orientation of the tie-lines in the new nonequilibrium phase space and the sign of upscaled thermodynamic functions. The proposed methodology is applied to challenging gas-injection problems with large numbers of components and highly heterogeneous permeability fields. The K-value-based coarse-scale operator produces results that are in good agreement with the fine-scale solutions for the quantities of interest, including the component overall compositions and saturation distributions.