Skip to content

wellcast.ipr

ipr

Inflow performance relationships (IPR) and critical-flow choke equations.

Units: pressures in psia (or consistently psig), rates in STB/d, gas-liquid ratio in scf/STB and choke size in 64ths of an inch. Inputs may be scalars or arrays; scalar inputs return a float.

An IPR gives the rate a well delivers for a given flowing bottomhole pressure \(p_{wf}\) at average reservoir pressure \(\bar{p}_r\).

productivity_index

productivity_index(rate: ArrayLike, reservoir_pressure: ArrayLike, flowing_pressure: ArrayLike) -> FloatOrArray

Productivity index from a stabilized rate test.

Parameters:

Name Type Description Default
rate array_like

Stabilized liquid rate, STB/d.

required
reservoir_pressure array_like

Average reservoir pressure, psi.

required
flowing_pressure array_like

Flowing bottomhole pressure during the test, psi.

required

Returns:

Type Description
float or ndarray

Productivity index J, STB/d/psi.

Raises:

Type Description
DataValidationError

If the drawdown is not positive or the rate is negative.

Notes
\[ J = \frac{q}{\bar{p}_r - p_{wf}} \]

Examples:

>>> productivity_index(350.0, 2500.0, 2000.0)
0.7

linear_ipr

linear_ipr(pwf: ArrayLike, reservoir_pressure: float, productivity_index: float) -> FloatOrArray

Straight-line IPR for single-phase (undersaturated) inflow.

Parameters:

Name Type Description Default
pwf array_like

Flowing bottomhole pressure, psi.

required
reservoir_pressure float

Average reservoir pressure, psi.

required
productivity_index float

Productivity index J, STB/d/psi.

required

Returns:

Type Description
float or ndarray

Rate, STB/d.

Raises:

Type Description
DataValidationError

If pwf exceeds the reservoir pressure or J is not positive.

Notes
\[ q = J (\bar{p}_r - p_{wf}) \]

Examples:

>>> linear_ipr(1850.0, 2500.0, 0.7)
455.0

vogel_qmax

vogel_qmax(rate: float, pwf: float, reservoir_pressure: float) -> float

Absolute open flow potential from one test, using Vogel's IPR.

Parameters:

Name Type Description Default
rate float

Stabilized test rate, STB/d.

required
pwf float

Flowing bottomhole pressure during the test, psi.

required
reservoir_pressure float

Average reservoir pressure (at or below the bubble point), psi.

required

Returns:

Type Description
float

Maximum rate \(q_{o,max}\) at \(p_{wf} = 0\), STB/d.

Raises:

Type Description
DataValidationError

If pwf is not below the reservoir pressure.

Notes
\[ q_{o,max} = \frac{q_o}{1 - 0.2 (p_{wf}/\bar{p}_r) - 0.8 (p_{wf}/\bar{p}_r)^2} \]

Vogel, J. V. (1968), "Inflow performance relationships for solution-gas drive wells", JPT 20(1), 83-92, SPE-1476-PA.

Examples:

>>> round(vogel_qmax(350.0, 2000.0, 2500.0), 2)
1067.07

vogel_ipr

vogel_ipr(pwf: ArrayLike, reservoir_pressure: float, qmax: float) -> FloatOrArray

Vogel IPR for a saturated (solution-gas drive) reservoir.

Parameters:

Name Type Description Default
pwf array_like

Flowing bottomhole pressure, psi.

required
reservoir_pressure float

Average reservoir pressure, psi.

required
qmax float

Absolute open flow potential, STB/d (see vogel_qmax).

required

Returns:

Type Description
float or ndarray

Oil rate, STB/d.

Raises:

Type Description
DataValidationError

If pwf exceeds the reservoir pressure.

Notes
\[ \frac{q_o}{q_{o,max}} = 1 - 0.2 \frac{p_{wf}}{\bar{p}_r} - 0.8 \left(\frac{p_{wf}}{\bar{p}_r}\right)^2 \]

Vogel (1968).

Examples:

>>> round(vogel_ipr(1850.0, 2500.0, 1067.07), 1)
441.7

fetkovich_ipr

fetkovich_ipr(pwf: ArrayLike, reservoir_pressure: float, c: float, n: float) -> FloatOrArray

Fetkovich back-pressure IPR.

Parameters:

Name Type Description Default
pwf array_like

Flowing bottomhole pressure, psi.

required
reservoir_pressure float

Average reservoir pressure, psi.

required
c float

Performance coefficient, STB/d/psi^(2n).

required
n float

Deliverability exponent, usually 0.5 (turbulent) to 1.0 (laminar).

required

Returns:

Type Description
float or ndarray

Oil rate, STB/d.

Raises:

Type Description
DataValidationError

If pwf exceeds the reservoir pressure or c, n are not positive.

Notes
\[ q_o = C (\bar{p}_r^2 - p_{wf}^2)^n \]

Fetkovich, M. J. (1973), "The isochronal testing of oil wells", SPE-4529-MS.

Examples:

>>> round(fetkovich_ipr(2000.0, 2500.0, 1e-4, 1.0), 1)
225.0

fit_fetkovich

fit_fetkovich(rates: ArrayLike, pwfs: ArrayLike, reservoir_pressure: float) -> tuple[float, float]

Fit Fetkovich's C and n to a multi-rate test.

Parameters:

Name Type Description Default
rates array_like

Stabilized rates, STB/d (at least two).

required
pwfs array_like

Corresponding flowing bottomhole pressures, psi.

required
reservoir_pressure float

Average reservoir pressure, psi.

required

Returns:

Name Type Description
c float

Performance coefficient.

n float

Deliverability exponent.

Raises:

Type Description
DataValidationError

If fewer than two valid points are given or shapes differ.

FitError

If the fitted exponent is not positive.

Notes

Least squares on \(\log q = \log C + n \log(\bar{p}_r^2 - p_{wf}^2)\).

Examples:

>>> import numpy as np
>>> pwf = np.array([2200.0, 1800.0, 1200.0])
>>> q = 2e-3 * (2500.0**2 - pwf**2) ** 0.8
>>> c, n = fit_fetkovich(q, pwf, 2500.0)
>>> round(n, 3), round(c, 5)
(0.8, 0.002)

composite_ipr

composite_ipr(pwf: ArrayLike, reservoir_pressure: float, bubble_point: float, productivity_index: float) -> FloatOrArray

Composite (generalized Vogel) IPR for an undersaturated reservoir.

Parameters:

Name Type Description Default
pwf array_like

Flowing bottomhole pressure, psi.

required
reservoir_pressure float

Average reservoir pressure, psi, at or above the bubble point.

required
bubble_point float

Bubble-point pressure, psi.

required
productivity_index float

Productivity index above the bubble point, STB/d/psi.

required

Returns:

Type Description
float or ndarray

Oil rate, STB/d.

Raises:

Type Description
DataValidationError

If the bubble point exceeds the reservoir pressure or pwf exceeds the reservoir pressure.

Notes

With \(q_b = J(\bar{p}_r - p_b)\):

\[ q = \begin{cases} J(\bar{p}_r - p_{wf}) & p_{wf} \ge p_b \\ q_b + \frac{J p_b}{1.8}\left[1 - 0.2\frac{p_{wf}}{p_b} - 0.8\left(\frac{p_{wf}}{p_b}\right)^2\right] & p_{wf} < p_b \end{cases} \]

The two branches join with equal slope at \(p_b\). Brown, K. E. (1984), The Technology of Artificial Lift Methods, Vol. 4, PennWell.

Examples:

>>> round(composite_ipr(0.0, 4000.0, 2000.0, 1.4), 1)
4355.6

composite_productivity_index

composite_productivity_index(rate: float, pwf: float, reservoir_pressure: float, bubble_point: float) -> float

Productivity index for composite_ipr from one rate test.

Parameters:

Name Type Description Default
rate float

Stabilized test rate, STB/d.

required
pwf float

Flowing bottomhole pressure during the test, psi.

required
reservoir_pressure float

Average reservoir pressure, psi.

required
bubble_point float

Bubble-point pressure, psi.

required

Returns:

Type Description
float

Productivity index J above the bubble point, STB/d/psi.

Raises:

Type Description
DataValidationError

If pwf is not below the reservoir pressure.

Notes

For a test above the bubble point \(J = q/(\bar{p}_r - p_{wf})\); below it

\[ J = \frac{q}{\bar{p}_r - p_b + \frac{p_b}{1.8}\left[1 - 0.2 \frac{p_{wf}}{p_b} - 0.8\left(\frac{p_{wf}}{p_b}\right)^2\right]} \]

Examples:

>>> round(composite_productivity_index(3000.0, 1500.0, 4000.0, 2000.0), 4)
1.2273

ipr_curve

ipr_curve(model: Literal['linear', 'vogel', 'fetkovich', 'composite'], reservoir_pressure: float, *, n_points: int = 50, **params: float) -> pd.DataFrame

Tabulate an IPR curve from zero to reservoir pressure.

Parameters:

Name Type Description Default
model ('linear', 'vogel', 'fetkovich', 'composite')

IPR model.

"linear"
reservoir_pressure float

Average reservoir pressure, psi.

required
n_points int

Number of pressures. Default 50.

50
**params float

Model parameters: productivity_index (linear), qmax (vogel), c and n (fetkovich), bubble_point and productivity_index (composite).

{}

Returns:

Type Description
DataFrame

Columns pwf (psi, decreasing) and rate (STB/d).

Raises:

Type Description
DataValidationError

If model is unknown or n_points < 2.

Examples:

>>> curve = ipr_curve("vogel", 2500.0, n_points=3, qmax=1000.0)
>>> curve["rate"].tolist()
[0.0, 700.0, 1000.0]

choke_pressure

choke_pressure(rate: ArrayLike, glr: ArrayLike, choke_size: ArrayLike, method: ChokeMethod = 'gilbert') -> FloatOrArray

Upstream (wellhead) pressure for critical two-phase flow through a choke.

Parameters:

Name Type Description Default
rate array_like

Liquid rate, STB/d.

required
glr array_like

Producing gas-liquid ratio, scf/STB.

required
choke_size array_like

Bean size in 64ths of an inch.

required
method ('gilbert', 'ros', 'baxendell', 'achong')

Correlation. Default "gilbert".

"gilbert"

Returns:

Type Description
float or ndarray

Upstream pressure, psi.

Raises:

Type Description
DataValidationError

If method is unknown, the rate is negative, or glr or choke_size is not positive.

Notes
\[ p_{wh} = \frac{A\, q_L\, R^{B}}{S^{C}} \]

The equations assume critical flow, roughly when the downstream pressure is below 0.588 times the upstream pressure. Gilbert, W. E. (1954), "Flowing and gas-lift well performance", Drilling and Production Practice, API, 126-157.

Examples:

>>> round(choke_pressure(1000.0, 1000.0, 32.0), 1)
621.3

choke_rate

choke_rate(pressure: ArrayLike, glr: ArrayLike, choke_size: ArrayLike, method: ChokeMethod = 'gilbert') -> FloatOrArray

Liquid rate through a choke for a given upstream pressure.

Inverse of choke_pressure.

Parameters:

Name Type Description Default
pressure array_like

Upstream (wellhead) pressure, psi.

required
glr array_like

Producing gas-liquid ratio, scf/STB.

required
choke_size array_like

Bean size in 64ths of an inch.

required
method ('gilbert', 'ros', 'baxendell', 'achong')

Correlation. Default "gilbert".

"gilbert"

Returns:

Type Description
float or ndarray

Liquid rate, STB/d.

Raises:

Type Description
DataValidationError

If method is unknown or an input is out of range.

Notes
\[ q_L = \frac{p_{wh} S^{C}}{A R^{B}} \]

Examples:

>>> round(choke_rate(621.25, 1000.0, 32.0), 1)
1000.0

gilbert_choke

gilbert_choke(rate: ArrayLike, glr: ArrayLike, choke_size: ArrayLike) -> FloatOrArray

Upstream pressure from Gilbert's choke equation.

Shortcut for choke_pressure(..., method="gilbert"); see choke_pressure for parameters and units.

Parameters:

Name Type Description Default
rate array_like

Liquid rate, STB/d.

required
glr array_like

Gas-liquid ratio, scf/STB.

required
choke_size array_like

Bean size, 64ths of an inch.

required

Returns:

Type Description
float or ndarray

Upstream pressure, psi.

Examples:

>>> round(gilbert_choke(1000.0, 1000.0, 32.0), 1)
621.3

ros_choke

ros_choke(rate: ArrayLike, glr: ArrayLike, choke_size: ArrayLike) -> FloatOrArray

Upstream pressure from Ros's choke equation.

Shortcut for choke_pressure(..., method="ros"). Ros, N. C. J. (1960), "An analysis of critical simultaneous gas/liquid flow through a restriction and its application to flowmetering", Applied Scientific Research 9, 374-388.

Parameters:

Name Type Description Default
rate array_like

Liquid rate, STB/d.

required
glr array_like

Gas-liquid ratio, scf/STB.

required
choke_size array_like

Bean size, 64ths of an inch.

required

Returns:

Type Description
float or ndarray

Upstream pressure, psi.

Examples:

>>> round(ros_choke(1000.0, 1000.0, 32.0), 1)
537.3

baxendell_choke

baxendell_choke(rate: ArrayLike, glr: ArrayLike, choke_size: ArrayLike) -> FloatOrArray

Upstream pressure from Baxendell's choke equation.

Shortcut for choke_pressure(..., method="baxendell"). Baxendell, P. B. (1957), "Bean performance: Lake Maracaibo wells", Internal Company Report, Shell Oil Co.

Parameters:

Name Type Description Default
rate array_like

Liquid rate, STB/d.

required
glr array_like

Gas-liquid ratio, scf/STB.

required
choke_size array_like

Bean size, 64ths of an inch.

required

Returns:

Type Description
float or ndarray

Upstream pressure, psi.

Examples:

>>> round(baxendell_choke(1000.0, 1000.0, 32.0), 1)
517.0