Understanding the phase behavior of a CO2-oil–water surfactant system is critical for carbon dioxide flooding engineering. Using dissipative particle dynamics, we investigate how the alkanes in crude oil are extracted after the injection of supercritical carbon dioxide into the formation, and what effect this extraction has on the miscible and immiscible displacement of carbon dioxide and crude oil. The images of the extraction are exhibited at the molecular level, and the effects of temperature and pressure on the extraction are investigated. The phase distribution of carbon dioxide, oil, and water under immiscible phase is simulated using actual reservoir fluid data based on a comprehensive understanding of extraction. Oil tends to be spread at the interface of carbon dioxide and water when it is immiscible. The miscible pictures were generated under conditions of reduced CO2-oil–water miscible pressure by adding surfactants to the CO2-oil–water system, and the fluid distribution characteristics under immiscible and miscible phases were examined. dissipative particle dynamics (DPD) simulation demonstrates that when the molar proportion of carbon dioxide is less than 0.4, the solid phase surface can always create a water film of varied thickness, regardless of whether the surface charge of the solid phase is positive or negative. As the molar fraction of carbon dioxide increases, the water film’s thickness decreases.