Class Ejector

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

Ejector class represents an ejector in a process simulation. It mixes a motive stream with a suction stream and calculates the resulting mixed stream using a quasi one-dimensional formulation. The implementation combines energy and momentum balances commonly used in steam-jet ejector design as summarised by Keenan et al. (1950) and ESDU 86030.

The ejector implements AutoSizeable for automatic sizing based on flow conditions and CapacityConstrainedEquipment for capacity analysis with constraints for entrainment ratio, compression ratio, and critical back pressure.

See Also:
  • Field Details

    • serialVersionUID

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

      private static final org.apache.logging.log4j.Logger logger
    • motiveStream

      private StreamInterface motiveStream
    • suctionStream

      private StreamInterface suctionStream
    • mixedStream

      private StreamInterface mixedStream
    • dischargePressure

      private double dischargePressure
    • mixingPressure

      private double mixingPressure
    • efficiencyIsentropic

      private double efficiencyIsentropic
    • diffuserEfficiency

      private double diffuserEfficiency
    • designSuctionVelocity

      private double designSuctionVelocity
    • designDiffuserOutletVelocity

      private double designDiffuserOutletVelocity
    • designSuctionVelocityOverride

      private boolean designSuctionVelocityOverride
    • designDiffuserVelocityOverride

      private boolean designDiffuserVelocityOverride
    • suctionConnectionLength

      private double suctionConnectionLength
    • dischargeConnectionLength

      private double dischargeConnectionLength
    • suctionConnectionLengthOverride

      private boolean suctionConnectionLengthOverride
    • dischargeConnectionLengthOverride

      private boolean dischargeConnectionLengthOverride
    • mechanicalDesign

      private transient EjectorMechanicalDesign mechanicalDesign
    • autoSized

      private boolean autoSized
      Flag indicating if ejector has been auto-sized.
    • designEntrainmentRatio

      private double designEntrainmentRatio
      Design entrainment ratio (suction/motive mass ratio).
    • designCompressionRatio

      private double designCompressionRatio
      Design compression ratio (discharge/suction pressure).
    • maxCriticalBackPressure

      private double maxCriticalBackPressure
      Maximum critical back pressure in bara.
    • designMotiveFlowRate

      private double designMotiveFlowRate
      Design motive flow rate in kg/s.
    • ejectorCapacityConstraints

      private Map<String, CapacityConstraint> ejectorCapacityConstraints
      Capacity constraints map.
    • ejectorCapacityAnalysisEnabled

      private boolean ejectorCapacityAnalysisEnabled
      Flag for capacity analysis.
    • BAR_TO_PA

      private static final double BAR_TO_PA
      See Also:
    • DEFAULT_NOZZLE_LENGTH_FACTOR

      private static final double DEFAULT_NOZZLE_LENGTH_FACTOR
      See Also:
    • DEFAULT_SUCTION_LENGTH_FACTOR

      private static final double DEFAULT_SUCTION_LENGTH_FACTOR
      See Also:
    • DEFAULT_MIXING_LENGTH_FACTOR

      private static final double DEFAULT_MIXING_LENGTH_FACTOR
      See Also:
    • DEFAULT_DIFFUSER_LENGTH_FACTOR

      private static final double DEFAULT_DIFFUSER_LENGTH_FACTOR
      See Also:
  • Constructor Details

    • Ejector

      public Ejector(String name, StreamInterface motiveStream, StreamInterface suctionStream)
      Constructs an Ejector with the specified name, motive stream, and suction stream.
      Parameters:
      name - the name of the ejector
      motiveStream - the motive stream
      suctionStream - the suction stream
  • Method Details

    • setDischargePressure

      public void setDischargePressure(double dischargePressure)

      Setter for the field dischargePressure.

      Parameters:
      dischargePressure - a double
    • setEfficiencyIsentropic

      public void setEfficiencyIsentropic(double efficiencyIsentropic)

      Setter for the field efficiencyIsentropic.

      Parameters:
      efficiencyIsentropic - a double
    • setDiffuserEfficiency

      public void setDiffuserEfficiency(double diffuserEfficiency)

      Setter for the field diffuserEfficiency.

      Parameters:
      diffuserEfficiency - a double
    • setThroatArea

      public void setThroatArea(double throatArea)

      Setter for the field throatArea.

      Parameters:
      throatArea - a double
    • setMixingPressure

      public void setMixingPressure(double mixingPressure)
      Sets the target mixing pressure within the ejector. If not set the suction pressure is used.
      Parameters:
      mixingPressure - the mixing pressure in bara
    • setDesignSuctionVelocity

      public void setDesignSuctionVelocity(double velocity)
      Sets the design suction velocity used when calculating mechanical dimensions.
      Parameters:
      velocity - velocity in m/s
    • setDesignDiffuserOutletVelocity

      public void setDesignDiffuserOutletVelocity(double velocity)
      Sets the design diffuser outlet velocity used when calculating mechanical dimensions.
      Parameters:
      velocity - velocity in m/s
    • setSuctionConnectionLength

      public void setSuctionConnectionLength(double length)
      Sets the straight length of suction piping to include in total volume calculations.
      Parameters:
      length - length in metres
    • setDischargeConnectionLength

      public void setDischargeConnectionLength(double length)
      Sets the straight length of discharge piping to include in total volume calculations.
      Parameters:
      length - length in metres
    • initMechanicalDesign

      public void initMechanicalDesign()
      Description copied from class: ProcessEquipmentBaseClass

      Initialize a initMechanicalDesign for the equipment.

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

      public EjectorMechanicalDesign getMechanicalDesign()
      Description copied from class: ProcessEquipmentBaseClass

      Get a mechanicalDesign for the equipment.

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

      public EjectorMechanicalDesign getDesignResult()
      Backwards compatible accessor for mechanical design results.
      Returns:
      the ejector mechanical design container
    • 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
    • getOutStream

      public StreamInterface getOutStream()

      getOutStream.

      Returns:
      a StreamInterface object
    • getEntrainmentRatio

      public double getEntrainmentRatio()

      getEntrainmentRatio.

      Returns:
      a double
    • diameterFromArea

      private static double diameterFromArea(double area)
    • estimateLength

      private static double estimateLength(double diameter, double factor)
    • cylinderVolume

      private static double cylinderVolume(double area, double length)
    • estimateDefaultMixingPressure

      private double estimateDefaultMixingPressure(double suctionPressure, double dischargePressure, double mDotMotive, double mDotSuction)
    • estimateDesignSuctionVelocity

      private double estimateDesignSuctionVelocity(double suctionPressure, double dischargePressure, double rhoSuction, double mDotSuction)
    • estimateDesignDiffuserOutletVelocity

      private double estimateDesignDiffuserOutletVelocity(double mixingPressure, double dischargePressure, double rhoDiffuser, double mDotTotal)
    • estimateSuctionConnectionLength

      private double estimateSuctionConnectionLength(double suctionDiameter, double suctionPressure, double dischargePressure)
    • estimateDischargeConnectionLength

      private double estimateDischargeConnectionLength(double diffuserDiameter, double mixingPressure, double dischargePressure)
    • clamp

      private static double clamp(double value, double min, double max)
    • 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
    • getMotiveStream

      public StreamInterface getMotiveStream()

      Getter for the field motiveStream.

      Returns:
      a StreamInterface object
    • getSuctionStream

      public StreamInterface getSuctionStream()

      Getter for the field suctionStream.

      Returns:
      a StreamInterface object
    • getMixedStream

      public StreamInterface getMixedStream()

      Getter for the field mixedStream.

      Returns:
      a StreamInterface object
    • getEfficiencyIsentropic

      public double getEfficiencyIsentropic()

      Getter for the field efficiencyIsentropic.

      Returns:
      a double
    • getDiffuserEfficiency

      public double getDiffuserEfficiency()

      Getter for the field diffuserEfficiency.

      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
    • 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)
    • 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
    • initializeEjectorCapacityConstraints

      private void initializeEjectorCapacityConstraints()
      Initialize ejector capacity constraints.
    • setDesignEntrainmentRatio

      public void setDesignEntrainmentRatio(double ratio)
      Sets the design entrainment ratio.
      Parameters:
      ratio - design entrainment ratio (suction/motive mass ratio)
    • getDesignEntrainmentRatio

      public double getDesignEntrainmentRatio()
      Gets the design entrainment ratio.
      Returns:
      design entrainment ratio
    • setDesignCompressionRatio

      public void setDesignCompressionRatio(double ratio)
      Sets the design compression ratio.
      Parameters:
      ratio - design compression ratio (discharge/suction pressure)
    • getDesignCompressionRatio

      public double getDesignCompressionRatio()
      Gets the design compression ratio.
      Returns:
      design compression ratio
    • setMaxCriticalBackPressure

      public void setMaxCriticalBackPressure(double pressure)
      Sets the maximum critical back pressure.
      Parameters:
      pressure - maximum critical back pressure in bara
    • getMaxCriticalBackPressure

      public double getMaxCriticalBackPressure()
      Gets the maximum critical back pressure.
      Returns:
      maximum critical back pressure in bara
    • isCapacityAnalysisEnabled

      public boolean isCapacityAnalysisEnabled()
      Checks if capacity analysis is enabled for this equipment.

      When disabled, this equipment is excluded from bottleneck detection, capacity utilization summaries, and optimization routines. The equipment still tracks its constraints but doesn't contribute to system-level analysis.

      Specified by:
      isCapacityAnalysisEnabled in interface CapacityConstrainedEquipment
      Overrides:
      isCapacityAnalysisEnabled in class ProcessEquipmentBaseClass
      Returns:
      true if capacity analysis is enabled (default is true)
    • setCapacityAnalysisEnabled

      public void setCapacityAnalysisEnabled(boolean enabled)
      Enables or disables capacity analysis for this equipment.

      When disabled, this equipment is excluded from:

      • System bottleneck detection (ProcessSystem.findBottleneck())
      • Capacity utilization summaries (ProcessSystem.getCapacityUtilizationSummary())
      • Equipment near capacity lists (ProcessSystem.getEquipmentNearCapacityLimit())
      • Optimization constraint checking

      The equipment still calculates and tracks its constraints internally.

      Specified by:
      setCapacityAnalysisEnabled in interface CapacityConstrainedEquipment
      Overrides:
      setCapacityAnalysisEnabled in class ProcessEquipmentBaseClass
      Parameters:
      enabled - true to include in capacity analysis, false to exclude
    • 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