{'fraction_non_alphanumeric': 0.01618614061709661, 'fraction_numerical': 0.0005058168942842691, 'mean_word_length': 5.200626959247649, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient and Robust Solver for Multiphase Rachford-Rice Equations in Compositional and Thermal Simulations


 Robust and efficient multiphase flash calculations are crucial in compositional and thermal simulations for complex fluid systems in which three or four phase may co-exist. Solution of the Richford-Rice (RR) equations is an important operation in the multiphase flash. The Newton method generally does not converge during solution of the RR equations unless very good initial values are provided. In this paper, the solution of the RR equations is formulated as a minimization of a convex function problem. For the first time, we use a trust-region (TR) method to solve the RR equations through minimization of the convex function. The Hessian matrix of the convex function is always positive-definite, and the TR-based solver guarantees convergence. The key to successful implementation is to determine the relaxation parameter in the Newton update. We select this relaxation parameter to meet the boundary of the objective function and to ensure an adequate step length. We tested the RR solver for three and four phase RR problems in the construction of phase diagrams. The test cases are representative of complex fluid systems encountered in enhanced oil recovery, including injection of CO2 into low temperature reservoirs and steam injection into heavy oil reservoirs at elevated temperatures. We performed tens of millions of multiphase flash computations, the results of which reveal our RR solver to be robust, efficient, insensitive to initial values, and capable of handling negative phase amounts. We also evaluated the effect of the initial values on convergence and recommend methods to estimate the initial values in our RR solver. In summary, our RR solver greatly improves the multiphase flash calculations and strengthens the coupling of phase equilibrium calculations to the governing equations in multiphase compositional and thermal simulation.