You are on page 1of 33

Reservoir Simulation

Lecture 7: Reservoir Simulator

Haval Hawez
Petroleum Engineering Department
Faculty of Engineering
Koya University

13.12.2018
Outline: Solution Methods

• Taylor Series

• Euler’s Method

2
Taylor Series

• Since the exact solution can not be used for the


simulation solutions because there is a change
regarding to time and distance. Therefore; methods
to solve the differential equations has been
employed like Taylor series expansion.

• For the infinite derivative equation more derivation


is required for more accurate result. That’s why
Euler’s method has been raised to simplify the
solution with less errors.

3
Taylor Series
• First-order differential equation of the form

𝑑𝑦
= 𝑓(𝑥) subjected to 𝑦 = 𝑦0 𝑎𝑡 𝑥 = 𝑥0
𝑑𝑥

If the variables are separated and the integration is carried out


on both sides, then

𝑦 𝑥

𝑑𝑦 = 𝑓 𝑥 𝑑𝑥
𝑦0 𝑥0

4
Taylor Series
𝑥

𝑦 − 𝑦0 = 𝑓 𝑥 𝑑𝑥
𝑥0 𝑥

𝑦 𝑥 = 𝑦0 + 𝑓 𝑥 𝑑𝑥
𝑥0
Recall Taylor’s Series Expansion

5
Taylor Series

Where:
x0 = base value or starting value
x = the point at which the value of the function is
needed
h = x . x0 = distance between x0 and x (step size)
n! = factorial of n = n(n-1) (n . 2).1
f(n) = indicates the nth derivative of the function f(x)
Rn+1 = the remainder of Taylor series expansion

6
Taylor Series

• In this case, Taylor’s series expansion provides the


true solution when all the terms are used.

7
Taylor Series

Example-1: Solve the following differential equation


using Taylor series expansion:

8
Taylor Series

9
Taylor Series

10
Taylor Series

• The exact solution can be obtained as follows:

11
Taylor Series

12
Taylor Series

Example-2: Solve the following differential equation


using Taylor’s series expansion:

13
Taylor Series

14
Taylor Series

Using the Taylor’s series expansion

15
Taylor Series

Using the Taylor’s series expansion

16
Taylor Series

17
Taylor Series

• The exact solution can be obtained as follows:

18
Taylor Series

19
Euler’s Method
As we noticed in the previous example, in some cases the
derivatives are not easily computed. Therefore, the
Taylor series can be truncated so that only the term with
the first derivative is used.

• The above equations can be rewritten in a more


compact form for computer implementation as

20
Euler’s Method
The iterative procedure for basic Euler’s method is given by

Where:

21
Euler’s Method
Example-3: Solve the following differential equation for 0
≤ x ≥ 1 using a step size of h = 0.1:

Solution: using the Euler’s equation

22
Euler’s Method

• First iteration (i=0):

23
Euler’s Method

• Second iteration (i=1):

24
Euler’s Method

• Third iteration (i=2):

25
Euler’s Method

The exact solution can be obtained as follows

26
Euler’s Method

27
Euler’s Method
Example-4: Solve the following differential equation using
Euler.s method for 1 ≤ x ≥ 2 with a step size of h = 0.1:

Solution: using the Euler’s equation

28
Euler’s Method

• First iteration (i=0):

29
Euler’s Method

• Second iteration (i=1):

30
Euler’s Method

• Third iteration (i=2):

31
Euler’s Method

The exact solution can be obtained as follows

32
Euler’s Method

33

You might also like