Liquid–vapor phase equilibrium is ubiquitous in industrial and engineering field, which involves the flash calculation. The conventional flash calculation is solved with the numerical simulator, accompanying with large computational efforts. In this paper, we propose a data-driven guided physics-informed segmented neural network (DDG-PISNN) for the liquid–vapor pressure–temperature flash calculation. The training of DDG-PISNN is divided into two stages. First, a classifier for determining the stability of the system and a guiding network are built using data-driven methods. Subsequently, various control equations are employed to construct loss functions based on the results of classifier. In this way, DDG-PISNN fully leverages the advantages of data-driven approaches and physical equations. The accuracy and robustness of DDG-PISNN are calibrated by experiments under different conditions, and the performance is compared with that of DDG-PINN. In addition, a surrogate model for flash calculation is constructed based on DDG-PISNN. The accuracy of the surrogate model is also validated against a numerical case, and the computational efficiency is more than 800 times. Then, the surrogate model is embedded into the reservoir simulation technique to perform the flash calculation and form a surrogate-based compositional model. The surrogate-based model is employed to simulate the process of CO2 displacing crude oil. The results are in good agreement with the results of numerical solution.