modelIndirectTankHeatExchanger

Heat exchanger typically submerged in a fluid with a second fluid circulating through it

Extends from Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports), Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes), Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models).

Information

This model is a heat exchanger with a moving fluid on one side and a stagnant fluid on the other. It is intended for use when a heat exchanger is submerged in a stagnant fluid. For example, the heat exchanger in a storage tank which is part of a solar thermal system.

This component models the fluid in the heat exchanger, convection between the fluid and the heat exchanger, and convection from the heat exchanger to the surrounding fluid.

The model is based on Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside and Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder.

The fluid ports are intended to be connected to a circulated heat transfer fluid while the heat port is intended to be connected to a stagnant fluid.

Parameters

TypeNameDefaultDescription
BooleanhomotopyInitializationtrue= true, use homotopy method
IntegernSegNumber of segments in the heat exchanger
Modelica.Units.SI.HeatCapacityCHexCapacitance of the heat exchanger
Modelica.Units.SI.VolumevolHexFluVolume of heat transfer fluid in the heat exchanger
Modelica.Units.SI.ThermalConductanceUA_nominalabs(Q_flow_nominal/(THex_nominal - TTan_nominal))Nominal UA value for the heat exchanger
Modelica.Units.SI.DiameterdExtHexExterior diameter of the heat exchanger pipe
Flow resistance
BooleancomputeFlowResistance (from TwoPortFlowResistanceParameters)true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp (from TwoPortFlowResistanceParameters)false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn (from TwoPortFlowResistanceParameters)2Flow exponent, n=1 for laminar, n=2 for turbulent
BooleanlinearizeFlowResistance (from TwoPortFlowResistanceParameters)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM (from TwoPortFlowResistanceParameters)0.1Fraction of nominal flow rate where flow transitions to laminar
Nominal condition
Modelica.Units.SI.PressureDifferencedp_nominal (from TwoPortFlowResistanceParameters)Pressure difference
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialTwoPortInterface)Nominal mass flow rate
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamics (from LumpedVolumeDeclarations)Modelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicssubstanceDynamics (from LumpedVolumeDeclarations)energyDynamicsType of independent mass fraction balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicstraceDynamics (from LumpedVolumeDeclarations)energyDynamicsType of trace substance balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicsenergyDynamicsSolidenergyDynamicsFormulation of energy balance for heat exchanger solid mass
Advanced › Dynamics
Modelica.Fluid.Types.DynamicsmassDynamics (from LumpedVolumeDeclarations)energyDynamicsType of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state
Initialization
Medium.AbsolutePressurep_start (from LumpedVolumeDeclarations)Medium.p_defaultStart value of pressure
Medium.TemperatureT_start (from LumpedVolumeDeclarations)Medium.T_defaultStart value of temperature
Medium.MassFraction[Medium.nX]X_start (from LumpedVolumeDeclarations)Medium.X_defaultStart value of mass fractions m_i/m
Medium.ExtraProperty[Medium.nC]C_start (from LumpedVolumeDeclarations)fill(0, Medium.nC)Start value of trace substances
Medium.ExtraProperty[Medium.nC]C_nominal (from LumpedVolumeDeclarations)fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Dynamics
RealmSenFac (from LumpedVolumeDeclarations)1Factor for scaling the sensible thermal mass of the volume
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialTwoPortInterface)1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Advanced › Diagnostics
Booleanshow_T (from PartialTwoPortInterface)false= true, if actual temperature at port is computed
General › Nominal condition
Modelica.Units.SI.HeatFlowRateQ_flow_nominalHeat transfer at nominal conditions
Modelica.Units.SI.TemperatureTTan_nominalTemperature of fluid inside the tank at UA_nominal
Modelica.Units.SI.TemperatureTHex_nominalTemperature of fluid inside the heat exchanger at UA_nominal
Realr_nominal0.5Ratio between coil inside and outside convective heat transfer
Advanced › Modeling detail
BooleanhA_flowDependenttrueSet to false to make the convective heat coefficient calculation of the fluid inside the coil independent of mass flow rate
BooleanhA_temperatureDependenttrueSet to false to make the convective heat coefficient calculation of the fluid inside the coil independent of temperature

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPort)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPort)Fluid connector b (positive design flow direction is from port_a to port_b)
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a[nSeg]portHeat port connected to water inside the tank

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow (from PartialTwoPortInterface)port_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp (from PartialTwoPortInterface)port_a.p - port_b.pPressure difference between port_a and port_b
Medium.ThermodynamicStatesta_a (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow))) else Medium.setState_phX(port_a.p, noEvent(inStream(port_a.h_outflow)), noEvent(inStream(port_a.Xi_outflow)))Medium properties in port_a
Medium.ThermodynamicStatesta_b (from PartialTwoPortInterface)if allowFlowReversal then Medium.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) else Medium.setState_phX(port_b.p, noEvent(port_b.h_outflow), noEvent(port_b.Xi_outflow))Medium properties in port_b
Buildings.Fluid.FixedResistances.PressureDropresCalculates the flow resistance and pressure drop through the heat exchanger
Buildings.Fluid.MixingVolumes.MixingVolume[nSeg]volHeat exchanger fluid
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor[nSeg]capThermal mass of the heat exchanger

Contents

NameDescription
MediumHexHeat transfer fluid flowing through the heat exchanger
MediumTanHeat transfer fluid inside the tank

Revisions

  • June 17, 2026, by Michael Wetter:
    Updated implementation to allow a flow coefficient n that is different from 2. This allows use of the model for not fully turbulent flow.
    This is for Buildings, #4620.
  • March 7, 2022, by Michael Wetter:
    Set final massDynamics=energyDynamics.
    This is for #1542.
  • April 9, 2021, by Michael Wetter:
    Corrected placement of each keyword.
    See Buildings, PR #2440.
  • April 14, 2020, by Michael Wetter:
    Changed homotopyInitialization to a constant.
    This is for IBPSA, #1341.
  • June 7, 2018 by Filip Jorissen:
    Copied model from Buildings and update the model accordingly. This is for #314.
  • January 7, 2016, by Filip Jorissen:
    Propagated flowDependent and temperatureDependent in hAPipIns. This is for issue #454.
  • September 24, 2015 by Michael Wetter:
    Set fixed attribute in cap.T to avoid unspecified initial conditions.
  • July 2, 2015, by Michael Wetter:
    Set prescribedHeatFlowRate=false in control volume.
  • July 1, 2015, by Filip Jorissen:
    Added parameter energyDynamicsSolid. This is for #434.
  • March 28, 2015, by Filip Jorissen:
    Propagated allowFlowReversal.
  • August 29, 2014, by Michael Wetter:
    Introduced MediumTan for the tank medium, and assigned Medium to be equal to MediumHex. This is to correct issue #271.
  • June 18, 2014, by Michael Wetter:
    Set initial equations for cap, and renamed this instance from Cap to cap. This was done to avoid a warning during translation, and to comply with the coding convention.
  • October 8, 2013, by Michael Wetter:
    Removed parameter show_V_flow.
  • January 29, 2013, by Peter Grant:
    First implementation.