{'fraction_non_alphanumeric': 0.02218430034129693, 'fraction_numerical': 0.0, 'mean_word_length': 6.00796812749004, '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}}
Using State Functions and MRST’ls AD-OO Framework to Implement Simulators for Chemical EOR

Surfactant and polymer flooding, alone or in combination, are common and effective chemical enhanced oil recovery (EOR) methods. This chapter reviews the main physical mechanisms and presents how the corresponding mathematical flow models are implemented as an add-on module to the MATLAB Reservoir Simulation Toolbox (MRST) to provide a powerful and flexible tool for investigating flooding processes in realistic reservoir scenarios. Using a so-called limited compositional model, surfactant and polymer are both assumed to be transported in the water phase only but also adsorbed within the rock. The hydrocarbon phases are described with the standard three-phase black-oil equations. The resulting flow models also take several physical effects into account, such as chemical adsorption, inaccessible pore space, permeability reduction, effective solution viscosities, capillary pressure alteration, relative permeability alteration, and so on. The new simulator is implemented using the object-oriented, automatic differentiation (AD-OO) framework from MRST and can readily utilize features such as efficient iterative linear solvers with constrained pressure residual (CPR) preconditioners, efficient implicit and sequential solution strategies, advanced timestep controls, improved spatial discretizations, etc. We describe how the computation of fluid properties can be decomposed into state functions for better granularity and present several numerical examples that demonstrate the software and illustrate different physical effects. We also discuss the resolution of trailing chemical waves and validate our implementation against a commercial simulator.