Class Stream
- All Implemented Interfaces:
Serializable, Cloneable, Runnable, ProcessEquipmentInterface, StreamInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
DexpiStream, DexpiStream, EquilibriumStream, IronIonSaturationStream, NeqStream, ScalePotentialCheckStream
Stream class.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprotected double[]protected doubleprotected doubleprotected double(package private) static org.apache.logging.log4j.LoggerLogger object for class.protected static intConstantnumberOfStreams=0.private static final longSerialization version UID.protected StreamInterfaceprotected intprotected 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 Stream.Stream(String name, StreamInterface stream) Constructor for Stream.Stream(String name, SystemInterface thermoSystem) Constructor for Stream. -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculate and return cricondenbar.doubleCalculate and return cricondentherm.clone()Clone object.Clone object and set a new name.voiddisplayResult.voidflashStream.doubleGCV()GCV.getFluid()getFluid.doubleGetter for the fieldgasQuality.doublegetGCV.doublegetHydrateEquilibriumTemperature.doublegetHydrocarbonDewPoint(String temperatureUnit, double refpressure, String refPressureUnit) Calculates the hydrocarbon dew point of the stream.getISO6976(String unit, double refTVolume, double refTCombustion) getWI.doublegetMolarRate.Gets the outlet stream.getProperty(String propertyName, String unit, String phase, String component) getProperty.getReport.String[][]getResultTable.doubleCalculates the Reid Vapor Pressure (RVP) of the stream.doubleCalculates the Reid Vapor Pressure (RVP) of the stream.doublegetSolidFormationTemperature(String solidName) getSolidFormationTemperature.doubleGetter for the fieldtemperature.doublegetTemperature(String unit) Getter for the fieldtemperatureconverted to specified unit.getThermoSystem.doubleCalculates the True Vapor Pressure (TVP) of the stream.doublegetWI.doubleLCV()LCV.booleanCheck if process equipment needs recalculating.voidphaseEnvelope.String[][]reportResults.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunController(double dt, UUID id) runController.voidrunTPflash.voidrunTransient(double dt, UUID id) runTransientvoidsetEmptyThermoSystem(SystemInterface thermoSystem) setEmptyThermoSystem.voidsetFlowRate(double flowrate, String unit) setFlowRate.voidsetFluid(SystemInterface fluid) setFluid.voidsetGasQuality(double gasQuality) Setter for the fieldgasQuality.voidsetInletStream(StreamInterface stream) Setter for the fieldstream.voidsetPressure(double pressure, String unit) setPressure.voidsetStream(StreamInterface stream) Setter for the fieldstream.voidsetTemperature(double temperature, String unit) setTemperature.voidsetThermoSystem(SystemInterface thermoSystem) setThermoSystem.voidsetThermoSystemFromPhase(SystemInterface thermoSystem, String phaseTypeName) setThermoSystemFromPhase.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.doubleCalculates the True Vapor Pressure (TVP) of the stream.Validate the process equipment before execution.Methods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getEntropyProduction, getExergyChange, getMassBalance, getMassBalance, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getSpecification, hashCode, initMechanicalDesign, isActive, isActive, isSetEnergyStream, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, 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
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getConditionAnalysisMessage, getController, getEntropyProduction, getExergyChange, getExergyChange, getMassBalance, getMassBalance, getMechanicalDesign, getReport_json, getRestCapacity, getSpecification, initMechanicalDesign, 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, solvedMethods inherited from interface StreamInterface
equals, getFlowRate, getPressure, getPressure, hashCode, setName
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
thermoSystem
-
streamNumber
protected int streamNumber -
numberOfStreams
protected static int numberOfStreamsConstantnumberOfStreams=0. -
gasQuality
private double gasQuality -
stream
-
lastTemperature
protected double lastTemperature -
lastPressure
protected double lastPressure -
lastFlowRate
protected double lastFlowRate -
lastComposition
protected double[] lastComposition
-
-
Constructor Details
-
Stream
-
Stream
Constructor for Stream.
NB! This construct uses the input stream object internally, i.e., it is not cloned. Use
streamObject.clone(newName)rather thannew Stream(newName,streamObject)- Parameters:
name- name of streamstream- Stream to use as internal Stream.
-
Stream
Constructor for Stream.
NB! This construct uses the input thermoSystem object internally, i.e., it is not cloned.
- Parameters:
name- name of streamthermoSystem- System to use as internal System.
-
-
Method Details
-
getGasQuality
public double getGasQuality()Getter for the field
gasQuality.- Returns:
- the gasQuality
-
setGasQuality
public void setGasQuality(double gasQuality) Setter for the field
gasQuality.- Parameters:
gasQuality- the gasQuality to set
-
getHydrateEquilibriumTemperature
public double getHydrateEquilibriumTemperature()getHydrateEquilibriumTemperature.
- Specified by:
getHydrateEquilibriumTemperaturein interfaceStreamInterface- Returns:
- a double
-
getSolidFormationTemperature
-
clone
Clone object.
- Specified by:
clonein interfaceStreamInterface- Overrides:
clonein classObject- Returns:
- a
StreamInterfaceobject
-
clone
Clone object and set a new name.
- Specified by:
clonein interfaceStreamInterface- Parameters:
name- Name of cloned object- Returns:
- a
StreamInterfaceobject
-
getTemperature
public double getTemperature()Getter for the field
temperature.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Specified by:
getTemperaturein interfaceStreamInterface- Overrides:
getTemperaturein classProcessEquipmentBaseClass- Returns:
- a double
-
getTemperature
Getter for the field
temperatureconverted to specified unit.- Specified by:
getTemperaturein interfaceProcessEquipmentInterface- Specified by:
getTemperaturein interfaceStreamInterface- Overrides:
getTemperaturein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getMolarRate
public double getMolarRate()getMolarRate.
- Specified by:
getMolarRatein interfaceStreamInterface- Returns:
- a double
-
setThermoSystem
setThermoSystem.
- Specified by:
setThermoSystemin interfaceStreamInterface- Parameters:
thermoSystem- aSystemInterfaceobject
-
setFluid
setFluid.
- Specified by:
setFluidin interfaceStreamInterface- Parameters:
fluid- aSystemInterfaceobject
-
setThermoSystemFromPhase
setThermoSystemFromPhase.
- Specified by:
setThermoSystemFromPhasein interfaceStreamInterface- Parameters:
thermoSystem- aSystemInterfaceobjectphaseTypeName- aStringobject
-
setEmptyThermoSystem
setEmptyThermoSystem.
- Specified by:
setEmptyThermoSystemin interfaceStreamInterface- Parameters:
thermoSystem- aSystemInterfaceobject
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Specified by:
getThermoSystemin interfaceStreamInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
setFlowRate
setFlowRate.
- Specified by:
setFlowRatein interfaceStreamInterface- Parameters:
flowrate- a doubleunit- aStringobject
-
setPressure
setPressure.
- Specified by:
setPressurein interfaceStreamInterface- Parameters:
pressure- a doubleunit- aStringobject
-
setTemperature
setTemperature.
- Specified by:
setTemperaturein interfaceStreamInterface- Parameters:
temperature- a doubleunit- aStringobject
-
runTPflash
-
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
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
getResultTable
getResultTable.
- Specified by:
getResultTablein interfaceProcessEquipmentInterface- Overrides:
getResultTablein classProcessEquipmentBaseClass- Returns:
- an array of
Stringobjects
-
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
-
runController
runController.
- Parameters:
dt- a doubleid- UUID of run
-
flashStream
-
phaseEnvelope
public void phaseEnvelope()phaseEnvelope.
-
CCB
Calculate and return cricondenbar.
- Specified by:
CCBin interfaceStreamInterface- Parameters:
unit- aStringobject- Returns:
- Calculated cricondenbar in specified unit
-
CCT
Calculate and return cricondentherm.
- Specified by:
CCTin interfaceStreamInterface- Parameters:
unit- aStringobject- Returns:
- Calculated cricondentherm in specified unit
-
TVP
Calculates the True Vapor Pressure (TVP) of the stream.
- Specified by:
TVPin interfaceStreamInterface- Parameters:
temperature- a doubleunit- aStringobject- Returns:
- a double
-
getTVP
Calculates the True Vapor Pressure (TVP) of the stream.
- Specified by:
getTVPin interfaceStreamInterface- Parameters:
referenceTemperature- a doubleunit- aStringobjectreturnUnit- aStringobject- Returns:
- a double
-
getRVP
Calculates the Reid Vapor Pressure (RVP) of the stream.
- Specified by:
getRVPin interfaceStreamInterface- Parameters:
referenceTemperature- a doubleunit- aStringobjectreturnUnit- aStringobject- Returns:
- a double
-
getRVP
Calculates the Reid Vapor Pressure (RVP) of the stream.- Specified by:
getRVPin interfaceStreamInterface- Parameters:
referenceTemperature- the reference temperature at which RVP is calculatedunit- the unit of the reference temperaturereturnUnit- the unit in which the RVP should be returnedrvpMethod- the method used to calculate RVP- Returns:
- the calculated RVP in the specified return unit
-
reportResults
reportResults.
- Specified by:
reportResultsin interfaceProcessEquipmentInterface- Overrides:
reportResultsin classProcessEquipmentBaseClass- Returns:
- an array of
Stringobjects
-
getProperty
-
GCV
-
getHydrocarbonDewPoint
public double getHydrocarbonDewPoint(String temperatureUnit, double refpressure, String refPressureUnit) Calculates the hydrocarbon dew point of the stream.- Specified by:
getHydrocarbonDewPointin interfaceStreamInterface- Parameters:
temperatureUnit- the unit of the temperature to be used (e.g., "C" for Celsius, "K" for Kelvin)refpressure- the reference pressure at which the dew point is to be calculatedrefPressureUnit- the unit of the reference pressure (e.g., "bar", "Pa")- Returns:
- the hydrocarbon dew point temperature in the specified temperature unit
-
getGCV
getGCV.
- Specified by:
getGCVin interfaceStreamInterface- Parameters:
unit- a StringrefTVolume- a double in CelciusrefTCombustion- a double in Celcius- Returns:
- a double
-
getWI
getWI.
- Specified by:
getWIin interfaceStreamInterface- Parameters:
unit- a StringrefTVolume- a double in CelciusrefTCombustion- a double in Celcius- Returns:
- a double
-
getISO6976
getWI.
- Specified by:
getISO6976in interfaceStreamInterface- Parameters:
unit- a StringrefTVolume- a double in CelciusrefTCombustion- a double in Celcius- Returns:
- a Standard_ISO6976
-
LCV
-
setStream
Setter for the field
stream.- Parameters:
stream- aStreamInterfaceobject
-
setInletStream
Setter for the field
stream.- Parameters:
stream- aStreamInterfaceobject
-
getOutletStream
Gets the outlet stream.- Returns:
- the outlet stream as a
StreamInterfaceobject.
-
getFluid
getFluid.
- Specified by:
getFluidin interfaceProcessEquipmentInterface- Returns:
- a
SystemInterfaceobject
-
getReport
-
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
-
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 stream setup before execution. Checks that:
- Equipment has a valid name
- Thermodynamic system is set and valid
- Temperature and pressure are in valid ranges
- Specified by:
validateSetupin interfaceProcessEquipmentInterface- Returns:
- validation result with errors and warnings
-