Class MultiStreamHeatExchanger
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.TwoPortEquipment
neqsim.process.equipment.heatexchanger.Heater
neqsim.process.equipment.heatexchanger.MultiStreamHeatExchanger
- All Implemented Interfaces:
Serializable, Runnable, HeaterInterface, MultiStreamHeatExchangerInterface, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface
MultiStreamHeatExchanger class.
Extends the Heater class to support multiple input and output streams, enabling the simulation of complex heat exchange processes such as those found in LNG heat exchangers.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprotected doubleprivate doubleprivate booleanprivate Stringprivate doubleprivate Stringprivate doubleprivate List<StreamInterface> (package private) int(package private) static org.apache.logging.log4j.LoggerLogger object for class.(package private) intprivate doubleprivate List<StreamInterface> private intprivate static final longprivate booleanprivate SystemInterfaceprivate doubleprotected doubleprivate doubleprivate doubleprivate booleanprivate booleanFields inherited from class Heater
coolingMediumTemperature, lastDuty, lastFlowRate, lastOutPressure, lastOutTemperature, lastPressure, lastPressureDrop, lastTemperature, mechanicalDesign, pressureOut, setOutPressureFields inherited from class TwoPortEquipment
inStream, outStreamFields 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 MultiStreamHeatExchanger.MultiStreamHeatExchanger(String name, List<StreamInterface> inStreams) Constructor for MultiStreamHeatExchanger with initial input streams. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInStream(StreamInterface inStream) Adds an inlet stream to the heat exchanger.doublecalcThermalEffectiveness(double NTU, double Cr) Calculates the thermal effectiveness based on the Number of Transfer Units (NTU) and the capacity ratio (Cr).voiddisplayResult.doubleRetrieves the fixed temperature difference (ΔT) used in calculations.doublegetDuty()getDuty.doublegetDuty(int streamNumber) Calculates the heat duty for a specified stream in the multi-stream heat exchanger.doublegetEntropyProduction(String unit) getEntropyProduction.Retrieves the flow arrangement of the heat exchanger.doubleRetrieves the guessed outlet temperature used during initialization.doubleRetrieves the hot and cold duty balance of the heat exchanger.getInStream(int i) Retrieves the input stream at the specified index.doublegetInTemperature(int i) Gets the inlet temperature of a specific input stream.doublegetMassBalance(String unit) getMassBalance.getOutStream(int i) Retrieves the output stream at the specified index.doublegetOutTemperature(int i) Gets the outlet temperature of a specific output stream.doubleGetter for the fieldtemperatureApproach.doubleGets the thermal effectiveness of the heat exchanger.doubleRetrieves the overall heat transfer coefficient times area (UA value).intReturns the number of feed streams connected to the heat exchanger.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidRuns a condition analysis using the current heat exchanger as the reference.voidrunConditionAnalysis(ProcessEquipmentInterface refExchanger) runConditionAnalysis.voidRuns the heat exchanger simulation using a specified stream approach.voidsetDeltaT(double deltaT) Sets the fixed temperature difference (ΔT) for calculations and enables its usage.voidsetdT(double dT) setdT.voidsetFeedStream(int index, StreamInterface inStream) Sets the feed stream at a specific index.voidsetFlowArrangement(String flowArrangement) Sets the flow arrangement of the heat exchanger.voidsetGuessOutTemperature(double guessOutTemperature) Sets the guessed outlet temperature in Kelvin.voidsetGuessOutTemperature(double guessOutTemperature, String unit) Sets the guessed outlet temperature with a specified unit.voidsetHotColdDutyBalance(double hotColdDutyBalance) Sets the hot and cold duty balance of the heat exchanger.voidSetter for the fieldname.voidsetOutTemperature(double temperature) Set the outlet temperature of the heater.voidsetTemperatureApproach(double temperatureApproach) Setter for the fieldtemperatureApproach.voidsetThermalEffectiveness(double thermalEffectiveness) Sets the thermal effectiveness of the heat exchanger.voidsetUAvalue(double UAvalue) Sets the overall heat transfer coefficient times area (UA value).voidsetUseDeltaT(boolean useDeltaT) Enables or disables the use of a fixed temperature difference (ΔT) in calculations.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 Heater
getCapacityDuty, getCapacityMax, getDuty, getEnergyInput, getExergyChange, getMechanicalDesign, getPressureDrop, getUtilitySpecification, initMechanicalDesign, isSetEnergyInput, needRecalculation, runTransient, setDuty, setEnergyInput, setOutPressure, setOutPressure, setOutStream, setOutTemperature, setOutTP, setPressureDrop, setSetEnergyInput, setUtilityApproachTemperature, setUtilityHeatCapacityRate, setUtilityOverallHeatTransferCoefficient, setUtilityReturnTemperature, setUtilitySpecification, setUtilitySupplyTemperatureMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, isActive, isActive, isSetEnergyStream, reportResults, run_step, 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, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getCapacityDuty, getCapacityMax, getConditionAnalysisMessage, getController, getExergyChange, getExergyChange, getFluid, getMassBalance, getMechanicalDesign, getPressure, getPressure, getReport_json, getRestCapacity, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, initMechanicalDesign, needRecalculation, reportResults, setController, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInStream, getOutStream
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
setTemperature
private boolean setTemperature -
outStreams
-
inStreams
-
system
-
NTU
private double NTU -
temperatureOut
protected double temperatureOut -
dT
protected double dT -
temperatureApproach
private double temperatureApproach -
UAvalueIsSet
private boolean UAvalueIsSet -
UAvalue
private double UAvalue -
duty
private double duty -
hotColdDutyBalance
private double hotColdDutyBalance -
firstTime
private boolean firstTime -
guessOutTemperature
private double guessOutTemperature -
guessOutTemperatureUnit
-
outStreamSpecificationNumber
private int outStreamSpecificationNumber -
thermalEffectiveness
private double thermalEffectiveness -
flowArrangement
-
useDeltaT
private boolean useDeltaT -
deltaT
private double deltaT -
MAX_ITERATIONS
int MAX_ITERATIONS -
iterations
int iterations
-
-
Constructor Details
-
MultiStreamHeatExchanger
Constructor for MultiStreamHeatExchanger.- Parameters:
name- Name of the heat exchanger
-
MultiStreamHeatExchanger
Constructor for MultiStreamHeatExchanger with initial input streams.- Parameters:
name- Name of the heat exchangerinStreams- Initial list of input streams
-
-
Method Details
-
addInStream
Adds an inlet stream to the heat exchanger.- Specified by:
addInStreamin interfaceMultiStreamHeatExchangerInterface- Parameters:
inStream- Input stream to be added
-
setFeedStream
Sets the feed stream at a specific index.- Specified by:
setFeedStreamin interfaceMultiStreamHeatExchangerInterface- Parameters:
index- Index of the stream to setinStream- Input stream to set at the specified index
-
setName
Setter for the field
name.- Specified by:
setNamein interfaceNamedInterface- Overrides:
setNamein classNamedBaseClass- Parameters:
name- aStringobject
-
setdT
public void setdT(double dT) setdT.
- Specified by:
setdTin interfaceHeaterInterface- Specified by:
setdTin interfaceMultiStreamHeatExchangerInterface- Overrides:
setdTin classHeater- Parameters:
dT- a double
-
getOutStream
Retrieves the output stream at the specified index.- Specified by:
getOutStreamin interfaceMultiStreamHeatExchangerInterface- Parameters:
i- Index of the output stream- Returns:
- The output
StreamInterfaceat the given index
-
getInStream
Retrieves the input stream at the specified index.- Specified by:
getInStreamin interfaceMultiStreamHeatExchangerInterface- Parameters:
i- Index of the input stream- Returns:
- The input
StreamInterfaceat the given index
-
setOutTemperature
public void setOutTemperature(double temperature) Set the outlet temperature of the heater.
- Specified by:
setOutTemperaturein interfaceMultiStreamHeatExchangerInterface- Overrides:
setOutTemperaturein classHeater- Parameters:
temperature- Temperature in Kelvin
-
getOutTemperature
public double getOutTemperature(int i) Gets the outlet temperature of a specific output stream.- Specified by:
getOutTemperaturein interfaceMultiStreamHeatExchangerInterface- Parameters:
i- Index of the output stream- Returns:
- Outlet temperature in Kelvin
-
getInTemperature
public double getInTemperature(int i) Gets the inlet temperature of a specific input stream.- Specified by:
getInTemperaturein interfaceMultiStreamHeatExchangerInterface- Parameters:
i- Index of the input stream- Returns:
- Inlet temperature in Kelvin
-
getDuty
public double getDuty()getDuty.
- Specified by:
getDutyin interfaceMultiStreamHeatExchangerInterface- Overrides:
getDutyin classHeater- Returns:
- a double
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classHeater
-
getUAvalue
public double getUAvalue()Retrieves the overall heat transfer coefficient times area (UA value).- Specified by:
getUAvaluein interfaceMultiStreamHeatExchangerInterface- Returns:
- UA value
-
setUAvalue
public void setUAvalue(double UAvalue) Sets the overall heat transfer coefficient times area (UA value).- Specified by:
setUAvaluein interfaceMultiStreamHeatExchangerInterface- Parameters:
UAvalue- UA value to set
-
getGuessOutTemperature
public double getGuessOutTemperature()Retrieves the guessed outlet temperature used during initialization.- Specified by:
getGuessOutTemperaturein interfaceMultiStreamHeatExchangerInterface- Returns:
- Guessed outlet temperature
-
setGuessOutTemperature
public void setGuessOutTemperature(double guessOutTemperature) Sets the guessed outlet temperature in Kelvin.- Specified by:
setGuessOutTemperaturein interfaceMultiStreamHeatExchangerInterface- Parameters:
guessOutTemperature- Guessed outlet temperature
-
setGuessOutTemperature
Sets the guessed outlet temperature with a specified unit.- Specified by:
setGuessOutTemperaturein interfaceMultiStreamHeatExchangerInterface- Parameters:
guessOutTemperature- Guessed outlet temperatureunit- Unit of the temperature (e.g., "K", "C")
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceMultiStreamHeatExchangerInterface- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classHeater- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceMultiStreamHeatExchangerInterface- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classTwoPortEquipment- Parameters:
unit- aStringobject- Returns:
- a double
-
runConditionAnalysis
runConditionAnalysis.
- Specified by:
runConditionAnalysisin interfaceMultiStreamHeatExchangerInterface- Specified by:
runConditionAnalysisin interfaceProcessEquipmentInterface- Overrides:
runConditionAnalysisin classProcessEquipmentBaseClass- Parameters:
refExchanger- aProcessEquipmentInterfaceobject
-
runConditionAnalysis
public void runConditionAnalysis()Runs a condition analysis using the current heat exchanger as the reference.- Specified by:
runConditionAnalysisin interfaceMultiStreamHeatExchangerInterface
-
getThermalEffectiveness
public double getThermalEffectiveness()Gets the thermal effectiveness of the heat exchanger.- Specified by:
getThermalEffectivenessin interfaceMultiStreamHeatExchangerInterface- Returns:
- Thermal effectiveness
-
setThermalEffectiveness
public void setThermalEffectiveness(double thermalEffectiveness) Sets the thermal effectiveness of the heat exchanger.- Specified by:
setThermalEffectivenessin interfaceMultiStreamHeatExchangerInterface- Parameters:
thermalEffectiveness- Thermal effectiveness to set
-
getFlowArrangement
Retrieves the flow arrangement of the heat exchanger.- Specified by:
getFlowArrangementin interfaceMultiStreamHeatExchangerInterface- Returns:
- Flow arrangement as a String (e.g., "counterflow", "parallelflow")
-
setFlowArrangement
Sets the flow arrangement of the heat exchanger.- Specified by:
setFlowArrangementin interfaceMultiStreamHeatExchangerInterface- Parameters:
flowArrangement- Name of the flow arrangement
-
calcThermalEffectiveness
public double calcThermalEffectiveness(double NTU, double Cr) Calculates the thermal effectiveness based on the Number of Transfer Units (NTU) and the capacity ratio (Cr).- Specified by:
calcThermalEffectivenessin interfaceMultiStreamHeatExchangerInterface- Parameters:
NTU- Number of Transfer UnitsCr- Capacity ratio (Cmin/Cmax)- Returns:
- Calculated thermal effectiveness
-
getHotColdDutyBalance
public double getHotColdDutyBalance()Retrieves the hot and cold duty balance of the heat exchanger.- Specified by:
getHotColdDutyBalancein interfaceMultiStreamHeatExchangerInterface- Returns:
- Hot and cold duty balance
-
setHotColdDutyBalance
public void setHotColdDutyBalance(double hotColdDutyBalance) Sets the hot and cold duty balance of the heat exchanger.- Specified by:
setHotColdDutyBalancein interfaceMultiStreamHeatExchangerInterface- Parameters:
hotColdDutyBalance- Hot and cold duty balance to set
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceMultiStreamHeatExchangerInterface- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classHeater- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceMultiStreamHeatExchangerInterface- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classHeater- Parameters:
cfg- report configuration- Returns:
- json string
-
setUseDeltaT
public void setUseDeltaT(boolean useDeltaT) Enables or disables the use of a fixed temperature difference (ΔT) in calculations.- Specified by:
setUseDeltaTin interfaceMultiStreamHeatExchangerInterface- Parameters:
useDeltaT- True to use ΔT, false otherwise
-
getDeltaT
public double getDeltaT()Retrieves the fixed temperature difference (ΔT) used in calculations.- Specified by:
getDeltaTin interfaceMultiStreamHeatExchangerInterface- Returns:
- Temperature difference ΔT
-
setDeltaT
public void setDeltaT(double deltaT) Sets the fixed temperature difference (ΔT) for calculations and enables its usage.- Specified by:
setDeltaTin interfaceMultiStreamHeatExchangerInterface- Parameters:
deltaT- Fixed temperature difference to set
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Overrides:
runin classHeater- Parameters:
id- UUID
-
runSpecifiedStream
Runs the heat exchanger simulation using a specified stream approach.- Parameters:
id- Unique identifier for the run
-
getTemperatureApproach
public double getTemperatureApproach()Getter for the field
temperatureApproach.- Returns:
- a double
-
setTemperatureApproach
public void setTemperatureApproach(double temperatureApproach) Setter for the field
temperatureApproach.- Parameters:
temperatureApproach- a double
-
numerOfFeedStreams
public int numerOfFeedStreams()Returns the number of feed streams connected to the heat exchanger.- Returns:
- the number of input streams.
-
getDuty
public double getDuty(int streamNumber) Calculates the heat duty for a specified stream in the multi-stream heat exchanger. The heat duty is determined as the difference in enthalpy between the outlet and inlet streams for the given stream index.- Parameters:
streamNumber- the index of the stream for which the heat duty is to be calculated. Must be less than the total number of input streams.- Returns:
- the heat duty (in appropriate energy units) for the specified stream in W
- Throws:
IndexOutOfBoundsException- if the specified stream index is out of bounds.
-