Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions

Simulate well test response using


analytical solutions
R WELL TESTING

Using Stehfest Numerical Laplace Inversion algorithm to simulate well pressure response.

AUTHOR

Rigoberto Chandomi Vazquez

PUBLISHED CITATION

Oct. 31, 2021 Vazquez, 2021

Through the stehfest numerical inverse transformation method (1976), we can calculate dimensionless
wellbore pressure in real space. The Laplace transform method can be given by (1)

N
min(i, ) N
2
N k 2 (2k)!
+i
V (i) = (−1) 2 ∑
N
i+1 ( − k)!(k)!(k − 1)!(i − k)!(2k − i)!
k= 2
2

where

N
ln(2) ¯¯
¯
f (t) = ∑ V (i)f (s)
t
i=1

ln(2)
s = i
t

The variable N could be one of the even numbers from 6 to 18. In this case we use the V (i) with Stehfest
parameter N = 8

V (1) V (2) V (3) V (4) V (5) V (6) V (7) V (8)

-0.3333 48.3333 -906 5464.6667 -14376.66667 18730 -11946.6667 2986.6667

Using the stehfest algorithm in the infinite acting reservoir with WBS and skin equation (2), we can get
dimensionless pressure in real space.

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 1/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions


− −
− −

¯
¯¯¯¯¯¯¯¯ 1 K 0 (√u ) + s√u K 1 (√u )
P wD = [ ]

− −
− −
− −
− −

u √u K 1 (√u ) + CD u[K 0 (√u ) + s√u K 1 (√u ])

In EOF units, the dimensionless variables are defined as:

pressure

kh
pD =
141.2qBμ

time

0.000264k
tD =
2
ϕμc t rw

wellbore storage

0.8936
CD =
2
ϕ c t hr w

radial distance

r
rD =
rw

Taking results from type curve post, Pressure response is simulated the response and compared with data.
First load the data to take the time elapse.

library ( plotly )
library ( dplyr )
library ( DT )

data.DD <- read.csv ( "ex1_DD.csv")

datatable( data.DD )

Show 10 entries Search:

t pwf

1 0.001 2748.95

2 0.0021 2745.62

3 0.0034 2744.63

4 0.0048 2745.49

5 0.0064 2741.7

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 2/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions

t pwf

6 0.0082 2742

7 0.0102 2736.69

8 0.0125 2737.26

9 0.0151 2733.72

10 0.018 2729.13

Showing 1 to 10 of 78 entries Previous 1 2 3 4 5 … 8 Next

plot_pwf <- plot_ly ( ) %>%


add_markers( data = data.DD , x = ~ t , y =
~ pwf , marker = list ( color = "blue" ) , name
= "Pwf" ) %>%
layout (
xaxis = list ( title = "time, hr") ,
yaxis = list ( title = "Pwf, psi")
)

plot_pwf

2800

2600
Pwf, psi

2400

2200

2000

0 20 40 60

time, hr

A log-log plot is generated from pressure change and its logarithmic derivative to identify flow regime.

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 3/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions

Qo <- 125 #STB/D


h <- 32 #ft
phi <- 0.22 #fraction
Bo <- 1.125 #RB/STB
Pi <- 2750 #psia
ct <- 0.0000109 #psia -1
rw <- 0.25 #ft
vis <- 2.122 #cp

#Results
k <- 22.92
s <- 5.78
C <- 0.005

data.DD $ dp <- Pi - data.DD $ pwf


data.DD $ dpdt <- c ( 0 ,diff ( data.DD
$ dp ) / diff ( log ( data.DD $
t ) ) )

plot_log <- plot_ly ( ) %>%


add_markers( data = data.DD , x = ~ t , y =
~ dp , marker = list ( color = "blue" ) , name
= "dp" ) %>%
add_markers( data = data.DD , x = ~ t , y =
~ dpdt , marker = list ( color = "green" ) , name
= "dp'" ) %>%
layout (
xaxis = list ( type = "log" , title = "time, hr"
) ,
yaxis = list ( type = "log" , title = "Pwf, psi"
)
)

plot_log

1000 dp
5
dp'

100

5
Pwf, psi

10

1
https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 4/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions
1

0.001 0.01 0.1 1 10 100

time, hr

To reuse code later Stehfest algorithm is defined as a function

#Stehfest inversion algorithm


Stehfest_inversion <- function ( tD , cD , s ) {

PwD <- 0

m <- length ( tD )

V <- c ( - 0.3333 ,48.3333 ,- 906 ,5464.666


,- 14376.6667,18730 ,- 11946.6667,2986.6667)

for ( j in 1 : m ) {

a <- log ( 2 ) / tD [ j
]
i <- c ( 1 : length ( V )
)
u <- ( i * a )
ru <- sqrt ( u )
aux1 <- besselK ( ru ,0 ) + s *
ru * besselK ( ru ,1 )
aux2 <- ru * besselK ( ru ,1 ) +
cD * u * ( besselK ( ru ,0 )
+ s * ru * besselK ( ru ,1 )
)
PwDL <- 1 / u * ( aux1 / aux2
)

PwD [ j ] <- a * sum ( V


* PwDL )

return ( PwD )

Now, The Stehfest_inversion() function is used with the results parameters. Fisrt, time and WBS is estimated
from above equations and then they and skin are used as Stehfest_inversion() parameters functions.

In the log-log plot we can observe a difference between pressure change from data and the simulation,
the different could be less adjust the k, C and s values with non-linear regression

tD <- ( 0.0002637* k * ( data.DD $


t ) ) / ( phi * vis * ct
* rw ^ 2 )

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 5/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions

cD <- ( 0.8936 * C ) / ( h
* phi * ct * rw ^ 2 )

PwD <- Stehfest_inversion( tD , cD , s )

data.DD $ dp_cal <- ( PwD * 141.2 * Bo


* vis * Qo ) / ( h * k
)
data.DD $ pwf_cal <- Pi - data.DD $ dp_cal

data.DD $ dpdt_cal <- c ( 0 ,diff ( data.DD


$ dp_cal ) / diff ( log ( data.DD $
t ) ) )

plot_log <- plot_log %>%


add_lines( data = data.DD , x = ~ t , y =
~ dp_cal , line = list ( color = "blue" ) , name
= "dp" ) %>%
add_lines( data = data.DD , x = ~ t , y =
~ dpdt_cal , line = list ( color = "green" ) , name
= "dp" )

plot_log

1000 dp
5
dp'
dp

2
dp

100

5
Pwf, psi

10

0.001 0.01 0.1 1 10 100

time, hr

Files

References

1. Spivey, J. & Lee, J. (2013) Applied well test interpretation. Society of petroleum engineers

2. Lee, J., Rollins, J. & Spivey, J. (2003) Pressure transient testing. Society of petroleum engineers

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 6/7
7/29/23, 11:29 AM Chato Solutions: Simulate well test response using analytical solutions

3. Sun, H. (2015) Advanced Production Decline Analysis. Gulf Professional Publishing

Buy me a coffee

 0 Comments Share:  

Citation
For attribution, please cite this work as

Vazquez (2021, Oct. 31). Chato Solutions: Simulate well test response using analytical solutions.
Retrieved from https://www.chatosolutions.com/posts/2021-10-17-stephest1/

BibTeX citation

@misc{vazquez2021simulate,
author = {Vazquez, Rigoberto Chandomi},
title = {Chato Solutions: Simulate well test response using analytical solutions},
url = {https://www.chatosolutions.com/posts/2021-10-17-stephest1/},
year = {2021}
}

https://www.chatosolutions.com/posts/2021-10-17-stephest1/ 7/7

You might also like