Class HeatExchanger

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, HeaterInterface, HeatExchangerInterface, ProcessEquipmentInterface, TwoPortInterface, StateVectorProvider, ProcessElementInterface, SimulationInterface, NamedInterface

public class HeatExchanger extends Heater implements HeatExchangerInterface, StateVectorProvider, CapacityConstrainedEquipment

HeatExchanger class.

Version:
$Id: $Id
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • setTemperature

      boolean setTemperature
    • outStream

      StreamInterface[] outStream
    • inStream

      StreamInterface[] inStream
    • 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

      public String guessOutTemperatureUnit
    • outStreamSpecificationNumber

      int outStreamSpecificationNumber
    • thermalEffectiveness

      public double thermalEffectiveness
    • flowArrangement

      private String flowArrangement
    • useDeltaT

      private boolean useDeltaT
    • deltaT

      private double deltaT
    • designMode

      private HeatExchanger.DesignMode designMode
      Design mode: SIZING (default, uses user-supplied UA) or RATING (calculates UA).
    • ratingCalculator

      private transient ThermalDesignCalculator ratingCalculator
      Tube-side shell-and-tube geometry for rating mode.
    • shellPasses

      private int shellPasses
      Number of shell passes for LMTD correction (1 = TEMA E, 2 = TEMA F).
    • ratingU

      private double ratingU
      Calculated overall U value from rating mode (W/(m2*K)).
    • ratingArea

      private double ratingArea
      Heat transfer area used in rating mode (m2).
    • designDuty

      private double designDuty
      Design duty in Watts for capacity constraint.
    • designUAValue

      private double designUAValue
      Design UA value in W/K for capacity constraint.
    • minApproachTemperature

      private double minApproachTemperature
      Minimum approach temperature in K.
    • maxShellPressureDrop

      private double maxShellPressureDrop
      Maximum shell-side pressure drop in bar.
    • maxTubePressureDrop

      private double maxTubePressureDrop
      Maximum tube-side pressure drop in bar.
    • hxCapacityConstraints

      private Map<String, CapacityConstraint> hxCapacityConstraints
      Capacity constraints map.
    • hxCapacityAnalysisEnabled

      private boolean hxCapacityAnalysisEnabled
      Flag for HX-specific capacity analysis.
    • lastInStream2Temperature

      private double lastInStream2Temperature
      Cached inlet stream 2 temperature for needRecalculation check.
    • lastInStream2Pressure

      private double lastInStream2Pressure
      Cached inlet stream 2 pressure for needRecalculation check.
    • lastInStream2FlowRate

      private double lastInStream2FlowRate
      Cached inlet stream 2 flow rate for needRecalculation check.
    • lastUAvalue

      private double lastUAvalue
      Cached UA value for needRecalculation check.
    • lastInStream2Composition

      private double[] lastInStream2Composition
      Cached inlet stream 2 composition for needRecalculation check.
    • wallMass

      private double wallMass
      Metal wall mass in kg.
    • wallCp

      private double wallCp
      Metal wall specific heat capacity in J/(kg*K).
    • wallTemperature

      private double wallTemperature
      Metal wall temperature in Kelvin — state variable for dynamic simulation.
    • shellHoldupVolume

      private double shellHoldupVolume
      Shell-side fluid holdup volume in m3.
    • tubeHoldupVolume

      private double tubeHoldupVolume
      Tube-side fluid holdup volume in m3.
    • shellSideHtc

      private double shellSideHtc
      Shell-side heat transfer coefficient in W/(m2*K).
    • tubeSideHtc

      private double tubeSideHtc
      Tube-side heat transfer coefficient in W/(m2*K).
    • heatTransferArea

      private double heatTransferArea
      Heat transfer area in m2 (for dynamic model).
    • dynamicModelEnabled

      private boolean dynamicModelEnabled
      Whether the dynamic heat exchanger model is enabled.
    • shellFluidTemperature

      private double shellFluidTemperature
      Shell-side fluid temperature in K — state variable for fluid accumulation model.
    • tubeFluidTemperature

      private double tubeFluidTemperature
      Tube-side fluid temperature in K — state variable for fluid accumulation model.
    • hxAutoSized

      private boolean hxAutoSized
      Internal auto-sized flag for heat exchanger.
  • Constructor Details

    • HeatExchanger

      public HeatExchanger(String name)
      Constructor for HeatExchanger.
      Parameters:
      name - name of heat exchanger
    • HeatExchanger

      public HeatExchanger(String name, StreamInterface inStream1)
      Constructor for HeatExchanger.
      Parameters:
      name - name of heat exchanger
      inStream1 - input stream
    • HeatExchanger

      public HeatExchanger(String name, StreamInterface inStream1, StreamInterface inStream2)
      Constructor for HeatExchanger.
      Parameters:
      name - name of heat exchanger
      inStream1 - input stream 1
      inStream2 - input stream 2
  • Method Details

    • addInStream

      public void addInStream(StreamInterface inStream)

      Add inlet stream.

      Parameters:
      inStream - a StreamInterface object
    • setFeedStream

      public void setFeedStream(int number, StreamInterface inStream)

      setFeedStream. Will also set name of outstreams.

      Parameters:
      number - a int
      inStream - a StreamInterface object
    • getMechanicalDesign

      public HeatExchangerMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

      Specified by:
      getMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      getMechanicalDesign in class Heater
      Returns:
      a MechanicalDesign object
    • initMechanicalDesign

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class Heater
    • setName

      public void setName(String name)

      Setter for the field name.

      Specified by:
      setName in interface NamedInterface
      Overrides:
      setName in class NamedBaseClass
      Parameters:
      name - a String object
    • setdT

      public void setdT(double dT)

      setdT.

      Specified by:
      setdT in interface HeaterInterface
      Overrides:
      setdT in class Heater
      Parameters:
      dT - a double
    • getOutStream

      public StreamInterface getOutStream(int i)

      getOutStream.

      Specified by:
      getOutStream in interface HeatExchangerInterface
      Parameters:
      i - a int
      Returns:
      a StreamInterface object
    • getOutletStream

      public StreamInterface 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:
      getOutletStream in interface TwoPortInterface
      Overrides:
      getOutletStream in class TwoPortEquipment
      Returns:
      the outlet stream for feed side 0
    • getOutletStreams

      public List<StreamInterface> getOutletStreams()
      Returns both outlet streams of the heat exchanger.
      Specified by:
      getOutletStreams in interface ProcessEquipmentInterface
      Overrides:
      getOutletStreams in class TwoPortEquipment
      Returns:
      a list containing both outlet streams (side 0 and side 1)
    • getInStream

      public StreamInterface getInStream(int i)

      Getter for the field inStream.

      Parameters:
      i - a int
      Returns:
      a StreamInterface object
    • setOutTemperature

      public void setOutTemperature(double temperature)

      Set the outlet temperature of the heater.

      Specified by:
      setOutTemperature in interface TwoPortInterface
      Overrides:
      setOutTemperature in class Heater
      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

      public void setOutStream(int streamNumber, StreamInterface outStream)

      Setter for the field outStream.

      Parameters:
      streamNumber - a int
      outStream - the outStream to set
    • runSpecifiedStream

      public void runSpecifiedStream(UUID id)

      runSpecifiedStream.

      Parameters:
      id - UUID of run
    • runDeltaT

      public void runDeltaT(UUID id)

      runDeltaT.

      Parameters:
      id - UUID of run
    • needRecalculation

      public boolean needRecalculation()

      Check if process equipment needs recalculating.

      Specified by:
      needRecalculation in interface ProcessEquipmentInterface
      Overrides:
      needRecalculation in class Heater
      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

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Specified by:
      run in interface SimulationInterface
      Overrides:
      run in class Heater
      Parameters:
      id - UUID
    • getDuty

      public double getDuty()

      getDuty.

      Overrides:
      getDuty in class Heater
      Returns:
      a double
    • displayResult

      public void displayResult()

      displayResult.

      Specified by:
      displayResult in interface ProcessEquipmentInterface
      Overrides:
      displayResult in class Heater
    • 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

      public void setGuessOutTemperature(double guessOutTemperature, String unit)

      Setter for the field guessOutTemperature.

      Parameters:
      guessOutTemperature - a double
      unit - a String
    • getEntropyProduction

      public double getEntropyProduction(String unit)

      getEntropyProduction.

      Specified by:
      getEntropyProduction in interface ProcessEquipmentInterface
      Overrides:
      getEntropyProduction in class Heater
      Parameters:
      unit - a String object
      Returns:
      a double
    • getMassBalance

      public double getMassBalance(String unit)

      getMassBalance.

      Specified by:
      getMassBalance in interface ProcessEquipmentInterface
      Overrides:
      getMassBalance in class TwoPortEquipment
      Parameters:
      unit - a String object
      Returns:
      a double
    • runConditionAnalysis

      public void runConditionAnalysis(ProcessEquipmentInterface refExchanger)

      runConditionAnalysis.

      Specified by:
      runConditionAnalysis in interface ProcessEquipmentInterface
      Overrides:
      runConditionAnalysis in class ProcessEquipmentBaseClass
      Parameters:
      refExchanger - a ProcessEquipmentInterface object
    • 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

      public String getFlowArrangement()

      Getter for the field flowArrangement.

      Returns:
      String
    • setFlowArrangement

      public void setFlowArrangement(String flowArrangement)

      Setter for the field flowArrangement.

      Parameters:
      flowArrangement - name of flow arrangement
    • getDesignMode

      public HeatExchanger.DesignMode getDesignMode()
      Gets the design mode.
      Returns:
      SIZING or RATING
    • 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

      public void setDesignMode(HeatExchanger.DesignMode mode)
      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

      public ThermalDesignCalculator getRatingCalculator()
      Gets the ThermalDesignCalculator used in rating mode.
      Returns:
      rating calculator, or null if not in rating mode or not yet run
    • setRatingCalculator

      public void setRatingCalculator(ThermalDesignCalculator calculator)
      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 double
      Cr - 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

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class Heater
      Returns:
      json string.
    • toJson

      public String toJson(ReportConfig cfg)
      Serializes the Process Equipment with configurable level of detail.
      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class Heater
      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:
      autoSize in interface AutoSizeable
      Overrides:
      autoSize in class Heater
      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:
      isAutoSized in interface AutoSizeable
      Overrides:
      isAutoSized in class Heater
      Returns:
      true if autoSize() has been called successfully
    • getSizingReport

      public String 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:
      getSizingReport in interface AutoSizeable
      Overrides:
      getSizingReport in class Heater
      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

      public StateVector 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:
      getStateVector in interface StateVectorProvider
      Returns:
      current state vector
    • builder

      public static HeatExchanger.Builder builder(String name)
      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:
      isCapacityAnalysisEnabled in interface CapacityConstrainedEquipment
      Overrides:
      isCapacityAnalysisEnabled in class ProcessEquipmentBaseClass
      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:
      setCapacityAnalysisEnabled in interface CapacityConstrainedEquipment
      Overrides:
      setCapacityAnalysisEnabled in class ProcessEquipmentBaseClass
      Parameters:
      enabled - true to include in capacity analysis, false to exclude
    • getCapacityConstraints

      public Map<String, CapacityConstraint> 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:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Specified by:
      getCapacityConstraints in interface ProcessEquipmentInterface
      Overrides:
      getCapacityConstraints in class Heater
      Returns:
      unmodifiable map of constraint name to constraint, empty if none defined
    • getBottleneckConstraint

      public CapacityConstraint 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:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Specified by:
      getBottleneckConstraint in interface ProcessEquipmentInterface
      Overrides:
      getBottleneckConstraint in class Heater
      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:
      isCapacityExceeded in interface CapacityConstrainedEquipment
      Specified by:
      isCapacityExceeded in interface ProcessEquipmentInterface
      Overrides:
      isCapacityExceeded in class Heater
      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:
      isHardLimitExceeded in interface CapacityConstrainedEquipment
      Specified by:
      isHardLimitExceeded in interface ProcessEquipmentInterface
      Overrides:
      isHardLimitExceeded in class Heater
      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:
      getMaxUtilization in interface CapacityConstrainedEquipment
      Specified by:
      getMaxUtilization in interface ProcessEquipmentInterface
      Overrides:
      getMaxUtilization in class Heater
      Returns:
      maximum utilization as fraction (1.0 = 100% of design capacity)
    • addCapacityConstraint

      public void addCapacityConstraint(CapacityConstraint constraint)
      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 CapacityConstraint to configure the constraint before adding.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Specified by:
      addCapacityConstraint in interface ProcessEquipmentInterface
      Overrides:
      addCapacityConstraint in class Heater
      Parameters:
      constraint - the capacity constraint to add (ignored if null)
    • removeCapacityConstraint

      public boolean removeCapacityConstraint(String constraintName)
      Removes a capacity constraint by name.
      Specified by:
      removeCapacityConstraint in interface CapacityConstrainedEquipment
      Overrides:
      removeCapacityConstraint in class Heater
      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:
      clearCapacityConstraints in interface CapacityConstrainedEquipment
      Overrides:
      clearCapacityConstraints in class Heater
    • 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

      public void runTransient(double dt, UUID id)

      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 dynamicModelEnabled is 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:
      runTransient in interface SimulationInterface
      Overrides:
      runTransient in class Heater
      Parameters:
      dt - time step in seconds
      id - calculation identifier