Title: A new automatic differentiation approach for fully implicit compositional reservoir simulation

Authors: Bruno Ramon Batista Fernandes; Francisco Marcondes; Kamy Sepehrnoori

Addresses: Center for Subsurface Energy and the Environment, The University of Texas at Austin, 200 E. Dean Keeton Street, Stop C0300, Austin, TX 78712-1585, USA ' Department of Metallurgical Engineering and Materials Science, Federal University of Ceará, Campus do Pici, Bl. 729, Fortaleza, CE 60020-181, Brazil ' Hildebrand Department of Petroleum and Geosystems Engineering, The University of Texas at Austin, 200 E. Dean Keeton Street, Stop C0300, Austin, TX 78712-1585, USA

Abstract: A new stand-alone object-oriented automatic differentiation (AD) tool for FORTRAN 95 codes is presented for facilitating the development of implicit solutions of PDEs. Five different AD approaches were implemented and tested: a forward mode (FM) with static allocation, an FM with dynamic allocation and memory stack, an expression-level reverse mode (RM) with memory stack, an expression-level RM with pointers, and a fully RM with pointers. The new tool is applied to an in-house chemical enhanced oil recovery simulator using three approaches: seed matrix, localised linearisation, and using AD only for computing gridblock properties. The FM AD with static allocation was the fastest AD approach but didn't have the flexibility for problems with variable gradient size. Among the AD coupling techniques, the localised linearisation presented a better performance for assembling the Jacobian when compared to the seed matrix scheme. The use of AD for computing properties only presented the smallest overhead. [Received: May 10, 2023; Accepted: June 1, 2023]

Keywords: automatic differentiation; reservoir simulation; implicit methods; chemical flooding; operator overloading; expression-level reverse mode.

DOI: 10.1504/IJOGCT.2023.133808

International Journal of Oil, Gas and Coal Technology, 2023 Vol.34 No.2, pp.119 - 156

Received: 06 May 2023
Accepted: 01 Jun 2023

Published online: 03 Oct 2023 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article