viernes, 17 de febrero de 2017

Linear Interpolation code C# and FORTRAN


With this method any two points are simple joined together by a straight line segment. The desired interpolation point should therefore lie on this same line segment. The next codes calculate single point linear interpolation (xval,yval) using to vectors data (x,y).


You can this code to linear interpolation in FORTRAN

       

SUBROUTINE LinearInterpolation(x,y,xval,yval,n)
  real::x(n),y(n),xval,yval
  integer::n,i
     yval = 0
     do i=1,n
  
   IF (xval >= x(i) .AND. xval < x(i+1)) then   
   
   yval = y(i)+(xval-x(i))*(y(i+1)-y(i))/(x(i+1)-x(i));
 
   end if
      end do
   return
   
      end SUBROUTINE 



jueves, 16 de febrero de 2017

Reservoir simulation code (1D-horizontal-single phase) FORTRAN

With this code you can practice with examples of reservoir simulation excersices with the follows considerations:

One dimension
Horizontal
One phase (oil)
Slightly compressible fluid
4 different types of boundary conditions
Implicit formulation
Peaceman well model
One well (specified production rate or specified flowing pressure)

You can change the number of cells, rock and fluid properties, boundaries conditions and well especification.

Z-factor: Dranchuk-Purvis-Robinson correlation C# code


Code to calculate Z factor with Dranchuk-Purvis-Robinson Method in C#.

Dranchuk et. al. (1974) developed a correlation based on the Benedict-Webb-Rubin type of equation of state. Fittig the equation to 1500 data points from the Standing and Katz Z-factor chart optimized the eight coefficient of the proposed equations. The equation has the following form:

jueves, 9 de febrero de 2017

Academic WaterFlooding (AWF)

Academic WaterFlooding (AWF)

AWF is part of a serie of basic reservoir engineering spreadsheets. With AWD you can do examples using thw Buckley-Leverett model and Welge solution estimating the displacement performance for a linear waterflood at constant injection rate.The necessary data is shown in the next picture.

miércoles, 14 de diciembre de 2016

ARS (1D - radial-Fractured)


ARS (1D - radial-Fractured) is part of a serie of basic reservoir simulation spreadsheets. With ARS (1D - radial-Fractured) you can do examples considering the follow features:

Naturally fractured reservoir (Warren and Root model)
One dimension in radial coordinates
One phase (oil)
Slightly compressible fluid
Rock porosity depending of pressure
4 different types of boundary conditions
Well with specified production rate or specified flowing pressure)

You will need the petrophysics properties of matrix and fracture (Porosity, compressibility, permeability and matrix-fracture shape fracture). You have the option to use a constant or variable time step.


In the follow image you can observe the double slope expected from the Warren and Root model.

You could check your results of your calculation by hand or your own code
Check it and tell us what do you think
Enjoy it


martes, 13 de diciembre de 2016

Academic Reservoir Simulator (1D - radial)

 ARS (1D - radial) is part of a serie of basic reservoir simulation spreadsheets. With ARS (1D - radial) you can do examples considering the follow features:

One dimension in radial coordinates
One phase (oil)
Slightly compressible fluid
Rock porosity constant or depending of pressure
4 different types of boundary conditions
Well with specified production rate or specified flowing pressure)


You could chech your result of your calculation by hand or your own code
Check it and tell us wath you think
Enjoy it



sábado, 19 de noviembre de 2016

Thomas Algorithmto to solve tridiagonal matrix (fortran and MATLAB)

Thomas algorithm offers an efficient algorithm to solve tridiagonal matrix. A tridiagonal matrix is generated when finite-difference equations are written in one dimension. This algorithm is executed in two major steps: Forward solution and Backward solution

The algorithm can be implemented as follows, in fortran or matlab:

Fortran
 MATLAB