Class Manifold

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, SimulationInterface, NamedInterface

public class Manifold extends ProcessEquipmentBaseClass implements AutoSizeable, CapacityConstrainedEquipment

Manifold class.

A manifold is a process unit that can take in any number of streams and distribute them into a number of output streams. In NeqSim it is created as a combination of a mixer and a splitter.

The manifold supports mechanical design calculations including:

  • Header and branch inner/outer diameters
  • Wall thickness calculations per ASME B31.3 or DNV-ST-F101
  • Velocity calculations (header, branch, erosional)
  • Flow-induced vibration analysis (LOF and FRMS methods)

The manifold implements CapacityConstrainedEquipment with constraints for:

  • Header velocity - SOFT limit based on erosional velocity
  • Branch velocity - SOFT limit based on erosional velocity
  • Header LOF (Likelihood of Failure) - SOFT limit for FIV
  • Header FRMS - SOFT limit for flow-induced vibration
Version:
$Id: $Id
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

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

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • mechanicalDesign

      private ManifoldMechanicalDesign mechanicalDesign
      Mechanical design for the manifold.
    • localmixer

      protected Mixer localmixer
    • localsplitter

      protected Splitter localsplitter
    • splitFactors

      double[] splitFactors
    • headerInnerDiameter

      private double headerInnerDiameter
      Header inner diameter in meters.
    • headerWallThickness

      private double headerWallThickness
      Header wall thickness in meters.
    • branchInnerDiameter

      private double branchInnerDiameter
      Branch inner diameter in meters.
    • branchWallThickness

      private double branchWallThickness
      Branch wall thickness in meters.
    • supportArrangement

      private String supportArrangement
      Support arrangement for FIV calculation.
    • autoSized

      private boolean autoSized
      Flag indicating if manifold has been auto-sized.
    • TARGET_HEADER_VELOCITY

      private static final double TARGET_HEADER_VELOCITY
      Target header velocity for sizing (m/s) - typical gas manifold design velocity.
      See Also:
    • TARGET_BRANCH_VELOCITY

      private static final double TARGET_BRANCH_VELOCITY
      Target branch velocity for sizing (m/s) - slightly higher than header.
      See Also:
    • STANDARD_PIPE_IDS

      private static final double[] STANDARD_PIPE_IDS
      Standard pipe inner diameters in meters (Schedule 40 approximate).
    • STANDARD_PIPE_WALLS

      private static final double[] STANDARD_PIPE_WALLS
      Standard pipe wall thicknesses in meters (Schedule 40 approximate).
    • capacityConstraints

      private final Map<String, CapacityConstraint> capacityConstraints
      Storage for capacity constraints.
    • maxHeaderVelocityDesign

      private double maxHeaderVelocityDesign
      Maximum header velocity design limit in m/s.
    • maxBranchVelocityDesign

      private double maxBranchVelocityDesign
      Maximum branch velocity design limit in m/s.
    • maxLOFDesign

      private double maxLOFDesign
      Maximum LOF design limit (1.0 = high risk threshold).
    • maxFRMSDesign

      private double maxFRMSDesign
      Maximum FRMS design limit.
  • Constructor Details

    • Manifold

      public Manifold(String name)

      Constructor for Manifold with name as input.

      Parameters:
      name - name of manifold
  • Method Details

    • addStream

      public void addStream(StreamInterface newStream)

      addStream.

      Parameters:
      newStream - a StreamInterface object
    • setSplitFactors

      public void setSplitFactors(double[] splitFact)

      setSplitFactors.

      Parameters:
      splitFact - an array of type double
    • getSplitStream

      public StreamInterface getSplitStream(int i)

      getSplitStream.

      Parameters:
      i - a int
      Returns:
      a StreamInterface object
    • getMixedStream

      public StreamInterface getMixedStream()

      getMixedStream.

      Returns:
      a StreamInterface
    • 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
      Parameters:
      id - UUID
    • setName

      public void setName(String name)

      Setter for the field name.

      Specified by:
      setName in interface NamedInterface
      Overrides:
      setName in class NamedBaseClass
      Parameters:
      name - a String object
    • getNumberOfOutputStreams

      public int getNumberOfOutputStreams()
      Get the number of output streams from the manifold.
      Returns:
      number of split streams
    • getHeaderInnerDiameter

      public double getHeaderInnerDiameter()
      Get header inner diameter.
      Returns:
      inner diameter in meters
    • setHeaderInnerDiameter

      public void setHeaderInnerDiameter(double diameter)
      Set header inner diameter.
      Parameters:
      diameter - inner diameter in meters
    • setHeaderInnerDiameter

      public void setHeaderInnerDiameter(double diameter, String unit)
      Set header inner diameter with unit.
      Parameters:
      diameter - inner diameter value
      unit - unit (m, mm, inch)
    • getHeaderOuterDiameter

      public double getHeaderOuterDiameter()
      Get header outer diameter (ID + 2 * wall thickness).
      Returns:
      outer diameter in meters
    • getHeaderWallThickness

      public double getHeaderWallThickness()
      Get header wall thickness.
      Returns:
      wall thickness in meters
    • setHeaderWallThickness

      public void setHeaderWallThickness(double thickness)
      Set header wall thickness.
      Parameters:
      thickness - wall thickness in meters
    • setHeaderWallThickness

      public void setHeaderWallThickness(double thickness, String unit)
      Set header wall thickness with unit.
      Parameters:
      thickness - wall thickness value
      unit - unit (m, mm, inch)
    • getBranchInnerDiameter

      public double getBranchInnerDiameter()
      Get branch inner diameter.
      Returns:
      inner diameter in meters
    • setBranchInnerDiameter

      public void setBranchInnerDiameter(double diameter)
      Set branch inner diameter.
      Parameters:
      diameter - inner diameter in meters
    • setBranchInnerDiameter

      public void setBranchInnerDiameter(double diameter, String unit)
      Set branch inner diameter with unit.
      Parameters:
      diameter - inner diameter value
      unit - unit (m, mm, inch)
    • getBranchOuterDiameter

      public double getBranchOuterDiameter()
      Get branch outer diameter (ID + 2 * wall thickness).
      Returns:
      outer diameter in meters
    • getBranchWallThickness

      public double getBranchWallThickness()
      Get branch wall thickness.
      Returns:
      wall thickness in meters
    • setBranchWallThickness

      public void setBranchWallThickness(double thickness)
      Set branch wall thickness.
      Parameters:
      thickness - wall thickness in meters
    • setBranchWallThickness

      public void setBranchWallThickness(double thickness, String unit)
      Set branch wall thickness with unit.
      Parameters:
      thickness - wall thickness value
      unit - unit (m, mm, inch)
    • getHeaderVelocity

      public double getHeaderVelocity()
      Calculate header velocity based on current flow and geometry.
      Returns:
      header velocity in m/s
    • getBranchVelocity

      public double getBranchVelocity()
      Calculate branch velocity based on current flow and geometry.
      Returns:
      average branch velocity in m/s
    • getErosionalVelocity

      public double getErosionalVelocity(double cFactor)
      Calculate erosional velocity per API RP 14E.
      Parameters:
      cFactor - erosional C-factor (typically 100-150)
      Returns:
      erosional velocity in m/s
    • getErosionalVelocity

      public double getErosionalVelocity()
      Calculate erosional velocity with default C-factor of 100.
      Returns:
      erosional velocity in m/s
    • getSupportArrangement

      public String getSupportArrangement()
      Get support arrangement for FIV calculations.
      Returns:
      support arrangement (Stiff, Medium stiff, Medium, Flexible)
    • setSupportArrangement

      public void setSupportArrangement(String arrangement)
      Set support arrangement for FIV calculations.
      Parameters:
      arrangement - support arrangement (Stiff, Medium stiff, Medium, Flexible)
    • calculateHeaderLOF

      public double calculateHeaderLOF()
      Calculate Likelihood of Failure (LOF) for header pipe based on flow-induced vibration.

      LOF interpretation:

      • < 0.5: Low risk - acceptable
      • 0.5 - 1.0: Medium risk - monitoring recommended
      • > 1.0: High risk - design review required
      Returns:
      LOF value (dimensionless)
    • calculateHeaderFRMS

      public double calculateHeaderFRMS()
      Calculate Flow-induced vibration RMS (FRMS) for header pipe.

      FRMS provides an alternative measure of vibration intensity based on mixture properties.

      Returns:
      FRMS value
    • calculateHeaderFRMS

      public double calculateHeaderFRMS(double frmsConstant)
      Calculate Flow-induced vibration RMS (FRMS) for header pipe with specified constant.
      Parameters:
      frmsConstant - FRMS constant (typically 6.7)
      Returns:
      FRMS value
    • calculateBranchLOF

      public double calculateBranchLOF()
      Calculate LOF for branch pipes.
      Returns:
      branch LOF value
    • calculateBranchFRMS

      public double calculateBranchFRMS()
      Calculate Flow-induced vibration RMS (FRMS) for branch pipes.

      FRMS provides an alternative measure of vibration intensity based on mixture properties.

      Returns:
      FRMS value
    • calculateBranchFRMS

      public double calculateBranchFRMS(double frmsConstant)
      Calculate Flow-induced vibration RMS (FRMS) for branch pipes with specified constant.
      Parameters:
      frmsConstant - FRMS constant (typically 6.7)
      Returns:
      FRMS value
    • getFIVAnalysis

      public Map<String,Object> getFIVAnalysis()
      Get comprehensive FIV analysis results as a map.
      Returns:
      map containing all FIV analysis results
    • getFIVAnalysisJson

      public String getFIVAnalysisJson()
      Get FIV analysis as JSON string.
      Returns:
      JSON string with FIV analysis
    • getMassBalance

      public double getMassBalance(String unit)

      getMassBalance.

      Specified by:
      getMassBalance in interface ProcessEquipmentInterface
      Overrides:
      getMassBalance in class ProcessEquipmentBaseClass
      Parameters:
      unit - a String object
      Returns:
      a double
    • toJson

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class ProcessEquipmentBaseClass
      Returns:
      json string.
    • toJson

      public String toJson(ReportConfig cfg)
      Serializes the Process Equipment with configurable level of detail.
      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class ProcessEquipmentBaseClass
      Parameters:
      cfg - report configuration
      Returns:
      json string
    • initMechanicalDesign

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class ProcessEquipmentBaseClass
    • getMechanicalDesign

      public ManifoldMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

      Specified by:
      getMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      getMechanicalDesign in class ProcessEquipmentBaseClass
      Returns:
      a MechanicalDesign object
    • autoSize

      public void autoSize(double safetyFactor)
      Automatically size the equipment based on connected stream conditions.

      This method calculates dimensions and design parameters using the inlet stream properties and applies the specified safety factor. The equipment must have a valid inlet stream connected before calling this method.

      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      safetyFactor - multiplier for design capacity, typically 1.1-1.3 (10-30% over design)
    • selectStandardPipeID

      private double selectStandardPipeID(double requiredID)
      Select the next larger standard pipe ID for the required diameter.
      Parameters:
      requiredID - required inner diameter in meters
      Returns:
      selected standard pipe ID in meters
    • getWallThicknessForID

      private double getWallThicknessForID(double pipeID)
      Get standard wall thickness for a given pipe ID.
      Parameters:
      pipeID - pipe inner diameter in meters
      Returns:
      wall thickness in meters
    • autoSize

      public void autoSize()
      Automatically size using default safety factor (1.2 = 20% margin).
      Specified by:
      autoSize in interface AutoSizeable
    • autoSize

      public void autoSize(String companyStandard, String trDocument)
      Automatically size using company-specific design standards.

      This method applies design rules from the specified company's technical requirements (TR) documents. The standards are loaded from the NeqSim design database.

      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      companyStandard - company name (e.g., "Equinor", "Shell", "TotalEnergies")
      trDocument - TR document reference (e.g., "TR2000", "DEP-31.38.01.11")
    • isAutoSized

      public boolean isAutoSized()
      Check if equipment has been auto-sized.
      Specified by:
      isAutoSized in interface AutoSizeable
      Returns:
      true if autoSize() has been called successfully
    • getSizingReport

      public String getSizingReport()
      Get a detailed sizing report after auto-sizing.

      The report includes:

      • Design basis (flow rates, pressures, temperatures)
      • Calculated dimensions
      • Design parameters (K-factor, Cv, velocity, etc.)
      • Safety margins
      Specified by:
      getSizingReport in interface AutoSizeable
      Returns:
      formatted sizing report string
    • getSizingReportJson

      public String getSizingReportJson()
      Get sizing report as JSON for programmatic access.
      Specified by:
      getSizingReportJson in interface AutoSizeable
      Returns:
      JSON string with sizing data
    • initializeCapacityConstraints

      protected void initializeCapacityConstraints()
      Initialize capacity constraints based on design limits and FIV analysis.

      NOTE: All constraints are disabled by default for backwards compatibility. Enable specific constraints when manifold capacity analysis is needed (e.g., after sizing).

    • getCapacityConstraints

      public Map<String, CapacityConstraint> getCapacityConstraints()
      Gets all capacity constraints defined for this equipment.

      The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.

      Specified by:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Returns:
      unmodifiable map of constraint name to CapacityConstraint
    • getBottleneckConstraint

      public CapacityConstraint getBottleneckConstraint()
      Gets the constraint with the highest utilization (the bottleneck).

      This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.

      Specified by:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Returns:
      the bottleneck constraint, or null if no constraints are defined
    • isCapacityExceeded

      public boolean isCapacityExceeded()
      Checks if any capacity constraint is violated (exceeds 100% utilization).

      A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.

      Specified by:
      isCapacityExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any constraint utilization exceeds 1.0 (100%)
    • isHardLimitExceeded

      public boolean isHardLimitExceeded()
      Checks if any HARD constraint limit is exceeded.

      HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.

      Specified by:
      isHardLimitExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any HARD constraint's max value is exceeded
    • getMaxUtilization

      public double getMaxUtilization()
      Gets the maximum utilization across all constraints.

      This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.

      Specified by:
      getMaxUtilization in interface CapacityConstrainedEquipment
      Returns:
      maximum utilization as fraction (1.0 = 100% of design capacity)
    • addCapacityConstraint

      public void addCapacityConstraint(CapacityConstraint constraint)
      Adds a new capacity constraint to this equipment.

      This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraint - the constraint to add
    • removeCapacityConstraint

      public boolean removeCapacityConstraint(String constraintName)
      Removes a capacity constraint by name.
      Specified by:
      removeCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraintName - the name of the constraint to remove
      Returns:
      true if the constraint was found and removed
    • clearCapacityConstraints

      public void clearCapacityConstraints()
      Clears all capacity constraints from this equipment.
      Specified by:
      clearCapacityConstraints in interface CapacityConstrainedEquipment
    • setMaxHeaderVelocityDesign

      public void setMaxHeaderVelocityDesign(double velocity)
      Set maximum header velocity design limit.
      Parameters:
      velocity - maximum velocity in m/s
    • setMaxBranchVelocityDesign

      public void setMaxBranchVelocityDesign(double velocity)
      Set maximum branch velocity design limit.
      Parameters:
      velocity - maximum velocity in m/s
    • setMaxLOFDesign

      public void setMaxLOFDesign(double lof)
      Set maximum LOF design limit.
      Parameters:
      lof - maximum LOF value
    • setMaxFRMSDesign

      public void setMaxFRMSDesign(double frms)
      Set maximum FRMS design limit.
      Parameters:
      frms - maximum FRMS value