Class ThreeFluidConservationEquations
java.lang.Object
neqsim.process.equipment.pipeline.twophasepipe.ThreeFluidConservationEquations
- All Implemented Interfaces:
Serializable
Conservation equations for three-fluid (gas-oil-water) pipe flow model.
Extends the two-fluid model to include water as a third phase. The model solves 7 coupled PDEs:
- Gas mass conservation
- Oil mass conservation
- Water mass conservation
- Gas momentum conservation
- Oil momentum conservation
- Water momentum conservation
- Mixture energy conservation
Momentum Source Terms
Each phase has:- Pressure gradient: -A_k ∂P/∂x
- Wall friction: -τ_wk S_wk
- Interfacial friction: ±τ_i S_i
- Gravity: -ρ_k g sin(θ) A_k
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classResult container for three-fluid RHS calculation. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanEnable heat transfer from surroundings.private static final doubleGravitational acceleration (m/s²).private GeometryCalculatorGeometry calculator for stratified flow.private doubleHeat transfer coefficient (W/(m²·K)).private InterfacialFrictionInterfacial friction calculator.private static final longprivate doubleSurface temperature for heat transfer (K).private WallFrictionWall friction calculator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcRHS(ThreeFluidSection section, double dPdx, ThreeFluidSection upstreamSection, ThreeFluidSection downstreamSection) Calculate RHS of conservation equations for a three-fluid section.private doublecalculateFrictionFactor(double re, double roughness, double diameter) Calculate Colebrook-White friction factor.private doublecalculateInterfacialFrictionFactor(double alpha1, double alpha2, double rho1, double rho2, double relVel, double diameter, double surfaceTension) Calculate interfacial friction factor.doubleGet heat transfer coefficient.double[]getStateVector(ThreeFluidSection section) Get state vector from section (for numerical integrator).doubleGet surface temperature.booleanCheck if heat transfer is enabled.voidsetEnableHeatTransfer(boolean enable) Enable or disable heat transfer modeling.voidsetHeatTransferCoefficient(double coefficient) Set heat transfer coefficient.voidsetStateVector(ThreeFluidSection section, double[] state) Set state vector to section.voidsetSurfaceTemperature(double temperature) Set surface temperature for heat transfer calculations.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
G
private static final double GGravitational acceleration (m/s²).- See Also:
-
geometryCalc
Geometry calculator for stratified flow. -
wallFriction
Wall friction calculator. -
interfacialFriction
Interfacial friction calculator. -
surfaceTemperature
private double surfaceTemperatureSurface temperature for heat transfer (K). -
heatTransferCoefficient
private double heatTransferCoefficientHeat transfer coefficient (W/(m²·K)). -
enableHeatTransfer
private boolean enableHeatTransferEnable heat transfer from surroundings.
-
-
Constructor Details
-
ThreeFluidConservationEquations
public ThreeFluidConservationEquations()Default constructor.
-
-
Method Details
-
calcRHS
public ThreeFluidConservationEquations.ThreeFluidRHS calcRHS(ThreeFluidSection section, double dPdx, ThreeFluidSection upstreamSection, ThreeFluidSection downstreamSection) Calculate RHS of conservation equations for a three-fluid section.- Parameters:
section- Current section statedPdx- Pressure gradient (Pa/m)upstreamSection- Upstream section (for fluxes)downstreamSection- Downstream section (for fluxes)- Returns:
- ThreeFluidRHS with all source terms
-
calculateFrictionFactor
private double calculateFrictionFactor(double re, double roughness, double diameter) Calculate Colebrook-White friction factor.- Parameters:
re- Reynolds numberroughness- pipe wall roughness in metersdiameter- pipe inner diameter in meters- Returns:
- Fanning friction factor
-
calculateInterfacialFrictionFactor
private double calculateInterfacialFrictionFactor(double alpha1, double alpha2, double rho1, double rho2, double relVel, double diameter, double surfaceTension) Calculate interfacial friction factor.Uses a simplified model based on relative velocity and density ratio.
- Parameters:
alpha1- phase 1 volume fractionalpha2- phase 2 volume fractionrho1- phase 1 density (kg/m³)rho2- phase 2 density (kg/m³)relVel- relative velocity between phases (m/s)diameter- pipe diameter (m)surfaceTension- surface tension (N/m)- Returns:
- interfacial friction factor (dimensionless)
-
getStateVector
Get state vector from section (for numerical integrator).- Parameters:
section- Three-fluid section- Returns:
- State vector [gasMass, oilMass, waterMass, gasMom, oilMom, waterMom, energy]
-
setStateVector
Set state vector to section.- Parameters:
section- Three-fluid sectionstate- State vector [gasMass, oilMass, waterMass, gasMom, oilMom, waterMom, energy]
-
setSurfaceTemperature
public void setSurfaceTemperature(double temperature) Set surface temperature for heat transfer calculations.- Parameters:
temperature- Surface temperature [K]
-
getSurfaceTemperature
public double getSurfaceTemperature()Get surface temperature.- Returns:
- Surface temperature [K]
-
setHeatTransferCoefficient
public void setHeatTransferCoefficient(double coefficient) Set heat transfer coefficient.- Parameters:
coefficient- Heat transfer coefficient [W/(m²·K)]
-
getHeatTransferCoefficient
public double getHeatTransferCoefficient()Get heat transfer coefficient.- Returns:
- Heat transfer coefficient [W/(m²·K)]
-
setEnableHeatTransfer
public void setEnableHeatTransfer(boolean enable) Enable or disable heat transfer modeling.- Parameters:
enable- true to enable heat transfer
-
isEnableHeatTransfer
public boolean isEnableHeatTransfer()Check if heat transfer is enabled.- Returns:
- true if heat transfer is enabled
-