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
Examples:
linear_ipr ¶
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 |
Notes
Examples:
vogel_qmax ¶
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 |
Notes
Vogel, J. V. (1968), "Inflow performance relationships for solution-gas drive wells", JPT 20(1), 83-92, SPE-1476-PA.
Examples:
vogel_ipr ¶
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 |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Oil rate, STB/d. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Vogel (1968).
Examples:
fetkovich_ipr ¶
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 |
Notes
Fetkovich, M. J. (1973), "The isochronal testing of oil wells", SPE-4529-MS.
Examples:
fit_fetkovich ¶
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:
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 |
Notes
With \(q_b = J(\bar{p}_r - p_b)\):
The two branches join with equal slope at \(p_b\). Brown, K. E. (1984), The Technology of Artificial Lift Methods, Vol. 4, PennWell.
Examples:
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 |
Notes
For a test above the bubble point \(J = q/(\bar{p}_r - p_{wf})\); below it
Examples:
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: |
{}
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Examples:
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"
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Upstream pressure, psi. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
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:
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"
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Liquid rate, STB/d. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Examples:
gilbert_choke ¶
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:
ros_choke ¶
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:
baxendell_choke ¶
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: