Class MultiphasePipe

All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, PipeLineInterface, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface

public class MultiphasePipe extends Pipeline
Multiphase pipe flow simulation model using non-equilibrium two-phase flow.

This class provides a process equipment wrapper around TwoPhasePipeFlowSystem, making it compatible with the standard NeqSim process simulation framework through the PipeLineInterface.

Features

  • Non-equilibrium mass transfer between phases (Krishna-Standart film model)
  • Interphase heat transfer with finite flux corrections
  • Multiple flow patterns: stratified, annular, slug, droplet/mist, bubble
  • Automatic flow pattern detection (optional)
  • Wall heat transfer with insulation and burial conditions
  • Transient simulation capability

Usage Example

// Create a multiphase fluid
SystemInterface fluid = new SystemSrkEos(295.0, 50.0);
fluid.addComponent("methane", 0.8);
fluid.addComponent("ethane", 0.1);
fluid.addComponent("nC10", 0.1);
fluid.createDatabase(true);
fluid.setMixingRule(2);

Stream inlet = new Stream("inlet", fluid);
inlet.setFlowRate(50000, "kg/hr");
inlet.run();

// Create multiphase pipe
MultiphasePipe pipe = new MultiphasePipe("pipeline", inlet);
pipe.setLength(5000.0); // 5 km
pipe.setDiameter(0.2); // 200 mm
pipe.setElevation(100.0); // 100 m rise
pipe.setInsulationType("polyurethane");
pipe.setInsulationThickness(0.05);
pipe.setAmbientTemperature(278.0);
pipe.run();

double pressureDrop = pipe.getPressureDrop();
String flowRegime = pipe.getFlowRegime();
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • flowSystem

      protected TwoPhasePipeFlowSystem flowSystem
      The underlying two-phase pipe flow system.
    • nonEquilibriumMassTransfer

      protected boolean nonEquilibriumMassTransfer
      Whether to use non-equilibrium mass transfer.
    • nonEquilibriumHeatTransfer

      protected boolean nonEquilibriumHeatTransfer
      Whether to use non-equilibrium heat transfer.
    • maxSimulationTime

      protected double maxSimulationTime
      Maximum simulation time for transient simulations in seconds.
    • timeStep

      protected double timeStep
      Time step for transient simulations in seconds.
    • solverType

      protected String solverType
      Solver type for the flow system.
  • Constructor Details

    • MultiphasePipe

      public MultiphasePipe(String name)
      Constructor for MultiphasePipe.
      Parameters:
      name - the equipment name
    • MultiphasePipe

      public MultiphasePipe(String name, StreamInterface inStream)
      Constructor for MultiphasePipe with inlet stream.
      Parameters:
      name - the equipment name
      inStream - the inlet stream
  • Method Details

    • enableNonEquilibriumMassTransfer

      public void enableNonEquilibriumMassTransfer()
      Enable non-equilibrium mass transfer between phases.

      When enabled, mass transfer is calculated using the Krishna-Standart film model, which accounts for finite-rate mass transfer at the gas-liquid interface.

    • disableNonEquilibriumMassTransfer

      public void disableNonEquilibriumMassTransfer()
      Disable non-equilibrium mass transfer (use equilibrium assumption).
    • enableNonEquilibriumHeatTransfer

      public void enableNonEquilibriumHeatTransfer()
      Enable non-equilibrium heat transfer between phases.

      When enabled, interphase heat transfer is calculated with finite flux corrections.

    • disableNonEquilibriumHeatTransfer

      public void disableNonEquilibriumHeatTransfer()
      Disable non-equilibrium heat transfer.
    • setSolverType

      public void setSolverType(String solverType)
      Set the solver type for the flow system.

      Solver types:

      • SIMPLE - Only mass and heat transfer. Fast but no pressure drop.
      • DEFAULT - Momentum, phase fraction, and energy equations.
      • FULL - All equations including composition changes.
      Parameters:
      solverType - the solver type ("SIMPLE", "DEFAULT", or "FULL")
    • getSolverType

      public String getSolverType()
      Get the solver type.
      Returns:
      the solver type
    • setMaxSimulationTime

      public void setMaxSimulationTime(double time)
      Set the maximum simulation time for transient simulations.
      Parameters:
      time - maximum simulation time in seconds
    • getMaxSimulationTime

      public double getMaxSimulationTime()
      Get the maximum simulation time.
      Returns:
      maximum simulation time in seconds
    • setTimeStep

      public void setTimeStep(double dt)
      Set the time step for transient simulations.
      Parameters:
      dt - time step in seconds
    • getTimeStep

      public double getTimeStep()
      Get the time step.
      Returns:
      time step in seconds
    • getFlowSystem

      public TwoPhasePipeFlowSystem getFlowSystem()
      Get the underlying TwoPhasePipeFlowSystem.
      Returns:
      the flow system
    • getPipe

      public FlowSystemInterface getPipe()
      Get the underlying flow system (for advanced models).
      Specified by:
      getPipe in interface PipeLineInterface
      Overrides:
      getPipe in class Pipeline
      Returns:
      flow system interface or null if not applicable
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Specified by:
      run in interface SimulationInterface
      Overrides:
      run in class Pipeline
      Parameters:
      id - UUID
    • configureGeometry

      private void configureGeometry()
      Configure the pipe geometry for the flow system.
    • configureHeatTransfer

      private void configureHeatTransfer()
      Configure heat transfer settings for the flow system.
    • configureSolver

      private void configureSolver()
      Configure the solver based on settings.
    • extractResults

      private void extractResults()
      Extract results from the flow system.
    • createOutletStream

      private void createOutletStream()
      Create the outlet stream from flow system results.
    • runTransient

      public void runTransient(double dt, UUID id)

      runTransient

      This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.
      Specified by:
      runTransient in interface SimulationInterface
      Overrides:
      runTransient in class Pipeline
      Parameters:
      dt - Delta time [s]
      id - Calculation identifier
    • getPressureProfile

      public double[] getPressureProfile()
      Get the pressure profile along the pipe.
      Specified by:
      getPressureProfile in interface PipeLineInterface
      Overrides:
      getPressureProfile in class Pipeline
      Returns:
      array of pressures in bar at each increment
    • getTemperatureProfile

      public double[] getTemperatureProfile()
      Get the temperature profile along the pipe.
      Specified by:
      getTemperatureProfile in interface PipeLineInterface
      Overrides:
      getTemperatureProfile in class Pipeline
      Returns:
      array of temperatures in Kelvin at each increment
    • getLiquidHoldupProfile

      public double[] getLiquidHoldupProfile()
      Get the liquid holdup profile along the pipe.
      Specified by:
      getLiquidHoldupProfile in interface PipeLineInterface
      Overrides:
      getLiquidHoldupProfile in class Pipeline
      Returns:
      array of liquid holdup values at each increment
    • getFlowRegime

      public String getFlowRegime()
      Get the determined flow regime.
      Specified by:
      getFlowRegime in interface PipeLineInterface
      Overrides:
      getFlowRegime in class Pipeline
      Returns:
      flow regime as string (e.g., "stratified", "slug", "annular", "dispersed bubble")
    • getVelocity

      public double getVelocity()
      Get the flow velocity in the pipe.
      Specified by:
      getVelocity in interface PipeLineInterface
      Overrides:
      getVelocity in class Pipeline
      Returns:
      velocity in m/s