Class UnisimCalculator
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.util.UnisimCalculator
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Generic UniSim calculation block used when importing UniSim operations that carry process stream
topology but do not have a one-to-one physical NeqSim equivalent.
The block behaves as a deterministic pass-through by default: the first connected inlet stream is cloned to one outlet stream and optional outlet specifications are applied. This is useful for UniSim balance blocks, virtual streams, template-interface placeholders, and lightweight calculator blocks where preserving connectivity is more important than silently dropping the operation.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringDescription of the current calculation mode.private final List<StreamInterface> Inlet streams connected to the imported UniSim operation.private doubleOptional outlet flow rate value.private booleanWhether an outlet flow rate override has been specified.private StringUnit for the optional outlet flow rate value.private double[]Optional outlet molar composition value.private booleanWhether an outlet molar composition override has been specified.private doubleOptional outlet pressure value.private booleanWhether an outlet pressure override has been specified.private StringUnit for the optional outlet pressure value.private StreamInterfaceOutlet stream exposed to downstream NeqSim equipment.private doubleOptional outlet temperature value.private booleanWhether an outlet temperature override has been specified.private StringUnit for the optional outlet temperature value.private static final longSerialization version UID.private StringUniSim operation type that created this block.Fields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionUnisimCalculator(String name) Creates an empty UniSim calculator block.UnisimCalculator(String name, StreamInterface inletStream) Creates a UniSim calculator block with one inlet stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStream(StreamInterface inletStream) Adds an inlet stream.private voidApplies configured outlet specifications before flashing the outlet stream.private StreamInterfacecreateOutletStream(StreamInterface inletStream) Creates a new outlet stream from an inlet stream.Gets the calculation mode label.Gets the first inlet stream.Returns all inlet streams connected to this equipment.doublegetMassBalance in kg/sec.Gets the outlet stream.Returns all outlet streams produced by this equipment.Gets the outlet stream using the shorter NeqSim utility naming convention.doubleGetter for the fieldpressure.doublegetPressure(String unit) Getter for the fieldpressureconverted to specified unit.Gets the UniSim operation type that created this calculator block.doubleGetter for the fieldtemperature.doublegetTemperature(String unit) Getter for the fieldtemperatureconverted to specified unit.getThermoSystem.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidsetCalculationMode(String calculationMode) Sets the calculation mode label.voidsetFlowRate(double flowRate, String unit) Sets an outlet flow rate override using the generic stream-style setter name.voidsetInletStream(StreamInterface inletStream) Sets the single inlet stream, replacing any previously connected inlet streams.voidsetMolarComposition(double[] molarComposition) Sets an outlet molar composition override.voidsetOutletFlowRate(double flowRate, String unit) Sets an outlet flow rate override.voidsetOutletPressure(double pressure) Sets an outlet pressure override in bara.voidsetOutletPressure(double pressure, String unit) Sets an outlet pressure override.voidsetOutletStream(StreamInterface outletStream) Sets an explicit outlet stream.voidsetOutletTemperature(double temperature) Sets an outlet temperature override in Kelvin.voidsetOutletTemperature(double temperature, String unit) Sets an outlet temperature override.voidsetPressure(double pressure, String unit) Sets an outlet pressure override using the generic stream-style setter name.voidsetSourceOperationType(String sourceOperationType) Sets the UniSim operation type that created this calculator block.voidsetTemperature(double temperature, String unit) Sets an outlet temperature override using the generic stream-style setter name.Methods inherited from class ProcessEquipmentBaseClass
addCapacityConstraint, addController, copy, displayResult, equals, getAvailableMargin, getAvailableMarginPercent, getBottleneckConstraint, getCapacityConstraints, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getEntropyProduction, getExergyChange, getFailureMode, getMassBalance, getMaxUtilization, getMaxUtilizationPercent, getMechanicalDesign, getMinimumFlow, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getUtilizationSummary, hashCode, initElectricalDesign, initializeDefaultConstraints, initInstrumentDesign, initMechanicalDesign, isActive, isActive, isCapacityAnalysisEnabled, isCapacityExceeded, isFailed, isHardLimitExceeded, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solved, toJson, toJsonMethods 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, getInstrumentDesign, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletTemperature, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculation, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
inletStreams
Inlet streams connected to the imported UniSim operation. -
outletStream
Outlet stream exposed to downstream NeqSim equipment. -
sourceOperationType
UniSim operation type that created this block. -
calculationMode
Description of the current calculation mode. -
outletFlowRate
private double outletFlowRateOptional outlet flow rate value. -
outletFlowRateUnit
Unit for the optional outlet flow rate value. -
outletFlowRateSpecified
private boolean outletFlowRateSpecifiedWhether an outlet flow rate override has been specified. -
outletPressure
private double outletPressureOptional outlet pressure value. -
outletPressureUnit
Unit for the optional outlet pressure value. -
outletPressureSpecified
private boolean outletPressureSpecifiedWhether an outlet pressure override has been specified. -
outletTemperature
private double outletTemperatureOptional outlet temperature value. -
outletTemperatureUnit
Unit for the optional outlet temperature value. -
outletTemperatureSpecified
private boolean outletTemperatureSpecifiedWhether an outlet temperature override has been specified. -
outletMolarComposition
private double[] outletMolarCompositionOptional outlet molar composition value. -
outletMolarCompositionSpecified
private boolean outletMolarCompositionSpecifiedWhether an outlet molar composition override has been specified.
-
-
Constructor Details
-
UnisimCalculator
Creates an empty UniSim calculator block.- Parameters:
name- name of the imported UniSim calculation block
-
UnisimCalculator
Creates a UniSim calculator block with one inlet stream.- Parameters:
name- name of the imported UniSim calculation blockinletStream- inlet stream used as the pass-through reference- Throws:
IllegalArgumentException- if the inlet stream is null
-
-
Method Details
-
setInletStream
Sets the single inlet stream, replacing any previously connected inlet streams.- Parameters:
inletStream- inlet stream used as the pass-through reference- Throws:
IllegalArgumentException- if the inlet stream is null
-
addStream
Adds an inlet stream. The first inlet is used as the pass-through reference.- Parameters:
inletStream- inlet stream to add- Throws:
IllegalArgumentException- if the inlet stream is null
-
getInletStream
Gets the first inlet stream.- Returns:
- first inlet stream, or null if no inlet is connected
-
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)
-
setOutletStream
Sets an explicit outlet stream.- Parameters:
outletStream- outlet stream exposed to downstream equipment
-
getOutletStream
Gets the outlet stream.- Returns:
- outlet stream, or null if the block has not been connected
-
getOutStream
Gets the outlet stream using the shorter NeqSim utility naming convention.- Returns:
- outlet stream, or null if the block has not been connected
-
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)
-
setSourceOperationType
Sets the UniSim operation type that created this calculator block.- Parameters:
sourceOperationType- UniSim operation type, for examplebalanceop
-
getSourceOperationType
Gets the UniSim operation type that created this calculator block.- Returns:
- UniSim operation type, or an empty string if unset
-
setCalculationMode
Sets the calculation mode label.- Parameters:
calculationMode- calculation mode label, for examplepassThrough
-
getCalculationMode
-
setOutletFlowRate
Sets an outlet flow rate override.- Parameters:
flowRate- outlet flow rate valueunit- unit of the flow rate value
-
setFlowRate
Sets an outlet flow rate override using the generic stream-style setter name.- Parameters:
flowRate- outlet flow rate valueunit- unit of the flow rate value
-
setOutletPressure
public void setOutletPressure(double pressure) Sets an outlet pressure override in bara.- Parameters:
pressure- outlet pressure in bara
-
setOutletPressure
Sets an outlet pressure override.- Parameters:
pressure- outlet pressure valueunit- unit of the pressure value
-
setPressure
Sets an outlet pressure override using the generic stream-style setter name.- Parameters:
pressure- outlet pressure valueunit- unit of the pressure value
-
setOutletTemperature
public void setOutletTemperature(double temperature) Sets an outlet temperature override in Kelvin.- Parameters:
temperature- outlet temperature in Kelvin
-
setOutletTemperature
Sets an outlet temperature override.- Parameters:
temperature- outlet temperature valueunit- unit of the temperature value
-
setTemperature
Sets an outlet temperature override using the generic stream-style setter name.- Parameters:
temperature- outlet temperature valueunit- unit of the temperature value
-
setMolarComposition
public void setMolarComposition(double[] molarComposition) Sets an outlet molar composition override.- Parameters:
molarComposition- component molar fractions in NeqSim component order
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
getPressure
public double getPressure()Getter for the field
pressure.- Specified by:
getPressurein interfaceProcessEquipmentInterface- Overrides:
getPressurein classProcessEquipmentBaseClass- Returns:
- Pressure in bara
-
getPressure
Getter for the field
pressureconverted to specified unit.- Specified by:
getPressurein interfaceProcessEquipmentInterface- Overrides:
getPressurein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getTemperature
public double getTemperature()Getter for the field
temperature.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Overrides:
getTemperaturein classProcessEquipmentBaseClass- Returns:
- a double
-
getTemperature
Getter for the field
temperatureconverted to specified unit.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Overrides:
getTemperaturein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
public double getMassBalance()getMassBalance in kg/sec.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classProcessEquipmentBaseClass- Returns:
- The mass balance of the process equipment in kg/sec.
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Parameters:
id- UUID
-
createOutletStream
Creates a new outlet stream from an inlet stream.- Parameters:
inletStream- inlet stream to clone- Returns:
- outlet stream with a cloned thermodynamic system
-
applyOutletSpecifications
private void applyOutletSpecifications()Applies configured outlet specifications before flashing the outlet stream.
-