Class CompressorTrain
- All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface
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
- Inlet scrubber (liquid knockout) — optional, enabled by default
- Compressor stage
- 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 Summary
FieldsModifier and TypeFieldDescriptionprivate CoolerAftercooler.private doubleDefault aftercooler outlet temperature in Kelvin.private CompressorThe compressor stage.private SeparatorInlet scrubber for liquid knockout.private static final org.apache.logging.log4j.LoggerLogger object for class.private static final longSerialization version UID.private booleanWhether to include an aftercooler.private booleanWhether to include an inlet scrubber.Fields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionCompressorTrain(String name) Constructor with name only.CompressorTrain(String name, StreamInterface inletStream) Constructor with name and inlet stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a capacity constraint to this equipment.private voidBuilds the internal equipment chain based on current configuration.voidClears all capacity constraints from this equipment.Get the aftercooler.Gets the bottleneck (most limiting) constraint for this equipment.Gets all capacity constraints defined for this equipment.doubleGet the actual compression ratio across the compressor.Get the compressor.doubleGet the distance to surge as a fraction.Get the inlet scrubber.Get all internal equipment as an ordered list.doubleGets the maximum utilization across all enabled constraints.doublegetOutletTemperature(String unit) Get the outlet temperature.Get a summary of the compressor train performance.doubleGet the compressor polytropic efficiency.doubleGet the polytropic head in kJ/kg.doublegetPower()Get the total power consumption in watts.doubleGet the total power consumption of the compressor stage.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanChecks if any HARD constraint limit is exceeded.booleanCheck if the compressor is in surge.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidsetAftercoolerTemperature(double temperature) Set the aftercooler outlet temperature.voidsetAftercoolerTemperature(double temperature, String unit) Set the aftercooler outlet temperature with units.voidsetInletStream(StreamInterface inStream) Set inlet Stream of twoport.voidsetUseAftercooler(boolean useAftercooler) Set whether to include an aftercooler.voidsetUseInletScrubber(boolean useInletScrubber) Set whether to include an inlet scrubber for liquid knockout.Methods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletStreams, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletStreams, getOutletTemperature, setInletPressure, setInletTemperature, setOutletPressure, setOutletPressure, setOutletStream, setOutletTemperature, setOutletTemperature, toJson, toJson, validateSetupMethods inherited from class ProcessEquipmentBaseClass
addController, copy, displayResult, equals, getAvailableMargin, getAvailableMarginPercent, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMaxUtilizationPercent, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, initMechanicalDesign, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getElectricalDesign, getEquipmentState, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from interface TwoPortInterface
getInStream, getOutStream, setOutPressure, setOutPressure, setOutTemperature, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger object for class. -
inletScrubber
Inlet scrubber for liquid knockout. -
compressor
The compressor stage. -
aftercooler
Aftercooler. -
useInletScrubber
private boolean useInletScrubberWhether to include an inlet scrubber. -
useAftercooler
private boolean useAftercoolerWhether to include an aftercooler. -
aftercoolerTemperature
private double aftercoolerTemperatureDefault aftercooler outlet temperature in Kelvin.
-
-
Constructor Details
-
CompressorTrain
Constructor with name and inlet stream.- Parameters:
name- train nameinletStream- inlet stream
-
CompressorTrain
-
-
Method Details
-
buildTrain
private void buildTrain()Builds the internal equipment chain based on current configuration. -
setInletStream
Set inlet Stream of twoport.- Specified by:
setInletStreamin interfaceTwoPortInterface- Overrides:
setInletStreamin classTwoPortEquipment- Parameters:
inStream- value to set
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
getCompressor
-
getInletScrubber
Get the inlet scrubber.- Returns:
- the inlet scrubber, or null if not enabled
-
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
Set the aftercooler outlet temperature with units.- Parameters:
temperature- temperature valueunit- temperature unit ("C" or "K")
-
getPower
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
Get the outlet temperature.- Specified by:
getOutletTemperaturein interfaceProcessEquipmentInterface- 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
Get all internal equipment as an ordered list.- Returns:
- list of internal equipment (scrubber, compressor, cooler)
-
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:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Specified by:
getCapacityConstraintsin interfaceProcessEquipmentInterface- Overrides:
getCapacityConstraintsin classProcessEquipmentBaseClass- Returns:
- unmodifiable map of constraint name to constraint, empty if none defined
-
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:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Specified by:
getBottleneckConstraintin interfaceProcessEquipmentInterface- Overrides:
getBottleneckConstraintin classProcessEquipmentBaseClass- 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:
isCapacityExceededin interfaceCapacityConstrainedEquipment- Specified by:
isCapacityExceededin interfaceProcessEquipmentInterface- Overrides:
isCapacityExceededin classProcessEquipmentBaseClass- 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:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- Specified by:
isHardLimitExceededin interfaceProcessEquipmentInterface- Overrides:
isHardLimitExceededin classProcessEquipmentBaseClass- 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:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Specified by:
getMaxUtilizationin interfaceProcessEquipmentInterface- Overrides:
getMaxUtilizationin classProcessEquipmentBaseClass- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
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
CapacityConstraintto configure the constraint before adding.- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Specified by:
addCapacityConstraintin interfaceProcessEquipmentInterface- Overrides:
addCapacityConstraintin classProcessEquipmentBaseClass- Parameters:
constraint- the capacity constraint to add (ignored if null)
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- 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:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-
getPerformanceSummary
Get a summary of the compressor train performance.- Returns:
- formatted summary string
-