Class Splitter
- All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, ProcessEquipmentInterface, SplitterInterface, 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 new capacity constraint to this equipment.voidcalcSplitFactors.voidClears all capacity constraints from this equipment.voiddisplayResult.Gets the constraint with the highest utilization (the bottleneck).Gets all capacity constraints defined for this equipment.doubleGets the design pressure drop.Getter for the fieldinletStream.doublegetMassBalance(String unit) getMassBalance.doubleGets the maximum design velocity.doubleGets the maximum utilization across all constraints.Get amechanicalDesignfor the 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
copy, equals, getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, isActive, isActive, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, 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, isNearCapacityLimitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getCapacityDuty, getCapacityMax, getConditionAnalysisMessage, getController, getEntropyProduction, getExergyChange, getExergyChange, getFluid, getMassBalance, getOperatingEnvelopeViolation, getPressure, getPressure, getReport_json, getRestCapacity, getResultTable, getSimulationValidationErrors, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, isSimulationValid, isWithinOperatingEnvelope, reportResults, runConditionAnalysis, setController, setPressure, 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
-
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.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)
-
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
-