Class DriftFluxModel

java.lang.Object
neqsim.process.equipment.pipeline.twophasepipe.DriftFluxModel
All Implemented Interfaces:
Serializable

public class DriftFluxModel extends Object implements Serializable
Drift-flux model for two-phase pipe flow.

Implements the drift-flux model equations for calculating slip between phases, pressure drop, and holdup. The model uses flow-regime-dependent closure relations.

Key equations:

  • v_G = C_0 * v_m + v_d (drift-flux relation)
  • C_0 = distribution coefficient (1.0 - 1.5 typically)
  • v_d = drift velocity (depends on flow regime)

References:

  • Zuber, N. and Findlay, J.A. (1965) - Average Volumetric Concentration in Two-Phase Flow Systems
  • Bendiksen, K.H. (1984) - An Experimental Investigation of the Motion of Long Bubbles in Inclined Tubes
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

  • Constructor Details

    • DriftFluxModel

      public DriftFluxModel()
  • Method Details

    • calculateDriftFlux

      public DriftFluxModel.DriftFluxParameters calculateDriftFlux(PipeSection section)
      Calculate drift-flux parameters for a section.
      Parameters:
      section - Pipe section with current state
      Returns:
      Drift-flux parameters
    • calculateBubbleFlowParameters

      private void calculateBubbleFlowParameters(DriftFluxModel.DriftFluxParameters params, double U_M, double D, double theta, double rho_L, double rho_G, double sigma)
      Calculate parameters for bubble flow.
      Parameters:
      params - output structure for drift-flux parameters
      U_M - mixture velocity [m/s]
      D - pipe diameter [m]
      theta - pipe inclination [rad]
      rho_L - liquid density [kg/m³]
      rho_G - gas density [kg/m³]
      sigma - surface tension [N/m]
    • calculateSlugFlowParameters

      private void calculateSlugFlowParameters(DriftFluxModel.DriftFluxParameters params, double U_M, double D, double theta, double rho_L, double rho_G, double sigma, double mu_L)
      Calculate parameters for slug flow.

      Uses Bendiksen (1984) correlation for Taylor bubble velocity.

      Parameters:
      params - output structure for drift-flux parameters
      U_M - mixture velocity [m/s]
      D - pipe diameter [m]
      theta - pipe inclination [rad]
      rho_L - liquid density [kg/m³]
      rho_G - gas density [kg/m³]
      sigma - surface tension [N/m]
      mu_L - liquid viscosity [Pa.s]
    • calculateAnnularFlowParameters

      private void calculateAnnularFlowParameters(DriftFluxModel.DriftFluxParameters params, double U_M, double D, double theta, double rho_L, double rho_G, double sigma)
      Calculate parameters for annular flow.
      Parameters:
      params - drift flux parameters to be calculated
      U_M - mixture velocity
      D - pipe diameter
      theta - pipe inclination angle
      rho_L - liquid density
      rho_G - gas density
      sigma - surface tension
    • calculateStratifiedFlowParameters

      private void calculateStratifiedFlowParameters(DriftFluxModel.DriftFluxParameters params, double U_SL, double U_SG, double D, double theta, double rho_L, double rho_G, double mu_L)
      Calculate parameters for stratified flow.

      Stratified flow doesn't follow simple drift-flux; use momentum balance.

      Parameters:
      params - drift flux parameters to be calculated
      U_SL - superficial liquid velocity
      U_SG - superficial gas velocity
      D - pipe diameter
      theta - pipe inclination angle
      rho_L - liquid density
      rho_G - gas density
      mu_L - liquid viscosity
    • estimateStratifiedLevel

      private double estimateStratifiedLevel(double U_SL, double U_SG, double D, double theta, double rho_L, double rho_G, double mu_L)
      Estimate liquid level in stratified flow.
      Parameters:
      U_SL - superficial liquid velocity (m/s)
      U_SG - superficial gas velocity (m/s)
      D - pipe diameter (m)
      theta - pipe inclination angle (rad)
      rho_L - liquid density (kg/m³)
      rho_G - gas density (kg/m³)
      mu_L - liquid viscosity (Pa·s)
      Returns:
      liquid level height (m)
    • calculateHoldupFromLevel

      private double calculateHoldupFromLevel(double h, double D)
      Calculate holdup from liquid level in circular pipe.
      Parameters:
      h - liquid level height (m)
      D - pipe diameter (m)
      Returns:
      liquid holdup fraction (0-1)
    • calculatePressureGradient

      public double calculatePressureGradient(PipeSection section, DriftFluxModel.DriftFluxParameters params)
      Calculate pressure gradient for drift-flux model.
      Parameters:
      section - Pipe section
      params - Drift-flux parameters
      Returns:
      Total pressure gradient (Pa/m), negative means pressure decreases in flow direction
    • calculateFrictionGradient

      private double calculateFrictionGradient(PipeSection section, DriftFluxModel.DriftFluxParameters params, double roughness)
      Calculate friction pressure gradient.
      Parameters:
      section - pipe section with flow properties
      params - drift-flux model parameters
      roughness - pipe wall roughness (m)
      Returns:
      friction pressure gradient (Pa/m)
    • calculateSinglePhaseGasFriction

      private double calculateSinglePhaseGasFriction(PipeSection section, double roughness)
      Calculate friction for single-phase gas flow.
      Parameters:
      section - pipe section with gas properties
      roughness - pipe wall roughness (m)
      Returns:
      friction factor
    • calculateSinglePhaseLiquidFriction

      private double calculateSinglePhaseLiquidFriction(PipeSection section, double roughness)
      Calculate friction for single-phase liquid flow.
      Parameters:
      section - pipe section with liquid properties
      roughness - pipe wall roughness (m)
      Returns:
      friction factor
    • calculateHomogeneousFriction

      private double calculateHomogeneousFriction(PipeSection section, DriftFluxModel.DriftFluxParameters params, double roughness)
      Calculate friction for homogeneous model (bubble, slug, dispersed).
      Parameters:
      section - Pipe section
      params - Drift-flux parameters
      roughness - Pipe roughness (m)
      Returns:
      Friction factor
    • calculateStratifiedFriction

      private double calculateStratifiedFriction(PipeSection section, DriftFluxModel.DriftFluxParameters params, double roughness)
      Calculate friction for stratified flow (two-fluid approach).
      Parameters:
      section - Pipe section
      params - Drift-flux parameters
      roughness - Pipe roughness (m)
      Returns:
      Friction factor
    • calculateAnnularFriction

      private double calculateAnnularFriction(PipeSection section, DriftFluxModel.DriftFluxParameters params, double roughness)
      Calculate friction for annular model.
      Parameters:
      section - Pipe section
      params - Drift-flux parameters
      roughness - Pipe roughness (m)
      Returns:
      Friction factor
    • calcFrictionFactor

      private double calcFrictionFactor(double Re, double roughness, double D)
      Calculate Darcy friction factor using Haaland correlation.
      Parameters:
      Re - Reynolds number
      roughness - pipe roughness [m]
      D - pipe diameter [m]
      Returns:
      Darcy friction factor
    • calculateEnergyEquation

      public DriftFluxModel.EnergyEquationResult calculateEnergyEquation(PipeSection section, DriftFluxModel.DriftFluxParameters params, double dt, double dx, double ambientTemperature, double overallHeatTransferCoeff, double jouleThomsonCoeff)
      Calculate temperature change in fluid flow using the energy equation.

      The energy equation for steady-state pipe flow is:

      ṁ·Cp·dT/dx = Q̇_wall + Q̇_friction - ṁ·μ_JT·Cp·dP/dx - ṁ·g·sin(θ)·dz/dx
      

      Where:

      • Q̇_wall = U·A·(T_ambient - T_fluid) - heat transfer to/from surroundings
      • Q̇_friction = |dP/dx|_friction · Q_vol - viscous dissipation heating
      • μ_JT = Joule-Thomson coefficient (K/Pa)
      • dP/dx = pressure gradient (Pa/m)

      For multiphase flow, mixture properties are used with appropriate averaging.

      Parameters:
      section - Current pipe section with fluid state
      params - Drift-flux parameters from calculateDriftFlux
      dt - Time step (s)
      dx - Spatial step (m)
      ambientTemperature - Ambient temperature (K)
      overallHeatTransferCoeff - Overall heat transfer coefficient U (W/(m²·K))
      jouleThomsonCoeff - Joule-Thomson coefficient (K/Pa), typically ~2e-6 for gas
      Returns:
      EnergyEquationResult containing temperature change components
    • calculateSteadyStateTemperature

      public double calculateSteadyStateTemperature(PipeSection section, double upstreamTemperature, double dx, double ambientTemperature, double overallHeatTransferCoeff, double massFlowRate, double jouleThomsonCoeff)
      Simplified energy equation for steady-state temperature profile calculation.

      This method calculates the temperature at each section by marching from inlet to outlet, considering:

      • Heat loss to surroundings (dominant effect for subsea/buried pipelines)
      • Joule-Thomson cooling for gas-dominated flow
      • Friction heating (usually small)
      Parameters:
      section - Pipe section
      upstreamTemperature - Temperature at upstream section (K)
      dx - Distance from upstream section (m)
      ambientTemperature - Ambient temperature (K)
      overallHeatTransferCoeff - Heat transfer coefficient U (W/(m²·K))
      massFlowRate - Mass flow rate (kg/s)
      jouleThomsonCoeff - Joule-Thomson coefficient (K/Pa)
      Returns:
      New temperature at this section (K)
    • estimateJouleThomsonCoefficient

      public double estimateJouleThomsonCoefficient(double temperature, double pressure, double gasMolWeight)
      Estimate Joule-Thomson coefficient for natural gas.

      For ideal gas, μ_JT = 0. For real gases, typical values are:

      • Methane at 300K, 50 bar: ~4.5e-6 K/Pa (0.45 K/MPa)
      • Natural gas mixture: 2-6e-6 K/Pa depending on composition
      • Liquids: typically very small (~1e-8 K/Pa)
      Parameters:
      temperature - Temperature (K)
      pressure - Pressure (Pa)
      gasMolWeight - Gas molecular weight (g/mol)
      Returns:
      Estimated Joule-Thomson coefficient (K/Pa)
    • calculateMixtureHeatCapacity

      public double calculateMixtureHeatCapacity(PipeSection section, DriftFluxModel.DriftFluxParameters params, double Cp_gas, double Cp_liquid)
      Calculate mixture heat capacity for two-phase flow.

      Uses mass-weighted average of phase heat capacities.

      Parameters:
      section - Pipe section with phase properties
      params - Drift-flux parameters
      Cp_gas - Gas heat capacity (J/(kg·K))
      Cp_liquid - Liquid heat capacity (J/(kg·K))
      Returns:
      Mixture heat capacity (J/(kg·K))