Class Compressor
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, CompressorInterface, ProcessEquipmentInterface, TwoPortInterface, StateVectorProvider, SimulationInterface, NamedInterface
- Direct Known Subclasses:
Expander
Compressor class.
- Version:
- $Id: $Id
- Author:
- esol
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructing Compressor instances with a fluent API. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate AntiSurgeprivate booleanFlag indicating if compressor has been auto-sized.private booleanbooleanprivate Map<String, CapacityConstraint> Capacity constraints map for this compressor.private doubleprivate CompressorChartInterfaceprivate StringTemplate used for curve generation.private doubledoubleprivate CompressorDriverprivate doubleprivate List<CompressorEventListener> private doubledoubledoubleprivate booleanprivate booleanprivate boolean(package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleprivate doubleprivate doubleMaximum discharge temperature in Kelvin for capacity constraint.private doubleprivate double(package private) CompressorMechanicalDesignprivate CompressorMechanicalLossesMechanical losses model for seal gas and bearing calculations.private static final doubleMinimum default design volume flow in m3/hr for zero-flow compressors.private static final doubleMinimum default design power in kW for zero-flow compressors.private doubleprivate intprivate intNumber of speed curves to generate.private CompressorOperatingHistoryprivate doubleprivate CompressorStateprivate doubledoubleprivate doubleprivate doubleprivate doubleprivate doubleprivate Stringbooleandoubleprivate Stringprivate doubleprivate doubleprivate CompressorPropertyProfileprivate doubleprivate static final longSerialization version UID.private doubleprivate ShutdownProfileprivate booleanprivate doubleprivate doubleprivate booleanprivate doubleprivate StartupProfileprivate doubleprivate booleanprivate doubleprivate booleanprivate doubleprivate doubleprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanbooleanprivate booleanprivate booleanFields 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
ConstructorsConstructorDescriptionCompressor(String name) Constructor for Compressor.Compressor(String name, boolean interpolateMapLookup) Constructor for Compressor.Compressor(String name, StreamInterface inletStream) Constructor for Compressor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAcknowledge a tripped compressor to allow restart.voidaddCapacityConstraint(CapacityConstraint constraint) Adds a new capacity constraint to this equipment.voidaddEventListener(CompressorEventListener listener) Add an event listener for compressor events.voidaddOperatingHours(double hours) Add operating time.voidautoSize()Automatically size using default safety factor (1.2 = 20% margin).voidautoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.voidAutomatically size using company-specific design standards.static Compressor.BuilderCreates a new Builder for constructing a Compressor with a fluent API.voidCheck driver power limits and fire events if limits are exceeded.voidCheck speed limits and fire events if limits are exceeded.voidCheck stone wall margin and fire events if threshold is crossed.voidCheck surge margin and fire events if thresholds are crossed.voidClears all capacity constraints from this equipment.copy()Create deep copy.voidDisable operating history tracking.voiddisplayResult.voidEmergency shutdown (ESD).voidEnable operating history tracking.private voidEnsures the capacity constraints map is initialized.booleandoublefindOutPressure(double hinn, double hout, double polytropicEfficiency) findOutPressure.private voidfirePowerLimitExceededEvent(double currentPower, double maxPower) Fire power limit exceeded event.private voidFire shutdown complete event.private voidfireSpeedBelowMinimumEvent(double currentSpeed, double ratio) Fire speed below minimum event.private voidfireSpeedLimitExceededEvent(double currentSpeed, double ratio) Fire speed limit exceeded event.private voidFire startup complete event.private voidfireStateChangeEvent(CompressorState oldState, CompressorState newState) Fire state change event.private voidfireStoneWallApproachEvent(double stoneWallMargin) Fire stone wall approach event.private voidfireSurgeApproachEvent(double surgeMargin, boolean isCritical) Fire surge approach event to all listeners.private voidfireSurgeOccurredEvent(double surgeMargin) Fire surge occurred event.voidGenerates a compressor chart based on the current operating point.voidgenerateCompressorChart(int numberOfSpeeds) Generates a compressor chart with multiple speed curves.voidgenerateCompressorChart(String generationOption) Generates a compressor chart with specified options.voidgenerateCompressorChart(String generationOption, double[] speeds) Generates a compressor chart with specific speed values.voidgenerateCompressorChart(String generationOption, int numberOfSpeeds) Generates a compressor chart with specified options and number of speeds.voidgenerateCompressorChartFromTemplate(String templateName, int numberOfSpeeds) Generates a compressor chart from a predefined template.voidgenerateCompressorCurves.doubleGetter for the fieldactualCompressionRatio.getAntiSurge.doubleGet total bearing power loss.Gets the constraint with the highest utilization (the bottleneck).Gets all capacity constraints defined for this equipment.doublegetCapacityDuty.doublegetCapacityMax.doubleGetter for the fieldcompressionRatio.Getter for the fieldcompressorChart.Get the compressor chart as a JSON string.Gets the current compressor chart type as a string.Get the curve template used for auto-sizing.doubleGet the performance degradation factor.doubleCalculate the distance to the stone wall (choke) limit.doublegetDistanceToSurge.Get the compressor driver model.doubleGet the effective efficiency accounting for degradation.doubleGet the effective polytropic head accounting for degradation.doubleGet the temperature tolerance used for efficiency solving iterations.doublegetEnergy.doublegetEntropyProduction(String unit) getEntropyProduction.doublegetExergyChange(String unit) getExergyChange.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.doubleGet the fouling factor.doublegetIsentropicEfficiency.doubleGet the maximum acceleration rate.doubleGet the maximum deceleration rate.doubleGets the maximum discharge temperature.doubleGets the maximum discharge temperature in specified unit.doublegetMaximumSpeed.doubleGetter for the fieldmaxOutletPressure.doubleGets the maximum utilization across all constraints.Get amechanicalDesignfor the equipment.doubleGet mechanical efficiency accounting for bearing and seal friction losses.Get the mechanical losses model for seal gas and bearing calculations.doublegetMinimumSpeed.intGetter for the fieldnumberOfCompressorCalcSteps.intGet the number of speed curves generated during auto-sizing.Gets the reason why equipment is outside its operating envelope.Get the operating history tracker.doubleGet the total operating hours.Get the current operating state of the compressor.doubleGet outlet pressure of twoport.doubleGetter for the fieldoutTemperature.doublegetPolytropicEfficiency.doubleGetter for the fieldpolytropicExponent.doubleGetter for the fieldpolytropicFluidHead.doubleGetter for the fieldpolytropicHead.doublegetPolytropicHead(String unit) Getter for the fieldpolytropicHead.doubleGetter for the fieldpolytropicHeadMeter.Getter for the fieldpolytropicMethod.doublegetPower()getPower.doublegetPower.Getter for the fieldpropertyProfile.doubleGet the ratio of the current compressor speed to the maximum speed in the compressor curves.doublegetRatioToMaxSpeed(double calculatedSpeed) Get the ratio of a calculated speed to the maximum speed in the compressor curves.doubleGet the ratio of the current compressor speed to the minimum speed in the compressor curves.doublegetRatioToMinSpeed(double calculatedSpeed) Get the ratio of a calculated speed to the minimum speed in the compressor curves.String[][]getResultTable.doubleGet the rotational inertia of the compressor rotor.double[]Get the safety-factor-corrected surge flow and head at the current compressor speed.doubleGet total seal gas consumption including primary leakage, buffer gas, and separation gas.Get the shutdown profile.Gets validation errors for the current simulation state.Get a detailed sizing report after auto-sizing.Get sizing report as JSON for programmatic access.doublegetSpeed()Getter for the fieldspeed.Get the startup profile.Get the current state as a standardized vector.doubleGet the stone wall warning threshold.doubleGet the surge critical threshold.doublegetSurgeFlowRate.doublegetSurgeFlowRateMargin.doubledoubleGet the surge warning threshold.doubleGet the target speed for dynamic control.getThermoSystem.doublegetTotalWork.inthashCode()protected voidInitializes default capacity constraints for this compressor.voidInitialize ainitMechanicalDesignfor the equipment.Initialize a default mechanical losses model based on current compressor configuration.initMechanicalLosses(double shaftDiameterMm) Initialize a mechanical losses model with specified shaft diameter.booleanCheck if equipment has been auto-sized.booleanCheck if auto-speed mode is enabled.booleanisCalcPressureOut.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanChecks if any HARD constraint limit is exceeded.booleanCheck if the current compressor speed is higher than the maximum speed in the compressor curves.booleanisHigherThanMaxSpeed(double calculatedSpeed) Check if a calculated speed is higher than the maximum speed in the compressor curves.booleanChecks if the compressor speed is limited.booleanCheck if the current compressor speed is lower than the minimum speed in the compressor curves.booleanisLowerThanMinSpeed(double calculatedSpeed) Check if a calculated speed is lower than the minimum speed in the compressor curves.booleanChecks if maximum discharge temperature has been explicitly set.booleanisSetMaxOutletPressure.booleanChecks if the current simulation result is physically valid.booleanisSolveSpeed.booleanCheck if the current compressor speed is within the defined compressor curve speed range.booleanisSpeedWithinRange(double calculatedSpeed) Check if a calculated speed is within the defined compressor curve speed range.booleanisStoneWall.booleanisStoneWall(double flow, double head) isStoneWall.booleanisSurge(double flow, double head) isSurge.booleanGetter for property useGERG2008.booleanGetter for property useLeachman.booleanisUseRigorousPolytropicMethod.booleanGetter for property useVega.booleanChecks if the equipment is operating within its valid operating envelope.voidloadCompressorChartFromCsv(String filePath) Load compressor chart from a CSV file.voidloadCompressorChartFromJson(String filePath) Load compressor chart from a JSON file.voidloadCompressorChartFromJsonString(String jsonString) Load compressor chart from a JSON string.voidrecordOperatingPoint(double time) Record the current operating point to history.voidReinitializes capacity constraints with current configuration.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.voidremoveEventListener(CompressorEventListener listener) Remove an event listener.voidReset all dynamic simulation state.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunController(double dt, UUID id) runController.voidrunTransient(double dt, UUID id) runTransientvoidsaveCompressorChartToCsv(String filePath) Save compressor chart to a CSV file.voidsaveCompressorChartToJson(String filePath) Save compressor chart to a JSON file.private voidSelect an appropriate curve template based on operating conditions.voidsetAntiSurge(AntiSurge antiSurge) Setter for the fieldantiSurge.voidsetAutoSpeedMode(boolean enabled) Enable or disable auto-speed mode.voidsetCalcPressureOut(boolean calcPressureOut) Setter for the fieldcalcPressureOut.voidsetCompressionRatio(double compRatio) Setter for the fieldcompressionRatio.voidsetCompressorChart(CompressorChartInterface compressorChart) Setter for the fieldcompressorChart.voidsetCompressorChartType(String type) Set CompressorChartTypevoidsetCurveTemplate(String template) Set the curve template to use for auto-sizing.voidsetDegradationFactor(double factor) Set the performance degradation factor.voidsetDriver(CompressorDriver driver) Set the compressor driver model.voidsetDriver(DriverType type, double ratedPower) Create and set a new driver with specified type and rated power.voidsetEfficiencySolveTolerance(double tolerance) Set the temperature tolerance used for efficiency solving iterations.voidsetFoulingFactor(double factor) Set the fouling factor.voidsetInletStream(StreamInterface inletStream) Set inlet Stream of twoport.voidsetIsentropicEfficiency(double isentropicEfficiency) setIsentropicEfficiency.voidsetIsSetMaxOutletPressure(boolean isSetMaxOutletPressure) Setter for the fieldisSetMaxOutletPressure.voidsetLimitSpeed(boolean limitSpeed) Sets whether the compressor speed should be limited.voidsetMaxAccelerationRate(double rate) Set the maximum acceleration rate.voidsetMaxDecelerationRate(double rate) Set the maximum deceleration rate.voidsetMaxDischargeTemperature(double tempKelvin) Sets the maximum discharge temperature in Kelvin.voidsetMaxDischargeTemperature(double temp, String unit) Sets the maximum discharge temperature constraint.voidsetMaximumSpeed(double maxSpeed) setMaximumSpeed.voidsetMaxOutletPressure(double maxOutletPressure) Setter for the fieldmaxOutletPressure.voidsetMechanicalLosses(CompressorMechanicalLosses mechanicalLosses) Set the mechanical losses model.voidsetMinimumSpeed(double minspeed) setMinimumSpeed.voidsetNumberOfCompressorCalcSteps(int numberOfCompressorCalcSteps) Setter for the fieldnumberOfCompressorCalcSteps.voidsetNumberOfSpeedCurves(int numberOfCurves) Set the number of speed curves to generate during auto-sizing.voidsetOperatingHours(double hours) Set the total operating hours.voidsetOperatingState(CompressorState state) Set the operating state of the compressor.voidsetOutletPressure(double pressure) Set outlet pressure of twoport.voidsetOutletPressure(double pressure, String unit) setOutletPressure.voidsetOutletTemperature(double outTemperature) Set the outlet temperature of the compressor.voidsetOutletTemperature(double temperature, String unit) Set the outlet temperature of the compressor with unit specification.voidsetOutTemperature(double outTemperature) Deprecated.voidsetPolytropicEfficiency(double polytropicEfficiency) setPolytropicEfficiency.voidsetPolytropicHeadMeter(double polytropicHeadMeter) Setter for the fieldpolytropicHeadMeter.voidsetPolytropicMethod(String polytropicMethod) Setter for the fieldpolytropicMethod.voidsetPower(double p) setPower.voidsetPressure(double pressure) Setter for the fieldpressure.voidsetPressure(double pressure, String unit) Setter for the fieldpressure.voidsetPropertyProfile(CompressorPropertyProfile propertyProfile) Setter for the fieldpropertyProfile.voidsetRotationalInertia(double inertia) Set the rotational inertia of the compressor rotor.voidsetShutdownProfile(ShutdownProfile profile) Set the shutdown profile.voidsetSolveSpeed(boolean solveSpeed) Setter for the fieldsolveSpeed.voidsetSpeed(double speed) Setter for the fieldspeed.voidsetStartupProfile(StartupProfile profile) Set the startup profile.voidsetStoneWallWarningThreshold(double threshold) Set the stone wall warning threshold.voidsetSurgeCriticalThreshold(double threshold) Set the surge critical threshold.voidsetSurgeWarningThreshold(double threshold) Set the surge warning threshold.voidsetTargetSpeed(double speed) Set the target speed for dynamic control.voidsetUseEnergyEfficiencyChart(boolean useEnergyEfficiencyChart) voidsetUseGERG2008(boolean useGERG2008) Setter for property useGERG2008.voidsetUseLeachman(boolean useLeachman) Setter for property useLeachman.voidsetUsePolytropicCalc(boolean usePolytropicCalc) Setter for the fieldusePolytropicCalc.voidsetUseRigorousPolytropicMethod(boolean useRigorousPolytropicMethod) Setter for the fielduseRigorousPolytropicMethod.voidsetUseVega(boolean useVega) Setter for property useVega.voidsolveAntiSurge.doublesolveEfficiency(double outTemperature) Calculates polytropic or isentropic efficiency by iteratively matching the specified outlet temperature.voidstartCompressor(double targetOperatingSpeed) Start the compressor following the startup profile.voidNormal shutdown.voidStop the compressor following the shutdown profile.toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.private voidUpdate speed automatically based on operating point.voidupdateDynamicState(double timeStep) Update the compressor state during a transient simulation step.voidUpdate mechanical losses model with current operating conditions.voidupdatePowerConstraint(double driverPowerRating) Updates the power constraint design value based on driver rating.private voidupdateShutdown(double timeStep) Update shutdown sequence.voidupdateSpeedConstraint(double designSpeed, double maximumSpeed) Updates the speed constraint design values.private voidupdateSpeedWithInertia(double targetSpd, double timeStep) Update speed considering inertia constraints.private voidupdateStartup(double timeStep) Update startup sequence.private booleanvoiduseOutTemperature(boolean useOutTemperature) useOutTemperature.booleanusePolytropicCalc.Methods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletStream, getOutletTemperature, setInletPressure, setInletTemperature, setOutletStream, validateSetupMethods inherited from class ProcessEquipmentBaseClass
getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getFailureMode, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getSpecification, getTemperature, getTemperature, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods 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 CompressorInterface
isSurgeMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getConditionAnalysisMessage, getController, getFluid, getMassBalance, getMassBalance, getPressure, getPressure, getReport_json, getRestCapacity, getSpecification, getTemperature, getTemperature, needRecalculation, reportResults, runConditionAnalysis, setController, setRegulatorOutSignal, setSpecification, setTemperature, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface StateVectorProvider
getStateDimension, getStateNamesMethods inherited from interface TwoPortInterface
getInletPressure, getInletStream, getInletTemperature, getInStream, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletTemperature, setOutletStream, setOutPressure, setOutPressure, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
thermoSystem
-
outTemperature
private double outTemperature -
useOutTemperature
private boolean useOutTemperature -
compressionRatio
private double compressionRatio -
actualCompressionRatio
private double actualCompressionRatio -
useCompressionRatio
private boolean useCompressionRatio -
maxOutletPressure
private double maxOutletPressure -
isSetMaxOutletPressure
private boolean isSetMaxOutletPressure -
maxDischargeTemperature
private double maxDischargeTemperatureMaximum discharge temperature in Kelvin for capacity constraint. -
isSetMaxDischargeTemperature
private boolean isSetMaxDischargeTemperature -
propertyProfile
-
dH
public double dH -
inletEnthalpy
public double inletEnthalpy -
solveSpeed
private boolean solveSpeed -
pressure
public double pressure -
speed
private double speed -
maxspeed
private double maxspeed -
minspeed
private double minspeed -
isentropicEfficiency
public double isentropicEfficiency -
polytropicEfficiency
public double polytropicEfficiency -
usePolytropicCalc
public boolean usePolytropicCalc -
powerSet
public boolean powerSet -
calcPressureOut
public boolean calcPressureOut -
compressorChart
-
antiSurge
-
polytropicHead
private double polytropicHead -
polytropicFluidHead
private double polytropicFluidHead -
polytropicHeadMeter
private double polytropicHeadMeter -
polytropicExponent
private double polytropicExponent -
numberOfCompressorCalcSteps
private int numberOfCompressorCalcSteps -
useRigorousPolytropicMethod
private boolean useRigorousPolytropicMethod -
useGERG2008
private boolean useGERG2008 -
useLeachman
private boolean useLeachman -
useVega
private boolean useVega -
limitSpeed
private boolean limitSpeed -
useEnergyEfficiencyChart
private boolean useEnergyEfficiencyChart -
operatingState
-
driver
-
operatingHistory
-
startupProfile
-
shutdownProfile
-
eventListeners
-
rotationalInertia
private double rotationalInertia -
maxAccelerationRate
private double maxAccelerationRate -
maxDecelerationRate
private double maxDecelerationRate -
targetSpeed
private double targetSpeed -
autoSpeedMode
private boolean autoSpeedMode -
degradationFactor
private double degradationFactor -
foulingFactor
private double foulingFactor -
operatingHours
private double operatingHours -
efficiencySolveTolerance
private double efficiencySolveTolerance -
autoSized
private boolean autoSizedFlag indicating if compressor has been auto-sized. -
curveTemplate
Template used for curve generation. -
numberOfSpeedCurves
private int numberOfSpeedCurvesNumber of speed curves to generate. -
surgeWarningThreshold
private double surgeWarningThreshold -
surgeCriticalThreshold
private double surgeCriticalThreshold -
stoneWallWarningThreshold
private double stoneWallWarningThreshold -
startupElapsedTime
private double startupElapsedTime -
shutdownElapsedTime
private double shutdownElapsedTime -
speedAtShutdownStart
private double speedAtShutdownStart -
surgeWarningActive
private boolean surgeWarningActive -
surgeCriticalActive
private boolean surgeCriticalActive -
speedLimitWarningActive
private boolean speedLimitWarningActive -
previousActualFlow
private double previousActualFlow -
previousPolyHead
private double previousPolyHead -
mechanicalDesign
CompressorMechanicalDesign mechanicalDesign -
mechanicalLosses
Mechanical losses model for seal gas and bearing calculations. -
pressureUnit
-
polytropicMethod
-
capacityConstraints
Capacity constraints map for this compressor. Marked transient because constraints contain lambdas/method references that are not serializable. Constraints are re-initialized after deserialization when needed. -
MIN_DEFAULT_DESIGN_POWER_KW
private static final double MIN_DEFAULT_DESIGN_POWER_KWMinimum default design power in kW for zero-flow compressors.- See Also:
-
MIN_DEFAULT_DESIGN_FLOW_M3H
private static final double MIN_DEFAULT_DESIGN_FLOW_M3HMinimum default design volume flow in m3/hr for zero-flow compressors.- See Also:
-
-
Constructor Details
-
Compressor
-
Compressor
Constructor for Compressor.
- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobject
-
Compressor
Constructor for Compressor.
- Parameters:
name- Name of compressorinterpolateMapLookup- a boolean
-
-
Method Details
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
getMechanicalLosses
Get the mechanical losses model for seal gas and bearing calculations.- Returns:
- mechanical losses model, or null if not configured
-
setMechanicalLosses
Set the mechanical losses model.- Parameters:
mechanicalLosses- the mechanical losses model
-
initMechanicalLosses
Initialize a default mechanical losses model based on current compressor configuration.This creates a mechanical losses model with typical parameters for a centrifugal compressor with dry gas seals and tilting pad bearings.
- Returns:
- the initialized mechanical losses model
-
initMechanicalLosses
Initialize a mechanical losses model with specified shaft diameter.- Parameters:
shaftDiameterMm- shaft diameter in mm- Returns:
- the initialized mechanical losses model
-
updateMechanicalLosses
public void updateMechanicalLosses()Update mechanical losses model with current operating conditions.Call this after running the compressor to update seal gas consumption and bearing losses.
-
getSealGasConsumption
public double getSealGasConsumption()Get total seal gas consumption including primary leakage, buffer gas, and separation gas.- Returns:
- seal gas consumption in Nm³/hr, or 0.0 if mechanical losses not configured
-
getBearingLoss
public double getBearingLoss()Get total bearing power loss.- Returns:
- bearing power loss in kW, or 0.0 if mechanical losses not configured
-
getMechanicalEfficiency
public double getMechanicalEfficiency()Get mechanical efficiency accounting for bearing and seal friction losses.- Returns:
- mechanical efficiency (0-1), or 0.98 if mechanical losses not configured
-
copy
Create deep copy.- Overrides:
copyin classProcessEquipmentBaseClass- Returns:
- a deep copy of the unit operation/process equipment
-
setInletStream
Set inlet Stream of twoport.- Specified by:
setInletStreamin interfaceTwoPortInterface- Overrides:
setInletStreamin classTwoPortEquipment- Parameters:
inletStream- value to set
-
solveAntiSurge
public void solveAntiSurge()solveAntiSurge.
-
setOutletPressure
public void setOutletPressure(double pressure) Set outlet pressure of twoport.- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- value to set in unit bara
-
setOutletPressure
setOutletPressure.
- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- a doubleunit- aStringobject
-
getOutletPressure
public double getOutletPressure()Get outlet pressure of twoport.- Specified by:
getOutletPressurein interfaceTwoPortInterface- Overrides:
getOutletPressurein classTwoPortEquipment- Returns:
- outlet pressure of TwoPortEquipment in unit bara
-
getEnergy
public double getEnergy()getEnergy.
- Specified by:
getEnergyin interfaceCompressorInterface- Returns:
- a double
-
getPower
public double getPower()getPower.
- Returns:
- a double
-
getPower
-
setPower
public void setPower(double p) setPower.
- Parameters:
p- a double
-
solveEfficiency
public double solveEfficiency(double outTemperature) Calculates polytropic or isentropic efficiency by iteratively matching the specified outlet temperature. The iteration continues until the temperature difference is within the tolerance set bysetEfficiencySolveTolerance(double)(default 0.01 K) or the maximum iteration count is reached.- Parameters:
outTemperature- the target outlet temperature in Kelvin- Returns:
- the calculated efficiency (polytropic or isentropic depending on configuration)
- See Also:
-
findOutPressure
public double findOutPressure(double hinn, double hout, double polytropicEfficiency) findOutPressure.
- Parameters:
hinn- a doublehout- a doublepolytropicEfficiency- a double- Returns:
- a double
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
useEnergyEfficiencyChart
private boolean useEnergyEfficiencyChart() -
setUseEnergyEfficiencyChart
public void setUseEnergyEfficiencyChart(boolean useEnergyEfficiencyChart) -
runTransient
runTransient
This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.- Specified by:
runTransientin interfaceSimulationInterface- Parameters:
dt- Delta time [s]id- Calculation identifier
-
generateCompressorCurves
public void generateCompressorCurves()generateCompressorCurves.
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
getResultTable
getResultTable.
- Specified by:
getResultTablein interfaceProcessEquipmentInterface- Overrides:
getResultTablein classProcessEquipmentBaseClass- Returns:
- an array of
Stringobjects
-
getTotalWork
public double getTotalWork()getTotalWork.
- Returns:
- a double
-
getIsentropicEfficiency
public double getIsentropicEfficiency()getIsentropicEfficiency.
- Specified by:
getIsentropicEfficiencyin interfaceCompressorInterface- Returns:
- a double
-
setIsentropicEfficiency
public void setIsentropicEfficiency(double isentropicEfficiency) setIsentropicEfficiency.
- Specified by:
setIsentropicEfficiencyin interfaceCompressorInterface- Parameters:
isentropicEfficiency- a double
-
usePolytropicCalc
public boolean usePolytropicCalc()usePolytropicCalc.
- Returns:
- the usePolytropicCalc
-
setUsePolytropicCalc
public void setUsePolytropicCalc(boolean usePolytropicCalc) Setter for the field
usePolytropicCalc.- Parameters:
usePolytropicCalc- the usePolytropicCalc to set
-
getPolytropicEfficiency
public double getPolytropicEfficiency()getPolytropicEfficiency.
- Specified by:
getPolytropicEfficiencyin interfaceCompressorInterface- Returns:
- a double
-
setPolytropicEfficiency
public void setPolytropicEfficiency(double polytropicEfficiency) setPolytropicEfficiency.
- Specified by:
setPolytropicEfficiencyin interfaceCompressorInterface- Parameters:
polytropicEfficiency- a double
-
getEfficiencySolveTolerance
public double getEfficiencySolveTolerance()Get the temperature tolerance used for efficiency solving iterations.- Returns:
- the efficiency solve tolerance in Kelvin
-
setEfficiencySolveTolerance
public void setEfficiencySolveTolerance(double tolerance) Set the temperature tolerance used for efficiency solving iterations. A larger tolerance provides faster convergence when using computationally expensive equations of state like GERG-2008, while still providing good engineering accuracy.- Parameters:
tolerance- the temperature tolerance in Kelvin (default is 0.01 K)
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
getCompressorChart
Getter for the field
compressorChart.- Returns:
- a
CompressorChartInterfaceobject
-
setCompressorChart
Setter for the field
compressorChart.- Parameters:
compressorChart- aCompressorChartInterfaceobject
-
saveCompressorChartToCsv
Save compressor chart to a CSV file.The CSV format is compatible with
CompressorChartReaderfor loading:speed;flow;head;polyEff 2000.00;9598.75;33.36;78.30 ...
- Parameters:
filePath- the path to save the CSV file- Throws:
IOException- if file cannot be written
-
saveCompressorChartToJson
Save compressor chart to a JSON file.The JSON format includes metadata (name, head unit, max design power) and is compatible with
CompressorChartJsonReaderfor loading:{ "compressorName": "Compressor Name", "headUnit": "kJ/kg", "maxDesignPower_kW": 16619.42, "speedCurves": [...] }- Parameters:
filePath- the path to save the JSON file- Throws:
IOException- if file cannot be written
-
loadCompressorChartFromCsv
Load compressor chart from a CSV file.The CSV format should match the output of
saveCompressorChartToCsv(String):speed;flow;head;polyEff 2000.00;9598.75;33.36;78.30 ...
- Parameters:
filePath- the path to the CSV file- Throws:
Exception- if file cannot be read or parsed
-
loadCompressorChartFromJson
Load compressor chart from a JSON file.The JSON format should match the output of
saveCompressorChartToJson(String). This method also restores the maxDesignPower if present in the JSON file.- Parameters:
filePath- the path to the JSON file- Throws:
Exception- if file cannot be read or parsed
-
loadCompressorChartFromJsonString
-
getCompressorChartAsJson
Get the compressor chart as a JSON string.- Returns:
- JSON string representation of the compressor chart
-
getAntiSurge
getAntiSurge.
- Specified by:
getAntiSurgein interfaceCompressorInterface- Returns:
- a
AntiSurgeobject
-
isSurge
public boolean isSurge(double flow, double head) isSurge.
- Parameters:
flow- a doublehead- a double- Returns:
- a boolean
-
getDistanceToSurge
public double getDistanceToSurge()getDistanceToSurge.
- Specified by:
getDistanceToSurgein interfaceCompressorInterface- Returns:
- a double
-
getSurgeFlowRateMargin
public double getSurgeFlowRateMargin()getSurgeFlowRateMargin.
- Specified by:
getSurgeFlowRateMarginin interfaceCompressorInterface- Returns:
- a double
-
getSurgeFlowRate
public double getSurgeFlowRate()getSurgeFlowRate.
- Specified by:
getSurgeFlowRatein interfaceCompressorInterface- Returns:
- a double
-
getSurgeFlowRateStd
public double getSurgeFlowRateStd()- Specified by:
getSurgeFlowRateStdin interfaceCompressorInterface
-
isStoneWall
public boolean isStoneWall()Description copied from interface:CompressorInterfaceisStoneWall.
- Specified by:
isStoneWallin interfaceCompressorInterface- Returns:
- a boolean
-
getDistanceToStoneWall
public double getDistanceToStoneWall()Calculate the distance to the stone wall (choke) limit.Returns a positive value indicating the percentage margin to stone wall. For example, 0.5 means the stone wall is 50% above the current flow rate.
For single speed compressors where the stone wall curve is not active, this method uses the maximum flow point at the current speed. For multi-speed compressors, it uses the stone wall curve interpolation.
- Returns:
- distance to stone wall as a ratio (stone wall flow / current flow - 1)
-
isStoneWall
public boolean isStoneWall(double flow, double head) isStoneWall.
- Parameters:
flow- a doublehead- a double- Returns:
- a boolean
-
setAntiSurge
-
getSafetyFactorCorrectedFlowHeadAtCurrentSpeed
public double[] getSafetyFactorCorrectedFlowHeadAtCurrentSpeed()Get the safety-factor-corrected surge flow and head at the current compressor speed.
This method returns the safe minimum operating point by applying the surge control factor (typically 1.05 for 5% margin) to the surge flow at the current speed. The head is calculated at this safe flow rate using the compressor chart. This is particularly useful for single speed compressors where speed cannot be adjusted to move away from surge.
- Returns:
- A double array with two elements: [0] = safe surge flow (m3/hr), [1] = head at safe flow (kJ/kg or meter depending on chart headUnit)
-
getSpeed
public double getSpeed()Getter for the field
speed.- Returns:
- a double
-
isHigherThanMaxSpeed
public boolean isHigherThanMaxSpeed()Check if the current compressor speed is higher than the maximum speed in the compressor curves.This method is useful for detecting when the compressor is operating outside its design envelope (requires speed extrapolation beyond the defined curves).
- Returns:
- true if the current speed exceeds the maximum curve speed, false otherwise
-
isHigherThanMaxSpeed
public boolean isHigherThanMaxSpeed(double calculatedSpeed) Check if a calculated speed is higher than the maximum speed in the compressor curves.- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the calculated speed exceeds the maximum curve speed, false otherwise
-
getRatioToMaxSpeed
public double getRatioToMaxSpeed()Get the ratio of the current compressor speed to the maximum speed in the compressor curves.A ratio greater than 1.0 indicates the speed exceeds the maximum curve speed.
- Returns:
- the ratio speed/maxSpeedCurve (dimensionless), or NaN if chart not set
-
getRatioToMaxSpeed
public double getRatioToMaxSpeed(double calculatedSpeed) Get the ratio of a calculated speed to the maximum speed in the compressor curves.- Parameters:
calculatedSpeed- the speed to compare in RPM- Returns:
- the ratio calculatedSpeed/maxSpeedCurve (dimensionless), or NaN if chart not set
-
isLowerThanMinSpeed
public boolean isLowerThanMinSpeed()Check if the current compressor speed is lower than the minimum speed in the compressor curves.This method is useful for detecting when the compressor is operating below its design envelope (requires speed extrapolation below the defined curves), which may indicate turndown issues.
- Returns:
- true if the current speed is below the minimum curve speed, false otherwise
-
isLowerThanMinSpeed
public boolean isLowerThanMinSpeed(double calculatedSpeed) Check if a calculated speed is lower than the minimum speed in the compressor curves.- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the calculated speed is below the minimum curve speed, false otherwise
-
getRatioToMinSpeed
public double getRatioToMinSpeed()Get the ratio of the current compressor speed to the minimum speed in the compressor curves.A ratio less than 1.0 indicates the speed is below the minimum curve speed.
- Returns:
- the ratio speed/minSpeedCurve (dimensionless), or NaN if chart not set
-
getRatioToMinSpeed
public double getRatioToMinSpeed(double calculatedSpeed) Get the ratio of a calculated speed to the minimum speed in the compressor curves.- Parameters:
calculatedSpeed- the speed to compare in RPM- Returns:
- the ratio calculatedSpeed/minSpeedCurve (dimensionless), or NaN if chart not set
-
isSpeedWithinRange
public boolean isSpeedWithinRange()Check if the current compressor speed is within the defined compressor curve speed range.- Returns:
- true if the speed is within [minSpeedCurve, maxSpeedCurve], false otherwise
-
isSpeedWithinRange
public boolean isSpeedWithinRange(double calculatedSpeed) Check if a calculated speed is within the defined compressor curve speed range.- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the speed is within [minSpeedCurve, maxSpeedCurve], false otherwise
-
setSpeed
public void setSpeed(double speed) Setter for the field
speed.- Parameters:
speed- a int
-
getPolytropicHead
-
getPolytropicHead
public double getPolytropicHead()Getter for the field
polytropicHead.- Returns:
- a double
-
getPolytropicFluidHead
public double getPolytropicFluidHead()Getter for the field
polytropicFluidHead.- Returns:
- a double
-
getPolytropicExponent
public double getPolytropicExponent()Getter for the field
polytropicExponent.- Returns:
- a double
-
getPolytropicHeadMeter
public double getPolytropicHeadMeter()Getter for the field
polytropicHeadMeter.- Returns:
- a double
-
setPolytropicHeadMeter
public void setPolytropicHeadMeter(double polytropicHeadMeter) Setter for the field
polytropicHeadMeter.- Parameters:
polytropicHeadMeter- a double
-
getOutTemperature
public double getOutTemperature()Getter for the field
outTemperature.- Returns:
- outlet temperature in Kelvin
-
setOutletTemperature
public void setOutletTemperature(double outTemperature) Set the outlet temperature of the compressor.
- Specified by:
setOutletTemperaturein interfaceTwoPortInterface- Overrides:
setOutletTemperaturein classTwoPortEquipment- Parameters:
outTemperature- outlet temperature in Kelvin
-
setOutletTemperature
Set the outlet temperature of the compressor with unit specification.
- Specified by:
setOutletTemperaturein interfaceTwoPortInterface- Overrides:
setOutletTemperaturein classTwoPortEquipment- Parameters:
temperature- outlet temperature valueunit- temperature unit (e.g., "K", "C", "R", "F")
-
setOutTemperature
Deprecated.usesetOutletTemperature(double)insteadSetter for the field
outTemperature.- Specified by:
setOutTemperaturein interfaceTwoPortInterface- Parameters:
outTemperature- outlet temperature in Kelvin
-
useOutTemperature
public void useOutTemperature(boolean useOutTemperature) useOutTemperature.
- Parameters:
useOutTemperature- a boolean
-
getNumberOfCompressorCalcSteps
public int getNumberOfCompressorCalcSteps()Getter for the field
numberOfCompressorCalcSteps.- Returns:
- the number of calculation steps in compressor
-
setNumberOfCompressorCalcSteps
public void setNumberOfCompressorCalcSteps(int numberOfCompressorCalcSteps) Setter for the field
numberOfCompressorCalcSteps.- Parameters:
numberOfCompressorCalcSteps- a int
-
isUseRigorousPolytropicMethod
public boolean isUseRigorousPolytropicMethod()isUseRigorousPolytropicMethod.
- Returns:
- a boolean
-
setUseRigorousPolytropicMethod
public void setUseRigorousPolytropicMethod(boolean useRigorousPolytropicMethod) Setter for the field
useRigorousPolytropicMethod.- Parameters:
useRigorousPolytropicMethod- a boolean
-
setPressure
public void setPressure(double pressure) Setter for the field
pressure.- Specified by:
setPressurein interfaceProcessEquipmentInterface- Overrides:
setPressurein classProcessEquipmentBaseClass- Parameters:
pressure- a double
-
setPressure
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getExergyChange
Get exergy change production of the process equipment.- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Overrides:
getExergyChangein classProcessEquipmentBaseClass- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
getPolytropicMethod
-
setPolytropicMethod
-
isUseGERG2008
public boolean isUseGERG2008()Getter for property useGERG2008.- Returns:
- Value
-
setUseGERG2008
public void setUseGERG2008(boolean useGERG2008) Setter for property useGERG2008.- Parameters:
useGERG2008- Value to set
-
isUseLeachman
public boolean isUseLeachman()Getter for property useLeachman.- Returns:
- Value
-
setUseLeachman
public void setUseLeachman(boolean useLeachman) Setter for property useLeachman.- Parameters:
useLeachman- Value to set
-
isUseVega
public boolean isUseVega()Getter for property useVega.- Returns:
- Value
-
setUseVega
public void setUseVega(boolean useVega) Setter for property useVega.- Parameters:
useVega- Value to set
-
getPropertyProfile
Getter for the field
propertyProfile.- Returns:
- a
CompressorPropertyProfileobject
-
setPropertyProfile
Setter for the field
propertyProfile.- Parameters:
propertyProfile- aCompressorPropertyProfileobject
-
runController
runController.
- Parameters:
dt- a doubleid- Calculation identifier
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceProcessEquipmentInterface- Overrides:
hashCodein classProcessEquipmentBaseClass
-
equals
- Specified by:
equalsin interfaceProcessEquipmentInterface- Overrides:
equalsin classProcessEquipmentBaseClass
-
setMaximumSpeed
public void setMaximumSpeed(double maxSpeed) setMaximumSpeed.
- Specified by:
setMaximumSpeedin interfaceCompressorInterface- Parameters:
maxSpeed- a double
-
setMinimumSpeed
public void setMinimumSpeed(double minspeed) setMinimumSpeed.
- Specified by:
setMinimumSpeedin interfaceCompressorInterface- Parameters:
minspeed- a double
-
getMaximumSpeed
public double getMaximumSpeed()getMaximumSpeed.
- Specified by:
getMaximumSpeedin interfaceCompressorInterface- Returns:
- a double
-
getMinimumSpeed
public double getMinimumSpeed()getMinimumSpeed.
- Specified by:
getMinimumSpeedin interfaceCompressorInterface- Returns:
- a double
-
setCompressionRatio
public void setCompressionRatio(double compRatio) Setter for the field
compressionRatio.- Parameters:
compRatio- a double
-
getCompressionRatio
public double getCompressionRatio()Getter for the field
compressionRatio.- Returns:
- a double
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Parameters:
cfg- report configuration- Returns:
- json string
-
getMaxOutletPressure
public double getMaxOutletPressure()Getter for the field
maxOutletPressure.- Returns:
- a double
-
setMaxOutletPressure
public void setMaxOutletPressure(double maxOutletPressure) Setter for the field
maxOutletPressure.- Parameters:
maxOutletPressure- a double
-
isSetMaxOutletPressure
public boolean isSetMaxOutletPressure()isSetMaxOutletPressure.
- Returns:
- a boolean
-
setIsSetMaxOutletPressure
public void setIsSetMaxOutletPressure(boolean isSetMaxOutletPressure) Setter for the field
isSetMaxOutletPressure.- Parameters:
isSetMaxOutletPressure- a boolean
-
getMaxDischargeTemperature
public double getMaxDischargeTemperature()Gets the maximum discharge temperature.- Returns:
- maximum discharge temperature in Kelvin
-
getMaxDischargeTemperature
Gets the maximum discharge temperature in specified unit.- Parameters:
unit- temperature unit ("K", "C", or "F")- Returns:
- maximum discharge temperature in specified unit
-
setMaxDischargeTemperature
Sets the maximum discharge temperature constraint.This value is used by the capacity constraint framework to track discharge temperature utilization. When the actual discharge temperature exceeds this limit, the compressor will be flagged as over-utilized.
- Parameters:
temp- maximum discharge temperatureunit- temperature unit ("K", "C", or "F")
-
setMaxDischargeTemperature
public void setMaxDischargeTemperature(double tempKelvin) Sets the maximum discharge temperature in Kelvin.- Parameters:
tempKelvin- maximum discharge temperature in Kelvin
-
isSetMaxDischargeTemperature
public boolean isSetMaxDischargeTemperature()Checks if maximum discharge temperature has been explicitly set.- Returns:
- true if max discharge temperature is set
-
getActualCompressionRatio
public double getActualCompressionRatio()Getter for the field
actualCompressionRatio.- Returns:
- a double
-
setCompressorChartType
Set CompressorChartType
- Specified by:
setCompressorChartTypein interfaceCompressorInterface- Parameters:
type- aStringobject
-
generateCompressorChart
public void generateCompressorChart()Generates a compressor chart based on the current operating point.This is a convenience method that creates a single-speed compressor chart using the compressor's current speed and operating conditions. The chart type will match the compressor's current chart type setting.
Example usage:
compressor.setSpeed(10000); compressor.run(); compressor.generateCompressorChart(); // Generates chart at current speed
-
generateCompressorChart
public void generateCompressorChart(int numberOfSpeeds) Generates a compressor chart with multiple speed curves.Creates a multi-speed compressor chart centered around the current speed. The speeds are distributed from 80% to 120% of the current speed.
- Parameters:
numberOfSpeeds- Number of speed curves to generate (must be at least 1)
-
generateCompressorChart
Generates a compressor chart with specified options.Available generation options:
- "normal curves" - Standard 5-point curves with surge, design, and stonewall points
- "mid range" - 3-point simplified curves
- Parameters:
generationOption- The generation option to use
-
generateCompressorChart
Generates a compressor chart with specified options and number of speeds.This is the main chart generation method that provides full control over the generated chart. The generated chart will automatically use the compressor's current chart type (simple, interpolate, or interpolate and extrapolate).
Example usage:
// Generate 5-speed chart with normal curves compressor.generateCompressorChart("normal curves", 5); // Generate 3-speed chart with simplified curves compressor.generateCompressorChart("mid range", 3);- Parameters:
generationOption- The generation option: "normal curves" or "mid range"numberOfSpeeds- Number of speed curves to generate (must be at least 1)
-
generateCompressorChartFromTemplate
Generates a compressor chart from a predefined template.Templates provide realistic compressor curve shapes based on typical compressor characteristics. Available templates:
- "CENTRIFUGAL_STANDARD" - Standard centrifugal compressor curves
- "CENTRIFUGAL_HIGH_FLOW" - High flow, lower head compressor
- "CENTRIFUGAL_HIGH_HEAD" - High head, narrower operating range
Example usage:
compressor.generateCompressorChartFromTemplate("CENTRIFUGAL_STANDARD", 9);- Parameters:
templateName- Name of the template to usenumberOfSpeeds- Number of speed curves to generate
-
generateCompressorChart
Generates a compressor chart with specific speed values.This method allows precise control over which speeds are included in the chart.
- Parameters:
generationOption- The generation option: "normal curves" or "mid range"speeds- Array of speed values in RPM
-
getCompressorChartType
Gets the current compressor chart type as a string.- Returns:
- The chart type: "simple", "interpolate", or "interpolate and extrapolate"
-
isSolveSpeed
public boolean isSolveSpeed()isSolveSpeed.
- Returns:
- a boolean
-
setSolveSpeed
public void setSolveSpeed(boolean solveSpeed) Setter for the field
solveSpeed.- Parameters:
solveSpeed- a boolean
-
isCalcPressureOut
public boolean isCalcPressureOut()isCalcPressureOut.
- Returns:
- a boolean
-
setCalcPressureOut
public void setCalcPressureOut(boolean calcPressureOut) Setter for the field
calcPressureOut.- Parameters:
calcPressureOut- a boolean
-
isLimitSpeed
public boolean isLimitSpeed()Checks if the compressor speed is limited.- Returns:
trueif the compressor speed is limited,falseotherwise.
-
setLimitSpeed
public void setLimitSpeed(boolean limitSpeed) Sets whether the compressor speed should be limited.- Parameters:
limitSpeed-trueto limit the compressor speed,falseotherwise.
-
getExergyChange
getExergyChange.
- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
getCapacityDuty
public double getCapacityDuty()getCapacityDuty.
For compressors, capacity duty is defined as the total shaft work (power consumption) in Watts. This is used in conjunction with
getCapacityMax()for bottleneck analysis viaProcessSystem.getBottleneck().For more detailed constraint analysis including speed and surge limits, use the
CapacityConstrainedEquipmentinterface methods.- Specified by:
getCapacityDutyin interfaceProcessEquipmentInterface- Returns:
- shaft power in Watts
-
getCapacityMax
public double getCapacityMax()getCapacityMax.
For compressors, maximum capacity is determined in priority order:
- Driver speed-dependent max power curve (if driver and speed are set)
- Mechanical design maximum power
- Driver rated power with 10% overload margin
- Specified by:
getCapacityMaxin interfaceProcessEquipmentInterface- Returns:
- maximum design power in Watts (converted from kW if from driver)
-
getStateVector
Get the current state as a standardized vector.The state vector should include all observable variables relevant for control and monitoring. Values should be in physical units with appropriate bounds.
Returns state vector containing:
- inlet_pressure - Inlet pressure [bar]
- outlet_pressure - Outlet pressure [bar]
- inlet_temperature - Inlet temperature [K]
- outlet_temperature - Outlet temperature [K]
- compression_ratio - Compression ratio [-]
- polytropic_efficiency - Polytropic efficiency [fraction]
- isentropic_efficiency - Isentropic efficiency [fraction]
- power - Shaft power [kW]
- speed - Rotational speed [rpm]
- surge_margin - Distance to surge [%]
- polytropic_head - Polytropic head [kJ/kg]
- inlet_flow - Inlet mass flow [kg/s]
- Specified by:
getStateVectorin interfaceStateVectorProvider- Returns:
- current state vector
-
getOperatingState
Get the current operating state of the compressor.- Returns:
- the current CompressorState
-
setOperatingState
Set the operating state of the compressor.- Parameters:
state- the new operating state
-
getDriver
Get the compressor driver model.- Returns:
- the driver model, or null if not set
-
setDriver
Set the compressor driver model.Setting a new driver will reinitialize capacity constraints to incorporate the driver's rated speed limit into the speed constraint.
- Parameters:
driver- the driver model
-
setDriver
Create and set a new driver with specified type and rated power.Setting a new driver will reinitialize capacity constraints to incorporate the driver's rated speed limit into the speed constraint.
- Parameters:
type- driver typeratedPower- rated power in kW
-
getOperatingHistory
Get the operating history tracker.- Returns:
- the operating history, or null if not enabled
-
enableOperatingHistory
public void enableOperatingHistory()Enable operating history tracking. -
disableOperatingHistory
public void disableOperatingHistory()Disable operating history tracking. -
recordOperatingPoint
public void recordOperatingPoint(double time) Record the current operating point to history.- Parameters:
time- simulation time in seconds
-
getStartupProfile
Get the startup profile.- Returns:
- the startup profile, or null if not set
-
setStartupProfile
Set the startup profile.- Parameters:
profile- the startup profile
-
getShutdownProfile
Get the shutdown profile.- Returns:
- the shutdown profile, or null if not set
-
setShutdownProfile
Set the shutdown profile.- Parameters:
profile- the shutdown profile
-
addEventListener
Add an event listener for compressor events.- Parameters:
listener- the event listener to add
-
removeEventListener
Remove an event listener.- Parameters:
listener- the event listener to remove
-
getRotationalInertia
public double getRotationalInertia()Get the rotational inertia of the compressor rotor.- Returns:
- inertia in kg⋅m²
-
setRotationalInertia
public void setRotationalInertia(double inertia) Set the rotational inertia of the compressor rotor.- Parameters:
inertia- inertia in kg⋅m²
-
getMaxAccelerationRate
public double getMaxAccelerationRate()Get the maximum acceleration rate.- Returns:
- max acceleration in RPM/s
-
setMaxAccelerationRate
public void setMaxAccelerationRate(double rate) Set the maximum acceleration rate.- Parameters:
rate- max acceleration in RPM/s
-
getMaxDecelerationRate
public double getMaxDecelerationRate()Get the maximum deceleration rate.- Returns:
- max deceleration in RPM/s
-
setMaxDecelerationRate
public void setMaxDecelerationRate(double rate) Set the maximum deceleration rate.- Parameters:
rate- max deceleration in RPM/s
-
getTargetSpeed
public double getTargetSpeed()Get the target speed for dynamic control.- Returns:
- target speed in RPM
-
setTargetSpeed
public void setTargetSpeed(double speed) Set the target speed for dynamic control.- Parameters:
speed- target speed in RPM
-
isAutoSpeedMode
public boolean isAutoSpeedMode()Check if auto-speed mode is enabled.In auto-speed mode, the compressor automatically calculates the required speed from the current operating point (flow and head) using the compressor chart.
- Returns:
- true if auto-speed mode is enabled
-
setAutoSpeedMode
public void setAutoSpeedMode(boolean enabled) Enable or disable auto-speed mode.- Parameters:
enabled- true to enable auto-speed mode
-
getDegradationFactor
public double getDegradationFactor()Get the performance degradation factor.- Returns:
- degradation factor (1.0 = new, less than 1.0 = degraded)
-
setDegradationFactor
public void setDegradationFactor(double factor) Set the performance degradation factor.- Parameters:
factor- degradation factor (1.0 = new, less than 1.0 = degraded)
-
getFoulingFactor
public double getFoulingFactor()Get the fouling factor.- Returns:
- fouling factor (0 = clean, higher = more fouled)
-
setFoulingFactor
public void setFoulingFactor(double factor) Set the fouling factor.- Parameters:
factor- fouling factor (0 = clean, higher = more fouled)
-
getOperatingHours
public double getOperatingHours()Get the total operating hours.- Returns:
- operating hours
-
setOperatingHours
public void setOperatingHours(double hours) Set the total operating hours.- Parameters:
hours- operating hours
-
addOperatingHours
public void addOperatingHours(double hours) Add operating time.- Parameters:
hours- hours to add
-
getSurgeWarningThreshold
public double getSurgeWarningThreshold()Get the surge warning threshold.- Returns:
- threshold as ratio (e.g., 0.15 = 15% margin)
-
setSurgeWarningThreshold
public void setSurgeWarningThreshold(double threshold) Set the surge warning threshold.- Parameters:
threshold- threshold as ratio
-
getSurgeCriticalThreshold
public double getSurgeCriticalThreshold()Get the surge critical threshold.- Returns:
- threshold as ratio (e.g., 0.05 = 5% margin)
-
setSurgeCriticalThreshold
public void setSurgeCriticalThreshold(double threshold) Set the surge critical threshold.- Parameters:
threshold- threshold as ratio
-
getStoneWallWarningThreshold
public double getStoneWallWarningThreshold()Get the stone wall warning threshold.- Returns:
- threshold as ratio
-
setStoneWallWarningThreshold
public void setStoneWallWarningThreshold(double threshold) Set the stone wall warning threshold.- Parameters:
threshold- threshold as ratio
-
checkSurgeMargin
public void checkSurgeMargin()Check surge margin and fire events if thresholds are crossed. -
checkStoneWallMargin
public void checkStoneWallMargin()Check stone wall margin and fire events if threshold is crossed. -
checkSpeedLimits
public void checkSpeedLimits()Check speed limits and fire events if limits are exceeded. -
checkPowerLimits
public void checkPowerLimits()Check driver power limits and fire events if limits are exceeded. -
startCompressor
public void startCompressor(double targetOperatingSpeed) Start the compressor following the startup profile.- Parameters:
targetOperatingSpeed- the final target speed in RPM
-
stopCompressor
Stop the compressor following the shutdown profile.- Parameters:
type- the type of shutdown
-
stopCompressor
public void stopCompressor()Normal shutdown. -
emergencyShutdown
public void emergencyShutdown()Emergency shutdown (ESD). -
updateDynamicState
public void updateDynamicState(double timeStep) Update the compressor state during a transient simulation step.This method should be called during dynamic simulation to update the compressor speed, state, and fire appropriate events.
- Parameters:
timeStep- the time step in seconds
-
updateStartup
private void updateStartup(double timeStep) Update startup sequence.- Parameters:
timeStep- time step in seconds
-
updateShutdown
private void updateShutdown(double timeStep) Update shutdown sequence.- Parameters:
timeStep- time step in seconds
-
updateSpeedWithInertia
private void updateSpeedWithInertia(double targetSpd, double timeStep) Update speed considering inertia constraints.- Parameters:
targetSpd- target speed in RPMtimeStep- time step in seconds
-
updateAutoSpeed
private void updateAutoSpeed()Update speed automatically based on operating point. -
getEffectivePolytropicHead
public double getEffectivePolytropicHead()Get the effective polytropic head accounting for degradation.- Returns:
- effective head in kJ/kg
-
getEffectivePolytropicEfficiency
public double getEffectivePolytropicEfficiency()Get the effective efficiency accounting for degradation.- Returns:
- effective polytropic efficiency
-
fireSurgeApproachEvent
private void fireSurgeApproachEvent(double surgeMargin, boolean isCritical) Fire surge approach event to all listeners.- Parameters:
surgeMargin- current surge marginisCritical- true if critical threshold
-
fireSurgeOccurredEvent
private void fireSurgeOccurredEvent(double surgeMargin) Fire surge occurred event.- Parameters:
surgeMargin- current surge margin
-
fireSpeedLimitExceededEvent
private void fireSpeedLimitExceededEvent(double currentSpeed, double ratio) Fire speed limit exceeded event.- Parameters:
currentSpeed- current speedratio- ratio to max speed
-
fireSpeedBelowMinimumEvent
private void fireSpeedBelowMinimumEvent(double currentSpeed, double ratio) Fire speed below minimum event.- Parameters:
currentSpeed- current speedratio- ratio to min speed
-
firePowerLimitExceededEvent
private void firePowerLimitExceededEvent(double currentPower, double maxPower) Fire power limit exceeded event.- Parameters:
currentPower- current power in kWmaxPower- max available power in kW
-
fireStateChangeEvent
Fire state change event.- Parameters:
oldState- previous statenewState- new state
-
fireStoneWallApproachEvent
private void fireStoneWallApproachEvent(double stoneWallMargin) Fire stone wall approach event.- Parameters:
stoneWallMargin- margin to stone wall
-
fireStartupCompleteEvent
private void fireStartupCompleteEvent()Fire startup complete event. -
fireShutdownCompleteEvent
private void fireShutdownCompleteEvent()Fire shutdown complete event. -
acknowledgeTrip
public void acknowledgeTrip()Acknowledge a tripped compressor to allow restart. -
resetDynamicState
public void resetDynamicState()Reset all dynamic simulation state. -
initializeCapacityConstraints
protected void initializeCapacityConstraints()Initializes default capacity constraints for this compressor.Creates constraints for speed, power, and surge margin based on the compressor's design parameters. Additional constraints can be added after construction.
-
reinitializeCapacityConstraints
public void reinitializeCapacityConstraints()Reinitializes capacity constraints with current configuration.Call this method after setting compressor charts or changing speed limits to update the constraints with the new values. This clears existing constraints and recreates them based on current settings.
-
ensureCapacityConstraintsInitialized
private void ensureCapacityConstraintsInitialized()Ensures the capacity constraints map is initialized. Called after deserialization since the map is transient. -
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:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Returns:
- unmodifiable map of constraint name to 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:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- 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:
isCapacityExceededin interfaceCapacityConstrainedEquipment- 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:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- 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:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
isSimulationValid
public boolean isSimulationValid()Checks if the current simulation result is physically valid.Returns false if calculated values are outside physically possible ranges. This method should be overridden by specific equipment types to perform equipment-specific validation. For example:
- Compressor: power must be positive, head must be positive
- Heat exchanger: duty direction must match temperature change
- Separator: phase fractions must sum to 1.0
Validates that the compressor simulation produced physically reasonable results. Checks for:
- Positive power consumption (compressors consume energy)
- Positive polytropic head (work done on gas)
- Outlet temperature greater than inlet (compression heats gas)
- Pressure ratio greater than 1.0
- Non-NaN values for key properties
- Speed within compressor chart limits (if chart is active)
- Operating point not in surge region (if surge curve is defined)
- Operating point not beyond stonewall/choke (if stonewall curve is defined)
- Specified by:
isSimulationValidin interfaceProcessEquipmentInterface- Returns:
- true if simulation results are physically valid, false otherwise
-
getSimulationValidationErrors
Gets validation errors for the current simulation state.Returns a list of human-readable error messages describing why the simulation result is invalid. Returns an empty list if the simulation is valid.
Returns detailed validation errors for the compressor simulation.
- Specified by:
getSimulationValidationErrorsin interfaceProcessEquipmentInterface- Returns:
- list of validation error messages, empty if valid
-
isWithinOperatingEnvelope
public boolean isWithinOperatingEnvelope()Checks if the equipment is operating within its valid operating envelope.This is different from capacity utilization - it checks whether the equipment can physically operate at the current conditions, not whether it's operating efficiently. For example:
- Compressor: checks if between surge and stonewall
- Pump: checks if above minimum flow (no cavitation)
- Heat exchanger: checks if approach temperature is positive
Checks if the compressor is operating within its valid envelope (between surge and stonewall).
- Specified by:
isWithinOperatingEnvelopein interfaceProcessEquipmentInterface- Returns:
- true if operating within valid envelope
-
getOperatingEnvelopeViolation
Gets the reason why equipment is outside its operating envelope.- Specified by:
getOperatingEnvelopeViolationin interfaceProcessEquipmentInterface- Returns:
- description of envelope violation, or null if within envelope
-
addCapacityConstraint
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:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraint- the constraint to add
-
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
-
updateSpeedConstraint
public void updateSpeedConstraint(double designSpeed, double maximumSpeed) Updates the speed constraint design values.Call this method after setting design speed and maximum speed to update the constraint.
- Parameters:
designSpeed- the design speed in RPMmaximumSpeed- the maximum allowable speed in RPM
-
updatePowerConstraint
public void updatePowerConstraint(double driverPowerRating) Updates the power constraint design value based on driver rating.- Parameters:
driverPowerRating- the driver power rating in kW
-
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:
autoSizein interfaceAutoSizeable- 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:
autoSizein interfaceAutoSizeable
-
autoSize
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:
autoSizein interfaceAutoSizeable- Parameters:
company- 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:
isAutoSizedin interfaceAutoSizeable- Returns:
- true if autoSize() has been called successfully
-
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:
getSizingReportin interfaceAutoSizeable- Returns:
- formatted sizing report string
-
getSizingReportJson
Get sizing report as JSON for programmatic access.- Specified by:
getSizingReportJsonin interfaceAutoSizeable- Returns:
- JSON string with sizing data
-
setCurveTemplate
Set the curve template to use for auto-sizing.Available templates:
- "CENTRIFUGAL_STANDARD" - Standard centrifugal compressor (default)
- "CENTRIFUGAL_HIGH_FLOW" - High flow, lower head compressor
- "CENTRIFUGAL_HIGH_HEAD" - High head, narrower operating range
- "PIPELINE" - Pipeline/export compressor
- "EXPORT" - Offshore export compressor
- "INJECTION" - Gas injection compressor
- "GAS_LIFT" - Gas lift compressor
- "REFRIGERATION" - Refrigeration compressor
- "BOOSTER" - Booster compressor
- Parameters:
template- the template name
-
getCurveTemplate
Get the curve template used for auto-sizing.- Returns:
- the template name
-
setNumberOfSpeedCurves
public void setNumberOfSpeedCurves(int numberOfCurves) Set the number of speed curves to generate during auto-sizing.- Parameters:
numberOfCurves- number of curves (typically 3-9)
-
getNumberOfSpeedCurves
public int getNumberOfSpeedCurves()Get the number of speed curves generated during auto-sizing.- Returns:
- number of speed curves
-
selectTemplateForApplication
private void selectTemplateForApplication()Select an appropriate curve template based on operating conditions. Called during autoSize(company, trDocument) to pick a suitable template. -
builder
Creates a new Builder for constructing a Compressor with a fluent API.Example usage:
Compressor comp = Compressor.builder("K-100").inletStream(feed).outletPressure(50.0, "bara") .polytropicEfficiency(0.75).speed(8000).build();- Parameters:
name- the name of the compressor- Returns:
- a new Builder instance
-
setOutletTemperature(double)instead