Interface ProcessEquipmentInterface
- All Superinterfaces:
NamedInterface, ProcessElementInterface, Runnable, Serializable, SimulationInterface
- All Known Subinterfaces:
AbsorberInterface, CompressorInterface, DistillationInterface, ExpanderInterface, MixerInterface, ModuleInterface, MultiStreamHeatExchangerInterface, PumpInterface, SplitterInterface, StreamInterface, TrayInterface, ValveInterface
- All Known Implementing Classes:
AdiabaticPipe, AdiabaticTwoPhasePipe, Adjuster, AdsorptionBed, AdsorptionDehydrationlModule, AirCooler, AmmoniaSynthesisReactor, AnaerobicDigester, AnnularLeakagePath, BatteryStorage, BiogasUpgrader, BiomassGasifier, BlackOilSeparator, BlowdownValve, Calculator, CementDegradationModel, CharCoalFilter, CheckValve, CO2Electrolyzer, CO2RemovalModule, CombinedCycleSystem, ComponentSplitter, Compressor, CompressorTrain, Condenser, ControlValve, Cooler, CryogenicSeparator, Crystallizer, DexpiProcessUnit, DexpiProcessUnit, DexpiStream, DexpiStream, DistillationColumn, DPCUModule, Dryer, Ejector, Electrolyzer, EndFlash, EnzymeTreatment, EquilibriumStream, ESDValve, ESPPump, Expander, ExpanderOld, FermentationReactor, Fermenter, Filter, FiredHeater, Flare, FlareStack, FlexiblePipe, FloatingSubstructure, FlowRateAdjuster, FlowSetter, FuelCell, FuelGasSystem, FurnaceBurner, GasFlotationUnit, GasScrubber, GasScrubberSimple, GasTurbine, GibbsReactor, GibbsReactorCO2, GlycolDehydrationlModule, GORfitter, H2SScavenger, Heater, HeatExchanger, HIPPSValve, HRSG, Hydrocyclone, Hydrocyclone, IncompressiblePipeFlow, InjectionConformanceMonitor, IronIonSaturationStream, LevelControlValve, LiquidLiquidExtractor, LNGAgeingScenario, LNGHeatExchanger, LNGTank, LoopedPipeNetwork, Manifold, MEGReclaimerModule, MembraneSeparator, MercuryRemovalBed, Mixer, MixerGasProcessingModule, MoleFractionControllerUtil, MooringSystem, MPFMfitter, MultiCompartmentReservoir, MultiEffectEvaporator, MultiphasePipe, MultiPortEquipment, MultiStreamHeatExchanger, MultiStreamHeatExchanger2, MultiVariableAdjuster, NeqGasScrubber, NeqHeater, NeqSimUnit, NeqStream, OffshoreEnergySystem, OnePhasePipeLine, Orifice, PackedColumn, PipeBeggsAndBrills, PipeFlowNetwork, PipeHagedornBrown, Pipeline, PipeMukherjeeAndBrill, PLEM, PLET, PlugFlowReactor, PressureControlValve, PressureDrop, PressureFilter, ProcessEquipmentBaseClass, ProcessModuleBaseClass, ProducedWaterTreatmentTrain, PropaneCoolingModule, PSDValve, Pump, PyrolysisReactor, RateBasedAbsorber, RateBasedPackedColumn, ReactiveTray, Reboiler, ReBoiler, Recycle, ReservoirCVDsim, ReservoirDiffLibsim, ReservoirTPsim, Riser, RotaryVacuumFilter, RuptureDisk, SafetyReliefValve, SafetyValve, ScalePotentialCheckStream, ScrewPress, ScrubColumn, SeparationTrainModule, SeparationTrainModuleSimple, Separator, SetPoint, Setter, ShortcutDistillationColumn, SimpleAbsorber, SimpleAdsorber, SimpleAmineAbsorber, SimpleFlowLine, SimpleReservoir, SimpleTEGAbsorber, SimpleTPoutPipeline, SimpleTray, SolarPanel, SolidsCentrifuge, SolidsSeparator, Splitter, SpreadsheetBlock, StaticMixer, StaticNeqMixer, StaticPhaseMixer, SteamHeater, SteamTurbine, StirredTankReactor, Stream, StreamSaturatorUtil, StreamTransition, SubseaBooster, SubseaJumper, SubseaManifold, SubseaPowerCable, SubseaTree, SubseaWell, SulfurDepositionAnalyser, SulfurFilter, Tank, ThreePhaseSeparator, ThrottlingValve, TopsidePiping, TransientPipe, TransientWellbore, TubingPerformance, TubingPerformance, TurboExpanderCompressor, TwoFluidPipe, TwoPhasePipeLine, TwoPhaseSeparator, TwoPortEquipment, Umbilical, UnisimCalculator, UtilityAirSystem, VesselDepressurization, VirtualStream, VLSolidTray, WaterCooler, WaterHammerPipe, WaterStripperColumn, WellFlow, WellFlowlineNetwork, WellFluidModule, WellSystem, WindFarm, WindTurbine
ProcessEquipmentInterface interface.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddCapacityConstraint(CapacityConstraint constraint) Adds a capacity constraint to this equipment.default voidaddController(String tag, ControllerDeviceInterface controller) Adds a controller to this equipment with the given tag name.createStateEntry(double value, String unit) Helper to create a state entry map with value and unit.voiddisplayResult.booleandefault doubleGets the available margin (headroom) on the most limiting constraint.default doubleGets the available margin as a percentage.default CapacityConstraintGets the bottleneck (most limiting) constraint for this equipment.default Map<String, CapacityConstraint> Gets all capacity constraints defined for this equipment.default doublegetCapacityDuty.default doublegetCapacityMax.getConditionAnalysisMessage.getController.default ControllerDeviceInterfacegetController(String tag) Gets a controller by tag name.default Collection<ControllerDeviceInterface> Gets all controllers attached to this equipment.default ElectricalDesignGet anelectricalDesignfor the equipment.default doublegetEntropyProduction(String unit) getEntropyProduction.getEquipmentState(String temperatureUnit, String pressureUnit, String flowUnit) Returns a map of key equipment properties with values and units.default doublegetExergyChange(String unit) getExergyChange.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.default doublegetExergyDestruction(String unit) Exergy destruction rate with a default surrounding temperature of 288.15 K (15 degC).default doublegetExergyDestruction(String unit, double surroundingTemperature) Exergy destruction rate of the unit operation, based on the universal relationE_destroyed = T0 * S_genwhereS_genis the entropy generation across the unit andT0is the surrounding ("dead state") temperature.default SystemInterfacegetFluid()getFluid.default List<StreamInterface> Returns all inlet streams connected to this equipment.default InstrumentDesignGet aninstrumentDesignfor the equipment.doublegetMassBalance in kg/sec.default doublegetMassBalance(String unit) getMassBalance.default doubleGets the maximum utilization across all enabled constraints.default doubleGets the maximum utilization as a percentage.Get amechanicalDesignfor the equipment.default StringGets the reason why equipment is outside its operating envelope.default doublegetOutletFlowRate(String unit) Returns the total flow rate across all outlet streams in the specified unit.default doublegetOutletPressure(String unit) Returns the pressure of the primary outlet stream in the specified unit.default List<StreamInterface> Returns all outlet streams produced by this equipment.default doublegetOutletTemperature(String unit) Returns the temperature of the primary outlet stream in the specified unit.doubleGetter for the fieldpressure.doublegetPressure(String unit) Getter for the fieldpressureconverted to specified unit.default ReferenceDesignationReturns the IEC 81346 reference designation for this equipment.default StringReturns the full IEC 81346 reference designation string.getReport_json.default doublegetRestCapacity.String[][]getResultTable.Gets validation errors for the current simulation state.getSpecification.doubleGetter for the fieldtemperature.doublegetTemperature(String unit) Getter for the fieldtemperatureconverted to specified unit.getThermoSystem.Gets a summary of all enabled constraint utilizations.inthashCode()default voidInitialize anelectricalDesignfor the equipment.default voidInitialize aninstrumentDesignfor the equipment.default voidInitialize ainitMechanicalDesignfor the equipment.default booleanChecks if any capacity constraint is violated (exceeds 100% utilization).default booleanChecks if any HARD constraint limit is exceeded.default booleanChecks if any enabled constraint is near its limit (above warning threshold).default booleanChecks if the current simulation result is physically valid.default booleanChecks if the equipment is operating within its valid operating envelope.default booleanCheck if process equipment needs recalculating.String[][]reportResults.voidrunConditionAnalysis(ProcessEquipmentInterface refExchanger) runConditionAnalysis.voidsetController(ControllerDeviceInterface controller) setController.voidsetPressure(double pressure) Setter for the fieldpressure.default voidsetReferenceDesignation(ReferenceDesignation referenceDesignation) Sets the IEC 81346 reference designation for this equipment.voidsetRegulatorOutSignal(double signal) setRegulatorOutSignal.voidsetSpecification(String specification) setSpecification.voidsetTemperature(double temperature) Setter for the fieldtemperature.toJson()Serializes the Process Equipment along with its state to a JSON string.default StringtoJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.default ValidationResultValidate the process equipment before execution.Methods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run, run_step, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solved
-
Method Details
-
reportResults
-
initMechanicalDesign
default void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment. -
getMechanicalDesign
MechanicalDesign getMechanicalDesign()Get a
mechanicalDesignfor the equipment.- Returns:
- a
MechanicalDesignobject
-
initElectricalDesign
default void initElectricalDesign()Initialize an
electricalDesignfor the equipment. -
getElectricalDesign
Get an
electricalDesignfor the equipment.- Returns:
- a
ElectricalDesignobject
-
initInstrumentDesign
default void initInstrumentDesign()Initialize aninstrumentDesignfor the equipment. -
getInstrumentDesign
Get aninstrumentDesignfor the equipment.- Returns:
- a
InstrumentDesignobject
-
needRecalculation
default boolean needRecalculation()Check if process equipment needs recalculating.
- Returns:
- true or false
-
getSpecification
-
setSpecification
-
displayResult
void displayResult()displayResult.
-
setRegulatorOutSignal
void setRegulatorOutSignal(double signal) setRegulatorOutSignal.
- Parameters:
signal- a double
-
setController
setController.
- Parameters:
controller- aControllerDeviceInterfaceobject
-
getController
ControllerDeviceInterface getController()getController.
- Returns:
- a
ControllerDeviceInterfaceobject
-
addController
Adds a controller to this equipment with the given tag name.- Parameters:
tag- a unique tag identifying the controller (e.g. "PC-101", "LC-101")controller- aControllerDeviceInterfaceobject
-
getController
Gets a controller by tag name.- Parameters:
tag- the controller tag name- Returns:
- the controller, or null if not found
-
getControllers
Gets all controllers attached to this equipment.- Returns:
- unmodifiable collection of controllers
-
getInletStreams
Returns all inlet streams connected to this equipment. Subclasses override to report their specific inlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Returns:
- unmodifiable list of inlet streams (empty by default)
-
getOutletStreams
Returns all outlet streams produced by this equipment. Subclasses override to report their specific outlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Returns:
- unmodifiable list of outlet streams (empty by default)
-
getFluid
-
getThermoSystem
-
getMassBalance
double getMassBalance()getMassBalance in kg/sec.
- Returns:
- The mass balance of the process equipment in kg/sec.
-
getPressure
double getPressure()Getter for the field
pressure.- Returns:
- Pressure in bara
-
getPressure
-
getTemperature
-
getTemperature
double getTemperature()Getter for the field
temperature.- Returns:
- a double
-
setPressure
void setPressure(double pressure) Setter for the field
pressure.- Parameters:
pressure- a double
-
setTemperature
void setTemperature(double temperature) Setter for the field
temperature.- Parameters:
temperature- Temperature in Kelvin
-
runConditionAnalysis
runConditionAnalysis.
- Parameters:
refExchanger- aProcessEquipmentInterfaceobject
-
getConditionAnalysisMessage
-
getExergyChange
Get exergy change production of the process equipment.- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
getResultTable
-
equals
-
hashCode
-
toJson
String toJson()Serializes the Process Equipment along with its state to a JSON string.
- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Parameters:
cfg- report configuration- Returns:
- json string
-
getReport_json
String getReport_json()getReport_json.
Return results of simulation in json format- Specified by:
getReport_jsonin interfaceSimulationInterface- Returns:
- a String
-
getEntropyProduction
-
getMassBalance
-
getExergyChange
-
getExergyDestruction
Exergy destruction rate of the unit operation, based on the universal relationE_destroyed = T0 * S_genwhereS_genis the entropy generation across the unit andT0is the surrounding ("dead state") temperature. The returned value is always non-negative.The default implementation uses
getEntropyProduction(String)expressed in J/K. For adiabatic equipment (valves, separators, mixers, compressors, pumps) this gives the exact exergy destruction. For units with heat crossing the boundary at a known source temperature (heaters, coolers), override this method to include the Carnot-weighted heat exergy.- Parameters:
unit- target unit, one of J, kJ, MJ, W, kW, MWsurroundingTemperature- surrounding (dead-state) temperature in K- Returns:
- non-negative exergy destruction rate in the requested unit
-
getExergyDestruction
Exergy destruction rate with a default surrounding temperature of 288.15 K (15 degC). SeegetExergyDestruction(String, double)for details.- Parameters:
unit- target unit- Returns:
- exergy destruction in the requested unit
-
getCapacityDuty
default double getCapacityDuty()getCapacityDuty.
- Returns:
- a double
-
getCapacityMax
default double getCapacityMax()getCapacityMax.
- Returns:
- a double
-
getRestCapacity
default double getRestCapacity()getRestCapacity.
- Returns:
- a double
-
validateSetup
Validate the process equipment before execution.Checks for common setup errors:
- Equipment has a valid name
- Input streams connected
- Operating parameters in valid ranges
- Returns:
- validation result with errors and warnings
-
isSimulationValid
default 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
- 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:
- list of validation error messages, empty if valid
-
isWithinOperatingEnvelope
default 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
- Returns:
- true if operating within valid envelope
-
getOperatingEnvelopeViolation
Gets the reason why equipment is outside its operating envelope.- Returns:
- description of envelope violation, or null if within envelope
-
getOutletTemperature
Returns the temperature of the primary outlet stream in the specified unit.Works uniformly across all equipment types by using
getOutletStreams(). For equipment with multiple outlets (e.g., separators), returns the first outlet's temperature.- Parameters:
unit- temperature unit, e.g. "C", "K"- Returns:
- outlet temperature in specified unit, or
Double.NaNif no outlet streams
-
getOutletPressure
Returns the pressure of the primary outlet stream in the specified unit.Works uniformly across all equipment types by using
getOutletStreams(). For equipment with multiple outlets, returns the first outlet's pressure.- Parameters:
unit- pressure unit, e.g. "bara", "barg", "Pa"- Returns:
- outlet pressure in specified unit, or
Double.NaNif no outlet streams
-
getOutletFlowRate
Returns the total flow rate across all outlet streams in the specified unit.For single-outlet equipment (compressor, heater, valve), returns the outlet flow rate. For multi-outlet equipment (separator), returns the sum of all outlet flow rates.
- Parameters:
unit- flow unit, e.g. "kg/hr", "Sm3/hr", "m3/hr"- Returns:
- total outlet flow rate in specified unit, or
Double.NaNif no outlet streams
-
getEquipmentState
default Map<String, Map<String,Object>> getEquipmentState(String temperatureUnit, String pressureUnit, String flowUnit) Returns a map of key equipment properties with values and units.Provides a unified way to access equipment state without knowing the specific equipment type. Each entry in the outer map has a property name (e.g. "temperature", "pressure"). Each inner map contains "value" (Double) and "unit" (String).
The default implementation uses
getOutletStreams()to report outlet conditions. Subclasses override this to add equipment-specific properties (e.g., valve opening, compressor power, separator liquid levels).- Parameters:
temperatureUnit- temperature unit (e.g. "C")pressureUnit- pressure unit (e.g. "bara")flowUnit- flow unit (e.g. "kg/hr")- Returns:
- map of property name to value/unit maps
-
createStateEntry
-
getReferenceDesignation
Returns the IEC 81346 reference designation for this equipment.The reference designation encodes three aspects per IEC 81346: function (what the system does), product (what the equipment is), and location (where it is installed).
- Returns:
- the reference designation object, never null
-
setReferenceDesignation
Sets the IEC 81346 reference designation for this equipment.- Parameters:
referenceDesignation- the reference designation to set
-
getReferenceDesignationString
Returns the full IEC 81346 reference designation string.Convenience method equivalent to
getReferenceDesignation().toReferenceDesignationString().- Returns:
- the formatted reference designation string, e.g. "=A1.K1-B1+P1.M1"
-
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
addCapacityConstraint(CapacityConstraint).- Returns:
- unmodifiable map of constraint name to constraint, empty if none defined
-
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.- Parameters:
constraint- the capacity constraint to add (ignored if null)
-
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.
- Returns:
- the most limiting constraint, or null if none
-
isCapacityExceeded
default 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.
- Returns:
- true if any enabled constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
default 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.
- Returns:
- true if any enabled HARD constraint's max value is exceeded
-
getMaxUtilization
default 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.
- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
getMaxUtilizationPercent
default double getMaxUtilizationPercent()Gets the maximum utilization as a percentage.- Returns:
- maximum utilization as percentage (100.0 = 100% of design capacity)
-
getAvailableMargin
default double getAvailableMargin()Gets the available margin (headroom) on the most limiting constraint.Returns the remaining capacity before the bottleneck constraint reaches 100%. Negative values indicate the equipment is already over capacity.
- Returns:
- available margin as fraction (0.2 = 20% headroom remaining)
-
getAvailableMarginPercent
default double getAvailableMarginPercent()Gets the available margin as a percentage.- Returns:
- available margin as percentage
-
isNearCapacityLimit
default boolean isNearCapacityLimit()Checks if any enabled constraint is near its limit (above warning threshold).The warning threshold is typically set at 90% of design capacity to provide early warning before constraints are violated.
- Returns:
- true if any enabled constraint is above its warning threshold
-
getUtilizationSummary
-