0% found this document useful (0 votes)
10 views

Lec4

The document discusses the finite-difference method (FDM) used for numerically solving single-phase flow equations in reservoir simulation. It provides various difference formulas for first and second derivatives in both one-dimensional and two-dimensional contexts, along with an example demonstrating the application of FDM. Additionally, it outlines the steps for solving time-independent partial differential equations (PDEs) using this method.

Uploaded by

rya336437
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lec4

The document discusses the finite-difference method (FDM) used for numerically solving single-phase flow equations in reservoir simulation. It provides various difference formulas for first and second derivatives in both one-dimensional and two-dimensional contexts, along with an example demonstrating the application of FDM. Additionally, it outlines the steps for solving time-independent partial differential equations (PDEs) using this method.

Uploaded by

rya336437
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

University of Basra-College of

Engineering

Petroleum Engineering Department

Subject: Reservoir Simulation 2nd Semester


Lecture 4
Lecturer: Dr. Amani J. Majeed Al-Husseini Class: 4th Year

FINITEDIFFERENCEMETHOD& NUMERICALSOLUTIONOFSINGLE‐
PHASEFLOWEQUATIONS
In numerical analysis, finite-difference methods (FDM)
are discretizations used for solving differential equations by
approximating them with difference equations that finite
differences approximate the derivatives.
FDMs convert linear ordinary differential equations (ODE)
or non-linear partial differential equations (PDE) into a
system of equations that can be solved by matrix algebra
techniques.

AJM
Numerical Solution of Flow Equations

The equations describing fluid flows in reservoirs are of partial


differential equations (PDEs)

Finite difference method (FDM) is traditionally used for the


numerical solution of the flow equations.

Typical Difference Formulas For (1D)

- Forward difference for first derivatives (1D)

𝝏𝒇 𝒇 𝒙 ∆𝒙 𝒇 𝒙
𝑶 ∆𝒙
𝝏𝒙 𝐱 ∆𝒙

- Or in space index form


𝝏𝒇 𝒇𝒊 𝟏 𝒇𝒊
𝑶 ∆𝒙
𝝏𝒙 𝒊 ∆𝒙

AJM
-Backward difference for first derivatives (1D)

𝝏𝒇 𝒇 𝒙 𝒇 𝒙 ∆𝒙
𝑶 ∆𝒙
𝝏𝒙 𝐱 ∆𝒙
- Or in space index form
𝝏𝒇 𝒇𝒊 𝒇𝒊 𝟏
𝑶 ∆𝒙
𝝏𝒙 𝒊 ∆𝒙

-Centered difference for first derivatives (1D)


𝝏𝒇 𝒇 𝒙 ∆𝒙 𝒇 𝒙 ∆𝒙
𝑶 ∆𝒙𝟐
𝝏𝒙 𝐱 𝟐∆𝒙

or in space index form


𝝏𝒇 𝒇𝒊 𝟏 𝒇𝒊 𝟏
𝑶 ∆ 𝒙𝟐
𝝏𝒙 𝒊 𝟐∆𝒙

AJM
Example

-Centered difference for second derivatives (1D)

𝝏𝟐 𝒇 𝒇 𝒙 ∆𝒙 𝟐𝒇 𝒙 𝒇 𝒙 ∆𝒙
𝑶 ∆𝒙𝟐
𝝏𝒙𝟐 𝐱
∆𝒙𝟐

or in space index form


𝝏𝟐 𝒇 𝒇𝒊 𝟏 𝟐𝒇𝒊 𝒇𝒊 𝟏
𝑶 ∆ 𝒙𝟐
𝝏𝒙𝟐 𝒊
∆𝒙𝟐

AJM
For Example

Example 1: Solve the following equation


𝒅𝟐 𝒚
𝒚 𝟎;
𝒅𝒙𝟐

If y (0) =0, and y (1) =1, by using finite difference method.


Take ∆𝐱 𝟎. 𝟐𝟓.

AJM
Solution;

By using finite difference method the eq.

𝐝𝟐 𝐲
𝐲 𝟎;
𝐝𝐱 𝟐
Will be rewrite as;
𝐲𝐢 𝟏 𝟐 𝐲𝐢 𝐲𝐢 𝟏
𝐲𝐢 𝟎
∆𝐱 𝟐

→ 𝐲𝐢 𝟏 𝟐 𝐲𝐢 𝐲𝐢 𝟏 ∆𝐱 𝟐 𝐲𝐢 𝟎

→ 𝐲𝐢 𝟏 ∆𝐱 𝟐 𝟐 𝐲𝐢 𝐲𝐢 𝟏 𝟎

→ 𝐲𝐢 𝟏 𝟏. 𝟗𝟑𝟕𝟓𝐲𝐢 𝐲𝐢 𝟏 𝟎

node 1 (i=1)

→ 𝐲𝟎 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟏 𝐲𝟐 𝟎

But y (0) =0 then;

AJM
→ 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟏 𝐲𝟐 𝟎

node 2 (i=2)

→ 𝐲𝟏 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟐 𝐲𝟑 𝟎

node 3 (i=3)

→ 𝐲𝟐 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟑 𝐲𝟒 𝟎

From B.Cs. y (4) = 1, then

→ 𝐲𝟐 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟑 𝟏
dont write y4 equation cause y5 isnt in the domain . we write zreo case ever thing star with zero
this apply in in lenghth eq

Now if we rearrange our Eqs., they will be like that

→ 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟏 𝐲𝟐 𝟎

→ 𝐲𝟏 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟐 𝐲𝟑 𝟎

→ 𝐲𝟐 𝟏. 𝟗𝟑𝟕𝟓𝐲𝟑 𝟏

Or in the matrix form

AJM
𝟏. 𝟗𝟑𝟕𝟓 𝟏 𝟎 𝐲𝟏 𝟎
𝟏 𝟏. 𝟗𝟑𝟕𝟓 𝟏 𝐲𝟐 𝟎
𝟎 𝟏 𝟏. 𝟗𝟑𝟕𝟓 𝐲𝟑 𝟏

then

𝒚𝟏 𝟎. 𝟐𝟗𝟒𝟑
𝒚𝟐 𝟎. 𝟓𝟕𝟎𝟐
𝒚𝟑 𝟎. 𝟖𝟏𝟎𝟒

For check

→ 𝟏. 𝟗𝟑𝟕𝟓𝒚𝟏 𝒚𝟐 𝟏. 𝟗𝟑𝟕𝟓 𝟎. 𝟐𝟗𝟒𝟑 𝟎. 𝟓𝟕𝟎𝟐 𝟎

Typical Difference Formulas For (2D)

AJM
- Forward difference for first derivatives (2D)

𝝏𝒇 𝒇 𝒙,𝒚 ∆𝒙 𝒇 𝒙,𝒚
𝑶 ∆𝒙
𝝏𝒙 𝐱,𝐲 ∆𝒙

- Or in space index form


𝝏𝒇 𝒇𝒊 𝟏,𝒋 𝒇𝒊,𝒋
𝑶 ∆𝒙
𝝏𝒙 𝒊,𝒋 ∆𝒙

And

𝛛𝐟 𝐟 𝐱, 𝐲 ∆𝐲 𝐟 𝐱, 𝐲
𝐎 ∆𝐲
𝛛𝐲 𝐱,𝐲
∆𝐲

- Or in space index form


𝝏𝒇 𝒇𝒊,𝒋 𝟏 𝒇𝒊,𝒋
𝑶 ∆𝒚
𝝏𝒚 𝒊,𝒋
∆𝒚

AJM
-Backward difference for first derivatives (2D)

𝝏𝒇 𝒇 𝒙, 𝒚 𝒇 𝒙, 𝒚 ∆𝒙
𝑶 ∆𝒙
𝝏𝒙 𝐱,𝐲 ∆𝒙

- Or in space index form


𝝏𝒇 𝒇𝒊,𝒋 𝒇𝒊 𝟏,𝒋
𝑶 ∆𝒙
𝝏𝒙 𝒊,𝒋 ∆𝒙

And
𝝏𝒇 𝒇 𝒙, 𝒚 𝒇 𝒙, 𝒚 ∆𝒚
𝑶 ∆𝒙
𝝏𝒚 𝐱,𝐲
∆𝒚

- Or in space index form


𝝏𝒇 𝒇𝒊,𝒋 𝒇𝒊,𝒋 𝟏
𝑶 ∆𝒙
𝝏𝒚 𝒊,𝒋
∆𝒚

AJM
-Centered difference for first derivatives (2D)

𝝏𝒇 𝒇 𝒙, 𝒚 ∆𝒙 𝒇 𝒙, 𝒚 ∆𝒙
𝑶 ∆𝒙𝟐
𝝏𝒙 𝐱,𝐲 𝟐∆𝒙

Or in space index form


𝝏𝒇 𝒇𝒊 𝟏,𝒋 𝒇𝒊 𝟏,𝒋
𝑶 ∆ 𝒙𝟐
𝝏𝒙 𝒊,𝒋 𝟐∆𝒙

And
𝝏𝒇 𝒇 𝒙, 𝒚 ∆𝒚 𝒇 𝒙, 𝒚 ∆𝒚
𝑶 ∆𝒚𝟐
𝝏𝒚 𝐱,𝐲
𝟐∆𝒚

Or in space index form

AJM
𝝏𝒇 𝒇𝒊,𝒋 𝟏 𝒇𝒊,𝒋 𝟏
𝑶 ∆ 𝒚𝟐
𝝏𝒚 𝒊,𝒋
𝟐∆𝒚

-Centered difference for second derivatives (2D)


𝝏𝟐 𝒇 𝒇 𝒙, 𝒚 ∆𝒙 𝟐𝒇 𝒙, 𝒚 𝒇 𝒙, 𝒚 ∆𝒙
𝑶 ∆𝒙𝟐
𝝏𝒙𝟐 𝐱,𝐲
∆𝒙𝟐

Or in space index form


𝝏𝟐 𝒇 𝒇𝒊 𝟏,𝒋 𝟐𝒇𝒊,𝒋 𝒇𝒊 𝟏,𝒋
𝑶 ∆ 𝒙𝟐
𝝏𝒙𝟐 𝒊,𝒋
∆𝒙𝟐

And

𝝏𝟐 𝒇 𝒇 𝒙, 𝒚 ∆𝒚 𝟐𝒇 𝒙, 𝒚 𝒇 𝒙, 𝒚 ∆𝒚
𝑶 ∆𝒙𝟐
𝝏𝒚𝟐 𝐱,𝐲
∆𝒚𝟐

Or in space index form

AJM
𝝏𝟐 𝒇 𝒇𝒊,𝒋 𝟏 𝟐𝒇𝒊,𝒋 𝒇𝒊,𝒋 𝟏
𝑶 ∆𝒚𝟐
𝝏𝒚𝟐 𝒊,𝒋
∆𝒚𝟐

Solving time-independent PDEs

 Divide the computational domain into sub-domains.

 Derive the difference formulation for the given PDE by


replacing all derivatives with corresponding difference
formulas.

 Apply boundary conditions to the points on the domain


boundaries.

 Apply the difference formulation to every inner points of the


computational domain.

 Solve the resulting algebraic system of equations.

AJM

You might also like