Skip to content

rodlift.flow.state

rodlift.flow.state

Local two-phase flow conditions and pressure-gradient results.

Sign convention

Pressure gradients are reported as pressure loss per unit length in the flow direction, -dp/dL (Pa/m). A positive elevation term means the flow goes uphill; a positive friction term always opposes the flow.

FlowRegime

Bases: IntEnum

Flow regime reported by a correlation.

UNKNOWN class-attribute instance-attribute

UNKNOWN = 0

The correlation does not identify a regime.

LIQUID class-attribute instance-attribute

LIQUID = 1

Single-phase liquid.

BUBBLE class-attribute instance-attribute

BUBBLE = 2

Bubble or distributed flow.

SLUG class-attribute instance-attribute

SLUG = 3

Slug or intermittent flow.

TRANSITION class-attribute instance-attribute

TRANSITION = 4

Transition between slug and mist/annular.

ANNULAR class-attribute instance-attribute

ANNULAR = 5

Mist, segregated or annular flow.

STRATIFIED class-attribute instance-attribute

STRATIFIED = 6

Stratified flow.

GAS class-attribute instance-attribute

GAS = 7

Single-phase gas.

DISPERSED class-attribute instance-attribute

DISPERSED = 8

Dispersed bubble flow.

CHURN class-attribute instance-attribute

CHURN = 9

Churn flow.

FlowState dataclass

FlowState(
    vsl: float,
    vsg: float,
    rho_l: float,
    rho_g: float,
    mu_l: float,
    mu_g: float,
    sigma: float,
    diameter: float,
    roughness: float = 0.0,
    inclination: float = math.pi / 2,
    pressure: float = 101325.0,
    temperature: float = math.nan,
    vso: float | None = None,
    vsw: float | None = None,
    gas_sg: float = math.nan,
    z: float = math.nan,
    gas_liquid_ratio: float = math.nan,
    liquid_sg_standard: float = math.nan,
    upstream: FlowState | None = None,
    downstream: FlowState | None = None,
    segment_length: float = math.nan,
)

Gas-liquid flow conditions at one point (or segment mid-point) of a pipe. SI units.

Attributes:

Name Type Description
vsl, vsg

Superficial liquid and gas velocities, m/s.

rho_l, rho_g

In-situ liquid and gas densities, kg/m³.

mu_l, mu_g

Liquid and gas viscosities, Pa·s.

sigma float

Gas-liquid surface tension, N/m.

diameter float

Pipe inside diameter, m.

roughness float

Absolute pipe roughness, m.

inclination float

Angle from horizontal in the flow direction, rad (+π/2 = vertical upward flow, −π/2 = vertical downward flow).

pressure float

Absolute pressure, Pa.

temperature float

Temperature, K (needed only by a few correlations).

vso, vsw

Superficial oil and water velocities, m/s. Default: all liquid is oil.

gas_sg float

Free-gas specific gravity (air = 1), for correlations that use the gas law.

z float

Gas compressibility factor, for correlations that use the gas law.

gas_liquid_ratio float

Producing gas-liquid ratio at standard conditions, m³/m³ (correlations based on the total mass per stock-tank barrel).

liquid_sg_standard float

Specific gravity of the stock-tank liquid (oil/water mix, water = 1), for the same correlations.

upstream, downstream

States at the two ends of the segment, used by correlations that compute the acceleration term from the change in kinetic energy across a segment.

segment_length float

Length of that segment, m.

area property

area: float

Pipe cross-sectional area, m².

vm property

vm: float

Mixture velocity, m/s.

no_slip_holdup property

no_slip_holdup: float

No-slip liquid holdup (input liquid fraction) λ_L.

rho_ns property

rho_ns: float

No-slip mixture density, kg/m³.

mu_ns property

mu_ns: float

No-slip mixture viscosity, Pa·s.

relative_roughness property

relative_roughness: float

Relative roughness ε/D.

mass_flow_liquid property

mass_flow_liquid: float

In-situ liquid mass flow rate, kg/s.

mass_flow_gas property

mass_flow_gas: float

In-situ gas mass flow rate, kg/s.

GradientResult dataclass

GradientResult(
    friction: float,
    elevation: float,
    acceleration: float,
    holdup: float,
    regime: FlowRegime = FlowRegime.UNKNOWN,
)

Pressure gradient and holdup returned by a flow correlation.

Attributes:

Name Type Description
friction, elevation, acceleration

Components of the pressure loss per unit length in the flow direction, Pa/m.

holdup float

In-situ (slip) liquid volume fraction.

regime FlowRegime

Flow regime identified by the correlation.

total property

total: float

Total pressure loss per unit length, Pa/m.