Class Splitter
- All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, ProcessEquipmentInterface, SplitterInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Splitter class.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDesign pressure drop [bar].(package private) double[](package private) String(package private) SystemInterface(package private) StreamInterfaceprotected double[]protected doubleprotected doubleprotected double(package private) SystemInterface(package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleMaximum design velocity [m/s].private SplitterMechanicalDesignMechanical design for the splitter.protected double[]private static final longSerialization version UID.(package private) double[]protected int(package private) StreamInterface[]private booleanWhether capacity analysis is enabled.private Map<String, CapacityConstraint> Splitter capacity constraints map.(package private) SystemInterface(package private) SystemInterface(package private) SystemInterfaceFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Splitter.Splitter(String name, StreamInterface inStream) Constructor for Splitter.Splitter(String name, StreamInterface inletStream, int number_of_splits) Constructor for Splitter. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a capacity constraint to this equipment.voidcalcSplitFactors.voidClears all capacity constraints from this equipment.voiddisplayResult.Gets the bottleneck (most limiting) constraint for this equipment.Gets all capacity constraints defined for this equipment.doubleGets the design pressure drop.Getter for the fieldinletStream.Returns all inlet streams connected to this equipment.doublegetMassBalance(String unit) getMassBalance.doubleGets the maximum design velocity.doubleGets the maximum utilization across all enabled constraints.Get amechanicalDesignfor the equipment.Returns all outlet streams produced by this equipment.doublegetSplitFactor(int i) Getter for the fieldsplitFactor.double[]getSplitFactors.intgetSplitNumber.getSplitStream(int i) getSplitStream.private voidInitialize splitter capacity constraints.voidInitialize ainitMechanicalDesignfor the equipment.booleanChecks if capacity analysis is enabled for this equipment.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanChecks if any HARD constraint limit is exceeded.booleanCheck if process equipment needs recalculating.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientvoidsetCapacityAnalysisEnabled(boolean enabled) Enables or disables capacity analysis for this equipment.voidsetDesignPressureDrop(double pressureDrop) Sets the design pressure drop.voidsetFlowRates(double[] flowRates, String flowUnit) setFlowRates.voidsetInletStream(StreamInterface inletStream) setInletStream.voidsetMaxDesignVelocity(double velocity) Sets the maximum design velocity.voidsetSplitFactors(double[] splitFact) setSplitFactors.voidsetSplitNumber(int number_of_splits) setSplitNumber.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.Validate the process equipment before execution.Methods inherited from class ProcessEquipmentBaseClass
addController, copy, equals, getAvailableMargin, getAvailableMarginPercent, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMaxUtilizationPercent, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, isActive, isActive, isFailed, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isNearCapacityLimitMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
addController, equals, getAvailableMargin, getAvailableMarginPercent, getCapacityDuty, getCapacityMax, getConditionAnalysisMessage, getController, getController, getControllers, getElectricalDesign, getEntropyProduction, getEquipmentState, getExergyChange, getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getInstrumentDesign, getMassBalance, getMaxUtilizationPercent, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletTemperature, getPressure, getPressure, getReferenceDesignation, getReferenceDesignationString, getReport_json, getRestCapacity, getResultTable, getSimulationValidationErrors, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initElectricalDesign, initInstrumentDesign, isNearCapacityLimit, isSimulationValid, isWithinOperatingEnvelope, reportResults, runConditionAnalysis, setController, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperatureMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solved
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
mechanicalDesign
Mechanical design for the splitter. -
splitterCapacityConstraints
Splitter capacity constraints map. -
splitterCapacityAnalysisEnabled
private boolean splitterCapacityAnalysisEnabledWhether capacity analysis is enabled. -
designPressureDrop
private double designPressureDropDesign pressure drop [bar]. -
maxDesignVelocity
private double maxDesignVelocityMaximum design velocity [m/s]. -
thermoSystem
SystemInterface thermoSystem -
gasSystem
SystemInterface gasSystem -
waterSystem
SystemInterface waterSystem -
liquidSystem
SystemInterface liquidSystem -
thermoSystemCloned
SystemInterface thermoSystemCloned -
inletStream
StreamInterface inletStream -
splitStream
StreamInterface[] splitStream -
splitNumber
protected int splitNumber -
splitFactor
double[] splitFactor -
flowRates
double[] flowRates -
flowUnit
String flowUnit -
oldSplitFactor
protected double[] oldSplitFactor -
lastTemperature
protected double lastTemperature -
lastPressure
protected double lastPressure -
lastFlowRate
protected double lastFlowRate -
lastComposition
protected double[] lastComposition
-
-
Constructor Details
-
Splitter
-
Splitter
Constructor for Splitter.- Parameters:
name- name of splitterinStream- input stream
-
Splitter
Constructor for Splitter.
- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobjectnumber_of_splits- an int
-
-
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
-
getInletStream
Getter for the field
inletStream.- Returns:
- a
StreamInterfaceobject
-
setSplitNumber
public void setSplitNumber(int number_of_splits) setSplitNumber.
- Specified by:
setSplitNumberin interfaceSplitterInterface- Parameters:
number_of_splits- a int
-
setSplitFactors
public void setSplitFactors(double[] splitFact) setSplitFactors.
- Parameters:
splitFact- an array of type double
-
setFlowRates
-
calcSplitFactors
public void calcSplitFactors()calcSplitFactors.
-
setInletStream
setInletStream.
- Specified by:
setInletStreamin interfaceSplitterInterface- Parameters:
inletStream- aStreamInterfaceobject
-
getSplitStream
getSplitStream.
- Specified by:
getSplitStreamin interfaceSplitterInterface- Parameters:
i- a int- Returns:
- a
Streamobject
-
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.- Specified by:
getInletStreamsin interfaceProcessEquipmentInterface- 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.- Specified by:
getOutletStreamsin interfaceProcessEquipmentInterface- Returns:
- unmodifiable list of outlet streams (empty by default)
-
needRecalculation
public boolean needRecalculation()Check if process equipment needs recalculating.
- Specified by:
needRecalculationin interfaceProcessEquipmentInterface- Returns:
- true or false
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
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
-
getSplitFactor
public double getSplitFactor(int i) Getter for the field
splitFactor.- Parameters:
i- a int- Returns:
- a double
-
getSplitFactors
public double[] getSplitFactors()getSplitFactors.
- Returns:
- an array of type double
-
getSplitNumber
public int getSplitNumber()getSplitNumber.
- Returns:
- number of split outlets
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Parameters:
cfg- report configuration- Returns:
- json string
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
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
Validates the splitter setup before execution. Checks that:
- Equipment has a valid name
- Inlet stream is connected
- Split factors are valid (sum to 1.0, all non-negative)
- At least one split outlet is defined
- Specified by:
validateSetupin interfaceProcessEquipmentInterface- Returns:
- validation result with errors and warnings
-
initializeSplitterCapacityConstraints
private void initializeSplitterCapacityConstraints()Initialize splitter capacity constraints. -
setDesignPressureDrop
public void setDesignPressureDrop(double pressureDrop) Sets the design pressure drop.- Parameters:
pressureDrop- design pressure drop in bar
-
getDesignPressureDrop
public double getDesignPressureDrop()Gets the design pressure drop.- Returns:
- design pressure drop in bar
-
setMaxDesignVelocity
public void setMaxDesignVelocity(double velocity) Sets the maximum design velocity.- Parameters:
velocity- max design velocity in m/s
-
getMaxDesignVelocity
public double getMaxDesignVelocity()Gets the maximum design velocity.- Returns:
- max design velocity in m/s
-
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.
- Specified by:
isCapacityAnalysisEnabledin interfaceCapacityConstrainedEquipment- Overrides:
isCapacityAnalysisEnabledin classProcessEquipmentBaseClass- 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.
- Specified by:
setCapacityAnalysisEnabledin interfaceCapacityConstrainedEquipment- Overrides:
setCapacityAnalysisEnabledin classProcessEquipmentBaseClass- Parameters:
enabled- true to include in capacity analysis, false to exclude
- System bottleneck detection (
-
getCapacityConstraints
Gets all capacity constraints defined for this equipment.Returns an unmodifiable map of constraint name to constraint object. Constraints are used by the optimization framework to detect bottlenecks, enforce limits, and guide production allocation. Equipment subclasses populate this map via
ProcessEquipmentInterface.addCapacityConstraint(CapacityConstraint).- Specified by:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Specified by:
getCapacityConstraintsin interfaceProcessEquipmentInterface- Overrides:
getCapacityConstraintsin classProcessEquipmentBaseClass- Returns:
- unmodifiable map of constraint name to constraint, empty if none defined
-
getBottleneckConstraint
Gets the bottleneck (most limiting) constraint for this equipment.Returns the enabled constraint with the highest utilization ratio. If no constraints are defined or enabled, returns null.
- Specified by:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Specified by:
getBottleneckConstraintin interfaceProcessEquipmentInterface- Overrides:
getBottleneckConstraintin classProcessEquipmentBaseClass- Returns:
- the most limiting constraint, or null if none
-
isCapacityExceeded
public boolean isCapacityExceeded()Checks if any capacity constraint is violated (exceeds 100% utilization).A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.
- Specified by:
isCapacityExceededin interfaceCapacityConstrainedEquipment- Specified by:
isCapacityExceededin interfaceProcessEquipmentInterface- Overrides:
isCapacityExceededin classProcessEquipmentBaseClass- Returns:
- true if any enabled constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
public boolean isHardLimitExceeded()Checks if any HARD constraint limit is exceeded.HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.
- Specified by:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- Specified by:
isHardLimitExceededin interfaceProcessEquipmentInterface- Overrides:
isHardLimitExceededin classProcessEquipmentBaseClass- Returns:
- true if any enabled HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all enabled constraints.Returns the highest utilization ratio across all enabled constraints. Values above 1.0 indicate the equipment is over capacity. Returns 0.0 if no constraints are defined or enabled.
- Specified by:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Specified by:
getMaxUtilizationin interfaceProcessEquipmentInterface- Overrides:
getMaxUtilizationin classProcessEquipmentBaseClass- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
Adds a capacity constraint to this equipment.Constraints can be added at any time. If a constraint with the same name already exists, it is replaced. Use the fluent builder API on
CapacityConstraintto configure the constraint before adding.- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Specified by:
addCapacityConstraintin interfaceProcessEquipmentInterface- Overrides:
addCapacityConstraintin classProcessEquipmentBaseClass- Parameters:
constraint- the capacity constraint to add (ignored if null)
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraintName- the name of the constraint to remove- Returns:
- true if the constraint was found and removed
-
clearCapacityConstraints
public void clearCapacityConstraints()Clears all capacity constraints from this equipment.- Specified by:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-