Sie sind auf Seite 1von 12

Streamline calculations.

Lecture note 2

February 26, 2007

Recapitulation from previous lecture


Definition of a streamline x( ) = s( ),
dx( )
= v(x, t),
d

x(0) = x0

(1)

Divergence free, irrotational flow in 2D: v can be expressed as the


gradient of a potential:
v =

(2)

where is the real part of the (analytic) complex potential


F (z) = (x, y) + i(x, y)

(3)

The streamlines are level curves of (x, y):


(x, y) = const

(4)

Divergence free flow in 2D: Streamline are still level curves of a streamfunction. An explicit formula for the streamfunction is

Z
Z
Z Z
dvy
dx dy
(x, y) = vx dy vy dx +
dy
For divergence free flow in 3D, two independent streamfunctions will
exist, such that their intersection describe a streamline. The streamfunctions in 3D seems to be more complicated and less useful in applications than the stream function in 2D.

Integration (continued from previous lecture)

Linear system of equations


Note: In this section we assume that the velocity is independent of
time, i.e., v(x, t) = v(x). Then path lines and streamlines are the
same; hence, it is not significant to distinguish between and t in
Equation (1). Thus in this section, we use x(t) to represent a streamline, which is consistent with the notation used in text books on ordinary differential equations.
Assume that v : Rn Rn is linear in space, such that the equation
for the streamline becomes,
dx
= v = Ax + b
dt

x(0) = x0 ,

(5)

where A is a constant n n matrix, and b is a constant n 1 vector.


Assume further, that A has n linearly independent eigenvectors i ,
with corresponding eigenvalues i , i = 1, . . . , n. Note: if A does not
have a set of n linearly independent eigenvectors, it is more involved,
but still possible to find an analytic solution. We now define the
matrices

1 0 0
0 2 0



T = 1 . . . n ,
D= .
(6)
.. . .
.. ,
.
.
. .
.
0 0 n
corresponding to the eigenvalue decomposition AT = T D. By using
, Equation (5) becomes
the substitution x = T x
T

d
x
+b
= AT x
dt

(0) = T 1 x0 x
0,
x

(7)

is obtained by multiplication by T 1 ,
and a decoupled equation in x
d
x
+ T 1 b
= Dx
dt

(0) = x
0
x

(8)

The last equation can be written in component form


d
xi
= i x
i + i ,
dt

x
i (0) = x
0i ,

i = 1, . . . , n,

(9)

which are easily integrated. The true solution x(t) is recovered by


(t)
x(t) = T x
2

(10)

Example
Let x = [x, y]T and v = [x 2y + 1, 3x + 4y 1]T and x0 = [2, 3]T .
Then


 
1 2
1
A=
,
b=
,
(11)
3
4
1
and 1 = 1, 2 = 2, 1 = [1, 1]T , and 2 = [2, 3]T . Hence,






1
2
3
2
1 0
1
T =
T =
D=
.
1 3
1 1
0 2

(12)

Then
T 1 b =

 
1
,
0

0 = T 1 x0 =
x

= [
and letting x
x, y], we have


d
x
x
+1
=

2
y
dt

 
0
1

(13)



C5 et 1
(t) =
x
,
C6 e2t

(14)

 t

e 1
(t) =
x
,
e2t

(15)

and
 
0
(0) = x
0 =
x
1

and finally
(t)
x(t) = T x


et + 2e2t 1
x(t) =
et 3e2t + 1


(16)

See Figure 1
Numerical integration
Methods for numerical integration of initial value problems (IVP) for
ordinary differential equations (ODE) include :
Taylor series
Eulers method
Heuns method
Runge-Kutta methods
Adams methods
The methods can be further classified with respect to
3

6
6

Figure 1: Field plot for v = [x 2y + 1, 3x + 4y 1]T . A streamline s( )


is started at s(0) = s0 = [2, 3] and traced backward in time to the point
s(0.5).
Single-step / multi-step method
Explict / implicit method.
We will here consider a second order Runge-Kutta method, for the
model problem:
dx
= f (x)
dt

x(0) = x0 .

(17)

Since the right-hand side in general dont need to be a velocity, we


have used f (x) instead of v(x) .
Choose a fixed time step t. We will compute a numerical solution
at discrete points ti , i = 1, . . . , N , such that ti+1 ti = t. The
approximate solution at time ti , is denoted xi . Integration of (17)

now gives
x(t) = x0 +

f (x)dt

x(tn+1 ) = x(tn + t) = x0 +
xn +
xn +

tn

f (x)dt +

tn+1

f (x)dt

tn

tn+1

f (x)dt

tn
Z tn+1
tn

f (xn+1/2 )dt

Approximate
xn+1/2


dx
xn + (tn+1/2 tn )
dt tn
t
= xn +
f (xn )
2

(18)

We then have the numerical scheme:


xn+1 = xn + tf (xn +

t
f (xn ))
2

(19)

Note: Matlab has a variety of solvers for initial value promblems for
ordinary differential equations, e.g. ode45 and ode23, which have automatic error control.
A minimal MATLAB implementation
Example
Let v = [cos(xy), x], and x0 = [1, 1]. See Figure 2. A minimal
MATLAB implementation for this velocity field could be:
function rktest()
[t, y] = rk2(@vel, [0,3], [-1; 1], 0.01);
return
function y=vel(x)
y(1,1)=cos(x(1,1)*x(2,1));
y(2,1)=x(1,1);
return
function [tout, yout] = rk2(yprime, tspan, y0, dt)
t0=tspan(1);
5

2.5
2
1.5
1
0.5
0
0.5
1
1.5
2
2.5
2.5

1.5

0.5

0.5

1.5

2.5

Figure 2: Field plot for v = [cos(xy), x]. A streamline s( ) is started at


s(0) = s0 = [1, 1], and traced to the point s(3).
tN=tspan(2);
N = floor((tN-t0)/dt) + 1;
tout = linspace(t0,tN,N);
h=tout(2)-tout(1);
yout = zeros(N,size(y0,1));
yout(1,:) = y0; y=y0;
for i=2:N
k=yprime(y);
y = y + h*yprime(y + (h/2)*k);
yout(i,:) = y;
end
return

Reservoir simulation
Reservoir simulation is the numerical solution of the partial differential
equations describing the flow in a porous media.
Ideally, the flow equations could be derived from conservation of mass
and momentum (and energy for compressible flow) for an infinitesimal

volume of fluid. This would lead to the Navier-Stokes equations, which


relates change of volume to pressure change and viscous forces.
However, for flow in porous media (like an oil reservoir), these equation
would become impossible to solve since we typically dont now the
exact shape of the pores.
We therefore employ an average concept, using the Darcys law, which
will replace the momentum equation.
Darcys law is a phenomologically derived constitutive equation. The
equation was originally formulated by Henry Darcy based on the results of experiments on the flow of water through beds of sand.

3.1

Two phase immiscible flow

We will consider a simple model problem, where we consider two immiscible phases oil and water.
Darcys law then reads
q =

kr
K(P g),

= o, w,

(20)

where
q are the specific discharge vectors (commonly denoted the Darcy
velocity)
K is the permeability tensor
kr are the realtive permabilities,
are the viscosities,
are the densities,
g is the gravity vector,
P are the phase pressures.
The Darcy velocity is related to the average particle velocity v for
phase through
q = v ,
(21)
See Figure 3.
Let S denote the fraction of the volume occupied by phase at a
given point in the reservoir.

11111111111111111111111111
00000000000000000000000000
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111
00000000000000000000000000
11111111111111111111111111

Figure 3: Cross section of a porous medium. White areas indicates pores,


whereas the cross hatched area denotes the matrix. To obtain the average
particle velocity normal to the cross section, we devide the total fluid flux
through the pores (white area) by the area of the pores (white area). To
obtain the Darcy velocity, we devide the flux by the total area of the cross
section (sum of white area and cross hatched area).
Conservation of mass is applied over a control volume V , to derive
the continuity equation. The conservation principle for volume V says
that
Accumulated Fluid + Flow out of V = Injected fluid
Mathematically this is expressed as
Z
Z

( q ) ndS = Q
( S )dV +
t V
V

( S ) + ( q ) = Q ,
t
where Q is the source term for phase .

(22)

(23)
(24)

In addition, we have the constitutive relations (equations of state).


Sw + So = 1

(25)

Po Pw = Pc (Sw )

(26)

= (Pw )

(27)

= (Pw )

(28)

kr = kr (Sw )

(29)

In addition, the porosity and the permeability must be known:


= (x, t)

(30)

K = K(x, t)

(31)

By inserting the Darcy velocity in (24), a formulation of the flow equations common for use with finite difference methods is obtained:
kr

( S ) + (
K(P g)) = Q ,
t

= o, w (32)

This is a system of two nonlinear equations in two unknowns, e.g., Pw


and Sw .
These equations can be solved numerically by finite difference methods.
A pressure/saturation formulation
We will reformulate the last equations into one pressure equation (elliptic) and one saturation equation (hyperbolic). In this way, it will be
easier to discover the porperties of the equations, and we can obtain
a faster numerical solution procedure.
To obtain the pressure equation, we begin with expanding the time
derivatives in (32),

S +
S +
+ ( q ) = Q
t
t
t

1
S
1
Q
S + S
+
+ ( q ) =
t
t
t

P
S
1
Q
S + S c
+
+
( q ) =
,
t
t
t

(33)
(34)
(35)

where
c =

1
P

(36)

Adding the two equations in (35), and using (25), we get





Pw
Po
+ Sw cw
+ So co
+
t
t
t
1
Qw
Qo
1
(w q w ) + (o q o ) =
+
, (37)
w
o
w
o
where we have eliminated the time derivatives of the saturations. This
last equation is denoted the pressure equation.
We now start by deriving the saturation equation. Define
=

kr

(38)

Introduce the total velocity q,


q = q w + q o = w K(Pw w g) o K(Po o g)

(39)

We will first express the water velocity in terms of the total velocity.
From Darcys law we have
1
q + o Kg
(40)
o o
1
q w Kg (41)
KPw =
w w

qo = o K(Po o g)

KPo =

qw = w K(Pw w g)

adding these equations gives


KPc =

1
1
qo +
q + (o w )Kg
o
w w

By using (39) to eliminate q o , we get




1
1
1
+
q w = q + KPc + (w o )Kg
o w
o

(42)

(43)

By defining
o w
o + w
w
,
fw (Sw ) =
o + w

hw (Sw ) =

(44)
(45)

we get
q w = fw q + hw K(Pc + (w o )g)

(46)

Saturation equation. By inserting (46) into Equation (24)

(w Sw ) + (w (fw q + hw K(Pc + (w o )g))) = Qw (47)


t

3.2

Simplified two-phase flow

To ease the discussion of what follows, we simplfy the the problem by


assuming,
Incompressible fluids (w , o are constant)
Time independent porosity (/t = 0)
No capillary pressure (Po = Pw = P )
No gravity (g = 0)
10

The flow equations (37) and (47) now simplifies to


Qw
Qo
+
w
o

(48)

Qw
Sw
+ (fw q) =
t
w

(49)

q =

Defining t = w + o , and using Equation (39), we have


q = q w + q o = w KP o KP = t KP,

(50)

and the pressure equation (48) can be written


(t KP ) =

Qo
Qw
+
w
o

(51)

It follows from (48) that q = 0, away from sources and sinks. In


this case the saturation equation (49) becomes

3.3

Sw
+ q fw = 0
t

(52)

Simplification using streamlines and time-of-flight

Within streamline simulation, the streamline parameter is denoted


the time-of-flight (TOF).
In some applications of streamline simulation, arrival times of particles
along streamlines will be important. Since these particles travel with
the average particle velocity, and not with the Darcy velocity, we will
relate the time of flight to the average particle velocity. Hence, we
define streamlines s( ) = x( ) and TOF by
q(x, t)
dx
=
,
d

x(0) = x0

(53)

We also have:
dx
ds
kdsk
ds
k=k k=
=
d
d
d
d
ds
kqk
=
d

Z s

ds
(s) =
0 kqk
k

(54)
(55)
(56)

From the previous equation, we also have the differential form


kqk

= ,
s

11

(57)

We now return to Equation (52). Using the previous relation and the
definition of a directional derivative, we get
q fw = kqk

fw
fw
=
s

(58)

Hence, by using streamlines and time-of-flight, we can simplify (52) as


Sw
fw (Sw )
+
=0
t

(59)

Note the two different meanings of t and in the last equation.


We have simplified the saturation equation to a 1D hyperbolic equation
along streamlines.

References

12

Das könnte Ihnen auch gefallen