• Non ci sono risultati.

A constrained pressure residual (CPR) based multiscale solver for fully implicit simulations of multiphase flow in porous media

N/A
N/A
Protected

Academic year: 2021

Condividi "A constrained pressure residual (CPR) based multiscale solver for fully implicit simulations of multiphase flow in porous media"

Copied!
118
0
0

Testo completo

(1)

Scuola di Ingegneria Industriale e dell’Informazione

Corso di Laurea Magistrale in Ingegneria Energetica

Tesi di Laurea Magistrale

A Constrained Pressure Residual (CPR) based multiscale

solver for fully implicit simulations of multiphase flow in

porous media

Relatore interno:

Prof. Anna Pandolfi

Relatori esterni :

Prof. Hadi Hajibeygi, TU Delft

Dr. Alexander Lukyanov, Schlumberger

Autore:

Matteo Cusini

Matr. 800878

(2)

First of all, I would like to thank my supervisors: Professor Hadi Hajibeygi and Dr. Alexander Lukyanov. They gave me a great opportunity and they both supported me throughout this work. It has been a honour working with them; their passion and commitment have been of great inspiration.

I want to thank Schlumberger for the economic support and all the people of the Abingdon Technology Centre for the great atmosphere in which I had the opportunity to work. A special thank goes to Gareth, Tom and the Research & Prototype team of Schlumberger for the fruitful discus-sions we had during my internship at Schlumberger.

I also thank Lisa, Nicolas, Laura, David, Monica, Rafa, Juanlu, Sara, Manu, Alessio and all my other friends in Oxford for making my stay in the UK more than just a work experience.

Ringrazio la professoressa Anna Pandolfi per aver accettato il ruolo di relatore e per l’aiuto nella stesura della tesi.

Ringrazio l’ingegner Cominelli per l’interesse mostrato verso il mio lavoro e per i suoi preziosi consigli.

Vi sono alcuni professori del Politecnico che vorrei ringraziare per aver influito positivamente sulla mia carriera universitaria, anche se solamente con dei gesti molto semplici; ringrazio, quindi, il prof. Perotti e il prof. Sec-chi per avermi aiutato nella ricerca di un relatore per questa tesi. Ringrazio il prof. D’Errico per la sua capacit`a di interpretare il ruolo di professore come qualcosa che va al di l`a della semplice didattica; una delle conferenze da lui organizzate nel corso del primo anno `e stata di grande ispirazione per me.

Durante la mia carriera universitaria ho avuto la possibilit`a di conoscere moltissime persone provenienti da vari paesi del mondo; ciascuno di loro ha contribuito a rendere indimenticabili i miei anni univesitari.

Ringrazio il mio amico David perch´e senza di lui il mio soggiorno a Delft non sarebbe stato la stessa cosa.

Ringrazio chi mi ha condiviso con me l’ultimo periodo al Politecnico: Elena, Davide, Leonardo, Tommaso, Andrea e Melinda.

Ringrazio i miei amici di Milano, Fede, Mary, Stefy, Luca, Luca e Mattia perch´e, grazie a loro, tornare a Milano ogni tanto non `e poi cos`ı male.

Ringrazio i miei compagni di avventure parigine ed in particolar modo tutti coloro che hanno condiviso con me l’esperienza del 2B. In modo

(3)

partic-Ringrazio tutti i bianconigli, Luca, Matteo, Gigi, Riccardo, Riccardo, che hanno sofferto e gioito con me durante i primi anni al Politecnico.

Ringrazio i miei amici di vecchia data, Luca, Pavel e Rocco perch´e, nono-stante le nostre vite abbiano preso strade molto diverse, non ho mai smesso di sentirli vicini.

Ringrazio tutti i membri della mia famiglia, i miei nonni, i miei zii, Lina, Maurizio, Patrizia, Simone e Mirko, per essermi sempre stati vicini nonostante i miei continui spostamenti.

Voglio rivolgere un ringraziamento particolare ai miei genitori per aver sempre supportato le mie scelte, cercando di aiutarmi a prendere le decisioni migliori, senza per`o cercare di limitarmi.

Infine, ringrazio mio fratello Tommaso per essere sempre capace di strap-parmi un sorriso e per la fiducia che ha in me.

(4)

Il presente lavoro ha l’obiettivo di sviluppare un metodo multiscala per la simulazione totalmente implicita di problemi di simulazione di giacimenti commerciali, cio`e di simulazione numerica di moti di filtrazione multifase in giacimenti di idrocarburi. Tipicamente, i fluidi dei giacimenti petroliferi sono costituiti da composti idrocarburici, in fase liquida o gassosa, ed acqua in fase liquida.

Formulazione e strategie risolutive

Formulazione matematica

La filtrazione di fluidi multifase nei mezzi porosi `e descritta da equazioni di bilancio di massa, quantit`a di moto ed energia che formano un sistema di equazioni differenziali. Le complicate geometrie dei pori e le diverse scale spaziali coinvolte nel problema (i pori possono avere dimensioni dell’ordine deiµm mentre i giacimenti si estendono per km) rendono la soluzione di tali equazioni praticamente impossibile per qualsiasi metodo numerico. General-mente, il problema viene semplificato e reso accessibile usando una relazione costitutiva empirica che descrive il flusso locale in termini del gradiente del carico idraulico trascurando i dettagli del flusso su scala microscopica (legge di Darcy):

qi = −An

Kki

µi

(∇pi− ρig∇z) (1)

dove qi `e la portata volumetrica della fase i, A `e la sezione di passaggio, n

il versore normale ad A, K `e il tensore di permeabilit`a del mezzo poroso, ki `e la permeabilit`a relativa della fase i, µi e ρi sono, rispettivamente, la

viscosit`a dinamica e la densit`a della fase i, p `e la pressione, g l’accelerazione di gravit`a e z `e un versore nella direzione dell’attrazione gravitazionale.

Si consideri un giacimento in cui sono presenti Nc componenti e Np fasi.

Si assume che lo stato termodinamico del giacimento sia descritto dalle seguenti variabili, tutte funzione della posizione:

• la pressione della fase ph (pph);

• la saturazione della fase ph (Sph);

(5)

La pressione di una fase, ad esempio la fase 1, viene scelta come riferimento e tutte le altre vengono espresse attraverso la relazione:

pph= p1+ pc,ph1 ∀ ph= 2, ..., Np, (2)

dove pc,ph1 `e detta pressione capillare tra la fase ph e la fase 1 ed `e una

funzione nota della saturazione.

Si ammetta di suddividere il dominio sede del processo di filtrazione in sottodomini o celle. Per ogni componente i e per ogni cella j viene scritto il bilancio molare: ∂Mij ∂t + X k Fijk +X w Qjwi = 0 (3)

dove, definita %ph la densit`a molare della fase ph:

t `e il tempo;

Mi = φ Vtot Np

P

ph=1

%phSphxi,ph `e il numero di moli della componente i, φ `e la

porosit`a e Vtot il volume della cella j; ∂Mij

∂t `e il termine di accumulo molare della componente i nella cella j;

Fijk = −Ajkn · Np P ph=1 xi,ph%ph Kkrph

µph (∇pph− ρphg∇z) `e il flusso della

compon-ente i dalla cella k alla cella j e Ajk `e la superficie tra le due celle;

Qjwi `e il flusso della componente i dal pozzo w alla cella j.

Le saturazioni e le frazioni molari, che sono espresse in termini percentuali, devono rispettare le condizioni:

Np X ph=1 Sph = 1 (4) Nc X i=1 xph,i = 1 ∀ ph = 1, .., Np (5)

Inoltre, nei casi in cui la temperatura non pu`o essere considerata costante, va inclusa anche l’equazione di bilancio termico. .

In molti casi reali, si possono introdurre alcune ipotesi semplificative che consentono di considerare la presenza di solo 3 componenti suddivise in altrettante fasi: acqua, olio e gas. Questa formulazione viene chiamata comunemente black oil.

(6)

Le equazioni (3) formano un sistema di equazioni differenziali non lineari per il quale non `e possibile trovare una soluzione analitica. Di conseguenza, e’ indispensabile fare ricorso a metodi numerici per trovare una soluzione approssimata.

Ogni metodo numerico richiede una discretizzazione spaziale e tempor-ale. Il processo avviene in un intervallo di tempo T, che viene suddiviso in intervalli ∆t. A seguito della discretizzazione spaziale, le equazioni differ-enziali vengono ricondotte a un sistema di equazioni altamente non lineari. Per ogni intervallo di tempo, ∆t, le equazioni non lineari vengono risolte con il metodo di Newton-Raphson che richiede la soluzione di un sistema lineare ad ogni iterazione.

Esistono due principali strategie risolutive per i sistemi non lineari: i metodi totalmente impliciti (FIM) ed i metodi sequenziali. I primi preve-dono un trattamento implicito di tutti i termini e la risoluzione dell’intero sistema. I secondi, invece, sono utilizzati prevalentemente per problemi black oil e prevedono la soluzione in serie delle due equazioni che governano il problema di filtrazione: l’equazione della pressione e quella del trasporto. Dalla prima si ottiene una soluzione del campo di pressione, che viene poi inserita nell’equazione del trasporto, a sua volta risolta per l’altra vari-abile del problema, la saturazione delle fasi. I metodi sequenziali sono stati introdotti perch´e le due equazioni hanno natura molto diversa e devono essere risolte con metodi differenti. Infatti, l’equazione della pressione `e ellittica (per flussi incomprimibili) o parabolica (per flussi comprimibili) e l’equazione del trasporto `e iperbolica.

La simulazione totalmente implicita `e pi`u costosa dal punto di vista computazionale ma ha il grande vantaggio di essere pi`u stabile. Infatti, per problemi caratterizzati da forte accoppiamento tra le variabili, le strategie sequenziali incorrono in problemi di stabilit`a.

CPR-MS

Metodi multiscala

I metodi multiscala sono stati sviluppati per risolvere l’equazione della pres-sione nell’ambito delle strategie sequenziali. Questi metodi si basano sulla discretizzazione multipla del dominio spaziale, introducendo piu’ griglie a diversa scala e a diversa struttura.

Consideriamo, per esempio, i bilanci massici di un problema bifase black oil:

∂t(φρiSi) − ∇ · (ρiλi· (∇p − g∇z)) = ρiqi for i = α, β, (6) Sommando le due equazioni di bilancio si ottiene la seguente equazione della pressione:

(7)

Afpf = bf, (8)

dove l’indice f indica che le grandezze sono riferite alla griglia inizialmente imposta sul dominio, formata da N celle, a cui ci si riferisce come griglia fine.

Per risolvere l’Eq. 8 si costruiscono due griglie lasche sovrapposte, dette griglia lasca primaria e griglia lasca duale e composte rispettivamente da Nc e Nd celle. Ciascun nodo di una cella Ωh della griglia duale corrisponde

al centro di una cella Ωk della griglia lasca primaria, dove si definisce la

pressione pk. Nei metodi multiscala si trovano i valori delle pressioni pk

ri-solvendo un sistema di dimensioni ridotte rispetto al sistema originario (Eq. 8). Successivamente, a partire da tali valori, si calcola un’approssimazione della pressione in tutti i punti della griglia fine utilizzando degli interpolatori detti funzioni di base. Si pu`o, dunque scrivere:

pf(x) ≈ p0(x) = Nd X h=1 Nc X k=1 Φhk(x)pk+ Φh(x)  . (9) dove Φh

k(x) sono le funzioni di base e sono la soluzione del seguente problema

su ciascun dominio Ωh:          ∇ · (λ∇Φh k) = r in Ωh (nh· ∇)  (λ∇Φh k) · nh  = 0 su ∂Ωh Φh k(xl) = δkl con k = 1, ...Nc (10)

Φh(x) sono, invece, dette funzioni di correzione e servono ad includere effetti,

come il peso o la pressione capillare, che non possono essere proiettati sulla griglia lasca.

A partire dalle funzioni di base si costruiscono due operatori algebrici detti R e P che servono rispettivamente a restringere il sistema iniziale sulla griglia lasca primaria e a prolungarne la soluzione sulla griglia fine. In particolare, si ha che il k-simo vettore colonna di P contiene Φk, definita

come: Φk= Nd X h=1 Φhk (11)

L’operatore R, invece, pu`o essere costruito in maniera diversa a seconda che si voglia usare un metodo multiscala ai volumi finiti (MSFV) o agli elementi finiti (MSFE). Nel primo caso, si ha che l’elemento della riga i e colonna j di R, rij `e:

rij =

(

1 se la cella j ∈ Ωi

0 altrove

dove Ωi `e una cella della griglia lasca primaria. Nel secondo caso, invece,

(8)

p0 = [P (RAfP)−1R]bf = MM S−1bf (12)

Tutti i metodi multiscala sviluppati fino ad oggi sono sempre stati inseriti all’interno di strategie sequenziali. Lo scopo di questo lavoro `e lo sviluppo di un metodo multiscala per la simulazione totalmente implicita.

Algoritmo del CPR-MS

Il metodo sviluppato, CPR-MS, combina il precondizionamento a due stadi della strategia CPR (”Constrained Pressure Residual”), usata per la risoluzione dei sistemi ”fully implicit”, con un metodo multiscala.

Consideriamo la forma discreta dell’ Eq. 3, ottenuta usando uno schema alle differenze finite, rappresentante il flusso della componente i nella cella j: Rji(X) = M j,n+1 i − M j,n i ∆t + X k Fijk+X w Qjwi = 0 (13)

dove X `e un vettore che contiene le variabili primarie del problema. Usando il metodo di Newton-Raphson si ha:

R(X + ∆X) ≈ R(X) + ∂R

∂X∆X = 0 (14)

dove il termine ∂R

∂X corrisponde alla matrice Jacobiana, J. L’Eq. 14 equivale

al seguente sistema lineare:

J∆X =Jpp Jps Jsp Jss  ∆xp ∆xs  = r =rp rs  , (15)

dove il blocco Jppcontiene i coefficienti della pressione, il blocco Jsscontiene

i coefficienti delle altre variabili (saturazioni delle fasi e frazioni molari delle componenti), Jpse Jspcontengono i termini di accoppiamento tra le variabili

e ∆xpe ∆xSsono rispettivamente gli incrementi della pressione e delle altre

variabili.

Il sistema viene moltiplicato per una matrice M , detto operatore di decoupling, che modifica il sistema iniziale in modo da estrarre il blocco Jpp. Si ottiene quindi: M J =J ∗ pp Jps∗ Jsp∗ Jss∗  e M r =r ∗ p r∗ s  (16) La matrice M J viene moltiplicata dalla matrice C = [I 0]T cos`ı da estrarre

un’equazione che dipende unicamente dall’incremento di pressione: (CTM J C)∆x0 p = (M J)pp∆x0p = Jpp∗ ∆x 0 p = r∗p = C Tr∗ . (17)

L’ Eq. 17 ha caratteristiche simili all’equazione della pressione dei met-odi sequenziali. Di conseguenza, e’ possibile pensare utilizzare un metodo

(9)

stadio di precondizionamento per risolvere il sistema intero.

L’algoritmo CPR-MS pu`o essere, quindi, riassunto come segue: 1. Precondizionamento CPR:

Si ottiene l’equazione della pressione. Acpr ∆x0p = (CTM J C)∆x

0

p = rp = CTr.

2. Pre-smoothing:

ns,1 iterazioni di un metodo iterativo vengono applicate e la soluzione

∆x0p e il residuo rp sono aggiornati.

3. Costruzione dell’equazione della pressione sulla griglia lasca: AM

cpr∆x c

p = (RAcprP) · ∆xcp = rMp = R · rp.

4. Soluzione del sistema lineare sulla griglia lasca e proiezione della soluzione sulla griglia fine:

∆x0p = P · ∆xc p.

5. Post-smoothing:

ns,2 iterazioni di un metodo iterativo vengono applicate e la soluzione

∆x0p e il residuo rp sono aggiornati.

6. Correzione del residuo del sistema intero: r∗ = r − J · (C · ∆x0p).

7. Secondo stadio di precondizionamento: ∆x∗ = Z2−1· r∗.

8. Ricombinazione delle soluzioni: ∆x = ∆x∗+ C · ∆x0p.

I due stadi di smoothing appaiono nell’algoritmo per eliminare le com-ponenti ad alta frequenza degli errori.

L’algoritmo `e stato implementato nel codice C++ di INTERSECT, che `e il software pi`u recente di reservoir simulation della societ`a Schlumberger. INTERSECT risolve il sistema lineare con un metodo GMRES (General-ized Minimum Residual method) precondizionato con la tecnica a due stadi CPR, in cui un metodo multigriglia algebrico (AMG) `e usato per il primo stadio di precondizionamento e una fattorizzazione LU incompleta (ILU(0)) per il secondo.

(10)

Il metodo CPR-MS `e stato testato su due casi studio tridimensionali di grandi dimensioni (pi`u di 5 · 105 celle). Entrambe i casi studio sono stati

risolti dapprima trascurando la capillarit`a e poi includendola.

La soluzione fornita dall’algoritmo combacia sempre perfettamente con la soluzione standard di INTERSECT, che `e stata presa come riferimento.

Le prestazioni dei due algoritmi sono state confrontate in termini di nu-mero di iterazioni non lineari, nunu-mero di iterazioni lineari e durata della simulazione. I risultati ottenuti sono particolarmente promettenti. Infatti, per alcuni casi studio l’algoritmo CPR-MS riduce la durata della simulazione e, in nessun caso, si sono registrati problemi di stabilit`a. Inoltre, tutte le simulazioni sono state svolte con un solo processore e, vista la predisposiz-ione alla parallelizzazpredisposiz-ione dei metodi multiscala, simulazioni multiprocessore dovrebbero dare risultati migliori.

Come caratteristica qualificante, il CPR-MS permette l’estensione dei metodi multiscala a problemi con forte accoppiamento tra le variabili de-rivanti, ad esempio, dalla presenza della pressione capillare.

Struttura

La tesi `e suddivisa nei seguenti sei capitoli:

1. Reservoir Simulation: il primo capitolo vuole essere un’ introduzione al problema fisico trattato e alle equazioni differenziali con cui viene modellato. Inoltre, in questo capitolo vengono dettagliate le principali strategie risolutive esistenti.

2. Metodi risolutivi per sistemi lineari: questo capitolo contiene una rassegna dei principali metodi di risoluzione di sistemi lineari, con particolare attenzione ai metodi implementati in INTERSECT. 3. Metodi multiscala: in questo capitolo viene presentata la teoria alla

base dei metodi multiscala ai volumi finiti ed agli elementi finiti. 4. CPR-MS: in questo capitolo `e descritto il metodo CPR-MS. Prima

di tutto si spiega la strategia di simulazione totalmente implicita im-plementata in INTERSECT, facendo particolare attenzione al pre-condizionatore CPR. In seguito, si illustra come in questo contesto sia stato inserito un metodo multiscala.

5. Risultati numerici: in questo capitolo vengono riassunti i principali risultati numerici ottenuti con il metodo CPR-MS. Sono analizzati i risultati ottenuti su due modelli tridimensionali in termini di numero di iterazioni non lineari e lineari e durata delle simulazioni. Entrambi i problemi vengono risolti senza considerare o considerando la pressione capillare, usata come esempio di termine di accoppiamento.

(11)
(12)

The objective of this work is the development of a multiscale method for fully implicit simulation of reservoir simulation problems, thus multiphase flow problems in hydrocarbons reservoirs. Typically, the fluids trapped in oil reservoirs are made of hydrocarbons compounds, in liquid or gaseous phase, and water in liquid phase.

Formulation and solution strategies

Mathematical formulation

Multiphase flows in porous media are described with mass, momentum and energy balance equations, which form a system of partial differential equa-tions. The complex geometries of the pores and the different length scales involved in the problem (pores can have dimensions of the order of µm whereas reservoirs extend over km) make the solution of such equations al-most impossible for any numerical method. Usually, the problem is simpli-fied and made accessible using an empirical constitutive law that describes the local flow rate as a function of the gradient of the hydraulic head, neg-lecting the microscopic-scale details (Darcy’s law):

qi = −An

Kki

µi

(∇pi− ρig∇z) (18)

where qi is the volumetric flow rate of phase i, A is the cross section, n

is a unit vector normal to A, K is the permeability tensor of the porous medium, ki is the relative permeability of phase i, µi and ρiare, respectively,

the dynamic viscosity and the mass density of phase i, p is the pressure, g is the gravitational acceleration z is a unit vector in the direction of the gravitational force.

Let us consider a reservoir with Nc components and Np phases. Let us

assume that its thermodynamic state is described by the following variables, all functions of the position:

• the pressure of the phase ph (pph);

• the saturation of the phase ph (Sph);

(13)

The pressure of one phase, e.g., phase 1, is used as a reference and all other pressures are obtained from the following equation:

pph= p1+ pc,ph1 ∀ ph= 2, ..., Np, (19)

where pc,ph1 is the capillary pressure between the phase ph and phase 1 and

is a known function of saturation.

The domain where the flow process takes place is divided into subdo-mains or cells. A molar balance equation is written for each component i in each cell j: ∂Mij ∂t + X k Fijk +X w Qjwi = 0 (20)

where, if %ph is the molar density of phase ph:

t is the time;

Mi = φ Vtot Np

P

ph=1

%phSphxi,ph is the number of moles of component i, φ is the

porosity and Vtot is the volume of cell j; ∂Mij

∂t is the accumulation term of component i in cell j;

Fijk = −Ajkn · Np P ph=1 xi,ph%ph Kkrph

µph (∇pph− ρphg∇z) is the flux of component

i from cell k into cell j and Ajk is the surface between the two cells;

Qjwi is the flux of component i from well w into cell j.

Phase saturations and component molar fractions have to satisfy the fol-lowing constraints: Np X ph=1 Sph = 1 (21) Nc X i=1 xph,i = 1 ∀ ph = 1, .., Np (22)

An energy balance equation is added for those cases where temperature cannot be considered to be constant.

In many real cases, the black oil formulation hypothesis can be intro-duced: this consists in considering the presence of only 3 components par-titioned in 3 phases.

(14)

Equations (20) form a system of nonlinear partial differential equations that cannot be solved analytically. Therefore, numerical methods are used to find an approximate solution.

All numerical methods require a discretization of the equations both in time and in space. The process takes places over a time interval T that is divided in small intervals ∆t. After applying a spatial discretization a system of highly nonlinear equations is obtained. For each time step, ∆t, the nonlinear equations are solved with the Newton-Raphson method that requires the solution of a linear system for each iteration.

There are two main solution strategies for nonlinear systems: fully impli-cit (FIM) and sequential methods. The former uses an impliimpli-cit treatment of all terms and solves directly the fully coupled system. The latter are mainly used for black oil problems and consist in the sequential solution of the two equations governing the flow problem: the pressure (or flow) equation and the transport equation. The first equation is solved for pressure and its solu-tion is plugged into the second equasolu-tion that is then solved for saturasolu-tion. Sequential strategies were introduced to exploit the different nature of the two equations. In fact, the pressure equation is elliptic (for incompressible flows) or parabolic (for compressible flows) whereas the transport equation is hyperbolic.

Fully implicit simulations are computationally more expensive but have the advantage of being more stable. In fact, sequential strategies have stability issues for problems characterized by strong coupling terms between the variables.

CPR-MS

Multiscale methods

Multiscale methods were developed to solve efficiently the pressure equation within sequential strategies. These methods are based on a multiple spatial discretization of the domain obtained by imposing grids of different scales and structures.

Let us consider, for example, the mass balance equations of a two-phase black oil problem:

∂t(φρiSi) − ∇ · (ρiλi· (∇p − g∇z)) = ρiqi for i = α, β, (23) The following pressure equation is obtained by summing the two mass bal-ance equations:

∇ · (λ∇p) = ∇ · (λg∇z) − q. (24)

Eq. 24 is written in algebraic form:

(15)

Eq. 25 is solved by the means of two overlapping coarse grids called primal and dual coarse grid, formed, respectively, by Ncand Ndcells. Each

primal control volume Ωk contains only one node, in which the coarse grid

pressure pk is defined, of a dual control volume Ωh. In multiscale methods

the values of pressures pk are found by solving a linear system smaller than

the original one (Eq. 25). An approximation of the fine scale pressure is computed by interpolating the pressures pk with particular interpolators

called basis functions. Thus, it can be written: pf(x) ≈ p0(x) = Nd X h=1 Nc X k=1 Φh k(x)pk+ Φh(x)  . (26) where Φh

k(x) are the basis functions, solutions of the following system on

each dual coarse domain domain Ωh:

         ∇ · (λ∇Φh k) = r in Ωh (nh· ∇)  (λ∇Φh k) · nh  = 0 su ∂Ωh Φh k(xl) = δkl con k = 1, ...Nc (27)

Φh(x) are called correction functions and capture the effect of fine scale

phenomena, such as gravity and capillary pressure, that cannot be projected to the coarse grid. Basis functions are used to construct two algebraic operators R and P , used to restrict the initial system to the coarse scale and to prolong its solution to the fine scale. The k-th column vector of the P operator contains Φk, defined as:

Φk= Nd

X

h=1

Φhk (28)

Ris constructed in two different ways depending whether a MSFV or MSFE method is used. In the MSFV method, the entry in row i and column j of R, rij is:

rij =

(

1 se la cella fine j ∈ Ωi

0 altrove

where Ωi is a domain of the primal coarse grid. In the MSFE method,

instead, R = PT.

Once P and R have been constructed, the solution p0, that approximates

the fine scale pressure pf, is obtained as follows:

p0 = [P (RAfP)−1R]bf = MM S−1bf (29)

All multiscale methods developed so far have always been implemented within sequential strategies. The aim of this project was the development of a multiscale method for fully implicit simulation.

(16)

The method that was developed, CPR-MS, combines the Constrained Pres-sure Residual (CPR) two-stage preconditioning strategy, used for fully im-plicit systems, with a multiscale method.

Let us consider the discrete form of Eq. 20, using a finite difference discret-ization, governing the flow of component i for cell j:

Rji(X) = M j,n+1 i − M j,n i ∆t + X k Fijk+X w Qjwi = 0 (30)

where X is a vector that contains all primary variables. The following equation is obtained using the Newton-Raphson method:

R(X + ∆X) ≈ R(X) + ∂R

∂X∆X = 0 (31)

where ∂R

∂X is the Jacobian matrix, J. Eq. 31 is equivalent to the linear

system: J∆X =Jpp Jps Jsp Jss  ∆xp ∆xs  = r =rp rs  , (32)

where the block Jpp contains the pressure coefficients, Jss the coefficients of

the other variables (phase saturations and component molar fractions), Jps

and Jsp contain the coupling terms and ∆xp and ∆xS are respectively the

increments of pressure and of the other variables.

Eq. 25 is multiplied by a matrix M , called decoupling operator, that modifies the initial system so that the Jpp can be extracted:

M J =J ∗ pp J ∗ ps Jsp∗ Jss∗  and M r =r ∗ p r∗ s  (33) The matrix M J is multiplied by C = [I 0]T so that a pressure equation is

obtained: (CTM J C)∆x0 p = (M J)pp∆x0p = Jpp∗ ∆x 0 p = r∗p = C Tr∗ . (34)

The characteristics of Eq. 34 are similar to those of the pressure equation of sequential strategies. As a consequence, a multiscale method can be used to solve it. Once Eq. 34 has been solved, following the CPR method, the full system residual is updated and the updated full system is solved with a second stage preconditioner.

The main steps of the CPR-MS algorithm are the following: 1. Perform CPR preconditioning:

Obtain the pressure eq. Acpr ∆x0p = (CTM J C)∆x 0

p = rp = CTr.

2. Pre-smoothing stage:

(17)

4. Solve the coarse system and prolong its solution: ∆x0p = P · ∆xc

p.

5. Post-smoothing stage:

Perform ns,2 iterations of a smoother and update ∆x0p and rp.

6. Update the FIM residual: r∗ = r − J · (C · ∆x0

p).

7. Perform the second stage preconditioner on FIM system: ∆x∗ = Z2−1· r∗.

8. Combine the two corrections: ∆x = ∆x∗+ C · ∆x0p.

The two smoothing stages are employed to eliminate high-frequency components of the error.

The algorithm was implemented in the C++ code of INTERSECT, that is the high resolution reservoir simulation of Schlumberger. The linear sys-tem is solved using GMRES (Generalized Minimum Residual method) pre-conditioned with the CPR method, where the first stage preconditioner is an algebraic multigrid method (AMG) method and the second stage pre-conditioner is an incomplete LU factorization (ILU(0)).

Numerical results and conclusions

The CPR-MS method was tested on two large-size complex 3D test cases (with more than 5·105cells). Both cases were solved both with and without

considering the effect of capillary pressure.

The solution obtained with CPR-MS is identical to the one provided by INTERSECT, that is used as a reference. The performance of the two algorithms are compared in terms of number of nonlinear and linear it-erations and simulation time. The results are very promising. In some cases, CPR-MS reduces the simulation time and for problems with strong coupling terms shows the same efficiency as the current solver implemented in INTERSECT. All simulations are obtained with a single processor but multiprocessors simulations are expected to give even better results.

As a conclusion, remark that the CPR-MS solver extends multiscale methods to real cases characterized by strong coupling terms between the variables that cannot be solved with sequential strategies.

(18)

The thesis is organised in the following six chapters:

1. Reservoir simulation: this chapter is a generic introduction to reservoir simulation. The physical problem and the main equations used to model it are presented along with the main existing solution strategies. The focus is maintained on the formulation and on the solution strategies used in the INTERSECT simulator.

2. Linear solvers: this chapter contains a review of the most common linear solvers used in reservoir simulation. All methods presented are implemented in the INTERSECT and were used for the implementa-tion of the CPR-MS solver.

3. Multiscale methods: The main concepts of the finite volume and finite element multiscale methods are explained in details.

4. CPR-MS: the actual CPR-MS solver is developed in this chapter. Firstly, the current fully implicit simulation strategy implemented in INTERSECT and CPR preconditioning are explained in details; secondly, the algorithm of CPR-MS is introduced.

5. Numerical results: this chapter contains the first numerical results obtained using CPR-MS with two large-size test cases. Results are presented in terms of CPU time and number of nonlineaer and linear iterations, and they are compared to the performance of the current solution strategy of INTERSECT. Both test cases are solved both with and without considering capillary pressure.

6. Conclusions: this is the last chapter of this work and contains the conclusion and some reflections about possible future developments of this work.

(19)
(20)

Motivated by the goal of maintaining or increasing the oil production, the oil industry is presently facing the need of exploiting extended and geologically more complex reservoirs. The availability of numerical models is incumbent to support decision making in such difficult environments.

The description of the flow across porous media is complicated by the presence of several phases (oil, water, gas). Multiphase flow simulations over extended non-regular domains require highly scalable solvers to achieve robustness and efficiency.

Simulations of multiphase flow in porous media require the treatment of two variables of very different nature; pressure, governed by an elliptic equa-tion (or parabolic equaequa-tion for compressible flows), and phase saturaequa-tion, governed by a hyperbolic equation. Multiscale methods were developed to deal efficiently with the heterogeneity of the coefficients of the pressure equation. The success of multiscale methods developed so far is limited by the fact that, to treat the coupling between flow and transport, they rely on a sequential approach (IMPES or sequential implicit), found to be unstable for problems with strong coupling terms (e.g., due to capillary pressure).

In this thesis, as original and truly innovative contribution, a multiscale method for fully implicit simulations (CPR-MS) was developed and imple-mented. The first numerical results obtained in single processor simulations are promising. The CPR-MS allows for the application of multiscale meth-ods to a range of problems characterized by strong nonlinear coupling terms between the variables.

Key words:

Reservoir simulation, multiphase flow, fully implicit, preconditioning, Con-strained Pressure Residual (CPR), multiscale methods.

(21)

Spinta dall’obiettivo di mantenere od aumentare la produzione di petrolio, oggi, l’industria petrolifera si ritrova obbligata a sfruttare giacimenti pi`u estesi e geologicamente pi`u complessi. La disponibilit`a di modelli numerici `e fondamentale per supportare le decisioni in ambienti cos`ı complicati.

La descrizione della filtrazione di fluidi nei mezzi porosi `e complicata dalla presenza di varie fasi (olio, acqua, gas). La simulazione su domini molto estesi ed irregolari richiede lo sviluppo di metodi risolutivi altamente scalabili per ottenere robustezza ed efficienza.

La simulazione di moti multifase nei mezzi porosi richiede il trattamento di due variabili di natura molto diversa fra loro: la pressione, governata da un’ equazione ellittica (o parabolica per problemi comprimibili), e la satu-razione delle fasi, che `e, invece, governata da un’ equazione iperbolica. I metodi multiscala sono stati sviluppati per trattare efficientemente la com-plessit`a dovuta alla eterogeneit`a dell’equazione della pressione. Il successo dei metodi multiscala sviluppati fino ad ora `e limitato dal fatto che sono tutti basati su un trattamento sequenziale dell’ accoppiamento tra pressione e saturazione (IMPES o metodo sequenziale implicito), che risulta instabile per problemi caratterizzati da termini di accoppiamento elevati (generati ad esempio dalla pressione capillare).

In questa tesi, come contributo originale ed innovativo, `e stato sviluppa-to ed implementasviluppa-to il primo mesviluppa-todo multiscala inserisviluppa-to per la simulazione totalmente implicita (CPR-MS). I primi risultati numerici ottenuti in simu-lazioni con un solo processore sono promettenti. Il CPR-MS permette di applicare i metodi multiscala ad un nuovo range di problemi, caratterizzati da forti termini non lineari di accoppiamento tra le variabili.

Parole chiave:

Reservoir simulation, flussi multifase, simulazione totalmente implicita, pre-condizionamento, Constrained Pressure Residual (CPR), metodi multiscala.

(22)

1 Reservoir simulation 5 1.1 Multiphase Flow in Porous Media . . . 5 1.1.1 Anisotropy . . . 7 1.1.2 Capillarity . . . 7 1.1.3 Relative Permeability . . . 9 1.2 Formulation . . . 11 1.2.1 Variables . . . 11 1.2.2 Governing equations . . . 12 1.2.3 Wells . . . 14 1.3 Compositional fluid model . . . 14 1.3.1 Equations of state . . . 15 1.3.2 Flash calculations . . . 16 1.4 Black oil fluid model . . . 16 1.5 Solution strategies . . . 18 1.5.1 Solution process . . . 19 1.5.2 Timestep selection and stability . . . 28

2 Linear Solvers 31

2.1 Direct Methods . . . 31 2.1.1 Triangular systems . . . 32 2.1.2 The Gaussian elimination method . . . 32 2.1.3 Alternative factorizations . . . 34 2.1.4 Tridiagonal matrices . . . 34 2.2 Stationary Iterative Methods . . . 35 2.2.1 Common linear iterative methods . . . 35 2.3 Non-stationary Iterative Methods . . . 37 2.3.1 Krylov methods . . . 37 2.4 Stopping criteria for iterative methods . . . 40 2.5 Preconditioning . . . 41 2.6 Multigrid methods . . . 42 2.6.1 AMG . . . 43

3 Multiscale methods 47

3.1 Multiscale FE and FV methods . . . 48 3.1.1 MS methods for incompressible problems . . . 48 3.1.2 Compressible problems . . . 52 3.2 Algebraic representation of MS methods . . . 52

(23)

3.3 Extensions of MS methods . . . 53 3.3.1 Iterative MSFV method (i-MSFV) . . . 54 3.3.2 Adaptive update of basis functions . . . 54 3.3.3 Combining MSFE and MSFV . . . 55 3.4 Limits of multiscale methods . . . 55

4 A CPR based fully implicit MS solver 57

4.1 Constrained Pressure Residual (CPR) . . . 57 4.1.1 CPR decoupling operators . . . 58 4.2 FIM simulation within INTERSECT . . . 61 4.2.1 Convergence criteria . . . 62 4.3 CPR-MS solver . . . 62 4.3.1 Implementation . . . 64

5 Numerical Results 65

5.1 SPE 9 model . . . 67 5.1.1 Simulations without capillary pressure . . . 68 5.1.2 Simulations with capillary pressure . . . 71 5.2 Brill C model . . . 73 5.2.1 Simulations without capillary pressure . . . 74 5.2.2 Simulations with capillary pressure . . . 75 5.3 Parametric study on the CPR-MS solver . . . 77 5.3.1 MSFV vs MSFE . . . 77 5.3.2 Coarsening factors . . . 77 5.3.3 Basis functions update frequency . . . 78

6 Conclusion 79

6.1 Future work . . . 79

A Sequential formulation 81

A.1 Terms of the pressure equation . . . 81 A.2 Linearisation of the transport equation . . . 82

(24)

Why the choice of this thesis?

Being an energy engineering student I am obviously interested in all energy related topics. According to the latest British Petroleum statistical review, fossil fuels cover over 85 % of the world primary energy consumption and 65 % of them is represented by oil and gas. As a consequence oil and gas profoundly influence the actual World economic situation.

Besides the importance of reservoir simulation for the oil and gas in-dustry, and thus for the modern society, I was also amazed by the variety of scientific topics touched by it. In fact, reservoir simulation includes most of the branches of engineering (solid mechanics, chemistry, fluid dynamics, mathematics, etc.). Having always been fascinated by mathematics and physics, especially if applied to real problems, this project attracted my attention when I discovered the close link between theoretical issues and practical problems.

Reservoir simulation

For oil and/or gas fields, reservoir simulations provide crucial information in terms of planned production over the incoming 30 to 40 years. Reservoir simulation is an extremely powerful tool for oil companies as it supports the decision making process by providing a clear picture of various possible scenarios. Simulators are used for estimating the productivity of an existing reservoir, planning its exploitation, evaluate different Enhanced Oil Recov-ery (EOR) strategies, and others. It is important to stress that empirical data are very difficult to obtain in this field due to the length and time scales of the problems.

The computational cost of reservoir simulation is very high. A full reser-voir study can require around 103 simulations. Unfortunately a full

tion can take a considerable amount of time; for example, parallel simula-tions with 32 or 64 cores can take over 20 hours for complex problems. In fact, complex problems can have over three million cells with several degrees of freedom.

Usually, the most time consuming part of a simulation is taken by the linear solver. For this reason, a lot of effort has been put over the past decades to develop reliable scalable approximated linear solver that allow

(25)

Aim of the project

The aim of this project is to find a way to extend multiscale methods to fully implicit strategies for reservoir simulation. In fact, the interest to-wards multiscale strategies has grown significantly over the past ten years as multiphase flow in porous media involves phenomena taking place on very different length scales.

Multiscale methods are able to deal efficiently with the heterogeneity of the coefficients of the so called pressure equation that has an elliptic (for incompressible flows) or parabolic (for compressible flows) nature. The latest developments of the multiscale finite volume methods include iterative strategies and have been tested with problems including faults and fractures. However, all multiscale methods developed so far have been applied only in combination with a sequential treatment (IMPES or sequential implicit) of the coupling between flow (pressure) and transport equations (saturation). Unfortunately, sequential strategies are unstable for problems with strong coupling terms between flow and transport. Strong coupling terms can be found in many practical problems where capillary effects have to be considered or a compositional formulation is used. For these cases fully implicit (FIM) systems are generally used because they are more stable. Consequently, it is crucial to extend multiscale methods to fully implicit simulations in order to avoid being restricted to a narrow range of cases and be able to analyse more challenging and realistic problems.

The most efficient fully implicit simulations use a two-stage precondi-tioning strategy developed in the 1980s, called CPR, in which a decoupling operator is used to extract a pressure system whose characteristics are sim-ilar to those of sequential strategies. The first preconditioning stage consists in the solution of the extracted pressure system. The obtained pressure solu-tion is used to correct the full system residual and the updated system is then solved in the second preconditioning stage.

In this work, a multiscale method is integrated within the CPR precon-ditioning technique; hence, the extracted pressure equation is solved with a multiscale method leading to the CPR-MS solution strategy.

The work was developed at Schlumberger Abingdon Technology Centre in Abingdon (UK). The CPR-MS solver was implemented in the INTER-SECT simulator C++ code, that is Schlumberger’s high resolution reservoir simulator. The first tests cases were run on relatively big and complex mod-els as the CPR-MS solver was integrated in a real commercial simulator, used by several oil companies.

(26)

The work is organised in the following six chapters:

• Chapter 1: this chapter is a generic introduction to reservoir simu-lation. The physical problem and the main equations used to model it are presented along with the main existing solution strategies. The focus is maintained on the formulation and on the solution strategies used in the INTERSECT simulator.

• Chapter 2: this chapter contains a review of the most common linear solvers used in reservoir simulation. All methods presented are imple-mented in the INTERSECT and were used for the implementation of the CPR-MS solver.

• Chapter 3: multiscale methods are presented in this chapter. The main concepts of multiscale methods are explained in details.

• Chapter 4: the actual CPR-MS solver is developed in this chapter. Firstly, the current fully implicit simulation strategy implemented in INTERSECT and CPR preconditioning are explained in details; secondly, the algorithm of CPR-MS is introduced.

• Chapter 5: this chapter contains the first numerical results obtained using CPR-MS with two 3D models of a fairly large size (over 600000 cells). Results are presented in terms of CPU time and number of nonlineaer and linear iterations, and they are compared to the per-formance of the current solution strategy of INTERSECT.

• Chapter 6: this is the last chapter of this work and contains the conclusion and some reflections about possible future developments of this work.

(27)
(28)

Reservoir simulation

The aim of this chapter is to introduce the main physical phenomena that are treated in reservoir simulation, to show how they are modelled and to justify the existing solution strategies. In the first part of this chapter an overview of the physical problem is given: Darcy’s law is introduced along with capillarity and relative permeability as these are the pillars of mul-tiphase flows in porous media. The second section is about the formulation used within INTERSECT. Sections 3 and 4 show two different models that can be used to represent an hydrocarbon mixture that flows in a reservoir (compositional and black oil models). In the last section of the chapter the focus is shifted towards the possible solution strategies.

1.1

Multiphase Flow in Porous Media

Porous media can be found in almost all our daily life activities; as under-lined in [8], all solid materials, with exception of metals, some very dense rocks and plastics, contain pores. As a consequence, there is a huge variety of applications where we can find phenomena of fluid flows through porous media (e.g., underground water movements, chemical reactors, food drying processes, etc).

This thesis focuses on reservoir simulation, therefore on the flow of mainly three phases (water, oil and gas) in the underground rocks. Oil reservoir generally have very large dimensions (km) whereas pores usually belong to the microscopic scale. Thus, it is important to understand on which scale a problem has to be solved and the influence that the micro-scopic structure has on the macromicro-scopic properties of a rock. The two main properties used to characterise a porous medium are porosity and permeab-ility. Porosity is the fraction of void space (or pore volume) over the total volume. Permeability is defined as the conductivity of rock with respect to permeation of a fluid. Permeability is measured in Da (darcy), where a permeability of 1 Da means that under a pressure difference of 1 atm a flow rate of 1 cm3

s is produced.

The most important law to describe macroscopically the flow of a fluid in a porous medium is Darcy’s law (Eq. 1.1). The latter is a macroscopic

(29)

Figure 1.1: Microscopic image of the pore structure of a sandstone.

empirical law that states that the flow rate of a fluid through a surface A between two points in a porous media is proportional to the difference of the fluid hydraulic head. The proportionality coefficient is the permeability of the medium to the fluid.

q= −Ak

µ∆Φ (1.1)

where q is the volumetric flow rate, A is the cross section, k is the effective permeability, µ is the viscosity and Φ is the hydraulic head ∆p + ρg∆z. Darcy’s law is valid for laminar (Re < 1) steady unidirectional flows of a single fluid in a porous medium. However, Darcy’s law is extended to multiphase flows in steady-state conditions, i.e.,

qi = −A

ki

µi

∆Φi (1.2)

where the index i means that the quantity refers to fluid i and ki is called

effective permeability.

Alternative equations that can be applied to non-laminar flows also exist, the most common of which is Forchheimer’s equation [3, 8]. However, when analysing the flow of reservoir fluids in porous media (with some exception for the parts of the reservoir closer to wells) Darcy’s law is generally valid because of the time scale of the problem, the high-viscosity of the fluids (apart from some cases of gas flows) and the very small length scale of the pores.

Eq. 1.2 is extended to all points of the porous medium. Thus, for a surface A it stands: qi = − Z A ki µi (∇p − ρig∇z) · ndA (1.3)

where n is a unit vector normal to A. This generalization of Darcy’s law corresponds to considering all properties defined everywhere in a porous

(30)

medium. However, porosity and permeability can only be defined over con-trol volumes that have a length scale a few order of magnitude bigger than the one of microscopic structures.

This aspect has to be considered when discretizing a domain for a reser-voir simulation problem. In fact, Eq. 1.3 can only be used if the cells are big enough to allow for the definition of macroscopic properties. On the other hand, to fully capture the heterogeneity of a porous medium, the cells should be small enough to allow us to consider all properties to be constant.

1.1.1

Anisotropy

The values of some properties of a porous media are affected by the direction in which they are measured. This phenomenon is usually called anisotropy. For reservoir simulation, it is particularly important to take into account the anisotropy of permeability. A fluid within a rock does not necessarily flow with the same ease in all directions. For example, the pore structure of the rock may facilitate the flow in a particular direction; this is very common in rocks because of their structure in layers (e.g., Figure 1.2). As a consequence, the effective permeability ki has the physical structure of a

tensor and will be reffered to as Ki.

Figure 1.2: Sedimentary rock of the Zion national Park (Utah): layering is one of the main reason of permeability anisotropy in rocks. Source: National Geographic.

1.1.2

Capillarity

As mentioned before, reservoir simulations problems generally involve three fluids that flow in a rock. When analysing the flow of two or more immiscible fluids, surface phenomena have to be taken into account. Wettability is a phenomenon observed when two fluid phases are in contact on a solid surface.

When two fluids get into contact, a curved interface is formed between them. This curved interface results in a pressure discontinuity; the pres-sure difference between the two phases is called capillary prespres-sure.

(31)

Obvi-ously, pressure is higher on the concave side of the interface. According to Laplace’s equation the pressure difference across the interface is:

∆p = σ 1 r1 + 1 r2  (1.4) where r1 and r2 are the curvature radius of the surface in two different

directions and σ is a property of the two fluids contact called interfacial or surface tension and is measured in (N/m).

Let us consider the case of a droplet of one phase attached to a solid surface surrounded by the other phase (Figure 1.3). The angle formed by the tangent to the droplet surface and the surface is called contact angle. Young’s equation gives us the force balance at the contact point, i.e.

σow· cos(θ) = σso− σsw (1.5)

where, σow is the surface tension between oil and water, σsw and σso are

the surface tensions between each fluid and the solid surface. The angle is always measured relative to the denser phase. Wettability, and wetting and non-wetting phases are defined based on the value of the contact angle.

If a water-oil system is considered, there are 4 different possible situ-ations:

1. σos= σws and σow =⇒ θ = 0

2. σos< σws =⇒ θ < 90o: the rock is water wet

3. σos> σws =⇒ θ > 90o: the rock is oil wet

4. complete spreading of oil or water (never observed).

Figure 1.3: Contact angle with a solid surface of a water bubble surrounded by oil . Source [7]

Generally, larger pores are occupied by the wetting phase and smaller ones by the non-wetting one.

Contact angles are usually determined empirically; different contact angles are observed depending whether the wetting phase is advancing or receding. This phenomenon is called hysteresis and there are three possible explanations for it:

(32)

• roughness of the solid surface;

• chemical heterogeneity of the solid surface; • time dependent effects.

If the values of capillary pressure between two phases as a function of the saturation of the wetting phase are plotted, because of hysteresis, two different curves are observed; they are called imbibition and drainage cuves (Figure 1.4). Imbibition consists in forcing the wetting phase into pores whereas drainage is the opposite process. The difference between the two curves is closely related to the difference in contact angles between the cases of advancing and receding fluids.

Imbibition and drainage curves for real cases can be even more complic-ated than the ones represented in Figure 1.4. More details about capillary pressure can be found in [8].

Figure 1.4: Capillary pressure hysteresis: imbibition and drainage curves are represented. Source [2].

1.1.3

Relative Permeability

The effective permeability Ki of the porous media with respect to phase i

is a combination of two properties:

ki = K · kri (1.6)

where K is the permeability tensor of the rock and a property of the porous medium. kri is called relative permeability and it is specific to each phase.

(33)

• it is a strong function of the saturation of phase i • it is a function of the saturations of the other phases • it is affected by the distribution of the pores size • it is affected by the wettability of the various phases

• it can also be affected by strong changes of the interfacial tensions Relative permeabilities of a porous medium are generally experimentally determined as a function of phase saturations. Figure 1.5 shows typical curves for a 2-phase system (generally oil and water) where water is usually the wetting phase and oil the non-wetting one.

Figure 1.5: Example of relative permeabilities curves.

Imbibition curves for a oil-water system show that relative permeability is usually a non-linear function of saturation. In addition to this, remark that there is an irreducible water saturation Swirr at which the relative

per-meability to water is equal to 0. There is also a residual non-wetting phase saturation Sor at which the relative permeability to oil is equal to 0.

Two-phase flow occurs whenever Swirr < Sw < 1 − Sor. An analytical relation

between relative permeability and saturations is given by the commonly used Corey’s correlation::

krw = k0rw Sw − Swirr 1 − Swirr − Sor !nw kro = k0ro 1 − Sw− Sor 1 − Swirr − Sor !no (1.7)

(34)

The nonlinearity of the relationship between relative permeability and sat-urations represents one of the challenges of reservoir simulation.

1.2

Formulation

To simulate multiphase flow in porous media the proper mathematical equa-tions, that describe the physical problem, should also be written. Theoret-ically, it should be possible to treat a multiphase flow in a porous medium by solving Navier-Stokes equations at the pore level by using surface forces as boundary conditions. In most real cases this is not possible due to the very complex geometry of the pores and to the large length scales of the problems. For this reason the momentum balance equation is replaced by the global expression reported in Eq. 1.3.

Let us now focus on the formulation used within INTERSECT. A com-pletely general formulation is used; no assumption is made in terms of phase-component partitioning. With no limits on the maximum number of components and phases, all components can exist in any phase and no ordering is assumed. This approach allows simulations of most reservoirs without requiring any customized setting to be adopted. Obviously, com-ponents and their partitioning between phases should be given as an input to the simulator.

1.2.1

Variables

Let us consider a system with Nc different components partitioned in Np

different phases and let us assume that its state is fully described by the following variables:

• Pressure of each phase (pα);

• Saturations of the Np phases (Sα);

• Phase mole fractions of the Nc components in the Np phases (xα,i);

• Temperature (T).

All variables are functions of the position and defined for each cell. There-fore, for such a system in each cell there are Np(2 + Nc) + 1 variables (Table

1.1).

Table 1.1: Number of variables

Phase Pressures Np

Phase saturations Np

Mole fractions Np· Nc

(35)

Usually, the pressure of one phase is selected, e.g., phase 1, and all other pressures are computed by using the capillarity relationship:

pα = p1+ pc,α1, ∀ α= 2, ..., Np (1.8)

where p1is the pressure of phase 1 and pc,α1is the capillary pressure between

phase 1 and a generic phase α. Capillary pressures between phases are known functions of the phase saturations. In addition to this, the tem-perature of the reservoir can be considered uniform and constant for many problems. Consequently, the number of unknowns becomes Np(Nc+ 1) + 1.

1.2.2

Governing equations

The number of equations has obviously to be equal to the number of vari-ables in order to solve the system.

The basic equations used to represent the physical phenomenon in INTER-SECT are:

• components mass balance; • Darcy’s law (Eq. 1.3);

• thermodynamic equilibrium of components between phases, with the definition of mole fraction and phase saturation.

Along with them, the definitions of phase saturation and mole fraction are used for closing the system.

Conservation equation

The domain where the flow process takes place is divided into subdomains or cells. A conservation equation is written for each component in each cell.

∂Mij ∂t + X k Fijk +X w Qjwi = 0 (1.9) where: t : is the time. ∂Mij

∂t : is the rate of change of the number of moles of component i in cell j.

Fijk : is the flow of moles of component i from cell k into cell j. Qjwi : is the flow of moles of component i from well w into cell j.

If the porosity of the medium in cell j, φj, and the molar density of phase

ph, %ph, are defined, Mi can be written as:

Mi = φjVtot Np

X

ph=1

(36)

where Vtot is the total volume and xi,ph is the molar fraction of component

i in phase ph.

The flow of moles of component i from cell k into cell j (Fijk) is expressed as: Fijk = Ajkn Np X ph=1 xi,ph%phvph, (1.11)

where According to Darcy’s law vph can be written as:

vph= −

Kkrph

µph

· ∇Φph, (1.12)

where A is the surface between cells j and k, and vphis the velocity of phase

ph that, according to Darcy’s law can be written as:

∇Φph = ∇pph+ ρphg∇z. (1.13)

The following equation is obtained by combining Eq. 1.11 and Eq. 1.12: Fijk = −Ajkn Np X ph=1 xi,ph%ph Kkrph µph · ∇Φph. (1.14) Thermodynamic equilibrium

Thermodynamic equilibrium of component i between two phases α and β is guaranteed when:

fα,i= fβ,i (1.15)

where fα,i is the fugacity of component i in phase α. For a system with Nc

components and Np phases, in which all components appear in all phases,

the thermodynamic equilibrium provides us with Nc· (Np − 1) equations.

In fact, if a component is present in n phases, n − 1 equilibrium conditions can be written.

Constraints

Two different constraints are to be taken into account:

• P

αSα= 1 ∀ α = 1, ..., Np

• P

ixα,i = 1 ∀ α = 1, ..., Np.

Thus, for a system with Nc components and Np phases if it is assumed,

without any loss of generality, that all components are present in all phases, for each cell there are Np(Nc+ 1) + 1 equations (Table 1.2).

It is evident that the number of variables, in the case where all com-ponents partition in all phases, is exactly equal to the number of equations. If one component does not appear in one of the phases, one variable (the mole fraction of the component) disappears along with one equation (the

(37)

Table 1.2: Number of equations

Conservation equations Nc

Thermodynamic equilibrium Nc· (Np− 1)

Saturation constraint 1

Mole fraction constraints Np

thermodynamic equilibrium). Considering that the sums of all saturations and of mole fractions for each phase are equal to one, one saturation and Np mole fractions can be eliminated. When running thermal simulation one

more variable (temperature) and one more equation (energy balance) have to be taken into account.

For each cell a different set of equations and variables can be chosen. In fact, the composition of each phase can change from one cell to another and in some cells some components may not exist in certain phases. Thus, while component balance equations exist in all cells, the thermodynamic equilibrium conditions depend on the phase composition.

1.2.3

Wells

In Eq. 1.9 there is a term Q, representing the flow form a well or an aquifer to cell j. Wells and aquifers are the source terms of the problem; a well can represent either a positive or a negative source term depending whether it is an injection (injector ) or an extraction well (producer ). Injection wells are used to inject a fluid (e.g., water or CO2) into the reservoir so that

the pressure is increased. Extraction wells are, as suggested by their name, responsible for the extraction of the hydrocarbons.

The main challenge of well modelling is the representation of the connection between the wells and the reservoir. In fact, wells in INTERSECT are represented as segments, where a segment is just like a cell (with uniform properties) but that does not belong to the reservoir. A detailed description of how wells are treated in INTERSECT can be found in [22].

1.3

Compositional fluid model

The fluids that can be found in petroleum reservoirs contain thousands of different chemical components which will affect their physical properties and phase behaviour during the life of the reservoir. Describing petroleum fluids in term of individual components would not be practical and too com-plicated. For this reason, petroleum fluids are described in terms of pseudo components (groups of molecules) which have average physical properties.

The phase behaviour is represented by an Equation of State (EOS) and phase equilibrium relations.

(38)

1.3.1

Equations of state

An EOS is a mathematical relationship between pressure, temperature and volume of a substance. For a mixture, composition is added to this relation-ship. The cubic form of the EOS is by far the most common one and the Redlich-Kwong-Soave-Peng-Robinson family of EOS, in particular, has been the industry standard for several years for the description of compositional flows in reservoir simulation.

The generic form of this family of EOS is:

p= RT v − b−

a(T )

(v + m1b)(v + m2b)

(1.16) where R is the universal gas constant, v is the molar volume, a = a(T ) represents the influence of the temperature dependent attractive term, b is the repulsive term (or covolume) and the parameters m1 and m2 vary

depending on the EOS used.

The EOS is usually expressed in terms of the compressibility factor (Z). In fact, the behaviour of most fluids can be described by adding a correction factor, Z = V olumereal

V olumeideal, to the EOS of ideal gases, i.e.

pV = Z(T, P )nRT. (1.17)

Eq. 1.18 is solved for Z and depending on the phases present and other consideration the appropriate root is selected.

Z3+ e2(A, B)Z2+ e1(A.B)Z + e0(A, B) = 0 (1.18)

where A and B are the non dimensional parameters corresponding to a and b in Eq. 1.16 and: e0 = −  AB+ m1m2B2(B + 1)  e1 = A + m1m2B2 − (m1m2)B(B + 1) e2 = (m1+ m2− 1)B − 1 (1.19)

The Z factor is used to fully characterise, using Eq. 1.17, the volumet-ric behaviour of a substance or a mixture. When applying the EOS to a mixture instead of a pure substance, mixing rules are applied to calculate the parameters A and B. Different EOS and mixing rules can be used; the analysis of the difference between all possible options falls beyond the scope of this work.

In reservoir simulation determining the Z factor of each component and/or phase is important for computing the values of all properties in each cell.

(39)

1.3.2

Flash calculations

The system composition is characterised by operating a flash calculation, that consists in determining, for each cell, which phases are present and their compositions.

There are two types of flash calculations. Equilibrium Ratios (Kc) flash

It is the simplest approach to flash calculations: the equilibrium ratios, Kc

are know functions of pressure and mole fractions.

Let us consider a two-phase system with Nc components that can exist

in both phases. The following equilibrium relations can be written: yc= Kcxc

zc= lxc+ (1 − l)yc

(1.20) zc, xcand ycare the molar fractions of component c over the total

compos-ition, in the liquid phase and in the gas one. l is the liquid fraction of the hydrocarbon component. xc and yc can be written in terms of l, zc and Kc:

xc= zc l+ (1 − l)Kc yc= Kczc l+ (1 − l)Kc (1.21)

The Rachford-Rice equation can be derived from the previous one by considering that the sum of the molar fractions of all components of a phase is always equal to 1. X c yc− X c xc= 1 − 1 = X c (yc− xc) = X c (Kc− 1)zc l+ (1 − l)Kc = 0 (1.22) Eq. 1.22 is solved for l and xc and yc are calculated with Eq. 1.20.

Equality of Fugacities Flash

At equilibrium, fc,o = fc,g for all hydrocarbons components. This equalities

are a series of nonlinear equations and they have to be solved either with the successive substitution method or the Newton-Raphson one. Obviously, the form of the component fugacities depends on the EOS used for the fluid.

1.4

Black oil fluid model

The black oil model is a special case of the compositional one; phase equilib-rium relations can be reduced to linear relations between component mole

(40)

fractions and pressure. The black oil model is usually applied to those reser-voir which contain an oil with a certain volatility; the gas solubility ration (Rs) has to be less than 750 scfstb, the oil formation volume factor (Bo) has to

be less than 1.4bbl

stb and the API gravity has to be less than 30. In this case,

phase behaviour can be represented just by Rs and Bo which are functions

of pressure and no flash calculation is needed. For a detailed description of the classification of reservoir mixtures we refer to [18].

Figure 1.6: Phase diagrams are used to characterize reservoir fluids. Here the phase diagram of a black oil with line isothermal reduction of pressure is presented. Source [18].

The behaviour of a black oil can be described by three quantities which relate surface volumes to reservoir volumes:

• Rs: soultion gas oil ratio = Vol. of surface gas dissolved in reservoir oilVol. of stock-tank oil from reservoir oil

• Bo: oil formation volume factor = Vol. of stock-tank oil from reservoir oilVol. reservoir oil

• Bg: gas formation volume factor = Vol. of surface gas from reservoir gasVol. of reservoir gas

Surface components are considered to have constant properties (density, vis-cosity etc.), computed at standard conditions, throughout the entire simu-lation.

For a black oil system it can be considered that only three phases (two liquid phases and a gaseous phase) and three components (water, oil and gas) are present and the following hypothsis stand:

• water is only contained in one liquid phase that will be called w; • oil is only contained in the other liquid phases that will be called o;

(41)

• gas is only contained in the gaseous phase g and in the oil phase. The molar fractions of the three components in the three phases under these hypothesis are: xoo = %o,ST %o,ST + Rs%g,ST , xwo = 0, xgo = 1 − xoo xow = 0, xww= 1, xgw = 0 xog = 0, xwg = 0, xgg= 1

where xij is the molar fraction of component i in phase j.

For such a system, mass balance equations can be written as follows: mass balance ∂Mj o ∂t + X k Fojk +X w Qjwo = 0 ∂Mj w ∂t + X k Fwjk +X w Qjww = 0 ∂Mj g ∂t + X k Fgjk +X w Qjwg = 0 (1.23)

Since Mph,ST = Vph,ST· %ph,ST, dividing all equations by the molar density at

stock tank conditions of each phase the volumetric formulation is obtained. volume balance ∂Vo,STj ∂t + X k fo,STjk +X w qo,STjw = 0 ∂Vw,STj ∂t + X k fw,STjk +X w qw,STjw = 0 ∂Vg,STj ∂t + X k fg,STjk +X w qg,STjw = 0 (1.24)

1.5

Solution strategies

The system of nonlinear partial differential equations described in section 1.2 cannot be solved analytically, therefore numerical methods are used to obtain an approximate solution. All numerical methods require both a spatial and a time discretization. The process takes place over a time interval T that is divided into timesteps ∆t.

Different solution techniques can be applied; depending on the number of variables that are solved implicitly, the number of primary variables may vary. In fact, expressing explicitly the fluxes for certain variables can reduce

(42)

the number of primary variables. When solving explicitly the transmittibil-ities between cells are assumed to be those at the previous time step. Four different approaches exist:

• IMPES (Implicit Pressure Explicit Saturations): pressure is solved implicitly and saturations and compositions are solved explicitly; • IMPSAT (Implicit Pressure and Saturations): pressure and

satura-tions are solved implicitly whereas composisatura-tions are solved explicitly; • FIM (Fully Implicit): all primary variables are solved implicitly; • AIM (Adaptive Implicit Method).

The number of primary variables changes depending on the solution technique used: for IMPES there is only 1 primary variable for each cell (the pressure), for IMPSAT the number of primary variables is equal to the number of phases.

AIM

The AIM solution scheme is meant to combine advantages of the FIM and of IMPSAT and IMPES. In fact, a FIM scheme is used for most unstable cells whereas IMPSAT or IMPES are used for the more stable ones. The cost of each Newton iteration is controlled by the percentage of cells solved with the FIM schemes; as long as this percentage does not grow too much the cost per-Newton iteration is maintained relatively low. AIM allows to use the timestep size of the FIM scheme which is unconditionally stable and thus can deal with bigger timesteps.

There are two ways of deciding the timestep size for AIM schemes:

• Fix timestep: a timestep size is given and an implicitness level is as-signed to each gridblock according to a stability criterion (CFL num-ber at that gridblock). The percentage of cells solved with FIM may change at each timestep;

• Fix percentage: First the maximum timestep size that can satisfy a given percentage of FIM cells has to be calculated. Secondly, the implicitness level can be assigned to each cell according to the stability criterion.

1.5.1

Solution process

Newton-Raphson iteration

For each timestep, the Newton-Raphson iterative method is used to deal with the non-linearity of the system of equations that has to be solved.

For a general system of equations and variables the non-linear system:

(43)

is solved. R represents the equations and X all the solution variables. A Taylor expansion of R, ignoring all terms of an order greater than 1, is applied in order to linearize the system.

Rn+1(X) ≈ Rν+1 = Rν(X) + ∂R ∂X ν ∆X (1.26)

The solution of the nonlinear system can thus be approximated by the solution of the linear system:

 ∂R ∂X

· ∆X = −Rν(X) and ∆X = Xν+1− Xν (1.27)

The left part of the equation contains the Jacobian (∂R

∂X) and the solution

correction (∆X) whereas R(X) represents the residual. Since a linear ap-proximation has been used, the solution update will not be correct at the first iteration and a few iterations will be necessary to reach convergence at the required level.

Figure 1.7 (b) illustrates the main steps within each Newton-Raphson iteration. Different parts of the simulator take care of each step. The property calculations are handled by Fluid and Rock Modeling, the well solution and field management parts are handled by the Well Modeling and Field Management (WM and FM) and the linear solution of the coupled system is handled by the Linear Solver (LS).

Let us now focus on two different approaches to deal with the coupling between the variables.

Figura

Figure 1.1: Microscopic image of the pore structure of a sandstone.
Figure 1.2: Sedimentary rock of the Zion national Park (Utah): layering is one of the main reason of permeability anisotropy in rocks
Figure 1.3: Contact angle with a solid surface of a water bubble surrounded by oil . Source [7]
Figure 1.4: Capillary pressure hysteresis: imbibition and drainage curves are represented
+7

Riferimenti

Documenti correlati

[r]

While the standard retention curve is expected still to provide the intrinsic retention properties of the porous skeleton, depending on the porous texture, an

clausii probiotic strains investigated in this study has protective effects and stimulates various non-immune mucosal barrier and innate immune system defense mechanisms in a

Tuttavia, è innegabile che la tecnologia abbia giocato, e continui tuttora a giocare, un ruolo fondamentale per la creazione di nuove soggettività femminili. Non più

In the search for new plant-derived compounds with antimicrobial activities, two alkaloid extracts obtained from bulbs and leaves of Pancratium illyricum L., a plant of

The components about eHealth governance were adapted from the panel of structural parameters elaborated for the Information Policy Unit of the English National Health Service

Validation of the Tonoport blood pres- sure measuring monitor according to the European Society of Hypertension International Protocol for validation of blood pressure measuring

In general, the broad agreement obtained between observed and simulated pressure profiles from the core with a clear distinction between CC and NCC systems out to cluster