short course on stanford gprs (general purpose research

97
Short Course on Stanford GPRS (General Purpose Research Simulator) D. Echeverría Ciaurri and H. Pan NTNU Workshop P2 October 15, 2008

Upload: others

Post on 16-May-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Short Course on Stanford GPRS (General Purpose Research

Short Course on Stanford GPRS(General Purpose Research Simulator)

D. Echeverría Ciaurri and H. Pan

NTNU Workshop P2October 15, 2008

Page 2: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 2

Outline

� Simple Examples

� Tutorial Presentation

� Black Oil� Compositional� Adjoint-based Optimization

� Hands-on Examples� Simulation� Adjoint-based Production Optimization� Derivative-Free History Matching

Page 3: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 3

Outline

� Simple Examples

� Tutorial Presentation

� Black Oil� Compositional� Adjoint-based Optimization

� Hands-on Examples� Simulation� Adjoint-based Production Optimization� Derivative-Free History Matching

Page 4: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 4

I. Tutorial Presentation

Page 5: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 5

Outline

� Input Files

� Brief Sotfware Description

� Reservoir

� Wells

� Output Files

� Control

� Adjoint-based Optimization

Page 6: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 6

Outline

� Input Files

� Brief Sotfware Description

� Reservoir

� Wells

� Output Files

� Control

� Adjoint-based Optimization

Page 7: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 7

A General Purpose Research Simulator

� New Generation of research simulator

� Developed by SUPRI-B/HW at Stanford

� GPRS is not a commercial simulator

� GPRS is research tool via source code

� limited support

� limited pre/post processing

� limited functionalities

� Object-oriented C++ code

Page 8: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 8

Advanced Features

� Structured/unestructured grid

� Black-oil/compositional fluid

� Arbitrary choice of primary variables

� Two/multi-point flux

� Variable implicit levels (FIM, IMPES, AIM, …)

� Many direct/iterative solvers/preconditioners

� Gradients for adjoint-based optimization

� Multiple-segmented well-model

Page 9: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 9

Fractured Porous Media

MultiscaleFormulation

Generalized Multiple Phase Compositional/Thermal Model

GPRS

Unstructured Grids/Advanced Solvers/Advanced Wells

CO2 Sequestration

GeomechanicsCoupling

Chemical Reaction

Opt

imiz

atio

n

Flexible Variable Set & Implicitness

Research Platform

Page 10: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 10

GPRS Releases

� GPRS 1.0 (initial version, 2002)

� GPRS 1.1 (08/03)

� GPRS 1.3 (11/04)

� GPRS 1.2 (06/04)

� GPRS 1.4 (11/05)

� GPRS 2.0 (06/06)

� GPRS 2.2 (xx/xx)

� GPRS 2.1 (02/07)

Page 11: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 11

Software Features

� Multiple platforms

� Visual Studio 6.0

� Visual Studio 2005

� Linux

� Unix (Solaris)

� Portable source code

� Single C++ source code for all platforms

Page 12: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 12

Documentation

� Building instructions

� User manual

� Under release packages (Enhancements)

� GPRS software overview

� Aplication Programming Interfaces (API)

� generated by Doxygen

� GPRS.html

Page 13: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 13

Packages

� Software package

� source code

� executable and support libraries

� building instruction files

� samples

� Document package

� basic simulator

� enhancements

Page 14: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 14

Executing GPRS

� Support libraries

� File gprs.in required

� Executable is same directory as input files

� or GPRS directory in PATH variable

� Executables

� gprs.exe and gprs_adj.exe

� mkl_support.dll and samg_dyn.dll

Page 15: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 15

Outline

� Input Files

� Brief Sotfware Description

� Reservoir

� Wells

� Output Files

� Control

� Adjoint-based Optimization

Page 16: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 16

# --- Field Data ---------------------FieldName Field1

# --- Reservoirs Data ---------------NumOfReservoirs 1INCLUDE res_spe1.inEND_RESERVOIRS

# --- Wells Data ----------------------NumOfWells 2INCLUDE wells_spe1.inEND_WELLS

# --- Control Data --------------------INCLUDE control.in

Main Input File: gprs.in

Page 17: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 17

GPRS Input Files

� Keyword values

� Keywords

� beginning: GRID_DATA, FLUID_DATA

� single value: NumOfWells 2

� end: END, END_RESERVOIRS, END_WELLS

� multiple values: GRIDSIZE 3 3 1

� array: DX 100 50 50

� table (two-dimensional array)

Page 18: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 18

GPRS Input Files

� INCLUDE for inserting files

� Comments by #

� n*X = X X … X (n times)

� Spaces at beginning of line are ignored

� one space between two inputs; rest ignored

� Keyword is case sensitive

� a blank line is treated as a comment

� 6*34 = 34 34 34 34 34 34

Page 19: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 19

# --- Field Data ---------------------FieldName Field1

# --- Reservoirs Data ---------------NumOfReservoirs 1INCLUDE res_spe1.inEND_RESERVOIRS

# --- Wells Data ----------------------NumOfWells 2INCLUDE wells_spe1.inEND_WELLS

# --- Control Data --------------------INCLUDE control.in

Basic GPRS Input

Page 20: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 20

Reservoir Input

� Grid data

� grid geometry and properties

� Fluid data

� phase and component properties

� Phase component relation data

� component existence in each phase

Page 21: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 21

Reservoir Input

� Rock fluid data

� relative permeability and capillary pressure

� Rock data

� rock compressibility

� Initial equilibrium data

� initial pressure/saturation, WOC/GOC depth

Page 22: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 22

GRID_DATA ###################GRIDSIZE 10 10 3DX

1000DY

1000DZ

100*20 100*30 100*50PERMX

100*500 100*50 100*200PERMY

100*500 100*50 100*200PERMZ

100*500 100*50 100*200PORO

0.3TOPS

8325TEMP

500END

Grid Data

Page 23: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 23

FLUID_DATA ##################FLUID_TYPE BLACK_OILNPHASES 2NCOMPONENTS 2

PHASE_NAME OIL STANDARD_DENS 49.1NUM_OF_TABLE_ENTRIES 2# P BO VISC RGO # PSI RB/STB CP SCF/STB

14.7 1.03 1.2 01014.7 1.0106 1.2 0

PHASE_NAME WATER STANDARD_DENS 64.79NUM_OF_TABLE_ENTRIES 2# P BW VISC RGW# PSI RB/BBL CP SCF/STB

14.7 1.0410 0.31 0264.7 1.0403 0.31 0

END

Fluid Data

Page 24: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 24

PHASE_COMP_RELATION_DATA ################### --- (nPhases by nComps) ---

#comp: oil water

1 0 #oil

0 1 #water

END

Phase Component Relation Data

Page 25: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 25

ROCKFLUID_DATA ###################OILWATERPERMOWNUM_OF_TABLE_ENTRIES 12#TABLE Sw KRw KROw PCow

0.0 0.0 1.0 00.1 0.0 0.960 00.2 0.0 0.875 00.25 0.0 0.800 00.30 0.010 0.700 00.40 0.040 0.430 00.50 0.075 0.230 00.60 0.125 0.100 00.70 0.2 0.025 00.80 0.3 0.000 00.90 0.575 0.000 01.0 1.0 0.000 0

END

Rock Fluid Data

Page 26: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 26

ROCK_DATA ##################### COMP. REF. PRES

3.E-6 14.7

Rock Data

Page 27: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 27

EQUILIBRIUM_DATA #################### Swi Sor Sgr

0.15 0.00 0.00

# pres @depth WOC GOC

4800 8400 8500 8200

END

Initial Equilibrium Data

Page 28: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 28

Standard Well Input

� Well specifications

� well name

� group name

� reservoir it belongs to

� producer or injector

� well status

� Well completions

� completion block index

� well index

� Well control strategy

Page 29: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 29

j

i

k

Grid index: (i-1) + (j-1)*Nx + (k-1)*Nx*Ny

Nx: number of grid blocks in x direction

Ny: number of grid blocks in y direction

Grid Indexing

Page 30: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 30

# PRODUCTION WELLS

# WELSPECS

# WELL_NAME GROUP RES_NAME TYPE STATUS

PROD01 GRP1 RES1 P OPENEND

# INJECTION WELLS

# WELSPECS# WELL_NAME GROUP RES_NAME TYPE STATUS

INJ01 GRP1 RES1 I OPEN

END

Well Specification Data

Page 31: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 31

# COMPDAT

number_of_perforations 1

# LOC(i,j,k) WI

399 9410

END

Well Completion Data

Page 32: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 32

# WELSEGS# PresDrop FlowModelHFA DF

END

number_of_segments 5# No.of Branch Outlet Length Depth Diam Rough # Seg Num Seg Change Change# 0 default homogeneous segment

1 0 0 0.1 0 0.15 0.0012 0 1 400 0 0.15 0.013 0 2 1 0 0.03 0.014 0 3 400 0 0.15 0.01

Multi-Segment Wells

Page 33: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 33

# CHOKE DEFINITION

CHOKESnumber_of_chokes 1# Seg num Choke model Cv

4 0 0.66

# --- well completions (trajectory) -------# COMPDAT

number_of_connections 2#LOC(i,j,k) WI Seg No.

18 9705 1523 9705 20

Multi-Segment Wells

Page 34: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 34

Well Control Data

� Control type

� ORATE

� WRATE

� GRATE

� LRATE

� BHP

� TBHP, TORATE, TWRATE, …

Page 35: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 35

# PRODUCTION WELLS

# CTRL Q BHP std_den

ORATE 6000 1000.0 49.10

BHP 1000.0

END

# INJECTION WELLS

# CTRL Q BHP std_den NComp OCon WCon

WRATE 6000 10000.0 64.79 2 0 1

BHP 10000.0 2 0 1

END

Well Control Data

Page 36: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 36

# PRODUCTION WELLS# CTRL tINI tEND BHP

TBHP 0 100 4277.99TBHP 100 200 4300.55TBHP 200 400 4283.54TBHP 400 500 4296.56

END

# INJECTION WELLS# CTRL tINI tEND BHP NComp OCon WCon

TBHP 0 100 5677.99 2 0 1TBHP 100 200 5645.23 2 0 1TBHP 200 400 5667.78 2 0 1TBHP 400 500 5679.29 2 0 1

END

Well Control Data

Page 37: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 37

Control Input

� Timestep control

� Newton iteration

� minimum/maximum and fixed number

� Timestep

� initial, minimum/maximum and total

� desired variable change and tuning factor

� Newton iteration control

� convergence criteria for variables/residuals

Page 38: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 38

Control Input

� Linear Solver

� Debug

� enable/disable, frequency of debug output

� Formulation

� type of variables to use, implicit levels

� solver/preconditioner and stopping criteria

� Restart

� enable/disable

Page 39: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 39

# TSINIT TSMAXZ TSMIN1 60 1

# TSTEP

3650

# --- iteration control --------

# minNewtonIter maxNewtonIter fixedNewtonIter1 12 30

# --- time step size control ---

# dp ds dx w200 0.2 0.02 0.5

# --- Newton iteration convergence control ----

# MBE PEE Pchange Schange MFChange relWellEqE0.1 0.02 0.0001 0.005 0.001 0.001

Control Input

Page 40: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 40

# --- solution method control ---# variType nImpTypes Percentages(AIM)

1 1 # nImpVars transOption CFL_Limit

2 4 1.0

# --- linear solver control ------

# Solver Precond. tol maxIter reStartNo4 3 1E-6 1500 10

# --- debug information ---

#Flag NumOfTimeSteps1 10

# --- Re-start file setting information ---

#Flag NumOfTimeSteps output-control0 1 1

Control Input

Page 41: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 41

Outline

� Input Files

� Brief Sotfware Description

� Reservoir

� Wells

� Output Files

� Control

� Adjoint-based Optimization

Page 42: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 42

Output Files

� Debug output (optional)

� Restat output (optional)

� reStartFile.dat

� One output file for each well

� name: reservoir_well.out

� name: reservoir_debug.out

� example: RES1_PROD.out, RES1_INJ.out

� example: RES1_debug.out

Page 43: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 43

Results for well: PROD in the reservoir: RES1

t BHP g(Oil) q(Water)(days) (psia) (STB/day) (STB/day)0 4303.69 0 0 1 3856.11 6000 0 2 3779.25 6000 0 3.59794 3723.07 6000 0 6.36781 3673.08 6000 0 11.0357 3630.13 6000 0 18.256 3599.82 6000 0 29.8017 3583.64 6000 0 46.1893 3580.45 6000 0 69.5331 3585.56 6000 0

Production Well Output

Page 44: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 44

Results for well: INJ in the reservoir: RES1

t BHP g(Oil) q(Water)(days) (psia) (STB/day) (STB/day)0 5260.07 0 0 1 5766.46 0 -6000 2 5881.56 0 -6000 3.59794 6021.55 0 -6000.01 6.36781 6221.39 0 -6000.77 11.0357 6512.4 0 -5999.78 18.256 6657.32 0 -6000.65 29.8017 6584.5 0 -6000.07 46.1893 6437.49 0 -6000.01 69.5331 6332.23 0 -6000

Injection Well Output

Page 45: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 45

Results of block pressure and saturations for reservoir: RES1

BlockNo P T So Sw xi yi

t=0 (days)0 4781.88 40 0.85 0.15 1.0 0.0 0.0 1.01 4781.88 40 0.85 0.15 1.0 0.0 0.0 1.02 4781.88 40 0.85 0.15 1.0 0.0 0.0 1.0

...398 4781.88 40 0.85 0.15 1.0 0.0 0.0 1.0 399 4781.88 40 0.85 0.15 1.0 0.0 0.0 1.0

t=69.5331 (days)0 5460.95 40 0.322 0.678 1.0 0.0 0.0 1.0 1 5286.71 40 0.449 0.551 1.0 0.0 0.0 1.0 2 5144.51 40 0.651 0.342 1.0 0.0 0.0 1.0

...

Debug File

Page 46: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 46

6000

0 9313.02 500 0.193141 0.806859 1 0 0 1

1 9208.15 500 0.194062 0.805938 1 0 0 1

2 9144.2 500 0.195721 0.804279 1 0 0 1

3 9099.27 500 0.198067 0.801933 1 0 0 1

4 9064.57 500 0.200184 0.799816 1 0 0 1

5 9036.33 500 0.205041 0.794959 1 0 0 1...

Restart File

Page 47: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 47

Outline

� Input Files

� Brief Sotfware Description

� Reservoir

� Wells

� Output Files

� Control

� Adjoint-based Optimization

Page 48: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 48

Adjoint-based Optimization

� Optimization parameters in \data\adjoint.in

� exact gradient: BHP control + rate constraints

� MATLAB code in seven folders

� main script ResOptDT.m in \main folder

� approximate gradient: rate control

� simulation data in \data folder

� Features available

� history matching: permeability and porosity

Page 49: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 49

NGRIDS605NCOMPONENTS2NPHASES2OIL_DENSITY // lbm/scf49.10WATER_DENSITY // lbm/scf64.79NPROD4NINJ1

adjoint.in

Page 50: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 50

OIL_PRICE // $/bbl80WATER_INJ_COST // $/bbl0WATER_PROD_COST // $/bbl5TSTEPS4RESERVOIR_NAME // resevoir name as in gprs.inRES1MAX_ITERS // of optim algorithm (orig 2)20TOT_CNSTRNT // rate constraint (bbl/day)4000

adjoint.in

Page 51: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 51

NPERFS //inj prod5 5 5 5 5 0LOWER_BNDS //inj prod1000 1000 1000 1000 1000 UPPER_BNDS //inj prod10000 10000 10000 10000 10000CONTROL_TABLE //dt inj prod180 10000.00 1000.0 1000.0 1000.0 1000.0180 10000.00 1000.0 1000.0 1000.0 1000.0180 10000.00 1000.0 1000.0 1000.0 1000.0180 10000.00 1000.0 1000.0 1000.0 1000.0180 10000.00 1000.0 1000.0 1000.0 1000.0180 10000.00 1000.0 1000.0 1000.0 1000.0

adjoint.in

Page 52: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 52

Sample Files

� Black-oil model

� SPE1: the first SPE comparative project

� SPE1_HW: non-conventional well and SPE1

� BlackOW: water-oil two phases with water injection

� MSWell3Laterals: gas-oil two phases, three lateral

multiple segment wells, drift-flux wellbore flow model

� Black3PinjGas: gas-oil-water three phases with gas

injection

� Black3PinjWater: gas-oil-water three phases with

water injection

� unstruc_mp: unstructured grids and multi-point flux

with water-oil two phases

Page 53: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 53

Sample Files

� Compositional model

� CO2-H2O: sample for CO2 sequestration in aquifer; oil-gas two phases, one prod. well and one gas inj. well

� CO2-H2O-fast: fast flash method for CO2-H2O� COMP: four comp., oil-gas two phases, one prod. well � CompSPE9: nine comp., oil-gas two phases, one prod.

well � CompSPE9-3000: as CompSPE9 sample but initial

reservoir pressure is 3000 psia and initial fluid is gas � Comp2PinjGas: four comp., oil-gas two phases, one

prod. well and one gas inj. well� Comp3PinjGas: four comp., oil-gas-water three phases,

one prod. well and one gas inj. well� Comp3PinjWater: four components, oil-gas-water three

phases, one prod. well and one water inj. well

Page 54: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 54

Enhancements

� \CO2H2OfastFlash: fast flash for CO2-H2O system in CO2 sequestration in aquifers (replaced by LookUp-K)

� \LookUp-K: lookup-K approach for flash in compositional simulation

� \Diffusion: diffusion & dispersion in compositional simulation

� \inactiveCells: removing inactive cells� \Multi_rockfluid: implementing multiple rock

fluid model

Page 55: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 55

Enhancements

� \MSWells: implementing multi-segment well modeling

� \relativePermeability: hysteresis of relative permeability, Stone I model for three phase relative permeability

� \SAMG preconditioner: SAMG pre-conditioner in the iterative linear solvers

� \Time Dependent Well Control: implementing time-dependent well controls

� \Tracer Flow: implementing tracer flow.

Page 56: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 56

Summary

� GPRS: research tool via portable source code

� Special needs/questions contact:

� Now some representative simple examples

� Huanquan Pan ([email protected])

� me ([email protected])

� In the afternoon more realistic cases

Page 57: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 57

Some more questions?

Page 58: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 58

Outline

� Simple Examples

� Tutorial Presentation

� Black Oil� Compositional� Adjoint-based Optimization

� Hands-on Examples� Simulation� Adjoint-based Production Optimization� Derivative-Free History Matching

Page 59: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 59

II. Simple Examples

Page 60: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 60

Simple Black-Oil (SPE1)

� 10 x 10 x 3 grid

� 3 distinct layers

� Black-oil oil-water-gas model

� One gas injector

� One producer controlled by oil rate

� Ten year production

Page 61: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 61

Unstructured Grid and Multi-Point Flux

� 301 x 1 x 1 grid

� Volume and connection list

� Black-oil oil-water model

� One water injector

� One producer controlled by oil rate

� Long production

Page 62: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 62

Compositional (SPE3)

� 5 x 5 x 5 grid

� Homogeneous reservoir

� permx = 10*permz

� 9 components and 2 phases (gas-oil)

� One producer controlled by BHP

� 2000 day production

Page 63: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 63

Adjoint-based Optimization

� 11 x 11 x 5 grid� 5 distinct layers

� Black-oil oil-water model� Five-spot pattern

� One water injector� All wells controlled by BHP

� 750 day production� 25 control intervals (125 control variables)� + total producing liquid rate constraint

Page 64: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 64

Outline

� Simple Examples

� Tutorial Presentation

� Black Oil� Compositional� Adjoint-based Optimization

� Hands-on Examples� Simulation� Adjoint-based Production Optimization� Derivative-Free History Matching

Page 65: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 65

III. Hands-on Examples

Page 66: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 66

� 1 ‘smart’ horizontal injector

� 1 ‘smart’ horizontal producer

� 45 segments in each� Two-phase flow, no

gravity� 1 PV injection in

reference� Segments under BHP

controlAdapted from Brouwer and Jansen, SPE 78278

Optimizing Smart Wells(from Sarma et al.)

Page 67: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 67

� 45X45X1 (2025) Cells

� 5 control changes in time

� Unknowns:

(45+45)*5 =450

� Objective: maximize NPV

� Max inj. rate ≤ 2710

bbl/day

Optimizing Smart Wells(from Sarma et al.)

Adapted from Brouwer and Jansen, SPE 78278

Page 68: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 68

Optimizing Smart Wells(from Sarma et al.)

Page 69: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 69

0 5 10 15 20 25 30 35 400

5

10

15

20

25

30

Log10(K)[mD]

y

x

P1

P3

P2

P4

INJ

0

10mD

100mD

1000mD

10000mD

A Section of SPE10(from Dewi Rahmawati et al.)

Page 70: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 70

• History Matching and Optimization

• Generic Workflow

• Case Study: Stanford VI Sector

• History Matching Results

History Matching Optimization

Page 71: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 71

m ( ) ( ) ||mOmO|| minargm̂ *

Mm−=

m**

observe ( )** mO

( )mO

History Matching

Page 72: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 72

• Model m: facies

• Observable O(m) = [Op(m) Os(m)]

– Op(m): production data

– Os(m): seismic data

• Scaling: Op(m) ~ Os(m)

Integrating Data

Page 73: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 73

• Production Op(m) = [Owi(m) Oop(m)]

– Owi(m) : total water injection

– Oop(m): cumulative oil production

• Seismic Os(m) = [Os1(m) Os2(m)]

– Os1(m) : crosswell section 1

– Os2(m) : crosswell section 2

Observables

Page 74: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 74

• Production Op(m) = [Owi(m) Oop(m)]

• Seismic Os(m) = [Os1(m) Os2(m)]

• Two types of seismics

– wave velocity (VP)

– diffraction tomography

Observables

Page 75: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 75

• Flexible cost function

• Weights modified along optimization

• Regularized:

( ) ( ) ( ) ( ) ||mOmO||||mOmO|| *sss

*ppp −ω+−ω

( ) ( ) ||mOmO|| *−

||mm|| prior−λ+

Cost Function

Page 76: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 76

• VP cannot be directly measured

• VP indirectly estimated

– multiple sources

– inversion process

• Diffraction tomography

source

receptor

Gr

Sr

Seismic Data: Tomography

Page 77: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 77

model m

VP tomography

Tomography Results

Page 78: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 78

true model m*

VP tomography

Tomography Results

Page 79: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 79

• History Matching and Optimization

• Generic Workflow

• Case Study: Stanford VI Sector

• History Matching Results

History Matching Optimization

Page 80: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 80

facies

Op(m)

Os(m)

||.||KPCA

m**

tooptimizer

manyparameters

lessparameters

rock properties

mξξξξ

Workflow

Page 81: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 81

• Principal Component Analysis (PCA)

• Data compression approach

• Based on a priori statistical information

Principal Component Analysis

Page 82: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 82

• Cost function = production + seismic

• No strategy for exact gradients

• Derivative-free optimizer

• Fairly efficient optimization scheme

• Very easy to implement and robust

13

Cost Function Gradients

Page 83: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 83

• History Matching and Optimization

• Generic Workflow

• Case Study: Stanford VI Sector

• History Matching Results

History Matching Optimization

Page 84: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 84

• 20x20x10 sector from zone 3

• m: facies

• k, φφφφ: regression from well location

• VP as seismics

• PCA: 30 coefficients retained

• Measured data only after 3 months

Some Results

Page 85: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 85

5 spot

injector

producer

Production Data

Page 86: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 86

5 spot

injector

producer

Seismic Data

Page 87: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 87

x

z

y

z

true

after production

initial

alternating

Velocities (VP)

Page 88: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 88

x

y

LAYER 1

true

after production

initial

alternating

Facies

Page 89: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 89

x

y

LAYER 1

true

after production

initial

alternating

Facies

Page 90: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 90

x

y

LAYER 4

true

after production

initial

alternating

Facies

Page 91: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 91

x

y

LAYER 4

true

after production

initial

alternating

Facies

Page 92: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 92

x

y

LAYER 6

true

after production

initial

alternating

Facies

Page 93: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 93

x

y

LAYER 6

true

after production

initial

alternating

Facies

Page 94: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 94

x

y

LAYER 10

true

after production

initial

alternating

Facies

Page 95: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 95

x

y

LAYER 10

true

after production

initial

alternating

Facies

Page 96: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 96

Thank you for

attending!

Page 97: Short Course on Stanford GPRS (General Purpose Research

October 15, 2008 Trondheim, Norway 97

Short Course on Stanford GPRS(General Purpose Research Simulator)

D. Echeverría Ciaurri and H. Pan

NTNU Workshop P2October 15, 2008