A backward automatic differentiation framework for reservoir simulation

被引:9
作者
Li, Xiang [1 ]
Zhang, Dongxiao [1 ]
机构
[1] Peking Univ, Coll Engn, Beijing 100871, Peoples R China
基金
中国国家自然科学基金;
关键词
Reservoir simulation; Automatic differentiation; Backward mode; Expression template; NON-LINEAR SYSTEMS; SENSITIVITY THEORY; FLOW;
D O I
10.1007/s10596-014-9441-z
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
In numerical reservoir simulations, Newton's method is a concise, robust and, perhaps the most commonly used method to solve nonlinear partial differential equations (PDEs). However, as reservoir simulators incorporate more and more physical and chemical phenomena, writing codes that compute gradients for reservoir simulation equations can become quite complicated. This paper presents an automatic differentiation (AD) framework that is specially designed for simplifying coding and simultaneously maintaining computational efficiency. First a parse tree for a mathematical expression is built and evaluated with the backward mode AD, and then the derivatives with respect to the expression's arguments are transformed to derivatives with respect to the PDE's independent variables. The first stage can be realized either by runtime polymorphism to gain higher flexibility or by compile-time polymorphism to gain faster execution speed; the second stage is realized by linear combinations of sparse vectors, which can be accelerated by recording the target column indices. The AD framework has been implemented in an in-house reservoir simulator. Individual tests on some complex mathematical expressions were carried out to compare the speed of the manual implementation, the runtime polymorphic implementation and the compile-time polymorphic implementation of the differentiation. Then the performance of the three was analyzed in complete simulations. These cases indicate that the proposed approach has good efficiency and is applicable to reservoir simulations.
引用
收藏
页码:1009 / 1022
页数:14
相关论文
共 35 条
[1]  
Alexandrescu A., 2001, Modern C++ Design: Generic Programming and Design Patterns Applied
[2]  
[Anonymous], SPE RES SIM S
[3]  
[Anonymous], 1981, SPRINGER LECT NOTES
[4]  
[Anonymous], 2011, SPE RES SIM S
[5]  
[Anonymous], 2002, Development of Techniques for General Purpose Simulators
[6]   Automatic differentiation in C++ using expression templates and application to a flow control problem [J].
Aubert, Pierre ;
Di Césaré, Nicolas ;
Pironneau, Olivier .
Computing and Visualization in Science, 2001, 3 (04) :197-208
[7]   THE COMPLEXITY OF PARTIAL DERIVATIVES [J].
BAUR, W ;
STRASSEN, V .
THEORETICAL COMPUTER SCIENCE, 1983, 22 (03) :317-330
[8]  
Beda LM., 1959, PROGRAMS AUTOMATIC D
[9]  
Bendtsen C., 1996, FADBAD, a Flexible C++ Package for Automatic Differentiation
[10]   Adifor 2.0: Automatic differentiation of Fortran 77 programs [J].
Bischof, C ;
Khademi, P ;
Mauer, A ;
Carle, A .
IEEE COMPUTATIONAL SCIENCE & ENGINEERING, 1996, 3 (03) :18-32