Class FlowRegimeDetector

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

public class FlowRegimeDetector extends Object implements Serializable
Mechanistic flow regime detector based on Taitel-Dukler and Barnea models.

Determines the flow pattern in two-phase pipe flow based on local conditions including fluid properties, velocities, pipe geometry and inclination.

Supports two detection methods:

  • MECHANISTIC: Uses Taitel-Dukler (1976) and Barnea (1987) transition criteria
  • MINIMUM_SLIP: Selects flow regime with minimum slip ratio (closest to homogeneous)

References:

  • Taitel, Y. and Dukler, A.E. (1976) - A Model for Predicting Flow Regime Transitions in Horizontal and Near Horizontal Gas-Liquid Flow
  • Barnea, D. (1987) - A Unified Model for Predicting Flow-Pattern Transitions for the Whole Range of Pipe Inclinations
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • GRAVITY

      private static final double GRAVITY
      See Also:
    • PI

      private static final double PI
      See Also:
    • detectionMethod

      private FlowRegimeDetector.DetectionMethod detectionMethod
      Current detection method.
    • driftFluxModel

      private transient DriftFluxModel driftFluxModel
      Drift flux model for slip calculations.
    • DEFAULT_GAS_OIL_IFT

      private static final double DEFAULT_GAS_OIL_IFT
      Default interfacial tension for gas-oil systems [N/m]. Typical values: 0.015-0.030 N/m for hydrocarbon systems.
      See Also:
    • DEFAULT_GAS_WATER_IFT

      private static final double DEFAULT_GAS_WATER_IFT
      Default interfacial tension for gas-water systems [N/m]. Typical value: ~0.072 N/m at 25°C.
      See Also:
    • DEFAULT_OIL_WATER_IFT

      private static final double DEFAULT_OIL_WATER_IFT
      Default interfacial tension for oil-water systems [N/m]. Typical values: 0.020-0.050 N/m depending on oil type.
      See Also:
  • Constructor Details

    • FlowRegimeDetector

      public FlowRegimeDetector()
  • Method Details

    • getDetectionMethod

      public FlowRegimeDetector.DetectionMethod getDetectionMethod()
      Get the current detection method.
      Returns:
      detection method
    • setDetectionMethod

      public void setDetectionMethod(FlowRegimeDetector.DetectionMethod method)
      Set the detection method for flow regime identification.
      Parameters:
      method - detection method to use
    • isUseMinimumSlipCriterion

      public boolean isUseMinimumSlipCriterion()
      Check if minimum slip criterion is used for flow regime detection.
      Returns:
      true if minimum slip criterion is used
    • setUseMinimumSlipCriterion

      public void setUseMinimumSlipCriterion(boolean useMinimumSlip)
      Enable or disable minimum slip criterion for flow regime detection.

      When enabled, the detector calculates the slip ratio for each feasible flow regime and selects the one with minimum slip (closest to 1). This approach assumes the physical system naturally tends toward the flow pattern with minimum phase velocity difference.

      Parameters:
      useMinimumSlip - true to use minimum slip criterion, false for mechanistic approach
    • getDriftFluxModel

      private DriftFluxModel getDriftFluxModel()
      Get or create drift flux model for slip calculations.
      Returns:
      the drift flux model instance
    • detectFlowRegime

      public PipeSection.FlowRegime detectFlowRegime(PipeSection section)
      Detect flow regime for a pipe section.
      Parameters:
      section - The pipe section with current state
      Returns:
      Detected flow regime
    • detectFlowRegimeByMinimumSlip

      private PipeSection.FlowRegime detectFlowRegimeByMinimumSlip(PipeSection section)
      Detect flow regime using minimum slip criterion.

      Calculates the slip ratio for each feasible flow regime and selects the one with the minimum slip (closest to 1). This approach is based on the principle that the physical system tends toward the flow pattern with minimum phase velocity difference.

      Parameters:
      section - Pipe section with current state
      Returns:
      Flow regime with minimum slip
    • detectHorizontalFlowRegime

      private PipeSection.FlowRegime detectHorizontalFlowRegime(double U_SL, double U_SG, double D, double theta, double rho_L, double rho_G, double mu_L, double sigma)
      Detect flow regime for horizontal or near-horizontal pipes.

      Uses Taitel-Dukler (1976) flow regime map.

      Parameters:
      U_SL - Superficial liquid velocity (m/s)
      U_SG - Superficial gas velocity (m/s)
      D - Diameter (m)
      theta - Inclination (radians)
      rho_L - Liquid density (kg/m³)
      rho_G - Gas density (kg/m³)
      mu_L - Liquid viscosity (Pa·s)
      sigma - Surface tension (N/m)
      Returns:
      Flow regime
    • detectInclinedFlowRegime

      private PipeSection.FlowRegime detectInclinedFlowRegime(double U_SL, double U_SG, double D, double theta, double rho_L, double rho_G, double mu_L, double sigma)
      Detect flow regime for inclined pipes (upward or downward).

      Uses Barnea (1987) unified model.

      Parameters:
      U_SL - Superficial liquid velocity (m/s)
      U_SG - Superficial gas velocity (m/s)
      D - Diameter (m)
      theta - Inclination (radians, positive = upward)
      rho_L - Liquid density (kg/m³)
      rho_G - Gas density (kg/m³)
      mu_L - Liquid viscosity (Pa·s)
      sigma - Surface tension (N/m)
      Returns:
      Flow regime
    • calcMartinelliParameter

      private double calcMartinelliParameter(double U_SL, double U_SG, double D, double rho_L, double rho_G, double mu_L, double sigma)
      Calculate Martinelli parameter X.
      Parameters:
      U_SL - superficial liquid velocity [m/s]
      U_SG - superficial gas velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m³]
      rho_G - gas density [kg/m³]
      mu_L - liquid viscosity [Pa·s]
      sigma - surface tension [N/m]
      Returns:
      Martinelli parameter X
    • calcFroudeNumber

      private double calcFroudeNumber(double U_SG, double D, double rho_L, double rho_G)
      Calculate modified Froude number.
      Parameters:
      U_SG - superficial gas velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m3]
      rho_G - gas density [kg/m3]
      Returns:
      modified Froude number [-]
    • calcKelvinHelmholtzParameter

      private double calcKelvinHelmholtzParameter(double U_SG, double D, double rho_L, double rho_G, double sigma)
      Calculate Kelvin-Helmholtz stability parameter.
      Parameters:
      U_SG - superficial gas velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m3]
      rho_G - gas density [kg/m3]
      sigma - interfacial tension [N/m]
      Returns:
      Kelvin-Helmholtz parameter [-]
    • calcTurbulenceParameter

      private double calcTurbulenceParameter(double U_SL, double D, double rho_L, double rho_G, double mu_L)
      Calculate turbulence parameter T.
      Parameters:
      U_SL - superficial liquid velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m3]
      rho_G - gas density [kg/m3]
      mu_L - liquid viscosity [Pa.s]
      Returns:
      turbulence parameter T [-]
    • isDispersedBubble

      private boolean isDispersedBubble(double U_SL, double U_SG, double D, double rho_L, double rho_G, double sigma)
      Check if flow is in dispersed bubble regime.
      Parameters:
      U_SL - superficial liquid velocity [m/s]
      U_SG - superficial gas velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m³]
      rho_G - gas density [kg/m³]
      sigma - surface tension [N/m]
      Returns:
      true if flow is in dispersed bubble regime
    • isAnnularFlow

      private boolean isAnnularFlow(double U_SL, double U_SG, double D, double rho_L, double rho_G, double sigma)
      Check if flow is in annular regime.

      Uses Taitel-Dukler (1976) criterion for annular flow transition. The critical gas velocity is based on the balance between aerodynamic lift and gravity forces on the liquid film.

      Parameters:
      U_SL - superficial liquid velocity [m/s]
      U_SG - superficial gas velocity [m/s]
      D - pipe diameter [m]
      rho_L - liquid density [kg/m³]
      rho_G - gas density [kg/m³]
      sigma - surface tension [N/m]
      Returns:
      true if flow is in annular regime
    • estimateStratifiedLiquidLevel

      private double estimateStratifiedLiquidLevel(double U_SL, double U_SG, double D, double rho_L, double rho_G, double mu_L, double theta)
      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]
      rho_L - liquid density [kg/m3]
      rho_G - gas density [kg/m3]
      mu_L - liquid viscosity [Pa.s]
      theta - pipe inclination angle [rad]
      Returns:
      estimated liquid level [m]
    • isKelvinHelmholtzUnstable

      private boolean isKelvinHelmholtzUnstable(double U_SG, double h_L, double D, double rho_L, double rho_G)
      Check Kelvin-Helmholtz instability for slug transition.
      Parameters:
      U_SG - superficial gas velocity
      h_L - liquid height
      D - pipe diameter
      rho_L - liquid density
      rho_G - gas density
      Returns:
      true if Kelvin-Helmholtz unstable condition exists
    • isWavyTransition

      private boolean isWavyTransition(double U_SG, double h_L, double D, double rho_L, double rho_G, double mu_L)
      Check transition from smooth to wavy stratified.
      Parameters:
      U_SG - superficial gas velocity
      h_L - liquid height
      D - pipe diameter
      rho_L - liquid density
      rho_G - gas density
      mu_L - liquid viscosity
      Returns:
      true if transition from smooth to wavy stratified occurs
    • calcBubbleRiseVelocity

      private double calcBubbleRiseVelocity(double D, double rho_L, double rho_G, double sigma)
      Calculate bubble rise velocity using Harmathy correlation.
      Parameters:
      D - pipe diameter (m)
      rho_L - liquid density (kg/m³)
      rho_G - gas density (kg/m³)
      sigma - surface tension (N/m)
      Returns:
      bubble rise velocity (m/s)
    • getFlowRegimeMap

      public PipeSection.FlowRegime[][] getFlowRegimeMap(PipeSection section, double U_SL_max, double U_SG_max, int resolution)
      Get flow regime transition map for visualization/debugging.
      Parameters:
      section - Pipe section with fluid properties
      U_SL_max - Maximum superficial liquid velocity (m/s)
      U_SG_max - Maximum superficial gas velocity (m/s)
      resolution - Grid resolution
      Returns:
      2D array of flow regimes