Class ProcessEquipmentBaseClass
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, ProcessElementInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
Adjuster, AnnularLeakagePath, BatteryStorage, BiogasUpgrader, BiomassGasifier, BlackOilSeparator, Calculator, CementDegradationModel, CO2Electrolyzer, ComponentSplitter, Crystallizer, DexpiProcessUnit, DexpiProcessUnit, DistillationColumn, Dryer, Ejector, Electrolyzer, FlareStack, FloatingSubstructure, FuelGasSystem, FurnaceBurner, InjectionConformanceMonitor, LiquidLiquidExtractor, LNGAgeingScenario, LoopedPipeNetwork, Manifold, MembraneSeparator, Mixer, MooringSystem, MultiCompartmentReservoir, MultiEffectEvaporator, MultiPortEquipment, MultiVariableAdjuster, OffshoreEnergySystem, PipeFlowNetwork, PLEM, ProducedWaterTreatmentTrain, PyrolysisReactor, RateBasedPackedColumn, Recycle, ReservoirCVDsim, ReservoirDiffLibsim, ReservoirTPsim, Separator, SetPoint, Setter, ShortcutDistillationColumn, SimpleAdsorber, SimpleReservoir, SolarPanel, SolidsSeparator, Splitter, SpreadsheetBlock, Stream, SubseaManifold, SubseaPowerCable, Tank, TwoPortEquipment, Umbilical, UnisimCalculator, UtilityAirSystem, VesselDepressurization, VirtualStream, WellFlowlineNetwork, WellSystem, WindFarm, WindTurbine
Abstract ProcessEquipmentBaseClass class.
- Version:
- $Id: $Id
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag to enable/disable capacity analysis for this equipment.private Map<String, CapacityConstraint> Capacity constraints for this equipment, keyed by constraint name.private ControllerDeviceInterfaceprivate final Map<String, ControllerDeviceInterface> Map of controller tag name to controller device.private EquipmentFailureModeCurrent failure mode of the equipment.(package private) ControllerDeviceInterfacebooleanprivate booleanprivate booleanFlag indicating if the equipment is in a failed state.private booleanprotected booleanprivate doubleprivate ReferenceDesignationIEC 81346 reference designation for this equipment.String[][]private static final longSerialization version UID.private StringFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ProcessEquipmentBaseClass. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a capacity constraint to this equipment.voidaddController(String tag, ControllerDeviceInterface controller) Adds a controller to this equipment with the given tag name.copy()Create deep copy.voiddisplayResult.private voidEnsures the capacity constraints map is initialized.booleandoubleGets the available margin (headroom) on the most limiting constraint.doubleGets the available margin as a percentage.Gets the bottleneck (most limiting) constraint for this equipment.Gets all capacity constraints defined for this equipment.getConditionAnalysisMessage.Evaluates all capacity constraints and returns a summary string.getController.getController(String tag) Gets a controller by tag name.Gets all controllers attached to this equipment.doubleGets the effective capacity factor considering any failure mode.Getter for the fieldenergyStream.doublegetEntropyProduction(String unit) getEntropyProduction.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.Gets the current failure mode of the equipment.doublegetMassBalance in kg/sec.doublegetMassBalance(String unit) getMassBalance.doubleGets the maximum utilization across all enabled constraints.doubleGets the maximum utilization as a percentage.Get amechanicalDesignfor the equipment.doubleGetter for the fieldminimumFlow, e.g., the minimum flow rate for the pump.doubleGetter for the fieldpressure.doublegetPressure(String unit) Getter for the fieldpressureconverted to specified unit.getProperty(String propertyName) getProperty.Returns the IEC 81346 reference designation for this equipment.getReport_json.String[][]getResultTable.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()voidInitialize anelectricalDesignfor the equipment.protected voidHook for subclasses to set up default capacity constraints.voidInitialize aninstrumentDesignfor the equipment.voidInitialize ainitMechanicalDesignfor the equipment.booleanisActive()Getter for the fieldisActive.voidisActive(boolean isActive) Setter for the fieldisActive.booleanChecks if capacity analysis is enabled for this equipment.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanisFailed()Checks if the equipment is in a failed state.booleanChecks if any HARD constraint limit is exceeded.booleanChecks if any enabled constraint is near its limit (above warning threshold).booleanisSetEnergyStream.String[][]reportResults.voidRestores the equipment from a failed state.voidrun_stepvoidrunConditionAnalysis(ProcessEquipmentInterface refExchanger) runConditionAnalysis.voidsetCapacityAnalysisEnabled(boolean enabled) Enables or disables capacity analysis for this equipment.voidsetController(ControllerDeviceInterface controller) setController.voidsetEnergyStream(boolean isSetEnergyStream) Setter for the fieldenergyStream.voidsetEnergyStream(EnergyStream energyStream) Setter for the fieldenergyStream.voidsetFailureMode(EquipmentFailureMode failureMode) Sets a failure mode on the equipment.voidsetFlowValveController(ControllerDeviceInterface controller) Setter for the fieldflowValveController.voidsetMinimumFlow(double minimumFlow) Setter for the fieldminimumFlow, e.g., the minimum flow rate for the pump.voidsetPressure(double pressure) Setter for the fieldpressure.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.voidsimulateDegradedOperation(double capacityPercent) Simulates degraded operation at a specified capacity.voidSimulates a trip (complete failure) on the equipment.booleansolved()Returns whether or not the module has been solved.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.Methods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getElectricalDesign, getEquipmentState, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInletStreams, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletStreams, getOutletTemperature, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculation, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
controller
-
flowValveController
ControllerDeviceInterface flowValveController -
hasController
public boolean hasController -
controllerMap
Map of controller tag name to controller device. Supports multiple controllers per equipment. -
specification
-
report
-
properties
-
energyStream
-
isSetEnergyStream
private boolean isSetEnergyStream -
isSolved
protected boolean isSolved -
isActive
private boolean isActive -
minimumFlow
private double minimumFlow -
capacityAnalysisEnabled
private boolean capacityAnalysisEnabledFlag to enable/disable capacity analysis for this equipment. When disabled, this equipment is excluded from bottleneck detection, capacity utilization summaries, and optimization routines. -
failureMode
Current failure mode of the equipment. Null means equipment is operating normally. -
isFailed
private boolean isFailedFlag indicating if the equipment is in a failed state. -
referenceDesignation
IEC 81346 reference designation for this equipment. Contains the function, product, and location aspects per IEC 81346 standard. -
capacityConstraints
Capacity constraints for this equipment, keyed by constraint name. Marked transient becauseCapacityConstraintinstances may hold non-serializable lambda value suppliers. After deserialization, subclasses should callinitializeDefaultConstraints()to rebuild. -
conditionAnalysisMessage
-
-
Constructor Details
-
ProcessEquipmentBaseClass
-
-
Method Details
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Returns:
- a
SystemInterfaceobject
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface
-
copy
Create deep copy.- Returns:
- a deep copy of the unit operation/process equipment
-
getProperty
-
setRegulatorOutSignal
public void setRegulatorOutSignal(double signal) setRegulatorOutSignal.
- Specified by:
setRegulatorOutSignalin interfaceProcessEquipmentInterface- Parameters:
signal- a double
-
setController
setController.
- Specified by:
setControllerin interfaceProcessEquipmentInterface- Parameters:
controller- aControllerDeviceInterfaceobject
-
setFlowValveController
Setter for the field
flowValveController.- Parameters:
controller- aControllerDeviceInterfaceobject
-
getController
getController.
- Specified by:
getControllerin interfaceProcessEquipmentInterface- Returns:
- a
ControllerDeviceInterfaceobject
-
addController
Adds a controller to this equipment with the given tag name.- Specified by:
addControllerin interfaceProcessEquipmentInterface- Parameters:
tag- a unique tag identifying the controller (e.g. "PC-101", "LC-101")controller- aControllerDeviceInterfaceobject
-
getController
Gets a controller by tag name.- Specified by:
getControllerin interfaceProcessEquipmentInterface- Parameters:
tag- the controller tag name- Returns:
- the controller, or null if not found
-
getControllers
Gets all controllers attached to this equipment.- Specified by:
getControllersin interfaceProcessEquipmentInterface- Returns:
- unmodifiable collection of controllers
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface
-
initElectricalDesign
public void initElectricalDesign()Initialize an
electricalDesignfor the equipment.- Specified by:
initElectricalDesignin interfaceProcessEquipmentInterface
-
initInstrumentDesign
public void initInstrumentDesign()Initialize aninstrumentDesignfor the equipment.- Specified by:
initInstrumentDesignin interfaceProcessEquipmentInterface
-
getSpecification
getSpecification.
- Specified by:
getSpecificationin interfaceProcessEquipmentInterface- Returns:
- a
Stringobject
-
setSpecification
setSpecification.
- Specified by:
setSpecificationin interfaceProcessEquipmentInterface- Parameters:
specification- aStringobject
-
reportResults
reportResults.
- Specified by:
reportResultsin interfaceProcessEquipmentInterface- Returns:
- an array of
Stringobjects
-
solved
public boolean solved()Returns whether or not the module has been solved.
- Specified by:
solvedin interfaceSimulationInterface- Returns:
- a boolean
-
getEnergyStream
Getter for the field
energyStream.- Returns:
- a
EnergyStreamobject
-
setEnergyStream
Setter for the field
energyStream.- Parameters:
energyStream- aEnergyStreamobject
-
setEnergyStream
public void setEnergyStream(boolean isSetEnergyStream) Setter for the field
energyStream.- Parameters:
isSetEnergyStream- a boolean
-
isSetEnergyStream
public boolean isSetEnergyStream()isSetEnergyStream.
- Returns:
- a boolean
-
getPressure
public double getPressure()Getter for the field
pressure.- Specified by:
getPressurein interfaceProcessEquipmentInterface- Returns:
- Pressure in bara
-
getPressure
Getter for the field
pressureconverted to specified unit.- Specified by:
getPressurein interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
setPressure
public void setPressure(double pressure) Setter for the field
pressure.- Specified by:
setPressurein interfaceProcessEquipmentInterface- Parameters:
pressure- a double
-
getTemperature
public double getTemperature()Getter for the field
temperature.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Returns:
- a double
-
getTemperature
Getter for the field
temperatureconverted to specified unit.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
setTemperature
public void setTemperature(double temperature) Setter for the field
temperature.- Specified by:
setTemperaturein interfaceProcessEquipmentInterface- Parameters:
temperature- Temperature in Kelvin
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
public double getMassBalance()getMassBalance in kg/sec.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Returns:
- The mass balance of the process equipment in kg/sec.
-
getExergyChange
Get exergy change production of the process equipment.- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
runConditionAnalysis
runConditionAnalysis.
- Specified by:
runConditionAnalysisin interfaceProcessEquipmentInterface- Parameters:
refExchanger- aProcessEquipmentInterfaceobject
-
getConditionAnalysisMessage
getConditionAnalysisMessage.
- Specified by:
getConditionAnalysisMessagein interfaceProcessEquipmentInterface- Returns:
- a
Stringobject
-
getResultTable
getResultTable.
- Specified by:
getResultTablein interfaceProcessEquipmentInterface- Returns:
- an array of
Stringobjects
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceProcessEquipmentInterface- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceProcessEquipmentInterface- Overrides:
equalsin classObject
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Parameters:
cfg- report configuration- Returns:
- json string
-
getReport_json
getReport_json.
Return results of simulation in json format- Specified by:
getReport_jsonin interfaceProcessEquipmentInterface- Specified by:
getReport_jsonin interfaceSimulationInterface- Returns:
- a String
-
run_step
run_step
In this method all thermodynamic and unit operations will be calculated in a steady state calculation. Sets calc identifier UUID. It does not solve recycles - only calculates one step- Specified by:
run_stepin interfaceSimulationInterface- Parameters:
id- Calc identifier UUID to set.
-
getMinimumFlow
public double getMinimumFlow()Getter for the field
minimumFlow, e.g., the minimum flow rate for the pump.- Returns:
- a double
-
setMinimumFlow
public void setMinimumFlow(double minimumFlow) Setter for the field
minimumFlow, e.g., the minimum flow rate for the pump.- Parameters:
minimumFlow- a double
-
isActive
public boolean isActive()Getter for the field
isActive.- Returns:
- a boolean
-
isActive
public void isActive(boolean isActive) Setter for the field
isActive.- Parameters:
isActive- a boolean
-
isCapacityAnalysisEnabled
public boolean isCapacityAnalysisEnabled()Checks if capacity analysis is enabled for this equipment.When disabled, this equipment is excluded from bottleneck detection, capacity utilization summaries, and optimization routines. The equipment still tracks its constraints but doesn't contribute to system-level analysis.
- Returns:
- true if capacity analysis is enabled (default is true)
-
setCapacityAnalysisEnabled
public void setCapacityAnalysisEnabled(boolean enabled) Enables or disables capacity analysis for this equipment.When disabled, this equipment is excluded from:
- System bottleneck detection (
ProcessSystem.findBottleneck()) - Capacity utilization summaries (
ProcessSystem.getCapacityUtilizationSummary()) - Equipment near capacity lists (
ProcessSystem.getEquipmentNearCapacityLimit()) - Optimization constraint checking
The equipment still calculates and tracks its constraints internally.
- Parameters:
enabled- true to include in capacity analysis, false to exclude
- System bottleneck detection (
-
getFailureMode
Gets the current failure mode of the equipment.- Returns:
- the failure mode, or null if equipment is operating normally
-
setFailureMode
Sets a failure mode on the equipment.When a failure mode is set, the equipment is marked as failed and its behavior changes according to the failure mode characteristics (capacity factor, etc.). Setting null clears the failure.
- Parameters:
failureMode- the failure mode to apply, or null to clear failure
-
isFailed
public boolean isFailed()Checks if the equipment is in a failed state.- Returns:
- true if the equipment has a failure mode set
-
simulateTrip
public void simulateTrip()Simulates a trip (complete failure) on the equipment.Convenience method that applies a standard trip failure mode. The equipment becomes inactive and is excluded from capacity analysis.
-
simulateDegradedOperation
public void simulateDegradedOperation(double capacityPercent) Simulates degraded operation at a specified capacity.- Parameters:
capacityPercent- remaining capacity percentage (0-100)
-
restoreFromFailure
public void restoreFromFailure()Restores the equipment from a failed state.Clears any failure mode and restores the equipment to normal operation.
-
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).
- Specified by:
getReferenceDesignationin interfaceProcessEquipmentInterface- Returns:
- the reference designation object, never null
-
setReferenceDesignation
Sets the IEC 81346 reference designation for this equipment.- Specified by:
setReferenceDesignationin interfaceProcessEquipmentInterface- Parameters:
referenceDesignation- the reference designation to set
-
getEffectiveCapacityFactor
public double getEffectiveCapacityFactor()Gets the effective capacity factor considering any failure mode.- Returns:
- capacity factor (0.0 to 1.0), where 1.0 is full capacity
-
ensureCapacityConstraintsInitialized
private void ensureCapacityConstraintsInitialized()Ensures the capacity constraints map is initialized.The map is transient (not serialized) so it may be null after deserialization. This method lazily initializes it and calls
initializeDefaultConstraints()to let subclasses re-attach their lambda value suppliers. -
initializeDefaultConstraints
protected void initializeDefaultConstraints()Hook for subclasses to set up default capacity constraints.Called lazily when constraints are first accessed, and after deserialization. Subclasses should override this to add equipment-specific constraints using
addCapacityConstraint(CapacityConstraint). The default implementation does nothing. -
getCapacityConstraints
Gets all capacity constraints defined for this equipment.Returns an unmodifiable map of constraint name to constraint object. Constraints are used by the optimization framework to detect bottlenecks, enforce limits, and guide production allocation. Equipment subclasses populate this map via
ProcessEquipmentInterface.addCapacityConstraint(CapacityConstraint).- Specified by:
getCapacityConstraintsin interfaceProcessEquipmentInterface- 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.- Specified by:
addCapacityConstraintin interfaceProcessEquipmentInterface- 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.
- Specified by:
getBottleneckConstraintin interfaceProcessEquipmentInterface- Returns:
- the most limiting constraint, or null if none
-
isCapacityExceeded
public boolean isCapacityExceeded()Checks if any capacity constraint is violated (exceeds 100% utilization).A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.
- Specified by:
isCapacityExceededin interfaceProcessEquipmentInterface- Returns:
- true if any enabled constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
public boolean isHardLimitExceeded()Checks if any HARD constraint limit is exceeded.HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.
- Specified by:
isHardLimitExceededin interfaceProcessEquipmentInterface- Returns:
- true if any enabled HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all enabled constraints.Returns the highest utilization ratio across all enabled constraints. Values above 1.0 indicate the equipment is over capacity. Returns 0.0 if no constraints are defined or enabled.
- Specified by:
getMaxUtilizationin interfaceProcessEquipmentInterface- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
getMaxUtilizationPercent
public double getMaxUtilizationPercent()Gets the maximum utilization as a percentage.- Specified by:
getMaxUtilizationPercentin interfaceProcessEquipmentInterface- Returns:
- maximum utilization as percentage (100.0 = 100% of design capacity)
-
getAvailableMargin
public 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.
- Specified by:
getAvailableMarginin interfaceProcessEquipmentInterface- Returns:
- available margin as fraction (0.2 = 20% headroom remaining)
-
getAvailableMarginPercent
public double getAvailableMarginPercent()Gets the available margin as a percentage.- Specified by:
getAvailableMarginPercentin interfaceProcessEquipmentInterface- Returns:
- available margin as percentage
-
isNearCapacityLimit
public 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.
- Specified by:
isNearCapacityLimitin interfaceProcessEquipmentInterface- Returns:
- true if any enabled constraint is above its warning threshold
-
getUtilizationSummary
Gets a summary of all enabled constraint utilizations.Returns a map of constraint names to their current utilization percentages. Useful for reporting and visualization.
- Specified by:
getUtilizationSummaryin interfaceProcessEquipmentInterface- Returns:
- map of constraint name to utilization percentage
-
getConstraintEvaluationReport
Evaluates all capacity constraints and returns a summary string.Useful for logging and diagnostics. Each enabled constraint is evaluated and its utilization is reported. Constraints that are violated or near their limit are flagged.
- Returns:
- multi-line summary of constraint status
-