You are on page 1of 9

Solution Proposal Exam V-2014

PET-510 Comput model


Trygve Carlsen Kjrslevik
November, 2014

Problem 1
(a) Considering the following transport equation:
x R = (, +)

ut + xux = q(x, t),


u(x, 0) = (x)

(1)
(2)

Solution of this equation when q(x, t) = 0:


Characteristic:
dx(t)
dt

=x
x(t = 0) = x0

1
dx =
x

Z
dt

(3)

Further:
ln(x) = t + C

x(t) = et+C

x(t) = C1 et

(4)

By using the initial condition, x(t = 0) = x0 , we get:


x(0) = C1 e0 = x0

C1 = x 0

x(t) = x0 e

(5)
(6)

Further:
u
(t) = u(x(t), t)
= ux

d
u(t)

= u(x(t), t)
dt
t

dx(t)
+ ut = 0
dt

(7)
(8)

As we see, u(x(t), t) is constant along the characteristic. Use t = 0 and


find:
u(x(0), 0) = (x0 )

u(x, t) = xet
Check that the solution is correct for all times:
For t = 0:

u(x, 0) = xe0 = (x)
OK!

(9)
(10)

(11)

For t > 0:
ut = 0 xet



xet = xet 0 xet



ux = 0 xet et = et 0 xet


ut + xux = xet 0 xet + xet 0 xet = 0
OK!


(12)
(13)
(14)

(b) We now consider (1), with q(x, t) = x. The characteristics are the
same as in (a), which is x(t) = x0 et .
u (x(t), t)
dx(t)
= ux
+ ut = x = x0 et
t
dt

(15)

Further:
u (x(t), t)
= x0 et
t
Z u(x(t),t)
Z t
du =
x0 et dt
u(x(0),0)

(16)
(17)



u (x(t), t) (x0 ) = x0 et 1


u (x(t), t) = (x0 ) + x0 et 1

u(x, t) = xet + x xet

(18)
(19)
(20)

Check the solution:


For t = 0:

u(x, t) = xe0 + x xe0 = (x)

OK!

(21)

For t > 0:

ux = 0 (xet ) et + 1 et

ut = 0 (xet ) xet + xet
t 0

ut + xux = xe (xe ) + xe

(22)
(23)
t 0

+ xe (xe ) + x xe

The dominant part of solution when t :



lim xet + x xet = (0) + x 0
t

=x

OK!
(24)

(25)

As we see here, x is the most dominant part of the solution as t moves


towards infinity.
(c) Now consider (1) with q(x, t) = xet . Characteristics being the same
as in (a) and (b), we get the following:
u (x(t), t)
dx(t)
= ux
+ ut = xet = x0
t
dt

(26)

Further:
u (x(t), t)
= x0
t
Z t
Z u(x(t),t)
du =
x0 dt
u(x(0),0)

(27)
(28)

u (x(t), t) = (x0 ) + x0 t

u(x, t) = xet + xet t

(29)
(30)

Check the solution:


For t = 0:

u(x, t) = xe0 + xe0 0 = (x)

OK!

(31)

For t > 0:

ux = 0 (xet ) et + et t


ut = 0 (xet ) xet + xet t + xet
t 0

t xe

t 0

t = xet

ut + xux = xe (xe ) xe

+ xe (xe ) + xe

(32)
(33)

(34)

OK!

The dominant part of solution when t :



lim xet + xet t = (0) + 0

(35)

Here we have no dominant part of the solution as t moves towards


infinity. However, depending on the function (x), (0) might be the
dominant part.
(d) We now consider (1), where q(x, t) = 0 on the interval x [0, 5]
the initial data:
(
2x
0 x < 0.5
(x) =
2(1 x) 0.5 x 1

From (a) we got that u(x, t) = xet . This then gives us:
(

2xet
0 xet < 0.5
t

xe
=
2 1 xet 0.5 xet 1
(
2xet
0 x < 0.5et

u(x, t) =
2 1 xet 0.5et x et

with

(36)

(37)
(38)

A sketch of the initial data, and the solution of u(x, t) at t = 1 is shown


in figure 1.
We obtain the given characterization of u as follows:
uut + xuux = 0

1 2
1
u t = x u2 x = 0
2
2
Note that by using the product rule, we can rewrite x 21 u2
to:



1 2
1
1
x u
= u2 + x u2 x
2
2
2
x



1
1
1
x u2 x = x u2 u2
2
2
2
x
4

(39)
(40)

x

in (40)

(41)
(42)

Initial state, t = 0
Solution at t = 1

u(x, t)

0.8
0.6
0.4
0.2
0

e
2

e 3

Figure 1: A plot of u(x, t) at initial state, and at t = 1.

By insering this expression in (40) and integrate over [0, 5] we get:



Z 5
Z
Z
1 2
1d 5 2
1 5 2
x u
u dx +
dx
u dx = 0
(43)
2 dt 0
2
2 0
0
x
|
{z
}
=0

d
dt
Then note

R5
0

u dx =

u2 dx

(44)

u2 dx as V , and integrate in time:

dV
=V
dt
Z V (x,t)

dV
= dt
V

Z t
dV
=
dt
V (x,0) V
0


V (x, t)
ln
=t
V (x, 0)

Switch back V and get:


Z 5
Z
2
t
u(x, t) dx = e
0

(45)
(46)
V (x, t) = et V (x, 0)

(47)

(x)2 dx

q.e.d

(48)

Which is valid for 0 t 1 (or as long as the solution does not cross
the right boundary at x = 5).

(e) Discretization of ut + xux = 0 in the domain [0, 5] [0, T ] for the


solution in part (d).
un+1
unj
j
t

un
n j+1/2
xj

unj1/2

=0

(49)

By using an upwind scheme with flow from left towards right, we get
for the interior part, j = 2, ..., M 1:
unj+1/2 = unj
unj1/2

(50)

unj1

(51)

un+1
=unj xnj unj unj1 ,
j


t
x

(52)

For the left boundary, j = 1:


un1+1/2 = un1

(53)

un11/2

(54)

=0

=un1 xn1 un1 ,


un+1
1

t
x

(55)

For the right boundary, j = M :


unM +1/2 = 0

(56)

unM 1/2 = unM 1

(57)

n
n
n
un+1
M =uM + xM uM 1 ,

t
x

(58)

Note that this scheme only is valid as long as the solution does not
interfer with the right boundary at x = 5 (as unM +1/2 is set equal to
zero).

Problem 2
(a) We have:
(
() =

t + (u)x = qw
(u)t + (u2 )x + P ()x = ku g,

x [0, L]

(59)

Set the term (u)t + (u2 )x = 0, and rewrite the equation with regards
to u. This gives:
g 1
(60)
u = P ()x
k
k
Then insert (60) in the first equation, which gives:
 

g 1
t + P ()x
= qw
(61)
k
k
x




g2
=
P ()x + qw
(62)
t +
k x
k
x
As we see, this can be rewritten as:
t + f ()x = (d()P ()x )x + qw
Where:

f () =

g2
k

d() =

(63)
(64)

(b) Discrete scheme of (63) for the interior domain (j = 2, ..., M 1):
n+1
nj
j

n
n
Fj+1/2
Fj1/2


1 
n
[dPx ]nj+1/2 [dPx ]nj1/2 + qw,j
t
x
x
(65)
For the transport term, we we use an upwind scheme with flow from
right towards left:
+

n
Fj+1/2
= f ()nj+1/2 f (nj+1/2 ) = f (nj+1 )
n
Fj1/2
= f ()nj1/2 f (nj1/2 ) = f (nj )

For the diffusion term, we define:


 


d(nj+1 ) + d(nj )
P (nj+1 ) P (nj )
n
[dPx ]j+1/2 =

2
x
 


n
n
n
d(j ) + d(j1 )
P (j ) P (nj1 )
n
[dPx ]j1/2 =

2
x

The full scheme for the interior domain will then be:

n+1
= nj f (nj+1 ) f (nj )
j
 


P (nj+1 ) P (nj )
d(nj+1 ) + d(nj )

+
2
x
 


P (nj ) P (nj1 )
d(nj ) + d(nj1 )
n

+ t qw,j

2
x

Where: =

t
x

(c) We look at the equation P ()x = ku g, where P ()x is the pressure gradient, ku is the friction term, and g is the hydrostatic
contribution. We note that the term g has a more or less constant
contribution to the pressure gradient, while the friction term is the one
that changes when we change the pump rate/fluid velocity.
1st case: We see that u is increasing with time. This gives P ()x a
more negative value. With a fixed pressure on top, a more negative
pressure gradient will give a higher bottom hole pressure.
2nd case: Here we see that u is increasing even more than in the first
case, thus making the value of P ()x even more negative. With a fixed
pressure on top, this gives an even higher bottom hole pressure than
in the first case.
3rd case: Here we see that u is decreasing with time. Fluid is taken
out at bottom. This gives P ()x a less negative value, and with a fixed
pressure on top, we get a lower bottom hole pressure than before.
(d) The effect of sound velocity, al on convergence towards a stationary
solution:
As al increases, pressure waves will propagate faster, thus making the
system reach a stationary state more quickly. A lower value of al will
decrease the speed of the pressure waves, thus it will take more time
to reach a stationary state. We can say that a high value for al is the
same as a little compressible fluid, while a fluid with low al is more
compressible. As we know, we will reach a stationary solution more
quickly the less compressible the fluid is.
(e) First we find an expression for P ()x by deriving the linear pressure
law:
dP () d
P ()x =

= a2l x
(66)
d
dx
By inserting this term for P ()x into ( ) and rewrite for x , we get:
x =

g2 qL k
a2l
8

(67)

By defining a =

ql k
a2l

and b =

g
a2l

we get:
(a + b2 )

x =

(68)

We now have a simple ODE, that easily can be solved:


(a + b2 )
d
=
dx

dx

=
d
(a + b2 )

(69)

Method of substitution gives us:


u = a + b2
du
= 2b
d

(70)

a+b

a+b2

(71)

 du

u 2b

(72)

dx =
Z

du
2b

d =

1
dx =
2b

a+b

a+b2

du
u

(73)

These integrals gives us:



a + b2
ln
= 2b(L x)
a + b2
s

a + b2 e2b(Lx) a
(x) =
b


(74)

(75)