Interface PipeLineInterface

All Superinterfaces:
NamedInterface, Runnable, Serializable, SimulationInterface, TwoPortInterface
All Known Implementing Classes:
AdiabaticPipe, AdiabaticTwoPhasePipe, IncompressiblePipeFlow, MultiphasePipe, OnePhasePipeLine, PipeBeggsAndBrills, Pipeline, Riser, SimpleTPoutPipeline, TopsidePiping, TransientPipe, TubingPerformance, TwoFluidPipe, TwoPhasePipeLine, WaterHammerPipe

public interface PipeLineInterface extends SimulationInterface, TwoPortInterface
Common interface for all pipeline simulation models.

This interface defines the standard methods that all pipeline models must implement, providing a unified API for pipeline simulation regardless of the underlying physical model (single-phase, two-phase, Beggs-Brill, two-fluid, etc.).

Pipeline Model Categories

Common Usage Pattern

// All pipeline models share these common methods
PipeLineInterface pipe = new PipeBeggsAndBrills("pipeline", inletStream);
pipe.setLength(5000.0); // 5 km
pipe.setDiameter(0.2); // 200 mm
pipe.setElevation(100.0); // 100 m rise
pipe.setPipeWallRoughness(4.6e-5); // 46 microns
pipe.run();

double pressureDrop = pipe.getPressureDrop();
double outletPressure = pipe.getOutletPressure("bara");
String flowRegime = pipe.getFlowRegime();
Version:
2.0
Author:
Even Solbraa
  • Method Details

    • setLength

      void setLength(double length)
      Set the total pipe length.
      Parameters:
      length - the pipe length in meters
    • getLength

      double getLength()
      Get the total pipe length.
      Returns:
      the pipe length in meters
    • setDiameter

      void setDiameter(double diameter)
      Set the pipe inner diameter.
      Parameters:
      diameter - the inner diameter in meters
    • getDiameter

      double getDiameter()
      Get the pipe inner diameter.
      Returns:
      the inner diameter in meters
    • setPipeWallRoughness

      void setPipeWallRoughness(double roughness)
      Set the pipe wall roughness.
      Parameters:
      roughness - the wall roughness in meters
    • getPipeWallRoughness

      double getPipeWallRoughness()
      Get the pipe wall roughness.
      Returns:
      the wall roughness in meters
    • setElevation

      void setElevation(double elevation)
      Set the elevation change from inlet to outlet.
      Parameters:
      elevation - elevation change in meters (positive = uphill)
    • getElevation

      double getElevation()
      Get the elevation change from inlet to outlet.
      Returns:
      elevation change in meters
    • setInletElevation

      void setInletElevation(double inletElevation)
      Set the inlet elevation above reference.
      Parameters:
      inletElevation - inlet elevation in meters
    • getInletElevation

      double getInletElevation()
      Get the inlet elevation above reference.
      Returns:
      inlet elevation in meters
    • setOutletElevation

      void setOutletElevation(double outletElevation)
      Set the outlet elevation above reference.
      Parameters:
      outletElevation - outlet elevation in meters
    • getOutletElevation

      double getOutletElevation()
      Get the outlet elevation above reference.
      Returns:
      outlet elevation in meters
    • setNumberOfLegs

      void setNumberOfLegs(int number)
      Set number of pipe legs/segments.
      Parameters:
      number - number of legs
    • getNumberOfLegs

      int getNumberOfLegs()
      Get number of pipe legs/segments.
      Returns:
      number of legs
    • setHeightProfile

      void setHeightProfile(double[] heights)
      Set the height profile along the pipe.
      Parameters:
      heights - array of heights at each leg boundary (length = numberOfLegs + 1)
    • setLegPositions

      void setLegPositions(double[] positions)
      Set the position of each leg along the pipe.
      Parameters:
      positions - array of positions at each leg boundary in meters
    • setPipeDiameters

      void setPipeDiameters(double[] diameters)
      Set pipe diameters for each segment.
      Parameters:
      diameters - array of diameters for each leg boundary
    • setPipeWallRoughness

      void setPipeWallRoughness(double[] roughness)
      Set wall roughness for each segment.
      Parameters:
      roughness - array of roughness values for each leg
    • setOuterTemperatures

      void setOuterTemperatures(double[] outerTemperatures)
      Set outer temperatures for heat transfer calculations.
      Parameters:
      outerTemperatures - array of outer temperatures in Kelvin for each leg
    • setNumberOfNodesInLeg

      void setNumberOfNodesInLeg(int number)
      Set number of computational nodes in each leg.
      Parameters:
      number - number of nodes per leg
    • setNumberOfIncrements

      void setNumberOfIncrements(int numberOfIncrements)
      Set number of computational increments/segments.
      Parameters:
      numberOfIncrements - number of increments for pressure drop calculation
    • getNumberOfIncrements

      int getNumberOfIncrements()
      Get number of computational increments/segments.
      Returns:
      number of increments
    • setOutletPressure

      void setOutletPressure(double pressure)
      Set the outlet pressure for flow rate calculation mode.

      When outlet pressure is specified, the pipeline model calculates the required flow rate to achieve the target outlet pressure.

      Specified by:
      setOutletPressure in interface TwoPortInterface
      Parameters:
      pressure - outlet pressure in bara
    • setOutPressure

      @Deprecated default void setOutPressure(double pressure)
      Deprecated.
      Set the outlet pressure for flow rate calculation mode.
      Specified by:
      setOutPressure in interface TwoPortInterface
      Parameters:
      pressure - outlet pressure in bara
    • setOutletTemperature

      void setOutletTemperature(double temperature)
      Set the outlet temperature.
      Specified by:
      setOutletTemperature in interface TwoPortInterface
      Parameters:
      temperature - outlet temperature in Kelvin
    • setOutTemperature

      @Deprecated default void setOutTemperature(double temperature)
      Deprecated.
      Set the outlet temperature.
      Specified by:
      setOutTemperature in interface TwoPortInterface
      Parameters:
      temperature - outlet temperature in Kelvin
    • getPressureDrop

      double getPressureDrop()
      Get the total pressure drop across the pipeline.
      Returns:
      pressure drop in bar
    • getOutletPressure

      double getOutletPressure(String unit)
      Get the outlet pressure.
      Parameters:
      unit - pressure unit (e.g., "bara", "barg", "Pa", "MPa")
      Returns:
      outlet pressure in specified unit
    • getOutletTemperature

      double getOutletTemperature(String unit)
      Get the outlet temperature.
      Parameters:
      unit - temperature unit (e.g., "K", "C")
      Returns:
      outlet temperature in specified unit
    • getVelocity

      double getVelocity()
      Get the flow velocity in the pipe.
      Returns:
      velocity in m/s
    • getSuperficialVelocity

      double getSuperficialVelocity(int phaseNumber)
      Get the superficial velocity for a specific phase.
      Parameters:
      phaseNumber - phase index (0=gas, 1=liquid)
      Returns:
      superficial velocity in m/s
    • getFlowRegime

      String getFlowRegime()
      Get the determined flow regime.
      Returns:
      flow regime as string (e.g., "stratified", "slug", "annular", "dispersed bubble")
    • getLiquidHoldup

      double getLiquidHoldup()
      Get the liquid holdup fraction.
      Returns:
      liquid holdup as fraction (0-1)
    • getReynoldsNumber

      double getReynoldsNumber()
      Get the Reynolds number for the flow.
      Returns:
      Reynolds number (dimensionless)
    • getFrictionFactor

      double getFrictionFactor()
      Get the friction factor.
      Returns:
      Darcy friction factor (dimensionless)
    • getPressureProfile

      double[] getPressureProfile()
      Get the pressure profile along the pipe.
      Returns:
      array of pressures in bar at each increment
    • getTemperatureProfile

      double[] getTemperatureProfile()
      Get the temperature profile along the pipe.
      Returns:
      array of temperatures in Kelvin at each increment
    • getLiquidHoldupProfile

      double[] getLiquidHoldupProfile()
      Get the liquid holdup profile along the pipe.
      Returns:
      array of liquid holdup values at each increment
    • setHeatTransferCoefficient

      void setHeatTransferCoefficient(double coefficient)
      Set the overall heat transfer coefficient.
      Parameters:
      coefficient - heat transfer coefficient in W/(m²·K)
    • getHeatTransferCoefficient

      double getHeatTransferCoefficient()
      Get the overall heat transfer coefficient.
      Returns:
      heat transfer coefficient in W/(m²·K)
    • setConstantSurfaceTemperature

      void setConstantSurfaceTemperature(double temperature)
      Set the constant surface temperature for heat transfer.
      Parameters:
      temperature - surface temperature in Kelvin
    • isAdiabatic

      boolean isAdiabatic()
      Check if the pipe is operating in adiabatic mode.
      Returns:
      true if adiabatic (no heat transfer)
    • setAdiabatic

      void setAdiabatic(boolean adiabatic)
      Set whether the pipe operates in adiabatic mode.
      Parameters:
      adiabatic - true for no heat transfer
    • setOutputFileName

      void setOutputFileName(String name)
      Set output file name for detailed results.
      Parameters:
      name - output file name
    • setInitialFlowPattern

      void setInitialFlowPattern(String flowPattern)
      Set initial flow pattern for simulation initialization.
      Parameters:
      flowPattern - initial flow pattern (e.g., "stratified", "slug")
    • getPipe

      Get the underlying flow system (for advanced models).
      Returns:
      flow system interface or null if not applicable
    • setPipeSpecification

      void setPipeSpecification(double nominalDiameter, String specification)
      Set pipe specification from database.
      Parameters:
      nominalDiameter - nominal diameter in mm or inches
      specification - pipe specification code (e.g., "API 5L", "ANSI B36.10")
    • getWallThickness

      double getWallThickness()
      Get the pipe wall thickness.
      Returns:
      wall thickness in meters
    • setWallThickness

      void setWallThickness(double thickness)
      Set the pipe wall thickness.
      Parameters:
      thickness - wall thickness in meters
    • getAngle

      double getAngle()
      Get the angle of the pipe from horizontal.
      Returns:
      angle in degrees (0 = horizontal, 90 = vertical upward)
    • setAngle

      void setAngle(double angle)
      Set the angle of the pipe from horizontal.
      Parameters:
      angle - angle in degrees (0 = horizontal, 90 = vertical upward)
    • setPipeMaterial

      void setPipeMaterial(String material)
      Set the pipe material.
      Parameters:
      material - pipe material name (e.g., "carbon steel", "stainless steel", "duplex")
    • getPipeMaterial

      String getPipeMaterial()
      Get the pipe material.
      Returns:
      pipe material name
    • setPipeSchedule

      void setPipeSchedule(String schedule)
      Set the pipe schedule.
      Parameters:
      schedule - pipe schedule (e.g., "40", "80", "STD", "XS")
    • getPipeSchedule

      String getPipeSchedule()
      Get the pipe schedule.
      Returns:
      pipe schedule
    • setInsulationThickness

      void setInsulationThickness(double thickness)
      Set the insulation thickness.
      Parameters:
      thickness - insulation thickness in meters
    • getInsulationThickness

      double getInsulationThickness()
      Get the insulation thickness.
      Returns:
      insulation thickness in meters
    • setInsulationConductivity

      void setInsulationConductivity(double conductivity)
      Set the insulation thermal conductivity.
      Parameters:
      conductivity - thermal conductivity in W/(m·K)
    • getInsulationConductivity

      double getInsulationConductivity()
      Get the insulation thermal conductivity.
      Returns:
      thermal conductivity in W/(m·K)
    • setInsulationType

      void setInsulationType(String insulationType)
      Set the insulation type/material.
      Parameters:
      insulationType - insulation type (e.g., "polyurethane", "mineral wool", "aerogel")
    • getInsulationType

      String getInsulationType()
      Get the insulation type/material.
      Returns:
      insulation type
    • setCoatingThickness

      void setCoatingThickness(double thickness)
      Set the coating thickness.
      Parameters:
      thickness - coating thickness in meters
    • getCoatingThickness

      double getCoatingThickness()
      Get the coating thickness.
      Returns:
      coating thickness in meters
    • setCoatingConductivity

      void setCoatingConductivity(double conductivity)
      Set the coating thermal conductivity.
      Parameters:
      conductivity - thermal conductivity in W/(m·K)
    • getCoatingConductivity

      double getCoatingConductivity()
      Get the coating thermal conductivity.
      Returns:
      thermal conductivity in W/(m·K)
    • setPipeWallConductivity

      void setPipeWallConductivity(double conductivity)
      Set the pipe wall thermal conductivity.
      Parameters:
      conductivity - thermal conductivity in W/(m·K)
    • getPipeWallConductivity

      double getPipeWallConductivity()
      Get the pipe wall thermal conductivity.
      Returns:
      thermal conductivity in W/(m·K)
    • setOuterHeatTransferCoefficient

      void setOuterHeatTransferCoefficient(double coefficient)
      Set the outer (external) heat transfer coefficient.

      This is the convective heat transfer coefficient between the pipe outer surface (or insulation outer surface if insulated) and the surrounding environment.

      Typical values:

      • Still air: 5-25 W/(m²·K)
      • Flowing air: 10-100 W/(m²·K)
      • Buried in soil: 1-5 W/(m²·K)
      • Still water: 100-500 W/(m²·K)
      • Flowing seawater: 500-2000 W/(m²·K)
      Parameters:
      coefficient - outer heat transfer coefficient in W/(m²·K)
    • getOuterHeatTransferCoefficient

      double getOuterHeatTransferCoefficient()
      Get the outer (external) heat transfer coefficient.
      Returns:
      outer heat transfer coefficient in W/(m²·K)
    • setInnerHeatTransferCoefficient

      void setInnerHeatTransferCoefficient(double coefficient)
      Set the inner (fluid-side) heat transfer coefficient.

      This is the convective heat transfer coefficient between the fluid and the pipe inner wall. If not set, it can be calculated automatically based on flow conditions.

      Parameters:
      coefficient - inner heat transfer coefficient in W/(m²·K)
    • getInnerHeatTransferCoefficient

      double getInnerHeatTransferCoefficient()
      Get the inner (fluid-side) heat transfer coefficient.
      Returns:
      inner heat transfer coefficient in W/(m²·K)
    • setOuterHeatTransferCoefficients

      void setOuterHeatTransferCoefficients(double[] coefficients)
      Set outer heat transfer coefficients for each pipe segment.
      Parameters:
      coefficients - array of outer heat transfer coefficients in W/(m²·K)
    • setWallHeatTransferCoefficients

      void setWallHeatTransferCoefficients(double[] coefficients)
      Set inner (wall) heat transfer coefficients for each pipe segment.
      Parameters:
      coefficients - array of wall heat transfer coefficients in W/(m²·K)
    • setAmbientTemperatures

      void setAmbientTemperatures(double[] temperatures)
      Set ambient/surrounding temperatures for each pipe segment.
      Parameters:
      temperatures - array of ambient temperatures in Kelvin
    • setAmbientTemperature

      void setAmbientTemperature(double temperature)
      Set the ambient temperature.
      Parameters:
      temperature - ambient temperature in Kelvin
    • getAmbientTemperature

      double getAmbientTemperature()
      Get the ambient temperature.
      Returns:
      ambient temperature in Kelvin
    • calculateOverallHeatTransferCoefficient

      double calculateOverallHeatTransferCoefficient()
      Calculate the overall heat transfer coefficient based on pipe buildup.

      This method calculates the overall U-value considering:

      • Inner fluid-side convection
      • Pipe wall conduction
      • Coating conduction (if present)
      • Insulation conduction (if present)
      • Outer convection

      The calculation uses the resistance analogy for cylindrical geometries.

      Returns:
      overall heat transfer coefficient in W/(m²·K) based on inner diameter
    • setBurialDepth

      void setBurialDepth(double depth)
      Set the burial depth below ground surface.
      Parameters:
      depth - burial depth in meters
    • getBurialDepth

      double getBurialDepth()
      Get the burial depth.
      Returns:
      burial depth in meters
    • setSoilConductivity

      void setSoilConductivity(double conductivity)
      Set the soil thermal conductivity.
      Parameters:
      conductivity - soil thermal conductivity in W/(m·K)
    • getSoilConductivity

      double getSoilConductivity()
      Get the soil thermal conductivity.
      Returns:
      soil thermal conductivity in W/(m·K)
    • isBuried

      boolean isBuried()
      Check if the pipe is buried.
      Returns:
      true if pipe is buried
    • setBuried

      void setBuried(boolean buried)
      Set whether the pipe is buried.
      Parameters:
      buried - true if pipe is buried
    • getMechanicalDesignCalculator

      PipeMechanicalDesignCalculator getMechanicalDesignCalculator()
      Get the mechanical design calculator for this pipeline.

      The calculator provides standards-based calculations for:

      • Wall thickness calculation per ASME B31.3/B31.4/B31.8 or DNV-OS-F101
      • Maximum Allowable Operating Pressure (MAOP)
      • Stress analysis (hoop, longitudinal, von Mises)
      • Test pressure calculation
      Returns:
      mechanical design calculator
    • setDesignPressure

      void setDesignPressure(double pressure)
      Set design pressure for mechanical design calculations.
      Parameters:
      pressure - design pressure in MPa
    • getDesignPressure

      double getDesignPressure()
      Get design pressure.
      Returns:
      design pressure in MPa
    • setDesignPressure

      void setDesignPressure(double pressure, String unit)
      Set design pressure with unit.
      Parameters:
      pressure - design pressure value
      unit - pressure unit ("MPa", "bar", "bara", "psi")
    • setDesignTemperature

      void setDesignTemperature(double temperature)
      Set maximum design temperature for mechanical design.
      Parameters:
      temperature - design temperature in Celsius
    • getDesignTemperature

      double getDesignTemperature()
      Get maximum design temperature.
      Returns:
      design temperature in Celsius
    • setMaterialGrade

      void setMaterialGrade(String grade)
      Set the pipe material grade per API 5L.
      Parameters:
      grade - material grade (e.g., "X42", "X52", "X65", "X70", "X80")
    • getMaterialGrade

      String getMaterialGrade()
      Get the pipe material grade.
      Returns:
      material grade
    • setDesignCode

      void setDesignCode(String code)
      Set the design code for wall thickness and pressure calculations.
      Parameters:
      code - design code (e.g., "ASME_B31_8", "ASME_B31_4", "ASME_B31_3", "DNV_OS_F101")
    • getDesignCode

      String getDesignCode()
      Get the design code.
      Returns:
      design code
    • setLocationClass

      void setLocationClass(int locationClass)
      Set the location class per ASME B31.8.

      Location classes:

      • Class 1: Offshore and remote areas (F=0.72)
      • Class 2: Fringe areas (F=0.60)
      • Class 3: Suburban areas (F=0.50)
      • Class 4: Urban areas (F=0.40)
      Parameters:
      locationClass - location class 1-4
    • getLocationClass

      int getLocationClass()
      Get the location class.
      Returns:
      location class 1-4
    • setCorrosionAllowance

      void setCorrosionAllowance(double allowance)
      Set the corrosion allowance.
      Parameters:
      allowance - corrosion allowance in meters
    • getCorrosionAllowance

      double getCorrosionAllowance()
      Get the corrosion allowance.
      Returns:
      corrosion allowance in meters
    • calculateMinimumWallThickness

      double calculateMinimumWallThickness()
      Calculate minimum required wall thickness based on design code.
      Returns:
      minimum wall thickness in meters
    • calculateMAOP

      double calculateMAOP()
      Calculate Maximum Allowable Operating Pressure (MAOP).
      Returns:
      MAOP in MPa
    • getMAOP

      double getMAOP(String unit)
      Get MAOP in specified unit.
      Parameters:
      unit - pressure unit ("MPa", "bar", "psi")
      Returns:
      MAOP in specified unit
    • calculateTestPressure

      double calculateTestPressure()
      Calculate hydrostatic test pressure.
      Returns:
      test pressure in MPa
    • calculateHoopStress

      double calculateHoopStress()
      Calculate hoop stress at operating pressure.
      Returns:
      hoop stress in MPa
    • calculateVonMisesStress

      double calculateVonMisesStress(double deltaT)
      Calculate von Mises equivalent stress.
      Parameters:
      deltaT - temperature change from installation in Celsius
      Returns:
      von Mises stress in MPa
    • isMechanicalDesignSafe

      boolean isMechanicalDesignSafe()
      Check if the mechanical design is within allowable stress limits.
      Returns:
      true if design stress is below allowable limit
    • generateMechanicalDesignReport

      String generateMechanicalDesignReport()
      Generate a mechanical design report.
      Returns:
      formatted design report string