Compositional modeling is essential when simulating any process that involves significant changes in the composition of reservoir fluids. This includes the modeling of the flow of multicomponent hydrocarbons in pipes and surface facilities and the flow of compositional fluids in subsurface rocks. However, the rigorous thermodynamics approach to obtain phase composition (based on a given pressure, temperature, and overall mole fraction) is computationally expensive. So, various researchers have considered using machine learning models trained with the rigorous phase-equilibrium (flash) calculations to improve computational speed.
Unlike previous publications that apply classical deep learning (DL) models to flash calculations, this work will demonstrate the first attempt to incorporate thermodynamics constraints into the training of these models to ensure that they honor physical laws. To this end, we generated one million different compositions with a space-filling mixture design and performed two-phase flash to obtain the corresponding phase compositions. We performed a seven-fold cross-validation to ensure reliable estimates of model accuracy and compared the physics-constrained and standard DL model results to quantify the ability of our approach to honor physical constraints.
The evaluation of our physics-informed neural network (PINN) model compared to a standard DL model shows that we can incorporate physical constraints without a considerable reduction in model accuracy. Based on the test data, our model evaluation results indicate that both PINN and standard DL models achieve coefficients of determination of 97%. In contrast, the root-mean-square error of the physics-constraint errors in the PINN model is at least two times smaller than in the standard DL model. To further demonstrate that our PINN model outperforms the DL model in terms of honoring physics, we generate phase envelopes using the overall compositions predicted using the PINN and DL models for several fluid mixtures in the test data. These results show the importance of incorporating the thermodynamic constraints into DL models.