A General Purpose Research Simulator (GPRS) for Numerical Simulation On CO2 Sequestration 8/24, 2011 Bin Gong Peking University Highlights GPRS is a next-generation research simulator developed in Stanford SUPRI-B group GPRS uses state-of-the-art object-oriented design and is programmed in standard C++ GPRS is easy to extend and easy for team development GPRS can be used by multiple researchers with various purposes of reservoir engineering and management Most of SUPRI-B group’s research results are tested and reflected in GPRS GPRS Introduction 2 Milestones 2002: 1st release of GPRS to SUPRI-B members: generalized unstructured, compositional formulation 2004: Finished Multi-segment well (MSWell) implementation 2005: Started to add energy equation; SLB/CVX/Total’s Intersect project initiated largely following the philosophy and system design of GPRS 2007: Finished adding advanced upscaling features for NFR (MSR), conventional reservoirs (ALG), and near-well regions 2009: Finished generalized chemical-reaction formulation (multispecies) 2010: Started to implement auto-differential formulation; finished CO2 sequestration and CBM module; Collaborative development agreement signed between Stanford and Peking University GPRS Introduction 3 Features of GPRS StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulation and Solvers Others GPRS Introduction 4 State-of-the-Art Object-oriented Design Major commercial reservoir simulators are still procedure-oriented design (Eclipse, CMG, VIP, etc.) GPRS uses object-oriented design – – – – – Much more natural way to model an oilfield field Enables datadata-encapsulation Clear structure, easy to maintain SimMaster Allow easy teamwork Unlimited extensibilities facilities solvers wells wellgroup pipeline GPRS Introduction grid … stdwell mswell reservoir smart wells … fluid rock 5 Outline StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulation and Solvers Others GPRS Introduction 6 Full-function Reservoir Simulator A Black-Oil simulator – Allow Any combination of oiloil-waterwater-gas phases – A Special case of compositional formulation A Compositional simulator – – – Any number of components Comprehensive EOS models Fast flash calculation A Chemical-Reaction Simulator – Largely applied in Global Climate and Energy Project (GCEP)’ (GCEP)’s CCS research – Ready to use for CBM and Shale Gas simulation and thermal – OnOn-going work GPRS Introduction 7 A Black-Oil Example 10th SPE standard comparison project, example 2 Oil-water model with 1.12 million grids GPRS Introduction 8 Benchmark Results Matched with industry simulators Much faster than Eclipse – It takes GPRS 4.5 hrs on single CPU (2.8GHz) – It takes Eclipse 5 hrs on 8 CPUs (2.8 GHz) GPRS Introduction 9 A Compositional Example • 3rd SPE standard comparison project • Gas-Condensate model,9 HC + water 40000 2000 35000 1800 Eclipse Gas Rate GPRS Gas Rate 30000 GPRS Oil Rate Oil Rate (bbl/day) Gas Rate (mscf/day) 1600 Eclipse Oil Rate 25000 20000 15000 1400 1200 1000 800 600 10000 400 5000 200 0 0 200 400 600 800 1000 1200 1400 0 1600 Time (day) GPRS Introduction 10 Outline StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulation and Solvers Others GPRS Introduction 11 Multi-level Sparse Block Matrix 0 Easy to assemble Efficient Extensible 2 00 4 00 6 00 8 00 1000 1200 1400 0 200 400 600 800 nz = 74960 1000 1200 R ~ reservoir F ~ facilities W ~ well GPRS Introduction RR RF FR FF RW1 RW2 1 400 12 Block Compressed Row Matrix compressed row sparse pointer matrix diagonal off-diagonal 9 1 4 • 3 3 6 Designed specifically for unstructured grid & AIM Easy to adopt new algorithms Better cache utilization GPRS Introduction 13 Outline StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulation and Solvers Others GPRS Introduction 14 Multi-Segment Well Multi-segment well (MSWell) model describes the flow behavior inside each discretized segment of the wellbore (e.g. J.A. Holmes) After J.A. Holmes GPRS Introduction 15 MSWell – More Physics Consider fluid gravity, friction with wellbore, and acceleration Consider the drift-flux between phases Assign variables of pressure, hold-ups, velocity along wellbore Liquid Phase Gas Phase Concentration Profile (Chen, Y 2002) w θ o at il gas er Velocity Profile Vd : Local Relative Velocity GPRS Introduction 16 MSWell Formulation segment 1 Reference pressure point segment 2 P, segment pressure Vm , mixture velocity f o , oil phase hold-up Vm fo cp Variables : f g , gas phase hold-up segment 3 Equations: Pseg segment 4 seg res Ro,i = ( Ain +1 − Ain ) o + ( Fi ,seg out − Fi , in ) o − Fin, o = 0 seg res Rw,i = ( Ain+1 − Ain ) w + ( Fi ,seg out − Fi ,in ) w − Fin, w = 0 seg res Rg ,i = ( Ain+1 − Ain ) g + ( Fi ,seg out − Fi ,in ) g − Fin, g = 0 perforation 3 ΔPtotal = ΔPh + ΔPf + ΔP a GPRS Introduction 17 Outline StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulation and Solvers Others GPRS Introduction 18 Grid Types GRPS supports various grid types – Cartesian grid – CornerCorner-point grid – Unstructured grid GPRS Introduction 19 Unstructured Grid Example GPRS Introduction 5227 fractures Large permeability range: 0.1 ~ 106 md Porosity: 0.25 ~ 1.0 Large cell size range: 10-3 ~ 103 cft 20 C1 Composition Maps t = 5 days t = 10 days t = 40 days t = 70 days t = 100 days t = 500 days GPRS Introduction 21 DFM Application in China’s First CCS project Hydraulic Fracture length: 100m Hydraulic Fracture length: 300m GPRS Introduction CO2 saturation profiles 22 3D Model with Hydraulic Fractures Hydraulic Fracture Model Geological Model DFM Model GPRS Introduction North – South (m) CO2 Distribution After 5 Years’ Injection East - West (m) GPRS Introduction CO2 Front Observation Time North – South (m) Time contour map of CO2 front observation time (month) East - West (m) GPRS Introduction CO2 front observation time at a specific position considering possible fracturing directions (year) Outline StateState-ofof-thethe-Art ObjectObject-Oriented Design FullFull-function Reservoir Simulator Innovative Data Structures Advanced Well Models Compatible with Various Grids Powerful Formulations and Solvers Others GPRS Introduction 26 Powerful Formulations and Solvers GPRS provides more flexible formulations – Fully implicit (FIM) method, – Implicit pressure explicit saturation (IMPES) method – Implicit pressure and saturations and explicit component mole fractions (IMPSAT) method – Adaptive implicit (AIM) method, with any combination of above formulations GPRS Introduction 27 Powerful Formulations and Solvers GPRS provides a large set of powerful solvers and preconditioners – LAPACK full/banded matrix direct solvers – BlitzPak iterative solver – PointPoint-wise / blockblock-wise GMRES iterative solver – BiCGstab iterative solver – PointPoint-wise/ blockblock-wise diagonal preconditioners – Incomplete LU decomposition preconditioners – Constraint pressure residual (CPR) preconditioners – AMG preconditioners GPRS Introduction 28 Results CPR method is a two-stage preconditioner – A highly accurate pressure solve as first stage – A loose ILU global solve as second stage AIM formulation + block-wise GMRES solver + CPR preconditioner are the best combination for most of reservoir simulation cases Widely recognized by industry GPRS Introduction 29 Examples Upscaled SPE10 (top formation) – – – – – 110x30x16 grid (52,800) OilOil-water system 5 multimulti-segmented bilateral producers 9 segments, 6 perforations per MSWell 2 standard vertical injectors GPRS Introduction 30 Results Two scenarios: producers are modeled with MSWell or not CPR is 4~6 time faster than ILU 927 1000 Time (Sec) 800 600 470 400 110 200 156 0 StdWell GMRES+ILU GPRS Introduction StdWell GMRES+CPR MSWell GMRES+ILU MSWell GMRES+CPR 31 Others Programmed in Standard C++, ideally should work on any operating system Currently available in 32-bit/64-bit Windows,Linux and Unix systems GPRS Introduction 32 Key Reference H. Cao, Development of Techniques for General Purpose Simulator, Ph.D. thesis, Stanford University, 2002 Y. Fan, Chemical Reaction Modeling in a Subsurface Flow Simulator with Application to In-Situ Upgrading and CO2 Mineralization, Ph.D. thesis, Stanford University, 2010 L.J. Durlofsky, K. Aziz, Advanced Techniques for Reservoir Simulation and Modeling of Non-conventional Wells, Final Report to U.S. Department of Energy, contract no. DE-AC26-99BC15213 (2004) 213 pp. 2004 GPRS Introduction 33 Thank You! GPRS Introduction 34