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 条
[11]  
Bischof CH, 1996, SIAM PROC S, P83
[12]  
Borodin A., 1975, COMPUTATIONAL COMPLE
[15]  
Griewank A., 1989, MATH PROGRAMMING REC, V6, P83
[16]  
Haaland S.E., 1983, J FLUIDS ENG US, V105
[17]  
Hogan R.J., 2014, ACM T MATH SOF UNPUB
[18]   Applicability of the Forchheimer equation for non-Darcy flow in porous media [J].
Huang, H. ;
Ayoub, J. .
SPE JOURNAL, 2008, 13 (01) :112-122
[19]  
Jiang Y., 2007, Techniques for modeling complex reservoirs and advanced wells
[20]   Open-source MATLAB implementation of consistent discretisations on complex grids [J].
Lie, Knut-Andreas ;
Krogstad, Stein ;
Ligaarden, Ingeborg Skjelkvale ;
Natvig, Jostein Roald ;
Nilsen, Halvor Moll ;
Skaflestad, Bard .
COMPUTATIONAL GEOSCIENCES, 2012, 16 (02) :297-322