Class FlowRegimeDetector
- All Implemented Interfaces:
Serializable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFlow regime detection method. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleDefault interfacial tension for gas-oil systems [N/m].private static final doubleDefault interfacial tension for gas-water systems [N/m].private static final doubleDefault interfacial tension for oil-water systems [N/m].Current detection method.private DriftFluxModelDrift flux model for slip calculations.private static final doubleprivate static final doubleprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate doublecalcBubbleRiseVelocity(double D, double rho_L, double rho_G, double sigma) Calculate bubble rise velocity using Harmathy correlation.private doublecalcFroudeNumber(double U_SG, double D, double rho_L, double rho_G) Calculate modified Froude number.private doublecalcKelvinHelmholtzParameter(double U_SG, double D, double rho_L, double rho_G, double sigma) Calculate Kelvin-Helmholtz stability parameter.private doublecalcMartinelliParameter(double U_SL, double U_SG, double D, double rho_L, double rho_G, double mu_L, double sigma) Calculate Martinelli parameter X.private doublecalcTurbulenceParameter(double U_SL, double D, double rho_L, double rho_G, double mu_L) Calculate turbulence parameter T.detectFlowRegime(PipeSection section) Detect flow regime for a pipe section.private PipeSection.FlowRegimedetectFlowRegimeByMinimumSlip(PipeSection section) Detect flow regime using minimum slip criterion.private PipeSection.FlowRegimedetectHorizontalFlowRegime(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.private PipeSection.FlowRegimedetectInclinedFlowRegime(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).private doubleestimateStratifiedLiquidLevel(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.Get the current detection method.private DriftFluxModelGet or create drift flux model for slip calculations.getFlowRegimeMap(PipeSection section, double U_SL_max, double U_SG_max, int resolution) Get flow regime transition map for visualization/debugging.private booleanisAnnularFlow(double U_SL, double U_SG, double D, double rho_L, double rho_G, double sigma) Check if flow is in annular regime.private booleanisDispersedBubble(double U_SL, double U_SG, double D, double rho_L, double rho_G, double sigma) Check if flow is in dispersed bubble regime.private booleanisKelvinHelmholtzUnstable(double U_SG, double h_L, double D, double rho_L, double rho_G) Check Kelvin-Helmholtz instability for slug transition.booleanCheck if minimum slip criterion is used for flow regime detection.private booleanisWavyTransition(double U_SG, double h_L, double D, double rho_L, double rho_G, double mu_L) Check transition from smooth to wavy stratified.voidSet the detection method for flow regime identification.voidsetUseMinimumSlipCriterion(boolean useMinimumSlip) Enable or disable minimum slip criterion for flow regime detection.
-
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
Current detection method. -
driftFluxModel
Drift flux model for slip calculations. -
DEFAULT_GAS_OIL_IFT
private static final double DEFAULT_GAS_OIL_IFTDefault 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_IFTDefault 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_IFTDefault 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
Get the current detection method.- Returns:
- detection method
-
setDetectionMethod
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
Get or create drift flux model for slip calculations.- Returns:
- the drift flux model instance
-
detectFlowRegime
Detect flow regime for a pipe section.- Parameters:
section- The pipe section with current state- Returns:
- Detected flow regime
-
detectFlowRegimeByMinimumSlip
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 velocityh_L- liquid heightD- pipe diameterrho_L- liquid densityrho_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 velocityh_L- liquid heightD- pipe diameterrho_L- liquid densityrho_G- gas densitymu_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 propertiesU_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
-