Downloaded from orbit.dtu.dk on: Dec 2, 217 Single Shooting and ESDIRK Methods for adjoint-based optimization of an oil reservoir Capolei, Andrea; Völcker, Carsten; Frydendall, Jan; Jørgensen, John Bagterp Publication date: 212 Document Version Publisher's PDF, also known as Version of record Link back to DTU Orbit Citation (APA): Capolei, A., Völcker, C., Frydendall, J., & Jørgensen, J. B. (212). Single Shooting and ESDIRK Methods for adjoint-based optimization of an oil reservoir [Sound/Visual production (digital)]. 17th Nordic Process Control Workshop, Kongens Lyngby, Denmark, 25/1/212, http://npcw17.imm.dtu.dk/ General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. Users may download and print one copy of any publication from the public portal for the purpose of private study or research. You may not further distribute the material or use it for any profit-making activity or commercial gain You may freely distribute the URL identifying the publication in the public portal If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim.
Single Shooting and ESDIRK Methods for adjoint-based optimization of an oil reservoir Andrea Capolei, Carsten Völcker, Jan Frydendall, John Bagterp Jørgensen Department of Informatics and Mathematical Modeling Technical University of Denmark 17th Nordic Process Control Workshop 26th of January, 212 1 / 23
Outline 1 Introduction 2 Optimal Control Problem Single Shooting Optimization 3 ESDIRK integration methods 4 Continuous Adjoint Method 5 Production Optimization for a Conventional Oil Field 6 Conclusions 2 / 23
Increasing Oil demand Introduction Production by region Million barrels daily Consumption by region Million barrels daily Asia Pacific Africa Middle East Europe & Eurasia S. & Cent. America North America 1 9 8 1 9 8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 85 9 95 5 1 85 9 95 5 1 (from BP statistical review 211) 3 / 23
An Offshore Oil Reservoir Introduction 4 / 23
Introduction Closed-loop reservoir management (after Jansen 25) 5 / 23
Introduction Water Flooding Modeled by a Two-Phase Flow Model The mass conservation of water (i w) and oil (i o) t C i(p i, S i ) = F i (P i, S i ) + Q i The mass concentrations C i = φρ i (P i )S i Fluxes through the porous medium k min :.24 Darcy, k max :11.312 Darcy 3 4 1 2 1.5.5 1 1.5 log 1 (K) (Darcy) Darcy s law F i = ρ i (P i )u i (P i, S i ) u i (P i, S i ) = K k ri(s i ) µ i ( ) P i ρ i (P i )g z A general formulation of the two-phase flow problem d dt g(x(t)) = f(x(t), u(t)) 6 / 23
Continuous form Optimal Control Problem Consider the continuous-time constrained optimal control problem in the Bolza form min J = ˆΦ(x(t tb b )) + Φ(x(t), u(t))dt (1a) x(t),u(t) t a subject to x(t a ) = x d dt g( x(t) ) = f(x(t), u(t)), t [t a, t b ], u(t) U(t) (1b) (1c) (1d) x(t) R nx is the state vector and u(t) R nu is the control vector. The time interval I = [t a, t b ] as well as the initial state, x, are assumed to be fixed. 7 / 23
Path constraints Optimal Control Problem Path constraints η(x(t), u(t)) (2) are included as soft constraints using the following smooth approximation χ i (x(t), u(t)) = 1 ( ) η i (x(t), u(t)) 2 2 + β 2 i η i (x(t), u(t) (3) to the exact penalty function max(, η i (x(t))) for i {1,..., n η }.With this approximation of the path constraints, the resulting stage cost, Φ(x(t), u(t)), used in (11) consist of the inherent stage cost, Φ(x(t), u(t)), and terms penalizing violation of the path constraints (2) Φ(x, u) = Φ(x, u) + χ(x, u) 1,Q1 + 1 2 χ(x, u) 2 2,Q 2 (4) 8 / 23
Optimal Control Problem Single Shooting Discretization We introduce the function { ψ({u k } N 1 k=, x ) = J = tb t a Φ(x(t), u(t))dt + ˆΦ(x(t b )) : x(t ) = x, d dt g(x(t)) = f(x(t), u(t)), t a t t b, } u(t) = u k, t k t < t k+1, k N =,.., N 1 such that (1) can be approximated with the finite dimensional constrained optimization problem min ψ = ψ(y, x ) (6a) y:={u k } N 1 k= s.t. u min u k u max k N (6b) (5) u min u k u max k N (6c) c k (u k ) k N (6d) 9 / 23
Optimal Control Problem Sequential Quadratic Programming We solve the NLP (6) iteratively improving a given estimate y i of the solution by y i+1 = y i + α i p i (7) where α i ( < α 1) is determined by a linesearch (LS) strategy based on Powell s exact l 1 -merit function. The search direction p i is given by solving the KKT solution (p i, λ i, µ i ) of a quadratic approximation to (6) 1 min p 2 p H i p + ψ(y i ) p s.t h(y i ) p = h(y i ) c(y i ) c(y i ) (8) where H i R n n is an approximation for the Hessian 2 yl of the lagrangian function L(y, λ, µ) = ψ(y) λh(y) µ c(y) which starting from an initial estimate H, is updated after every step using BFGS. 1 / 23
ESDIRK integration methods Runge-Kutta ESDIRK Methods We use an embedded ESDIRK method c 2 a 21 γ c 3 a 31 a 32 γ..... 1 b 1 b 2 b 3 γ x n+1 b 1 b 2 b 3 γ ˆx n+1 ˆb1 ˆb2 ˆb3 ˆbs 1 Solve implicit system T i = t n + h n c i, g(x i ) = g(x n ) + h n 2 Compute x n+1 = X s i 2,..., s s a ij f(t j, X j, u) j=1 3 Compute the error/tolerance ratio e n+1 = g(x n+1 ) g(ˆx n+1 ) s = h n (b j ˆb j )f(t j, X j, u) j=1 r n+1 = 1 e n+1 nx atol + g(x n+1 ) rtol 2 11 / 23
ESDIRK integration methods Temporal step size controller performance (after Völcker 21) 12 / 23
Continuous Adjoint Method Proposition (Gradients based on Continuous Adjoints) Consider the function ψ = ψ({u k } N 1 k= ; x ) defined by (5). The gradients, ψ/ u k, may be computed as ψ tk+1 ( ) Φ f = λt dt k =, 1,..., N 1 (9) u k t k u u in which x(t) is computed by solution of (1b)-(1c) and λ(t) is computed by solution of the adjoint equations dλ T g f + λt dt x x Φ x = ˆΦ x (x(t b)) + λ T (t b ) g x (x(t b)) = (1a) (1b) Remember that the dynamic model is given as d dt g(x(t)) = f(x(t), u(t)) 13 / 23
Production Optimization for a Conventional Oil Field Test case for waterflooding optimization squared reservoir of size 45m 45m 1m uniform cartesian grid of 25x25x1 grid blocks no flow boundaries, 4 injectors and 1 producer (rate controlled) We maximize an economic value for different discount factors b,.6,.12 min J(t b) = NPV(t b ) = x(t),u(t) tb t a Φ(x(t), u(t))dt 1 Φ = (1 + b) t/365 (r o (1 f w,j ) f w,j r w ) q j (t) j P where f w = λ w /(λ w + λ o ), λ i = ρ i kk ri /µ i, i {w, o} (11) k min :.24 Darcy, k max :11.312 Darcy 1 3 4.5.5 log 1 (K) (Darcy) 1 2 1 1.5 14 / 23
Production Optimization for a Conventional Oil Field Constraints The manipulated variable at time period k N is u k = {{q w,i,k } i I, {q i,k } i P } (12) with I being the set of injectors and P being the set of producers. q w,i,k q i,k injection rate (m 3 /day) of water at injector i I total flow rate (m 3 /day) at producer i P Bound constraints q w,i,k q max i I, k N (13a) q i,k q max i P, k N (13b) Rate constraints q i,k q i,k 1 5 i I P, k N (14a) q w,i,k q w,i,k 1 5 i I, k N (14b) 15 / 23
Production Optimization for a Conventional Oil Field Constraints (2) voidage replacement constraint q i,k = q w,i,k = q i,k i I i I i P k N (15) total injection constraint q w,i,k = q max k N (16) i I We set q max = 1 m 3 /day, t b = 427 days, T s = 35 days hence N = 122 periods. Injection of 1.5 pore volume during operation of the reservoir We consider as a reference case a fixed water injection of 1/4 = 25 m 3 /day from each injector. The prediction horizon t b is optimal in the reference case 16 / 23
Production Optimization for a Conventional Oil Field Optimal solution TIME: 15 (Day) TIME: 2135 (Day) TIME: 15 (Day) TIME: 2135 (Day) y 4 3 2 1 2 4 x TIME: 322 (Day).8.6.4.2 y 4 3 2 1 2 4 x TIME: 427 (Day).8.6.4.2 y 4 3 2 1 2 4 x TIME: 322 (Day).8.6.4.2 y 4 3 2 1 2 4 x TIME: 427 (Day).8.6.4.2 y 4 3 2 1 2 4 x.8.6.4.2 y 4 3 2 1 2 4 x.8.6.4.2 y 4 3 2 1 2 4 x.8.6.4.2 y 4 3 2 1 2 4 x.8.6.4.2 (a) Optimal solution (b = ). (b) Reference solution. Oil saturations at different times for the optimal solution and the reference solution. 17 / 23
Production Optimization for a Conventional Oil Field Cumulative oil and water production for different discount factors CUMULATIVE PRODUCTION (m 3 ) x 1 5 3 opt oil ref oil opt water 2.5 ref water 2 1.5 1.5 CUMULATIVE PRODUCTION (m 3 ) x 1 5 3 opt oil ref oil opt water 2.5 ref water 2 1.5 1.5 CUMULATIVE PRODUCTION (m 3 ) x 1 5 3 opt oil ref oil opt water 2.5 ref water 2 1.5 1.5 5 1 15 2 25 3 35 4 TIME (DAY) 5 1 15 2 25 3 35 4 TIME (DAY) 5 1 15 2 25 3 35 4 TIME (DAY) (a) Discount factor b =. (b) Discount factor b =.6. (c) Discount factor b =.12. Cumulative oil and water productions for different discount factors, b. 18 / 23
Production Optimization for a Conventional Oil Field NPV, Water cut, Water fraction Million dollars 3 25 2 15 1 opt. b= ref. b= opt. b=.6 ref. b=.6 opt. b=.12 ref. b=.12.4.35.3.25.2.15 opt. b= opt. b=.6 opt. b=.12 reference 1.8.6.4 opt. b= opt. b=.6 opt. b=.12 reference 5.1.5.2 5 1 15 2 25 3 35 4 days (a) NPV. 5 1 15 2 25 3 35 4 days (b) Water cut. 5 1 15 2 25 3 35 4 days (c) Water fraction (kg water/kg fluid). The net present value (NPV), water cut (accumulated water production per produced fluid), and the water fraction as function of time for the scenarios considered. 19 / 23
Production Optimization for a Conventional Oil Field Optimal input trajectories injector 3 (m 3 /day) injector 1 (m 3 /day) 1 5 1 2 3 4 time t (Days) 1 5 b= b=.6 b=.12 reference 1 2 3 4 time t (Days) injector 4 (m 3 /day) injector 2 (m 3 /day) 1 5 1 2 3 4 time t (Days) 1 5 1 2 3 4 time t (Days) Optimal water injection rates for different discount factors, b. 2 / 23
Production Optimization for a Conventional Oil Field Improvement table Table: Key indicators for the optimized cases. Improvements are compared to the base case. b NPV NPV Cum. Oil Oil Cum. water Water 1 6 USD % 1 5 m 3 % 1 5 m 3 % 28. +8.7 3.5 +6.5.122 13.2.6 22.1 +5.6 3.1 +5.2.126 1.5.12 18.3 +4.8 2.98 +4.1.129 8.2 b Oil Rec. factor Oil Rec. factor % %-point 83.7 +5.2.6 82.6 +4.1.12 81.7 +3.2 21 / 23
Conclusions Conclusions A novel algorithm for large scale optimal control based on a novel formulation of the differential equations an ESDIRK method for integration of differential equations the continuous adjoint method for gradient computation the SQP method for optimization the single shooting principle This algorithm is applied for production optimization of oil reservoirs. For this field, optimal control improves the NPV by 8.7%. Optimal control and nonlinear model predictive control can potentially have a very big impact in oil reservoir management. 22 / 23
Acknowledgement Conclusions The Center for Energy Resources Engineering Consortium www.cere.dtu.dk The Danish Research Council for Technology and Production Sciences, FTP Grant no 274-6-284 23 / 23