Skip to content

rodlift.pvt.gas

rodlift.pvt.gas

Natural-gas properties: pseudo-critical properties, z-factor, FVF, density, viscosity.

All public functions use SI units (Pa, K, kg/m³, Pa·s) and accept scalars or arrays.

References

.. [Standing1977] Standing, M.B. (1977). Volumetric and Phase Behavior of Oil Field Hydrocarbon Systems. SPE, Dallas. .. [WichertAziz1972] Wichert, E. and Aziz, K. (1972). "Calculate Z's for sour gases." Hydrocarbon Processing, 51(5), 119-122. .. [Kay1936] Kay, W.B. (1936). "Density of hydrocarbon gases and vapors at high temperature and pressure." Ind. Eng. Chem., 28(9), 1014-1019. .. [DAK1975] Dranchuk, P.M. and Abou-Kassem, J.H. (1975). "Calculation of Z factors for natural gases using equations of state." J. Can. Pet. Technol., 14(3), 34-36. .. [Lee1966] Lee, A.L., Gonzalez, M.H. and Eakin, B.E. (1966). "The viscosity of natural gases." J. Pet. Technol., 18(8), 997-1000.

R_GAS module-attribute

R_GAS: Final = 8.314462618

Universal gas constant, J/(mol·K).

AIR_MOLAR_MASS module-attribute

AIR_MOLAR_MASS: Final = 0.02897

Molar mass of air, kg/mol.

PseudoCritical

Bases: NamedTuple

Pseudo-critical pressure (Pa) and temperature (K) of a gas mixture.

pseudo_critical_properties

pseudo_critical_properties(
    gas_sg: ArrayLike,
    y_n2: ArrayLike = 0.0,
    y_co2: ArrayLike = 0.0,
    y_h2s: ArrayLike = 0.0,
) -> PseudoCritical

Pseudo-critical pressure and temperature of a natural gas.

Uses Standing's natural-gas correlation [Standing1977]_ for the hydrocarbon fraction. When N₂, CO₂ or H₂S are present, the hydrocarbon gravity is isolated, the non-hydrocarbon critical properties are mixed in with Kay's rule [Kay1936], and the result is corrected for acid gases with Wichert and Aziz [WichertAziz1972].

Parameters:

Name Type Description Default
gas_sg ArrayLike

Gas specific gravity (air = 1), including the non-hydrocarbon components.

required
y_n2 ArrayLike

Mole fractions of nitrogen, carbon dioxide and hydrogen sulfide.

0.0
y_co2 ArrayLike

Mole fractions of nitrogen, carbon dioxide and hydrogen sulfide.

0.0
y_h2s ArrayLike

Mole fractions of nitrogen, carbon dioxide and hydrogen sulfide.

0.0

Returns:

Type Description
PseudoCritical

(pressure [Pa], temperature [K]).

z_factor_dranchuk_abou_kassem

z_factor_dranchuk_abou_kassem(
    ppr: ArrayLike,
    tpr: ArrayLike,
    *,
    tol: float = 1e-12,
    max_iter: int = 100,
) -> FloatOrArray

Gas compressibility factor from Dranchuk & Abou-Kassem [DAK1975]_.

The 11-constant equation of state fitted to the Standing-Katz chart is solved for the reduced density. The smallest positive root (the vapour root) is located by a coarse scan and refined with safeguarded Newton iterations, which is robust also for pseudo-reduced temperatures at or below 1.

Parameters:

Name Type Description Default
ppr ArrayLike

Pseudo-reduced pressure (> 0).

required
tpr ArrayLike

Pseudo-reduced temperature (> 0).

required
tol float

Absolute tolerance on the reduced density.

1e-12
max_iter int

Maximum Newton iterations.

100

Returns:

Type Description
float or ndarray

Compressibility factor z.

Warns:

Type Description
CorrelationRangeWarning

Outside the published range 1.0 < Tpr ≤ 3.0, 0.2 ≤ Ppr < 30.

ConvergenceWarning

If no root is found.

z_factor

z_factor(
    pressure: ArrayLike,
    temperature: ArrayLike,
    gas_sg: ArrayLike,
    *,
    y_n2: ArrayLike = 0.0,
    y_co2: ArrayLike = 0.0,
    y_h2s: ArrayLike = 0.0,
) -> FloatOrArray

Gas compressibility factor at pressure and temperature.

Combines :func:pseudo_critical_properties with :func:z_factor_dranchuk_abou_kassem.

Parameters:

Name Type Description Default
pressure ArrayLike

Absolute pressure, Pa.

required
temperature ArrayLike

Temperature, K.

required
gas_sg ArrayLike

Gas specific gravity (air = 1).

required
y_n2 ArrayLike

Mole fractions of non-hydrocarbon components.

0.0
y_co2 ArrayLike

Mole fractions of non-hydrocarbon components.

0.0
y_h2s ArrayLike

Mole fractions of non-hydrocarbon components.

0.0

gas_fvf

gas_fvf(
    pressure: ArrayLike,
    temperature: ArrayLike,
    z: ArrayLike,
) -> FloatOrArray

Gas formation volume factor, reservoir m³ per standard m³.

Bg = (p_sc / T_sc) · z T / p with standard conditions 14.696 psia and 60 °F (see :data:rodlift.units.P_STANDARD, :data:rodlift.units.T_STANDARD).

gas_density

gas_density(
    pressure: ArrayLike,
    temperature: ArrayLike,
    gas_sg: ArrayLike,
    z: ArrayLike,
) -> FloatOrArray

Gas density from the real-gas law, kg/m³: ρ = p M / (z R T).

gas_viscosity_lee

gas_viscosity_lee(
    pressure: ArrayLike,
    temperature: ArrayLike,
    gas_sg: ArrayLike,
    z: ArrayLike,
) -> FloatOrArray

Gas viscosity from Lee, Gonzalez and Eakin [Lee1966]_, Pa·s.

Parameters:

Name Type Description Default
pressure ArrayLike

Absolute pressure, Pa.

required
temperature ArrayLike

Temperature, K.

required
gas_sg ArrayLike

Gas specific gravity (air = 1).

required
z ArrayLike

Gas compressibility factor at pressure and temperature.

required