Class HeatExchanger
- All Implemented Interfaces:
Serializable, Runnable, HeaterInterface, HeatExchangerInterface, ProcessEquipmentInterface, TwoPortInterface, StateVectorProvider, SimulationInterface, NamedInterface
HeatExchanger class.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructing HeatExchanger instances with a fluent API. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double(package private) doubleprotected double(package private) double(package private) booleanprivate Stringdoubleprivate double(package private) StreamInterface[](package private) double(package private) StreamInterface[](package private) intprivate static final longSerialization version UID.(package private) boolean(package private) SystemInterfaceprotected doubledoubleprivate doubleprivate booleanFields inherited from class Heater
coolingMediumTemperature, lastDuty, lastFlowRate, lastOutPressure, lastOutTemperature, lastPressure, lastPressureDrop, lastTemperature, mechanicalDesign, pressureOut, setOutPressureFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionHeatExchanger(String name) Constructor for HeatExchanger.HeatExchanger(String name, StreamInterface inStream1) Constructor for HeatExchanger.HeatExchanger(String name, StreamInterface inStream1, StreamInterface inStream2) Constructor for HeatExchanger. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInStream(StreamInterface inStream) Add inlet stream.static HeatExchanger.BuilderCreates a new Builder for constructing a HeatExchanger with a fluent API.doublecalcThermalEffectivenes(double NTU, double Cr) calcThermalEffectivenes.voiddisplayResult.doubleGetter for the fielddeltaT.doublegetDuty()getDuty.doublegetEntropyProduction(String unit) getEntropyProduction.Getter for the fieldflowArrangement.doubleGetter for the fieldguessOutTemperature.doubleGetter for the fieldhotColdDutyBalance.getInStream(int i) Getter for the fieldinStream.doublegetInTemperature(int i) Get temperature of instream i.doublegetMassBalance(String unit) getMassBalance.Get amechanicalDesignfor the equipment.getOutStream(int i) getOutStream.doublegetOutTemperature(int i) Get temperature of outstream i.Get the current state as a standardized vector.doubleGetter for the fieldthermalEffectiveness.doublegetUAvalue.voidInitialize ainitMechanicalDesignfor the equipment.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunConditionAnalysis.voidrunConditionAnalysis(ProcessEquipmentInterface refExchanger) runConditionAnalysis.voidrunDeltaT.voidrunSpecifiedStream.voidsetDeltaT(double deltaT) Setter for the fielddeltaT.voidsetdT(double dT) setdT.voidsetFeedStream(int number, StreamInterface inStream) setFeedStream.voidsetFlowArrangement(String flowArrangement) Setter for the fieldflowArrangement.voidsetGuessOutTemperature(double guessOutTemperature) Setter for the fieldguessOutTemperature.voidsetGuessOutTemperature(double guessOutTemperature, String unit) Setter for the fieldguessOutTemperature.voidsetHotColdDutyBalance(double hotColdDutyBalance) Setter for the fieldhotColdDutyBalance.voidSetter for the fieldname.voidsetOutStream(int streamNumber, StreamInterface outStream) Setter for the fieldoutStream.voidsetOutTemperature(double temperature) Set the outlet temperature of the heater.voidsetThermalEffectiveness(double thermalEffectiveness) Setter for the fieldthermalEffectiveness.voidsetUAvalue(double UAvalue) setUAvalue.voidsetUseDeltaT(boolean useDeltaT) Setter for the fielduseDeltaT.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, getPressureDrop, getUtilitySpecification, 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 HeaterInterface
setOutPressure, setOutTemperature, setOutTPMethods inherited from interface NamedInterface
getName, getTagName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getExergyChange, getFluid, getRestCapacityMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface StateVectorProvider
getStateDimension, getStateNamesMethods inherited from interface TwoPortInterface
getInStream, getOutStream
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
setTemperature
boolean setTemperature -
outStream
StreamInterface[] outStream -
inStream
StreamInterface[] inStream -
system
SystemInterface system -
NTU
double NTU -
temperatureOut
protected double temperatureOut -
dT
protected double dT -
dH
double dH -
UAvalue
private double UAvalue -
duty
double duty -
hotColdDutyBalance
private double hotColdDutyBalance -
firstTime
boolean firstTime -
guessOutTemperature
public double guessOutTemperature -
guessOutTemperatureUnit
-
outStreamSpecificationNumber
int outStreamSpecificationNumber -
thermalEffectiveness
public double thermalEffectiveness -
flowArrangement
-
useDeltaT
private boolean useDeltaT -
deltaT
private double deltaT
-
-
Constructor Details
-
HeatExchanger
Constructor for HeatExchanger.- Parameters:
name- name of heat exchanger
-
HeatExchanger
Constructor for HeatExchanger.- Parameters:
name- name of heat exchangerinStream1- input stream
-
HeatExchanger
Constructor for HeatExchanger.- Parameters:
name- name of heat exchangerinStream1- input stream 1inStream2- input stream 2
-
-
Method Details
-
addInStream
Add inlet stream.
- Parameters:
inStream- aStreamInterfaceobject
-
setFeedStream
setFeedStream. Will also set name of outstreams.
- Parameters:
number- a intinStream- aStreamInterfaceobject
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classHeater- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classHeater
-
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- Overrides:
setdTin classHeater- Parameters:
dT- a double
-
getOutStream
getOutStream.
- Specified by:
getOutStreamin interfaceHeatExchangerInterface- Parameters:
i- a int- Returns:
- a
StreamInterfaceobject
-
getInStream
Getter for the field
inStream.- Parameters:
i- a int- Returns:
- a
StreamInterfaceobject
-
setOutTemperature
public void setOutTemperature(double temperature) Set the outlet temperature of the heater.
- Overrides:
setOutTemperaturein classHeater- Parameters:
temperature- Temperature in Kelvin
-
getOutTemperature
public double getOutTemperature(int i) Get temperature of outstream i.
- Parameters:
i- a int- Returns:
- a double
-
getInTemperature
public double getInTemperature(int i) Get temperature of instream i.
- Parameters:
i- a int- Returns:
- a double
-
setOutStream
Setter for the field
outStream.- Parameters:
streamNumber- a intoutStream- the outStream to set
-
runSpecifiedStream
-
runDeltaT
-
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
-
getDuty
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classHeater
-
getUAvalue
public double getUAvalue()getUAvalue.
- Returns:
- the UAvalue
-
setUAvalue
public void setUAvalue(double UAvalue) setUAvalue.
- Parameters:
UAvalue- the UAvalue to set
-
getGuessOutTemperature
public double getGuessOutTemperature()Getter for the field
guessOutTemperature.- Returns:
- a double
-
setGuessOutTemperature
public void setGuessOutTemperature(double guessOutTemperature) Setter for the field
guessOutTemperature.- Parameters:
guessOutTemperature- a double
-
setGuessOutTemperature
Setter for the field
guessOutTemperature.- Parameters:
guessOutTemperature- a doubleunit- a String
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classHeater- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classTwoPortEquipment- Parameters:
unit- aStringobject- Returns:
- a double
-
runConditionAnalysis
runConditionAnalysis.
- Specified by:
runConditionAnalysisin interfaceProcessEquipmentInterface- Overrides:
runConditionAnalysisin classProcessEquipmentBaseClass- Parameters:
refExchanger- aProcessEquipmentInterfaceobject
-
runConditionAnalysis
public void runConditionAnalysis()runConditionAnalysis.
-
getThermalEffectiveness
public double getThermalEffectiveness()Getter for the field
thermalEffectiveness.- Returns:
- a double
-
setThermalEffectiveness
public void setThermalEffectiveness(double thermalEffectiveness) Setter for the field
thermalEffectiveness.- Parameters:
thermalEffectiveness- a double
-
getFlowArrangement
-
setFlowArrangement
Setter for the field
flowArrangement.- Parameters:
flowArrangement- name of flow arrangement
-
calcThermalEffectivenes
public double calcThermalEffectivenes(double NTU, double Cr) calcThermalEffectivenes.
- Parameters:
NTU- a doubleCr- a double- Returns:
- a double
-
getHotColdDutyBalance
public double getHotColdDutyBalance()Getter for the field
hotColdDutyBalance.- Returns:
- a double
-
setHotColdDutyBalance
public void setHotColdDutyBalance(double hotColdDutyBalance) Setter for the field
hotColdDutyBalance.- Parameters:
hotColdDutyBalance- a double
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classHeater- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classHeater- Parameters:
cfg- report configuration- Returns:
- json string
-
setUseDeltaT
public void setUseDeltaT(boolean useDeltaT) Setter for the field
useDeltaT.- Parameters:
useDeltaT- a boolean
-
getDeltaT
public double getDeltaT()Getter for the field
deltaT.- Returns:
- a double
-
setDeltaT
public void setDeltaT(double deltaT) Setter for the field
deltaT.- Parameters:
deltaT- a double
-
getStateVector
Get the current state as a standardized vector.The state vector should include all observable variables relevant for control and monitoring. Values should be in physical units with appropriate bounds.
Returns state vector containing:
- hot_inlet_temp - Hot side inlet temperature [K]
- hot_outlet_temp - Hot side outlet temperature [K]
- cold_inlet_temp - Cold side inlet temperature [K]
- cold_outlet_temp - Cold side outlet temperature [K]
- duty - Heat duty [kW]
- ua_value - UA value [W/K]
- effectiveness - Thermal effectiveness [fraction]
- lmtd - Log mean temperature difference [K]
- hot_flow - Hot side mass flow [kg/s]
- cold_flow - Cold side mass flow [kg/s]
- Specified by:
getStateVectorin interfaceStateVectorProvider- Returns:
- current state vector
-
builder
Creates a new Builder for constructing a HeatExchanger with a fluent API.Example usage:
HeatExchanger hx = HeatExchanger.builder("E-100").hotStream(hotFeed).coldStream(coldFeed) .UAvalue(5000.0).flowArrangement("counterflow").build();- Parameters:
name- the name of the heat exchanger- Returns:
- a new Builder instance
-