Class HeatExchanger
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, HeaterInterface, HeatExchangerInterface, ProcessEquipmentInterface, TwoPortInterface, StateVectorProvider, ProcessElementInterface, 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.static enumDesign mode for the heat exchanger. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleDesign duty in Watts for capacity constraint.private HeatExchanger.DesignModeDesign mode: SIZING (default, uses user-supplied UA) or RATING (calculates UA).private doubleDesign UA value in W/K for capacity constraint.(package private) doubleprotected double(package private) doubleprivate booleanWhether the dynamic heat exchanger model is enabled.(package private) booleanprivate Stringdoubleprivate doubleHeat transfer area in m2 (for dynamic model).private doubleprivate booleanInternal auto-sized flag for heat exchanger.private booleanFlag for HX-specific capacity analysis.private Map<String, CapacityConstraint> Capacity constraints map.(package private) StreamInterface[]private double[]Cached inlet stream 2 composition for needRecalculation check.private doubleCached inlet stream 2 flow rate for needRecalculation check.private doubleCached inlet stream 2 pressure for needRecalculation check.private doubleCached inlet stream 2 temperature for needRecalculation check.private doubleCached UA value for needRecalculation check.private doubleMaximum shell-side pressure drop in bar.private doubleMaximum tube-side pressure drop in bar.private doubleMinimum approach temperature in K.(package private) double(package private) StreamInterface[](package private) intprivate doubleHeat transfer area used in rating mode (m2).private ThermalDesignCalculatorTube-side shell-and-tube geometry for rating mode.private doubleCalculated overall U value from rating mode (W/(m2*K)).private static final longSerialization version UID.(package private) booleanprivate doubleShell-side fluid temperature in K — state variable for fluid accumulation model.private doubleShell-side fluid holdup volume in m3.private intNumber of shell passes for LMTD correction (1 = TEMA E, 2 = TEMA F).private doubleShell-side heat transfer coefficient in W/(m2*K).(package private) SystemInterfaceprotected doubledoubleprivate doubleTube-side fluid temperature in K — state variable for fluid accumulation model.private doubleTube-side fluid holdup volume in m3.private doubleTube-side heat transfer coefficient in W/(m2*K).private doubleprivate booleanprivate doubleMetal wall specific heat capacity in J/(kg*K).private doubleMetal wall mass in kg.private doubleMetal wall temperature in Kelvin — state variable for dynamic simulation.Fields inherited from class Heater
coolingMediumTemperature, electricalDesign, instrumentDesign, lastComposition, lastDuty, lastFlowRate, lastOutPressure, lastOutTemperature, lastPressure, lastPressureDrop, lastTemperature, logger, 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 TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a capacity constraint to this equipment.voidaddInStream(StreamInterface inStream) Add inlet stream.voidautoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.static HeatExchanger.BuilderCreates a new Builder for constructing a HeatExchanger with a fluent API.doublecalcThermalEffectivenes(double NTU, double Cr) calcThermalEffectivenes.voidClears all capacity constraints from this equipment.voiddisplayResult.doubleCalculates the current approach temperature.Gets the bottleneck (most limiting) constraint for this equipment.Gets all capacity constraints defined for this equipment.doubleGetter for the fielddeltaT.doubleGets the design duty.Gets the design mode.doubleGets the design UA value.doublegetDuty()getDuty.doublegetEntropyProduction(String unit) getEntropyProduction.Getter for the fieldflowArrangement.doubleGetter for the fieldguessOutTemperature.doubleGets the heat transfer area used in the dynamic model.doubleGetter for the fieldhotColdDutyBalance.getInStream(int i) Getter for the fieldinStream.doublegetInTemperature(int i) Get temperature of instream i.doublegetMassBalance(String unit) getMassBalance.doubleGets the maximum utilization across all enabled constraints.Get amechanicalDesignfor the equipment.doubleGets the minimum approach temperature.Returns the first outlet stream (side 0) of the heat exchanger.Returns both outlet streams of the heat exchanger.getOutStream(int i) getOutStream.doublegetOutTemperature(int i) Get temperature of outstream i.doubleGets the heat transfer area used in rating mode.Gets the ThermalDesignCalculator used in rating mode.doubleGets the overall U value computed from rating mode correlations.doubleGets the shell-side holdup volume.intGets the number of shell passes.doubleGets the shell-side heat transfer coefficient.Get a detailed sizing report after auto-sizing.Get the current state as a standardized vector.doubleGetter for the fieldthermalEffectiveness.doubleGets the tube-side holdup volume.doubleGets the tube-side heat transfer coefficient.doublegetUAvalue.doubleGets the metal wall specific heat capacity.doubleGets the metal wall mass used in the dynamic heat exchanger model.doubleGets the current metal wall temperature (dynamic state variable).private voidInitialize heat exchanger specific capacity constraints.voidInitialize ainitMechanicalDesignfor the equipment.booleanCheck if equipment has been auto-sized.booleanChecks if capacity analysis is enabled for this equipment.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanReturns whether the dynamic heat exchanger model is enabled.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.voidrunConditionAnalysis.voidrunConditionAnalysis(ProcessEquipmentInterface refExchanger) runConditionAnalysis.voidrunDeltaT.voidrunSpecifiedStream.voidrunTransient(double dt, UUID id) runTransientprotected voidsetAutoSized(boolean autoSized) Sets the autoSized flag.voidsetCapacityAnalysisEnabled(boolean enabled) Enables or disables capacity analysis for this equipment.voidsetDeltaT(double deltaT) Setter for the fielddeltaT.voidsetDesignDuty(double duty) Sets the design duty for capacity calculations.voidSets the design mode.voidsetDesignUAValue(double uaValue) Sets the design UA value for capacity calculations.voidsetdT(double dT) setdT.voidsetDynamicModelEnabled(boolean enabled) Enables or disables the dynamic heat exchanger model.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.voidsetHeatTransferArea(double heatTransferArea) Sets the heat transfer area for the dynamic model.voidsetHotColdDutyBalance(double hotColdDutyBalance) Setter for the fieldhotColdDutyBalance.voidsetMaxShellPressureDrop(double pressureDrop) Sets the maximum shell-side pressure drop.voidsetMaxTubePressureDrop(double pressureDrop) Sets the maximum tube-side pressure drop.voidsetMinApproachTemperature(double temperature) Sets the minimum approach temperature.voidSetter for the fieldname.voidsetOutStream(int streamNumber, StreamInterface outStream) Setter for the fieldoutStream.voidsetOutTemperature(double temperature) Set the outlet temperature of the heater.voidsetRatingArea(double area) Sets the heat transfer area for rating mode.voidsetRatingCalculator(ThermalDesignCalculator calculator) Sets the ThermalDesignCalculator for rating mode.voidsetShellHoldupVolume(double shellHoldupVolume) Sets the shell-side holdup volume.voidsetShellPasses(int shellPasses) Sets the number of shell passes for LMTD correction factor calculation.voidsetShellSideHtc(double shellSideHtc) Sets the shell-side heat transfer coefficient.voidsetThermalEffectiveness(double thermalEffectiveness) Setter for the fieldthermalEffectiveness.voidsetTubeHoldupVolume(double tubeHoldupVolume) Sets the tube-side holdup volume.voidsetTubeSideHtc(double tubeSideHtc) Sets the tube-side heat transfer coefficient.voidsetUAvalue(double UAvalue) setUAvalue.voidsetUseDeltaT(boolean useDeltaT) Setter for the fielduseDeltaT.voidsetWallCp(double wallCp) Sets the metal wall specific heat capacity.voidsetWallMass(double wallMass) Sets the metal wall mass for the dynamic heat exchanger model.voidsetWallTemperature(double wallTemperature) Sets the metal wall temperature.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.private voidUpdates cached state for needRecalculation checks.private voidUpdates the rating calculator with current stream fluid properties.Methods inherited from class Heater
autoSize, autoSize, getCapacityDuty, getCapacityMax, getDuty, getElectricalDesign, getEnergyInput, getEquipmentState, getExergyChange, getInstrumentDesign, getMaxDesignDuty, getMaxDesignDuty, getMaxOutletTemperature, getMaxOutletTemperature, getMinOutletTemperature, getMinOutletTemperature, getPressureDrop, getSizingReportJson, getUtilitySpecification, hasMaxOutletTemperatureLimit, hasMinOutletTemperatureLimit, initElectricalDesign, initializeCapacityConstraints, initInstrumentDesign, isSetEnergyInput, setDuty, setEnergyInput, setMaxDesignDuty, setMaxDesignDuty, setMaxOutletTemperature, setMaxOutletTemperature, setMinOutletTemperature, setMinOutletTemperature, setOutletPressure, setOutletPressure, setOutletTemperature, setOutletTemperature, setOutStream, setOutTP, setPressureDrop, setSetEnergyInput, setUtilityApproachTemperature, setUtilityHeatCapacityRate, setUtilityOverallHeatTransferCoefficient, setUtilityReturnTemperature, setUtilitySpecification, setUtilitySupplyTemperatureMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletStreams, getInletTemperature, getOutletPressure, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletStream, validateSetupMethods inherited from class ProcessEquipmentBaseClass
addController, copy, equals, getAvailableMargin, getAvailableMarginPercent, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getFailureMode, getMassBalance, getMaxUtilizationPercent, getMinimumFlow, getPressure, getPressure, getProperty, getReferenceDesignation, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, getUtilizationSummary, hashCode, initializeDefaultConstraints, isActive, isActive, isFailed, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setTagNumberMethods 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 HeaterInterface
setOutletPressure, setOutletTemperature, setOutTPMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getExergyChange, getExergyDestruction, getExergyDestruction, getFluid, getOperatingEnvelopeViolation, getOutletFlowRate, getOutletPressure, getOutletTemperature, getReferenceDesignationString, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelopeMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface StateVectorProvider
getStateDimension, getStateNamesMethods inherited from interface TwoPortInterface
getInStream, getOutStream, setOutPressure, setOutPressure, setOutTemperature
-
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 -
designMode
Design mode: SIZING (default, uses user-supplied UA) or RATING (calculates UA). -
ratingCalculator
Tube-side shell-and-tube geometry for rating mode. -
shellPasses
private int shellPassesNumber of shell passes for LMTD correction (1 = TEMA E, 2 = TEMA F). -
ratingU
private double ratingUCalculated overall U value from rating mode (W/(m2*K)). -
ratingArea
private double ratingAreaHeat transfer area used in rating mode (m2). -
designDuty
private double designDutyDesign duty in Watts for capacity constraint. -
designUAValue
private double designUAValueDesign UA value in W/K for capacity constraint. -
minApproachTemperature
private double minApproachTemperatureMinimum approach temperature in K. -
maxShellPressureDrop
private double maxShellPressureDropMaximum shell-side pressure drop in bar. -
maxTubePressureDrop
private double maxTubePressureDropMaximum tube-side pressure drop in bar. -
hxCapacityConstraints
Capacity constraints map. -
hxCapacityAnalysisEnabled
private boolean hxCapacityAnalysisEnabledFlag for HX-specific capacity analysis. -
lastInStream2Temperature
private double lastInStream2TemperatureCached inlet stream 2 temperature for needRecalculation check. -
lastInStream2Pressure
private double lastInStream2PressureCached inlet stream 2 pressure for needRecalculation check. -
lastInStream2FlowRate
private double lastInStream2FlowRateCached inlet stream 2 flow rate for needRecalculation check. -
lastUAvalue
private double lastUAvalueCached UA value for needRecalculation check. -
lastInStream2Composition
private double[] lastInStream2CompositionCached inlet stream 2 composition for needRecalculation check. -
wallMass
private double wallMassMetal wall mass in kg. -
wallCp
private double wallCpMetal wall specific heat capacity in J/(kg*K). -
wallTemperature
private double wallTemperatureMetal wall temperature in Kelvin — state variable for dynamic simulation. -
shellHoldupVolume
private double shellHoldupVolumeShell-side fluid holdup volume in m3. -
tubeHoldupVolume
private double tubeHoldupVolumeTube-side fluid holdup volume in m3. -
shellSideHtc
private double shellSideHtcShell-side heat transfer coefficient in W/(m2*K). -
tubeSideHtc
private double tubeSideHtcTube-side heat transfer coefficient in W/(m2*K). -
heatTransferArea
private double heatTransferAreaHeat transfer area in m2 (for dynamic model). -
dynamicModelEnabled
private boolean dynamicModelEnabledWhether the dynamic heat exchanger model is enabled. -
shellFluidTemperature
private double shellFluidTemperatureShell-side fluid temperature in K — state variable for fluid accumulation model. -
tubeFluidTemperature
private double tubeFluidTemperatureTube-side fluid temperature in K — state variable for fluid accumulation model. -
hxAutoSized
private boolean hxAutoSizedInternal auto-sized flag for heat exchanger.
-
-
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
-
getOutletStream
Returns the first outlet stream (side 0) of the heat exchanger.HeatExchanger has two outlet streams corresponding to the two feed sides. This method returns the outlet for feed side 0. Use
getOutStream(int)to access a specific side.- Specified by:
getOutletStreamin interfaceTwoPortInterface- Overrides:
getOutletStreamin classTwoPortEquipment- Returns:
- the outlet stream for feed side 0
-
getOutletStreams
Returns both outlet streams of the heat exchanger.- Specified by:
getOutletStreamsin interfaceProcessEquipmentInterface- Overrides:
getOutletStreamsin classTwoPortEquipment- Returns:
- a list containing both outlet streams (side 0 and side 1)
-
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.
- Specified by:
setOutTemperaturein interfaceTwoPortInterface- 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
-
needRecalculation
public boolean needRecalculation()Check if process equipment needs recalculating.
- Specified by:
needRecalculationin interfaceProcessEquipmentInterface- Overrides:
needRecalculationin classHeater- Returns:
- true or false
-
updateLastState
private void updateLastState()Updates cached state for needRecalculation checks. Saves both HeatExchanger stream-2 state and Heater base-class stream-1 state so that super.needRecalculation() returns false when inputs are unchanged. -
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
-
getDesignMode
-
updateRatingCalculatorFromStreams
private void updateRatingCalculatorFromStreams()Updates the rating calculator with current stream fluid properties. Extracts density, viscosity, Cp, and thermal conductivity from both inlet streams. -
setDesignMode
Sets the design mode. In RATING mode, the exchanger computes UA from geometry and fluid properties instead of using a user-supplied value.- Parameters:
mode- SIZING or RATING
-
getRatingCalculator
Gets the ThermalDesignCalculator used in rating mode.- Returns:
- rating calculator, or null if not in rating mode or not yet run
-
setRatingCalculator
Sets the ThermalDesignCalculator for rating mode. The caller should configure the calculator with geometry and fluid properties before calling run().- Parameters:
calculator- configured thermal design calculator
-
setRatingArea
public void setRatingArea(double area) Sets the heat transfer area for rating mode.- Parameters:
area- heat transfer area (m2)
-
getRatingArea
public double getRatingArea()Gets the heat transfer area used in rating mode.- Returns:
- area (m2)
-
getRatingU
public double getRatingU()Gets the overall U value computed from rating mode correlations.- Returns:
- overall U (W/(m2*K)), or 0 if not in rating mode
-
setShellPasses
public void setShellPasses(int shellPasses) Sets the number of shell passes for LMTD correction factor calculation.- Parameters:
shellPasses- number of shell passes (1, 2, 3, ...)
-
getShellPasses
public int getShellPasses()Gets the number of shell passes.- Returns:
- number of shell passes
-
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
-
autoSize
public void autoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.This method calculates dimensions and design parameters using the inlet stream properties and applies the specified safety factor. The equipment must have a valid inlet stream connected before calling this method.
- Specified by:
autoSizein interfaceAutoSizeable- Overrides:
autoSizein classHeater- Parameters:
safetyFactor- multiplier for design capacity, typically 1.1-1.3 (10-30% over design)
-
setAutoSized
protected void setAutoSized(boolean autoSized) Sets the autoSized flag. Protected to allow subclass access.- Parameters:
autoSized- true if equipment has been auto-sized
-
isAutoSized
public boolean isAutoSized()Check if equipment has been auto-sized.- Specified by:
isAutoSizedin interfaceAutoSizeable- Overrides:
isAutoSizedin classHeater- Returns:
- true if autoSize() has been called successfully
-
getSizingReport
Get a detailed sizing report after auto-sizing.The report includes:
- Design basis (flow rates, pressures, temperatures)
- Calculated dimensions
- Design parameters (K-factor, Cv, velocity, etc.)
- Safety margins
- Specified by:
getSizingReportin interfaceAutoSizeable- Overrides:
getSizingReportin classHeater- Returns:
- formatted sizing report 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
-
setDesignDuty
public void setDesignDuty(double duty) Sets the design duty for capacity calculations.- Parameters:
duty- design duty in Watts
-
getDesignDuty
public double getDesignDuty()Gets the design duty.- Returns:
- design duty in Watts
-
setDesignUAValue
public void setDesignUAValue(double uaValue) Sets the design UA value for capacity calculations.- Parameters:
uaValue- design UA value in W/K
-
getDesignUAValue
public double getDesignUAValue()Gets the design UA value.- Returns:
- design UA value in W/K
-
setMinApproachTemperature
public void setMinApproachTemperature(double temperature) Sets the minimum approach temperature.- Parameters:
temperature- minimum approach temperature in K
-
getMinApproachTemperature
public double getMinApproachTemperature()Gets the minimum approach temperature.- Returns:
- minimum approach temperature in K
-
setMaxShellPressureDrop
public void setMaxShellPressureDrop(double pressureDrop) Sets the maximum shell-side pressure drop.- Parameters:
pressureDrop- maximum pressure drop in bar
-
setMaxTubePressureDrop
public void setMaxTubePressureDrop(double pressureDrop) Sets the maximum tube-side pressure drop.- Parameters:
pressureDrop- maximum pressure drop in bar
-
getApproachTemperature
public double getApproachTemperature()Calculates the current approach temperature.- Returns:
- current approach temperature in K
-
initializeHxCapacityConstraints
private void initializeHxCapacityConstraints()Initialize heat exchanger specific capacity constraints. -
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.Returns an unmodifiable map of constraint name to constraint object. Constraints are used by the optimization framework to detect bottlenecks, enforce limits, and guide production allocation. Equipment subclasses populate this map via
ProcessEquipmentInterface.addCapacityConstraint(CapacityConstraint).- Specified by:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Specified by:
getCapacityConstraintsin interfaceProcessEquipmentInterface- Overrides:
getCapacityConstraintsin classHeater- Returns:
- unmodifiable map of constraint name to constraint, empty if none defined
-
getBottleneckConstraint
Gets the bottleneck (most limiting) constraint for this equipment.Returns the enabled constraint with the highest utilization ratio. If no constraints are defined or enabled, returns null.
- Specified by:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Specified by:
getBottleneckConstraintin interfaceProcessEquipmentInterface- Overrides:
getBottleneckConstraintin classHeater- Returns:
- the most limiting constraint, or null if none
-
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- Specified by:
isCapacityExceededin interfaceProcessEquipmentInterface- Overrides:
isCapacityExceededin classHeater- Returns:
- true if any enabled 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- Specified by:
isHardLimitExceededin interfaceProcessEquipmentInterface- Overrides:
isHardLimitExceededin classHeater- Returns:
- true if any enabled HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all enabled constraints.Returns the highest utilization ratio across all enabled constraints. Values above 1.0 indicate the equipment is over capacity. Returns 0.0 if no constraints are defined or enabled.
- Specified by:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Specified by:
getMaxUtilizationin interfaceProcessEquipmentInterface- Overrides:
getMaxUtilizationin classHeater- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
Adds a capacity constraint to this equipment.Constraints can be added at any time. If a constraint with the same name already exists, it is replaced. Use the fluent builder API on
CapacityConstraintto configure the constraint before adding.- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Specified by:
addCapacityConstraintin interfaceProcessEquipmentInterface- Overrides:
addCapacityConstraintin classHeater- Parameters:
constraint- the capacity constraint to add (ignored if null)
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- Overrides:
removeCapacityConstraintin classHeater- 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- Overrides:
clearCapacityConstraintsin classHeater
-
getWallMass
public double getWallMass()Gets the metal wall mass used in the dynamic heat exchanger model.- Returns:
- wall mass in kg
-
setWallMass
public void setWallMass(double wallMass) Sets the metal wall mass for the dynamic heat exchanger model.- Parameters:
wallMass- wall mass in kg (must be non-negative)
-
getWallCp
public double getWallCp()Gets the metal wall specific heat capacity.- Returns:
- wall Cp in J/(kg*K)
-
setWallCp
public void setWallCp(double wallCp) Sets the metal wall specific heat capacity.- Parameters:
wallCp- specific heat in J/(kg*K)
-
getWallTemperature
public double getWallTemperature()Gets the current metal wall temperature (dynamic state variable).- Returns:
- wall temperature in Kelvin (NaN if not yet initialized)
-
setWallTemperature
public void setWallTemperature(double wallTemperature) Sets the metal wall temperature.- Parameters:
wallTemperature- wall temperature in Kelvin
-
getShellHoldupVolume
public double getShellHoldupVolume()Gets the shell-side holdup volume.- Returns:
- shell holdup volume in m3
-
setShellHoldupVolume
public void setShellHoldupVolume(double shellHoldupVolume) Sets the shell-side holdup volume.- Parameters:
shellHoldupVolume- volume in m3
-
getTubeHoldupVolume
public double getTubeHoldupVolume()Gets the tube-side holdup volume.- Returns:
- tube holdup volume in m3
-
setTubeHoldupVolume
public void setTubeHoldupVolume(double tubeHoldupVolume) Sets the tube-side holdup volume.- Parameters:
tubeHoldupVolume- volume in m3
-
getShellSideHtc
public double getShellSideHtc()Gets the shell-side heat transfer coefficient.- Returns:
- heat transfer coefficient in W/(m2*K)
-
setShellSideHtc
public void setShellSideHtc(double shellSideHtc) Sets the shell-side heat transfer coefficient.- Parameters:
shellSideHtc- heat transfer coefficient in W/(m2*K)
-
getTubeSideHtc
public double getTubeSideHtc()Gets the tube-side heat transfer coefficient.- Returns:
- heat transfer coefficient in W/(m2*K)
-
setTubeSideHtc
public void setTubeSideHtc(double tubeSideHtc) Sets the tube-side heat transfer coefficient.- Parameters:
tubeSideHtc- heat transfer coefficient in W/(m2*K)
-
getHeatTransferArea
public double getHeatTransferArea()Gets the heat transfer area used in the dynamic model.- Returns:
- heat transfer area in m2
-
setHeatTransferArea
public void setHeatTransferArea(double heatTransferArea) Sets the heat transfer area for the dynamic model.- Parameters:
heatTransferArea- area in m2
-
isDynamicModelEnabled
public boolean isDynamicModelEnabled()Returns whether the dynamic heat exchanger model is enabled.- Returns:
- true if dynamic model is active
-
setDynamicModelEnabled
public void setDynamicModelEnabled(boolean enabled) Enables or disables the dynamic heat exchanger model. When enabled, the runTransient method integrates the metal wall energy balance instead of using steady-state calculations.- Parameters:
enabled- true to enable
-
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.Dynamic heat exchanger model. When
dynamicModelEnabledis true, integrates the metal wall energy ODE using forward Euler:M_wall * Cp_wall * dT_wall/dt = h_shell * A * (T_shell - T_wall) - h_tube * A * (T_wall - T_tube)
The heat duty to each fluid side is then calculated and applied via enthalpy adjustment.
- Specified by:
runTransientin interfaceSimulationInterface- Overrides:
runTransientin classHeater- Parameters:
dt- time step in secondsid- calculation identifier
-