Class ThreeFluidConservationEquations

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

public class ThreeFluidConservationEquations extends Object implements 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • G

      private static final double G
      Gravitational acceleration (m/s²).
      See Also:
    • geometryCalc

      private GeometryCalculator geometryCalc
      Geometry calculator for stratified flow.
    • wallFriction

      private WallFriction wallFriction
      Wall friction calculator.
    • interfacialFriction

      private InterfacialFriction interfacialFriction
      Interfacial friction calculator.
    • surfaceTemperature

      private double surfaceTemperature
      Surface temperature for heat transfer (K).
    • heatTransferCoefficient

      private double heatTransferCoefficient
      Heat transfer coefficient (W/(m²·K)).
    • enableHeatTransfer

      private boolean enableHeatTransfer
      Enable 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 state
      dPdx - 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 number
      roughness - pipe wall roughness in meters
      diameter - 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 fraction
      alpha2 - phase 2 volume fraction
      rho1 - 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

      public double[] getStateVector(ThreeFluidSection section)
      Get state vector from section (for numerical integrator).
      Parameters:
      section - Three-fluid section
      Returns:
      State vector [gasMass, oilMass, waterMass, gasMom, oilMom, waterMom, energy]
    • setStateVector

      public void setStateVector(ThreeFluidSection section, double[] state)
      Set state vector to section.
      Parameters:
      section - Three-fluid section
      state - 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