wellcast.pvt¶
pvt ¶
Empirical PVT correlations for black oil and natural gas.
All functions use oilfield units: pressure in psia, temperature in degF,
solution gas-oil ratio in scf/STB, gas specific gravity relative to air and
oil gravity in degrees API. Inputs may be scalars or arrays; scalar inputs
return a float.
Each correlation was fitted to a finite laboratory data set. Inputs outside
the published range are still evaluated, but a
wellcast._validation.RangeWarning is issued.
Notes
Oil specific gravity and API gravity are related by \(\gamma_o = 141.5 / (131.5 + \mathrm{API})\).
RangeWarning ¶
Bases: UserWarning
An input lies outside the range a correlation was developed for.
api_to_specific_gravity ¶
Convert API gravity to oil specific gravity (water = 1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api
|
array_like
|
Oil gravity in degrees API. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Specific gravity at 60 degF. |
Notes
\(\gamma_o = 141.5 / (131.5 + \mathrm{API})\).
Examples:
specific_gravity_to_api ¶
bubble_point_standing ¶
bubble_point_standing(rs: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike) -> FloatOrArray
Bubble-point pressure from Standing's correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rs
|
array_like
|
Solution gas-oil ratio at the bubble point, scf/STB. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Reservoir temperature, degF. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Bubble-point pressure, psia. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Warns:
| Type | Description |
|---|---|
RangeWarning
|
Outside 100-258 degF, 20-1425 scf/STB, 16.5-63.8 API or gas gravity 0.59-0.95. |
Notes
Standing, M. B. (1947), "A pressure-volume-temperature correlation for mixtures of California oils and gases", Drilling and Production Practice, API, 275-287.
Examples:
solution_gor_standing ¶
solution_gor_standing(pressure: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike, bubble_point: ArrayLike | None = None) -> FloatOrArray
Solution gas-oil ratio from Standing's correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure, psia. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
bubble_point
|
array_like
|
Bubble-point pressure, psia. Above it the oil is undersaturated and Rs stays at its bubble-point value. If omitted, the oil is assumed saturated at every pressure. |
None
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Solution gas-oil ratio, scf/STB. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Inverse of bubble_point_standing:
Standing (1947), see bubble_point_standing.
Examples:
oil_fvf_standing ¶
oil_fvf_standing(rs: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike) -> FloatOrArray
Saturated oil formation volume factor from Standing's correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rs
|
array_like
|
Solution gas-oil ratio, scf/STB. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Oil formation volume factor, bbl/STB, at or below the bubble point. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Standing (1947), see bubble_point_standing.
Examples:
solution_gor_vasquez_beggs ¶
solution_gor_vasquez_beggs(pressure: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike, *, separator_pressure: float = 114.7, separator_temperature: float = 60.0) -> FloatOrArray
Solution gas-oil ratio from the Vasquez-Beggs correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure at or below the bubble point, psia. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1) at separator conditions. |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
separator_pressure
|
float
|
Separator pressure, psia. Default 114.7 (100 psig). |
114.7
|
separator_temperature
|
float
|
Separator temperature, degF. Default 60. |
60.0
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Solution gas-oil ratio, scf/STB. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
with \((C_1, C_2, C_3) = (0.0362, 1.0937, 25.7240)\) for API <= 30 and \((0.0178, 1.1870, 23.931)\) above, and the separator-corrected gravity \(\gamma_{gs} = \gamma_g [1 + 5.912\times10^{-5}\,\mathrm{API}\, T_{sep} \log_{10}(p_{sep}/114.7)]\).
Vasquez, M. and Beggs, H. D. (1980), "Correlations for fluid physical property prediction", JPT 32(6), 968-970, SPE-6719-PA.
Examples:
bubble_point_vasquez_beggs ¶
bubble_point_vasquez_beggs(rs: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike, *, separator_pressure: float = 114.7, separator_temperature: float = 60.0) -> FloatOrArray
Bubble-point pressure from the Vasquez-Beggs correlation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rs
|
array_like
|
Solution gas-oil ratio at the bubble point, scf/STB. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1) at separator conditions. |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
separator_pressure
|
float
|
Separator pressure, psia. Default 114.7. |
114.7
|
separator_temperature
|
float
|
Separator temperature, degF. Default 60. |
60.0
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Bubble-point pressure, psia. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Algebraic inverse of solution_gor_vasquez_beggs:
Examples:
oil_fvf_vasquez_beggs ¶
oil_fvf_vasquez_beggs(rs: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike, *, separator_pressure: float = 114.7, separator_temperature: float = 60.0) -> FloatOrArray
Saturated oil formation volume factor from Vasquez-Beggs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rs
|
array_like
|
Solution gas-oil ratio, scf/STB. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1) at separator conditions. |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
separator_pressure
|
float
|
Separator pressure, psia. Default 114.7. |
114.7
|
separator_temperature
|
float
|
Separator temperature, degF. Default 60. |
60.0
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Oil formation volume factor, bbl/STB. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
with \((C_1, C_2, C_3) = (4.677\times10^{-4}, 1.751\times10^{-5}, -1.811\times10^{-8})\) for API <= 30 and \((4.670\times10^{-4}, 1.100\times10^{-5}, 1.337\times10^{-9})\) above. Vasquez and Beggs (1980).
Examples:
oil_fvf_undersaturated ¶
oil_fvf_undersaturated(pressure: ArrayLike, bubble_point: ArrayLike, bo_bubble: ArrayLike, rs_bubble: ArrayLike, gas_gravity: ArrayLike, api: ArrayLike, temperature: ArrayLike) -> FloatOrArray
Oil formation volume factor above the bubble point.
Uses the Vasquez-Beggs isothermal compressibility, integrated from the
bubble point to pressure. At or below the bubble point the value at
the bubble point is returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure, psia. |
required |
bubble_point
|
array_like
|
Bubble-point pressure, psia. |
required |
bo_bubble
|
array_like
|
Formation volume factor at the bubble point, bbl/STB. |
required |
rs_bubble
|
array_like
|
Solution gas-oil ratio at the bubble point, scf/STB. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Oil formation volume factor, bbl/STB. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If a pressure is not positive. |
Notes
With \(c_o = A / p\) and \(A = 10^{-5}(-1433 + 5 R_{sb} + 17.2\,T - 1180\,\gamma_g + 12.61\,\mathrm{API})\):
Vasquez and Beggs (1980).
Examples:
dead_oil_viscosity_beggs_robinson ¶
Dead (gas-free) oil viscosity from Beggs and Robinson.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api
|
array_like
|
Oil gravity, degrees API. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Dead oil viscosity, cP. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Beggs, H. D. and Robinson, J. R. (1975), "Estimating the viscosity of crude oil systems", JPT 27(9), 1140-1141, SPE-5434-PA. The correlation tends to overpredict below about 100 degF.
Examples:
live_oil_viscosity_beggs_robinson ¶
Saturated (live) oil viscosity from Beggs and Robinson.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dead_viscosity
|
array_like
|
Dead oil viscosity at the same temperature, cP. |
required |
rs
|
array_like
|
Solution gas-oil ratio, scf/STB. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Live oil viscosity at or below the bubble point, cP. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Beggs and Robinson (1975).
Examples:
undersaturated_oil_viscosity_vasquez_beggs ¶
undersaturated_oil_viscosity_vasquez_beggs(pressure: ArrayLike, bubble_point: ArrayLike, saturated_viscosity: ArrayLike) -> FloatOrArray
Oil viscosity above the bubble point from Vasquez and Beggs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure, psia. |
required |
bubble_point
|
array_like
|
Bubble-point pressure, psia. |
required |
saturated_viscosity
|
array_like
|
Viscosity at the bubble point, cP. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Oil viscosity, cP. Equals |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If any input is not positive. |
Notes
Vasquez and Beggs (1980).
Examples:
pseudo_critical_standing ¶
Pseudo-critical temperature and pressure of a natural gas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tpc |
float or ndarray
|
Pseudo-critical temperature, degR. |
ppc |
float or ndarray
|
Pseudo-critical pressure, psia. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
Standing's fit for natural gas systems (sweet, dry gas):
Standing, M. B. (1977), Volumetric and Phase Behavior of Oil Field Hydrocarbon Systems, SPE.
Examples:
z_factor_hall_yarborough ¶
z_factor_hall_yarborough(ppr: ArrayLike, tpr: ArrayLike, *, tol: float = 1e-12, max_iter: int = 100) -> FloatOrArray
Gas compressibility factor from the Hall-Yarborough equation of state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ppr
|
array_like
|
Pseudo-reduced pressure. |
required |
tpr
|
array_like
|
Pseudo-reduced temperature. |
required |
tol
|
float
|
Convergence tolerance on the reduced density. Default 1e-12. |
1e-12
|
max_iter
|
int
|
Maximum Newton iterations. Default 100. |
100
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Compressibility factor z. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Warns:
| Type | Description |
|---|---|
RangeWarning
|
Outside 1.0 <= Tpr <= 3.0 or Ppr > 24. |
Notes
With \(t = 1/T_{pr}\), the reduced density \(y\) solves
where \(A = 0.06125\,t\,e^{-1.2(1-t)^2}\), \(B = t(14.76 - 9.76t + 4.58t^2)\), \(C = t(90.7 - 242.2t + 42.4t^2)\) and \(D = 2.18 + 2.82t\). Then \(z = A p_{pr} / y\). Solved here by a damped Newton method.
Hall, K. R. and Yarborough, L. (1973), "A new equation of state for Z-factor calculations", Oil and Gas Journal 71(25), 82-92.
Examples:
z_factor ¶
Gas compressibility factor from pressure, temperature and gravity.
Combines pseudo_critical_standing with
z_factor_hall_yarborough.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure, psia. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
gas_gravity
|
array_like
|
Gas specific gravity (air = 1). |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Compressibility factor z. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Examples:
gas_fvf ¶
Gas formation volume factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressure, psia. |
required |
temperature
|
array_like
|
Temperature, degF. |
required |
z
|
array_like
|
Gas compressibility factor. |
required |
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Gas formation volume factor, reservoir ft3 per scf. Divide by 5.615 for bbl/scf. |
Raises:
| Type | Description |
|---|---|
DataValidationError
|
If |
Notes
From the real gas law between reservoir and standard conditions (14.7 psia, 60 degF):
with \(T\) in degR.
Examples:
black_oil_table ¶
black_oil_table(pressure: ArrayLike, temperature: float, api: float, gas_gravity: float, rs_bubble: float) -> pd.DataFrame
Tabulate black-oil properties over a pressure range.
Below the bubble point Standing's Rs and Bo and the Beggs-Robinson live viscosity are used; above it Rs is constant and Bo and viscosity follow Vasquez-Beggs. Gas z and Bg are reported at every pressure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
array_like
|
Pressures, psia. |
required |
temperature
|
float
|
Reservoir temperature, degF. |
required |
api
|
float
|
Oil gravity, degrees API. |
required |
gas_gravity
|
float
|
Gas specific gravity (air = 1). |
required |
rs_bubble
|
float
|
Solution gas-oil ratio at the bubble point, scf/STB. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns |
Examples: