You are on page 1of 12

Synopsis

The purpose of this paperwork is to demonstrate the work done on Matlab to simulate
flow in a reservoir numerically using the effect of Darcys law in pressure in two wells. The
minimal distance then, will be defined between two wells in order not to have interaction
between their flow characteristics. By running a series of simulations, the impact of grid
spacing and porosity change on simulating speed and accuracy will also be observed.

Introduction
A petroleum reservoir is an underground porous medium in which oil or gas or both are
trapped structurally or/and stratigraphically. Fluid flow in such a porous medium is very
complex phenomena. Generally, analytical solutions to mathematical models are only
obtainable after making simplifying assumptions in regard to reservoir geometry,
properties and boundary conditions. However, such simplifications are often invalid for
most fluid flow problems. In many cases, it is impossible to develop analytical solutions
for practical issues due to the complex behaviors of multiphase flow, nonlinearity of the
governing equations, and the heterogeneity and irregular shape of a reservoir system. As
a result, these models must be solved with numerical methods such a finite difference or
finite element. Reservoir simulation provides numerical solutions to hydrodynamic
problems of fluids (oil, gas and water) in petroleum reservoir-well systems on a digital
machine. Today, it has become a standard tool in petroleum engineering discipline and
been widely used for solving a variety of fluid flow problems involved in recovery of oil
and gas from the porous media of reservoirs.
In the given problem, numerical simulation of two of the wellbores is required to find
which is mathematically based on 2 dimensional form of Darcys pressure equation at
steady state flow. Reservoir characteristics are given below:
Porosity 12 %
Permeability 70 mD
Compressibility 2*10-9 Pa-1
Viscosity 4 cP
Reservoir dimensions 400x400 m
Wellbore pressure well_1 700 psi
Wellbore pressure well_2 500 psi
Table1. Provided data
Frequently, it is desired to account for the effects of more than one well on the pressure
at some point in the reservoir. In case of considering the effect of two wells in our
simulation problem, superposition concept can be easily applied. The superposition
concept states that the total pressure drop at any point in the reservoir is the sum of the
pressure changes at that point caused by flow in each of the wells in the reservoir.

Figure1. Principle of Superposition

The governing PDE equation found in heat transfer and mass transfer are similar to that
for the distribution of pressure in a porous rock structure:
2 2 2
= 2 + 2 + 2

Under the assumption of steady state, in 2 dimensions, we have:
2 2
= 2 + 2


In each equation, the hydraulic diffusivity is given by = . Under the assumption of
a homogeneous reservoir, = and can then be ignored in the simulation. Although
we would normally view a reservoir as a 3D block, we can simplify this to look at a 2D slice
that divides the rectangular block into two parts; an upper and lower block:

Upper Block
Upper Block z

x 2D Plane

Lower Block y
Lower Block

Figure2. 2D gridblocks

Analysis
To start with, we have produced a plot to see what happens to the pressure from one
pressure on the left boundary when all other pressures were held to the same value as
constant. The time lapse had its impact on reservoir boundaries as a result. Adjusting the
number of grid cells resulted on different plots. In the first case, grid cells were taken as
10x10 and changed to 20x10. Plots showed that, 20x10 adjustment demonstrated smooth
and better result comparing to 10x10 adjustment result, however, the case slowed down
the simulation process.
Figure3. Simulation based on 10x10 adjustment

Figure4. Simulation based on 20x10 adjustment


It is also recommendable to check the case using solution_p on Matlab. So, in case of two
wells, we have analyzed grid number adjustment and different well spacing to see if
significant differences take place. By adjusting grid numbers from 20x10 to 40x20 we had
results shown below:

3500

3000
PRESSURE (PSI)

2500

2000

1500

1000

500

0
0 50 100 150 200 250
POSITION (METER)

Figure5. Pressure distribution (solution_p) based on grid number adjustment


And in case of different well spacing in x-direction by making interval between wells larger
each case, the solution_p executed the followings:

Pressure - Case 3 Pressure - Case 2 Pressure - Case 4

2500

2000
PRESSURE (PSI)

1500

1000

500

0
0 50 100 150 200 250 300 350 400
POSITION (METER)

Figure6. Pressure distribution (solution_p) based on well spacing


The other way to analyze grid number difference on our simulated result is to report CPU
timing on Matlab. We have used adjustment from 10x10 to 10x20 and timing has changed
from 0.245s to 0.307s as shown below:

Figure7. Timing based on 10x10 adjustment

Figure8. 10x10 simulated result


Figure9. Timing based on 20x10 adjustment

Figure10. 20x10 simulated result


At the end, sensitivity was conducted to investigate what happens if porosity changes
from 10% to 20%. We discussed diffusivity equation in terms of:
70
= = = 0.072
0.12 2 109 4 1012

This value is introduced into the coding as follows:


% Diffusion coefficients
Dx=0.072; % m2/s
Dy=0.072; % m2/s
If porosity changes to 20% diffusivity constant becomes 0.044, and graph changes slightly
due to additional pressure drop but spacing stays the same.
Conclusion
To conclude, different sensitivity analyzes were done to explore different wellbore
simulations on Matlab. Grid numbers, well spacing, and porosity difference demonstrated
different results for two well simulations, and we have observed these using timing,
pressure distribution by solution_p function and simulated imagings. Additionally, using
4 scripts had its impact on timings, so we can improve it putting all functions in one script.

Code Description
To start by simulation, set the number of cells in the grid
(each cell is counted with meter)
nx=20;
ny=10;

Set the dimensions of the rectangular in meters (the values are


given in problem statement)
block_length=400;
block_width=200;

Set the Boundary pressures for both two wells in the unit of psi
(the values are given in problem statement)
side_pressure=3000;
well_pressure(1)=700;
well_pressure(2)=500;

Set locations for two of the wells in meters (the wells are
located in 3 dimensional space on the opposite sides of y axis)
x_well(1)=10;
y_well(1)=120;
x_well(2)=380;
y_well(2)=120;

State the diffusion coefficients (the values are same for x and
y axis because the reservoir is taken to be homogenous)
Dx=0.072; % m2/s
Dy=0.072; % m2/s

Specify boundary pressures as side pressure (pressures are same


in boundaries)
upper_y_pressure = side_pressure;
lower_y_pressure = side_pressure;
left_x_pressure = side_pressure;
right_x_pressure = side_pressure;

Define the i,j co-ordinates for the given wellbore


i_well = int16(x_well/block_length*nx);
j_well = int16(y_well/block_width*ny);

Check to see if the obtained number will be valid


if j_well<=0 j_well=1; end
if j_well>=ny j_well=ny; end

if i_well<=0 i_well=1; end


if i_well>=nx i_well=nx;end

Convert Pressures from psi to Pa


cf=6.8948E3;
TopBoundary=upper_y_pressure*cf;
BaseBoundary=lower_y_pressure*cf;
RightBoundary=right_x_pressure*cf;
LeftBoundary=left_x_pressure*cf;
WellBoundary(1)=well_pressure(1)*cf;
WellBoundary(2)=well_pressure(2)*cf;

dx=block_length/(nx-1);
dy=block_width/(ny-1);

State the kx and ky parameters


kx=Dx/(dx*dx);
ky=Dy/(dy*dy);

Specify the arrays to hold the grid meanwhile the number of


linear equations
array_size=nx*ny;
array_A=zeros(array_size);
array_B=zeros(array_size,1);

k=1; Set the counter for each of the equations


for i=1:nx
for j=1:ny
Set up matrix indexes
ij=index(i,j,nx,ny);
ip1=index(i+1,j,nx,ny);
im1=index(i-1,j,nx,ny);
jp1=index(i,j+1,nx,ny);
jm1=index(i,j-1,nx,ny);

Check the boundary values for array B first


bv=0;
if j==ny
bv=-TopBoundary*ky+bv; Any j+1 will give the top
boudnary
end
if i==nx
bv=-RightBoundary*kx+bv; Any i+1 will give the right
boundary
end
if j==1
bv=-BaseBoundary*ky+bv; Any j-1 will give the base
boundary
end
if i==1
bv=-LeftBoundary*kx+bv; Any i-1 will give the left
boundary
end

Set the coefficients in A array


if i<nx
array_A(k,ip1)=kx;
end
if i>1
array_A(k,im1)=kx;
end
if j>1
array_A(k,jm1)=ky;
end
if j<ny
array_A(k,jp1)=ky;
end

Set the coefficient and boundary value for two of the


arrays
array_A(k,ij)=-2*(kx+ky);
array_B(k)=bv;

Check to see if boundaries exist


for w=1:2
if i==i_well(w) && j==j_well(w)
array_A(k,ij)=1; Make the coefficient 1
array_A(k,ip1)=0;
array_A(k,im1)=0;
array_A(k,jp1)=0;
array_A(k,jm1)=0;
array_B(k)=WellBoundary(w); tell array its value
end
end

k=k+1;
end
end

array_C=(array_A^-1)*array_B;

Convert Pa to psi once again


array_C=array_C/6.8948E3;

Rearrange the stated new array


solution_p=zeros(ny,nx);
for i=1:nx
for j=1:ny
k=nx*(j-1)+i;
solution_p(ny-j+1,i)=array_C(k);
end
end
Create the simulated graph
createfigure(solution_p)

You might also like