Class CompressorTrain

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

public class CompressorTrain extends TwoPortEquipment implements CapacityConstrainedEquipment
Composite equipment representing a single compressor stage (train).

A CompressorTrain wraps the common pattern of inlet separator (scrubber), compressor, and aftercooler into a single reusable equipment unit. This simplifies process model construction and provides aggregate performance reporting.

Equipment Sequence

  1. Inlet scrubber (liquid knockout) — optional, enabled by default
  2. Compressor stage
  3. Aftercooler — optional, enabled by default

Usage Example

CompressorTrain train = new CompressorTrain("HP Compressor", feedStream);
train.getCompressor().setOutletPressure(85.0);
train.getCompressor().setPolytropicEfficiency(0.76);
train.getCompressor().setUsePolytropicCalc(true);
train.getCooler().setOutTemperature(273.15 + 35.0);
train.run();

double power = train.getPower("kW");
double outTemp = train.getOutletTemperature("C");
Version:
1.0
Author:
NeqSim Development Team
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
      Logger object for class.
    • inletScrubber

      private Separator inletScrubber
      Inlet scrubber for liquid knockout.
    • compressor

      private Compressor compressor
      The compressor stage.
    • aftercooler

      private Cooler aftercooler
      Aftercooler.
    • useInletScrubber

      private boolean useInletScrubber
      Whether to include an inlet scrubber.
    • useAftercooler

      private boolean useAftercooler
      Whether to include an aftercooler.
    • aftercoolerTemperature

      private double aftercoolerTemperature
      Default aftercooler outlet temperature in Kelvin.
  • Constructor Details

    • CompressorTrain

      public CompressorTrain(String name, StreamInterface inletStream)
      Constructor with name and inlet stream.
      Parameters:
      name - train name
      inletStream - inlet stream
    • CompressorTrain

      public CompressorTrain(String name)
      Constructor with name only.
      Parameters:
      name - train name
  • Method Details

    • buildTrain

      private void buildTrain()
      Builds the internal equipment chain based on current configuration.
    • setInletStream

      public void setInletStream(StreamInterface inStream)
      Set inlet Stream of twoport.
      Specified by:
      setInletStream in interface TwoPortInterface
      Overrides:
      setInletStream in class TwoPortEquipment
      Parameters:
      inStream - value to set
    • 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
    • getCompressor

      public Compressor getCompressor()
      Get the compressor.
      Returns:
      the compressor stage
    • getInletScrubber

      public Separator getInletScrubber()
      Get the inlet scrubber.
      Returns:
      the inlet scrubber, or null if not enabled
    • getAftercooler

      public Cooler getAftercooler()
      Get the aftercooler.
      Returns:
      the aftercooler, or null if not enabled
    • setUseInletScrubber

      public void setUseInletScrubber(boolean useInletScrubber)
      Set whether to include an inlet scrubber for liquid knockout.
      Parameters:
      useInletScrubber - true to include inlet scrubber
    • setUseAftercooler

      public void setUseAftercooler(boolean useAftercooler)
      Set whether to include an aftercooler.
      Parameters:
      useAftercooler - true to include aftercooler
    • setAftercoolerTemperature

      public void setAftercoolerTemperature(double temperature)
      Set the aftercooler outlet temperature.
      Parameters:
      temperature - temperature in Kelvin
    • setAftercoolerTemperature

      public void setAftercoolerTemperature(double temperature, String unit)
      Set the aftercooler outlet temperature with units.
      Parameters:
      temperature - temperature value
      unit - temperature unit ("C" or "K")
    • getPower

      public double getPower(String unit)
      Get the total power consumption of the compressor stage.
      Parameters:
      unit - power unit ("W", "kW", or "MW")
      Returns:
      power in the requested unit
    • getPower

      public double getPower()
      Get the total power consumption in watts.
      Returns:
      power in watts
    • getOutletTemperature

      public double getOutletTemperature(String unit)
      Get the outlet temperature.
      Specified by:
      getOutletTemperature in interface ProcessEquipmentInterface
      Parameters:
      unit - temperature unit ("C" or "K")
      Returns:
      outlet temperature
    • getPolytropicEfficiency

      public double getPolytropicEfficiency()
      Get the compressor polytropic efficiency.
      Returns:
      polytropic efficiency (0-1)
    • getCompressionRatio

      public double getCompressionRatio()
      Get the actual compression ratio across the compressor.
      Returns:
      compression ratio (outlet pressure / inlet pressure)
    • getPolytropicHead

      public double getPolytropicHead()
      Get the polytropic head in kJ/kg.
      Returns:
      polytropic head
    • isSurging

      public boolean isSurging()
      Check if the compressor is in surge.
      Returns:
      true if operating point is at or below surge line
    • getDistanceToSurge

      public double getDistanceToSurge()
      Get the distance to surge as a fraction.
      Returns:
      surge margin ratio (currentFlow/surgeFlow - 1)
    • getInternalEquipment

      public List<ProcessEquipmentInterface> getInternalEquipment()
      Get all internal equipment as an ordered list.
      Returns:
      list of internal equipment (scrubber, compressor, cooler)
    • getCapacityConstraints

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

      Returns an unmodifiable map of constraint name to constraint object. Constraints are used by the optimization framework to detect bottlenecks, enforce limits, and guide production allocation. Equipment subclasses populate this map via ProcessEquipmentInterface.addCapacityConstraint(CapacityConstraint).

      Specified by:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Specified by:
      getCapacityConstraints in interface ProcessEquipmentInterface
      Overrides:
      getCapacityConstraints in class ProcessEquipmentBaseClass
      Returns:
      unmodifiable map of constraint name to constraint, empty if none defined
    • getBottleneckConstraint

      public CapacityConstraint getBottleneckConstraint()
      Gets the bottleneck (most limiting) constraint for this equipment.

      Returns the enabled constraint with the highest utilization ratio. If no constraints are defined or enabled, returns null.

      Specified by:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Specified by:
      getBottleneckConstraint in interface ProcessEquipmentInterface
      Overrides:
      getBottleneckConstraint in class ProcessEquipmentBaseClass
      Returns:
      the most limiting constraint, or null if none
    • 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
      Specified by:
      isCapacityExceeded in interface ProcessEquipmentInterface
      Overrides:
      isCapacityExceeded in class ProcessEquipmentBaseClass
      Returns:
      true if any enabled 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
      Specified by:
      isHardLimitExceeded in interface ProcessEquipmentInterface
      Overrides:
      isHardLimitExceeded in class ProcessEquipmentBaseClass
      Returns:
      true if any enabled HARD constraint's max value is exceeded
    • getMaxUtilization

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

      Returns the highest utilization ratio across all enabled constraints. Values above 1.0 indicate the equipment is over capacity. Returns 0.0 if no constraints are defined or enabled.

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

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

      Constraints can be added at any time. If a constraint with the same name already exists, it is replaced. Use the fluent builder API on CapacityConstraint to configure the constraint before adding.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Specified by:
      addCapacityConstraint in interface ProcessEquipmentInterface
      Overrides:
      addCapacityConstraint in class ProcessEquipmentBaseClass
      Parameters:
      constraint - the capacity constraint to add (ignored if null)
    • 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
    • getPerformanceSummary

      public String getPerformanceSummary()
      Get a summary of the compressor train performance.
      Returns:
      formatted summary string