Well-Test Analysis with Python Part 1: Drawdown and Pressure Tests

Well-Test Analysis with Python Part 1: Drawdown and Pressure Tests

What we have covered in our previous article on modeling pressure and rate transient response of flowing and shuted-in well is essential for us to analyze a well-test result. The three most fundamental well-tests are the drawdown test, buildup test, and constant pressure test. The drawdown test and buildup test are conducted by flowing the well at a constant rate, whereas in a constant pressure test, the well is flowed at a constant borehole flowing pressure or BHFP. In Part 1, we will discuss the drawdown test and constant pressure test.

To understand the behavior of a flowing well, we can think as a "stimulus and response" relationship. We give the stimulus to the well by flowing or shutting in the well, then we obtain the transient signal as the response. If the stimulus is a constant rate, then the response is the pressure transient. Likewise, if the stimulus is a constant pressure, then the response is the rate transient.

No alt text provided for this image

The objective of conducting a well-test analysis is not to produce economic fluid from the reservoir but to test the reservoir for an understanding of some properties and conditions, namely reservoir permeability, skin factor (the level of damage of the formation around the well), and reservoir extent or size.

Analysis of Drawdown and Constant Pressure Test

The basic way of doing a drawdown test is flowing the well under a constant rate over a long period of time, for instance, flowing 1,000 barrels a day in 48 hours. This is known as a constant rate drawdown test. In addition, the drawdown test can also be done by flowing the well under step-like changing of rates over some time, for instance, flowing 1,000 STB/D in the first 24 hours, then increase to 1,500 STB/D in the next 24 hours. This is known as a multiple rate drawdown test.

Both ways of drawdown tests have the same basic concept of analysis and interpretation. The figure below is an interpretation of a constant rate drawdown test. In the drawdown test, where the well flows, the recorded flowing pressure decreases with time (also known as the normal time). If we plot the data in a semilog curve (like below), we could identify three time-regimes; the early time-regime (ETR), the middle time-regime (MTR), and the long time-regime (LTR). The ETR is the time period when flow in the well experiences wellbore storage effect; after the flow is stopped, the fluid from the reservoir can still flow inside the well at a decreasing rate. The MTR is the time period when the well is infinite-acting (or steady-state); flow still does not reach the reservoir boundary. The LTR is the time period is finite-acting (or pseudosteady-state); flow is affected by reservoir boundary. We have intensively discussed these flow behavior in our previous article about well-transient modeling.

No alt text provided for this image

The three time-regimes are recognized from the curvature of the pressure semilog curve. Often in some cases, the well is installed with a downhole shut-in device to minimize the wellbore storage effect. Therefore, in the recorded pressure, the curve will look like the blue curve (ideal curve) and there is no ETR. However, mostly this device is not installed, therefore the ETR exists, shown here the deviation of the red curve. For analysis, a linear regression done on the MTR curve gives lots of information; reservoir permeability and skin factor. The LTR is also often analyzed to give information on the reservoir size (radius).

In a multiple rate drawdown test, we apply the Superposition Principle (that we have already discussed in our previous article) on our analysis. Using this principle, we consider the rates as a sum of the preceding rate series. In a constant pressure well-test analysis, a specified plot is devised.

The following table lists the plot components of each well-test and the formula to calculate some reservoir variables, namely the permeability (k), or permeability-thickness product, (kh), skin factor (s), reservoir size (re), and pore volume (PV).

No alt text provided for this image

Let's begin our tutorial.

Basic Well-test Analysis with Python

In this tutorial, we will use a program called "wellanalysis" that you could download from the hyperlink shown. Also, we will use six datasets, each for each part in the following tutorials. The datasets are inside a folder and you could get here.

>>> Get here for the full Python script of the tutorial <<<

First, our usual routine is to import all three libraries (Numpy, Matplotlib, and Pandas), and also the wellanalysis library that we use. The Matplotlib style that we use now is Seaborn (can be others, depends on your preference).

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

from wellanalysis import *

plt.style.use('seaborn')

Then, let us input all the required reservoir and fluid properties for our analysis. The initial reservoir pressure is 2,500 psia.

# known 
poro = 0.15 # Reservoir porosity
rw = 0.333 # Wellbore radius, ft
h = 32 # Reservoir thickness, ft
ct = 12E-06 # Total compressibility, sip
pi = 2500 # Initial reservoir pressure, psia
mu_oil = 2 # Oil viscosity, cp
Bo = 1.333 # Oil FVF, RB/STB

There are three tests in this tutorial; the constant rate drawdown, the multiple rate drawdown, and the constant pressure test. Each part uses the dataset that is started by filename "welltest1" for test 1, "welltest2" for test 2, and "welltest3" for test 3. The following figure represents the stimulus given to the well (top row) and the response obtained from the well (bottom row).

No alt text provided for this image
No alt text provided for this image

All parts are using the same reservoir and fluid properties defined above. So, let's begin.

Constant Rate Drawdown Test

In the first part, we will analyze a well-test result from a constant rate drawdown test. We first load the first dataset, that contains the time and flowing pressure (BHFP) columns.

# load well-test data
df = pd.read_csv('/content/pyreservoir/data/welltest/welltest1_constant_rate_drawdown.csv')


t = df['t'].values
p = df['p'].values

Next, we define at which rate the constant rate drawdown is performed. In our case is 1,000 STB/D.

# define rate
q = 1000 # Well rate, STB/D

We need to pay attention to the following input. As in our plot later, we will distinguish the separation of MTR and LTR. In our next input, we make our initial guess on the data index where separation happens. If we guess index 20, meaning that you guess the separation may happen in the 20th time. This is our first guess,

# guess time index (input to user)
your_guess = 30

Then, directly do the plotting analysis by using the following function and execute with the input values. This will produce two plots; the first is the normal plot of BHFP vs. time, and the second is the semilog plot. In addition, the MTR-LTR separation will be shown to us based on our previously guessed data index.

# well-test analysis
constant_rate_drawdown_test(t, p, q, Bo, mu_oil, h, poro, ct, rw, pi, your_guess)

This is our first result,

No alt text provided for this image

Which is not a good guess. Why? The separation of MTR and LTR is still incorrect, hence the calculated permeability, skin, and reservoir extent cannot be trusted. The separation should happen earlier (around 10 hours) than our initial guess. Therefore, we need to adjust our guess. We obtain a guess equals 19 to produce a correct separation, as in the following result.

No alt text provided for this image

Based on the result of linear regression on the MTR portion of the plot above, the calculated permeability is 600 milidarcies, the reservoir extent is nearly 1,000 ft, and the well skin is zero. The wellanalysis program will do automatically the analysis for this constant rate drawdown test, in addition, it is user-involved.

Multiple Rate Drawdown Test

The next test is a multiple rate drawdown test. We load the second dataset.

# load well-test data
df = pd.read_csv('/content/pyreservoir/data/welltest/welltest2_multi_rate_drawdown.csv')


t = df['t'].values
p = df['p'].values

The rate tests are carried out as follows; 1,000 STB/D for the first 10 hours, then 1,500 STB/D for the second 10 hours, and finally 300 STB/D for the third 10 hours. We define the rate series as follows,

# define rate-time steps
t_change = np.array([10, 20, 30])
q_change = np.array([1000, 1500, 300])

The reservoir properties are similar to the previous test, and our objective is to determine the permeability and well skin factor. Next, we directly produce the plots as follows,

# well-test analysis
multi_rate_drawdown_test(t, p, t_change, q_change, Bo, mu_oil, h, poro, ct, rw, pi)

Here's the result.

No alt text provided for this image

The linear regression on the drawdown plot produces the calculated permeability of 600 milidarcies and well skin factor of 9. The magnitude of well skin factor indicates that the formation around the wellbore is damaged or collapsed.

Constant Pressure Test

Finally, is the constant pressure test. In this test we flow the well under a constant borehole flowing pressure (BHFP) and obtain the result of its rate transient. Now, load the third dataset.

# load well-test data
df = pd.read_csv('/content/pyreservoir/data/welltest/welltest3_constant_pressure.csv')


t = df['t'].values
q = df['q'].values

The BHFP is kept constant at 1,500 psia over 200 hours, just below the initial reservoir pressure of 2,500 psia. Define the BHFP.

# define flowing pressure
pwf = 1500 # Wellbore Flowing Pressure, psia

All things done, we directly produce the well-test analysis plot of our constant pressure test result. This will produces the normal plot of rate vs. time and the semilog plot of reciprocal rate (1/q) vs. time, and calculate the permeability and well skin factor from a linear regression method.

# well-test analysis
constant_pressure_test(t, q, pwf, pi, Bo, mu_oil, h, poro, ct, rw)

And here's our result,

No alt text provided for this image

The linear regression on the semilog plot gives us a calculated permeability of around 40 milidarcies and well skin factor of approximately zero.

Conclusion

As an integral part of reservoir understanding, well-test analysis (specifically discussed here in Part 1 is the drawdown and constant pressure test) gives an estimate reservoir permeability, well skin factor, and reservoir extent. In Part 2, we will discuss a Python tutorial for analyzing buildup test results.

Reference

Lee, W. J. (1982). Well Testing: SPE Textbook Series Vol. 1. Society of Petroleum Engineers

Towler, B. F. (2002). Fundamental Principles of Reservoir Engineering: SPE Textbook Series Vol. 8. Society of Petroleum Engineers

khemissi aboub

M.Sc Petroleum Engineering Students | Strong Knowledge in Drilling Operations | Ready to Make an Impact in the Industry ?????

1 年

Thanks for sharing .it will be very useful to me ??

回复
Salvador Suazo

Petroleum Engineer

2 年

Excelent

回复
Douglas Silva de Almeida

Graduando em Engenharia de Petróleo na UFRJ | Técnico em Engenharia de Reservatórios (P&D) @ LRAP

2 年

Thanks for sharing this content, I spend the whole day studying and thinking in ways to extend this code e get more knowledge.

回复
Mohammad Ghodsi

MSc Petroleum Eng student at University of Tehran|Single/Multiphase Modeling in Porous Media|OpenFoam??|Young student award winner ????|Programmer ????|Coupled CFD-DEM simulations|Machine learning in Pet Engineering ??

3 年

that was useful for me! thanks ??

回复

Can you provide the test data you used in your analysis?

回复

要查看或添加评论,请登录

Yohanes Nuwara的更多文章

  • MLP (Keras) Optimizers for Discrete Problems

    MLP (Keras) Optimizers for Discrete Problems

    Optimization problem occurs every time in our daily life. In engineering, optimization is widely in many setup and it…

    10 条评论
  • Training Kolmogorov-Arnold Network (KAN) for Lithology Classification

    Training Kolmogorov-Arnold Network (KAN) for Lithology Classification

    We may have heard about the ground-breaking new type of neural network called Kolmogorov-Arnold Network (KAN), which is…

    11 条评论
  • Well Placement Optimization using Python PyMRST

    Well Placement Optimization using Python PyMRST

    Well placement optimization is one of the most challenging and expensive problems in the oil and gas industry. Well…

    1 条评论
  • Tutorial: Reservoir Simulation with Python PyMRST

    Tutorial: Reservoir Simulation with Python PyMRST

    Can you name the best reservoir simulator in the world? Perhaps ECLIPSE, CMG IMEX, Nexus, and so on. You may have heard…

    31 条评论
  • CutMix Augmentation for Object Detection

    CutMix Augmentation for Object Detection

    When building a computer vision model, sometimes, we get an F1-score accuracy that is not good enough. Then, we decide…

    1 条评论
  • Big Data & AI in Indonesian Healthcare Services

    Big Data & AI in Indonesian Healthcare Services

    Artificial Intelligence (AI) has become a transformative force in the field of healthcare, offering numerous benefits…

    7 条评论
  • ChatGPT for Sustainability

    ChatGPT for Sustainability

    The use of ChatGPT in the corporate world is becoming popular nowadays. It helps people work more productively and…

    5 条评论
  • Unlocking the Value of AI in Precision Forestry

    Unlocking the Value of AI in Precision Forestry

    We use forest products every day, for example paper products. Paper products come from wood fiber as its raw material…

    3 条评论
  • PDA Series #2 Facies Classification from Well Logs

    PDA Series #2 Facies Classification from Well Logs

    In the second series, we will discuss the application of supervised learning ML for the classification of lithofacies…

    2 条评论
  • PDA Series #1 Recovering Missing Sonic Logs

    PDA Series #1 Recovering Missing Sonic Logs

    In the first series, we will discuss the application of supervised learning ML for recovering missing sonic logs. PDA…

    10 条评论

社区洞察

其他会员也浏览了