freeflow library description
Introduction

freeflow is a library for a mathematical modeling of pressure fields. To start using this library you should type the command:

$ load libfreeflow[info sharedlibextension]

freeflow provides gridding rules, commands and variables. Using freeflow gridding rules with some of surfit gridding rules you can create special gridding algorithms for solving 2d hydrodynamics tasks.

Description
Energy state of a productive oil formation is an important indicator used for the correct and effective planning of its further development. freeflow implements the way of pressure fields reconstruction based on the constructing and consecutive minimization of functional sequence. In other words freeflow extends gridding algorithm with new gridding rules. It allows to reconstruct pressure fields from different data of different extent of thruth.
Two main ways of pressure fields reconstruction

There are two widely-used ways of solving pressure reconstruction problem:

Due to the simplicity of usage, the first way is much more widely used PU (performance unit): there is no necessity in model tuning and algorithms are simply to use. Obtained pressure field is often physically inadequate, nevertheless it is used to analyze energy state of oil formation, to detect boundaries of reduced and raised pressure zones and calculate weighted average pressures within areas.

The second way is usually used in research institutes and model creation is well-expensive. Usually it takes about one year. The significant constraint involuntarily set up to mathematical models described by the terms of partial differential equations is connected with the correctness of a boundary problem. For example, to describe a well in mathematical model we set only fluid rate/injectivity or bottom hole pressure. The simultaneous setting of rates and pressures may lead to incorrect (overdetermined) boundary problem. However, the simultaneous setting of inconsistent data is frequent for solving of underground fluid filtration problems - there is a lot of inconsistent data with different levels of errors. Existent mathematical models require precise data with no errors (rates, pressures, permeability), but it is impossible in the real life. That's why the ability of mathematical model to take into account inconsistent data and data with errors is of high-interest for freeflow authors.

freeflow implements the method, which has the features of the both considered ways and has the ability to take into account often inconsistent values of rates and bottom hole pressures in wells.

Classical statement of the problem in the differential form.

We are considering the task of calculating an pressure field for a homogeneous productive oil formation with a relatively small thickness $ h $. In this case the function $ u(x,y) $ of the formation pressure can be considered two-dimensional. $ u(x,y) $ is obtained by solving the boundary problem:

\[ \frac {k}{\mu} \Delta u = \sum\limits_{i=1}^{N} Q_i \delta(P-P_i) + \sum\limits_{j=1}^M \int\limits_l S_j(l)\delta(P-l)dl, \]

where $ k $ is permeability ( $ m^2 $), $ \mu $ - liquid viscosity ( $ Pa \cdot sec $). The vertical wells are described as point sources with volume flow rates of $ Q_i \quad ( m^3 / sec$). The position of horizontal (directional) wells and formation fractures are described by a curve with the curved source density of $ S_i \quad (m^2 / sec)$.

The boundary conditions are:

For a differential equation of elliptical type the simultaneous setting of rates and pressures for the same points and/or curves of the area is incorrect but it is frequent when the formation energy state is studied. In order to use the overdetermined conditions and avoid the incorrectness the boundary problem is re-formulated as a variational problem.

Variational statement of the problem.

The pressure field is determined as cells of equidistant grid with values:

\[ u(x,y) = \sum\limits_{i=1}^N \sum\limits_{j=1}^M u_{i,j} \phi_{i,j}(x,y), \]

where $ \phi_{i,j}(x,y) = \phi_i(x) \phi_j(y) $,

\[ \phi_i \left( x \right) = \left\{ 1,x \in \left[ih + a - \frac{h} {2},(i + 1)h + a - \frac{h} {2}\right) \qquad 0, x \notin \left[ih + a - \frac{h} {2},(i + 1)h + a - \frac{h} {2}\right) \hfill \right. \]

For each cell we use the flowing hypothesis:

Following linear Darcy law, evalute filtration speeds throuth the cell borders:

darcy_law.gif
Darcy law for a cell

\[ \overline{\nu}_{i,j}^1 = - \frac{ k^1_{i,j} } { \mu_{i,j} } \frac{(u_{i+1,j}-u_{i,j})} {h_x} \overline{x}, \]

\[ \overline{\nu}_{i,j}^2 = - \frac{ k^2_{i,j} } { \mu_{i,j} } \frac{(u_{i,j+1}-u_{i,j})} {h_y} \overline{y}, \]

\[ \overline{\nu}_{i,j}^3 = - \frac{ k^1_{i-1,j} } { \mu_{i,j} } \frac{(u_{i,j}-u_{i-1,j})} {h_x} \overline{x}, \]

\[ \overline{\nu}_{i,j}^4 = - \frac{ k^2_{i,j-1} } { \mu_{i,j} } \frac{(u_{i,j}-u_{i,j-1})} {h_y} \overline{y}, \]

where $ k_{i,j}^p $ cell permeability in $ \overline{\nu}_{i,j}^p $ direction, $ \mu_{i,j} $ liquid viscosity for (i,j) cell, $ \overline{x} $ unit vector in X direction, $ \overline{y} $ unit vector in Y direction.

Consider two functionals:

For each cell we consider three possible situations:

\[ \beta A_{i,j} + P_{i,j} = \min, \]

where $ \beta $ determines degree of reliability for each of the functionals.

In case if we use only 1 and 2 types of functionals to obtain the solution, the solution will be the same as for corresponding boundary problem because we use only consistent data. In case of redundant and inconsistent data we use the third functional.

Example 1:
freeflow_ex1.gif

On the pictures you can see the results of the proposed algorithm. On the contour showed by a dashed line pressure of 250 atmospheres was set. On the first picture at the center the well with pressure of 200 atmospheres was set. For the second picture in the center rate in 97 m3 per a second was assumed. The third picture is the result of calculation when both pressure and debit were assumed in the center. As you can see this result is approximately in the middle of results, showed in the first and second pictures. It means that we can take into account both of data - pressures and debits that is impossible to get by solving of a boundary problem. This result was obtained from scripts:

Example 2:
freeflow_ex2.gif

The second example is about determination of formation fracture for Arigol oilfield direction. Two situations were considered: horizontal and vertical formation fracture direction. For this fracture we know the rate and pressure and take them into account writing the combination of two functionals. The result is that the best direction is vertical, because in this case each of the two functionals takes lower values, than for horizontal direction. This criterion is explained by the idea, that the correct fracture direction makes pressure and rate more consistent.

This result was obtained from scripts:



surfit: gridding and contouring software.