modelInternalHEXTwoUTube

Internal heat exchanger of a borehole for a double U-tube configuration. In loop 1, fluid 1 streams from a1 to b1 and comes back from a2 to b2. In loop 2: fluid 2 streams from a3 to b3 and comes back from a4 to b4.

Extends from Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialInternalHEX (Partial model to implement the internal heat exchanger of a borehole segment), Buildings.Fluid.Interfaces.EightPortHeatMassExchanger (Model transporting four fluid streams between eight ports with storing mass or energy).

Information

Model for the heat transfer between the fluid and within the borehole filling. This model computes the dynamic response of the fluid in the tubes, the heat transfer between the fluid and the borehole filling, and the heat storage within the fluid and the borehole filling.

This model computes the different thermal resistances present in a single-U-tube borehole using the method of Bauer et al. (2011) and computing explicitely the fluid-to-ground thermal resistance Rb and the grout-to-grout resistance Ra as defined by Claesson and Hellstrom (2011) using the multipole method.

References

J. Claesson and G. Hellstrom. Multipole method to calculate borehole thermal resistances in a borehole heat exchanger. HVAC&R Research, 17(6): 895-911, 2011.

D. Bauer, W. Heidemann, H. Müller-Steinhagen, and H.-J. G. Diersch. Thermal resistance and capacity models for borehole heat exchangers . International Journal Of Energy Research, 35:312-320, 2011.

Parameters

TypeNameDefaultDescription
Buildings.Fluid.Geothermal.Borefields.Data.Borefield.TemplateborFieDat (from PartialInternalHEX)Borefield parameters
RealmSenFac (from PartialInternalHEX)1Factor for scaling the sensible thermal mass of the volume
Modelica.Units.SI.LengthhSeg (from PartialInternalHEX)Length of the internal heat exchanger
Modelica.Units.SI.VolumeVTubSeg (from PartialInternalHEX)hSeg*Modelica.Constants.pi*(borFieDat.conDat.rTub - borFieDat.conDat.eTub)^2Fluid volume in each tube
BooleanhomotopyInitialization (from EightPortHeatMassExchanger)true= true, use homotopy method
Initialization
Modelica.Units.SI.TemperatureTFlu_start (from PartialInternalHEX)Start value of fluid temperature
Modelica.Units.SI.TemperatureTGro_start (from PartialInternalHEX)Start value of grout temperature
Assumptions
BooleanallowFlowReversal1 (from EightPort)true= true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b)
BooleanallowFlowReversal2 (from EightPort)true= true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b)
BooleanallowFlowReversal3 (from EightPort)true= true to allow flow reversal in medium 3, false restricts to design direction (port_a -> port_b)
BooleanallowFlowReversal4 (from EightPort)true= true to allow flow reversal in medium 4, false restricts to design direction (port_a -> port_b)
Advanced › Initialization
Modelica.Units.SI.SpecificEnthalpyh_outflow_a1_start (from EightPort)Medium1.h_defaultStart value for enthalpy flowing out of port a1
Modelica.Units.SI.SpecificEnthalpyh_outflow_b1_start (from EightPort)Medium1.h_defaultStart value for enthalpy flowing out of port b1
Modelica.Units.SI.SpecificEnthalpyh_outflow_a2_start (from EightPort)Medium2.h_defaultStart value for enthalpy flowing out of port a2
Modelica.Units.SI.SpecificEnthalpyh_outflow_b2_start (from EightPort)Medium2.h_defaultStart value for enthalpy flowing out of port b2
Modelica.Units.SI.SpecificEnthalpyh_outflow_a3_start (from EightPort)Medium3.h_defaultStart value for enthalpy flowing out of port a1
Modelica.Units.SI.SpecificEnthalpyh_outflow_b3_start (from EightPort)Medium3.h_defaultStart value for enthalpy flowing out of port b1
Modelica.Units.SI.SpecificEnthalpyh_outflow_a4_start (from EightPort)Medium4.h_defaultStart value for enthalpy flowing out of port a1
Modelica.Units.SI.SpecificEnthalpyh_outflow_b4_start (from EightPort)Medium4.h_defaultStart value for enthalpy flowing out of port b1
Nominal condition
Modelica.Units.SI.MassFlowRatem1_flow_nominal (from PartialEightPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem2_flow_nominal (from PartialEightPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem3_flow_nominal (from PartialEightPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem4_flow_nominal (from PartialEightPortInterface)Nominal mass flow rate
Modelica.Units.SI.Pressuredp1_nominal (from EightPortFlowResistanceParameters)Pressure difference
Modelica.Units.SI.Pressuredp2_nominal (from EightPortFlowResistanceParameters)Pressure difference
Modelica.Units.SI.Pressuredp3_nominal (from EightPortFlowResistanceParameters)Pressure difference
Modelica.Units.SI.Pressuredp4_nominal (from EightPortFlowResistanceParameters)Pressure difference
Advanced
Medium1.MassFlowRatem1_flow_small (from PartialEightPortInterface)1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow
Medium2.MassFlowRatem2_flow_small (from PartialEightPortInterface)1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow
Medium3.MassFlowRatem3_flow_small (from PartialEightPortInterface)1E-4*abs(m3_flow_nominal)Small mass flow rate for regularization of zero flow
Medium4.MassFlowRatem4_flow_small (from PartialEightPortInterface)1E-4*abs(m4_flow_nominal)Small mass flow rate for regularization of zero flow
Advanced › Diagnostics
Booleanshow_T (from PartialEightPortInterface)false= true, if actual temperature at port is computed
Flow resistance › Medium 1
BooleancomputeFlowResistance1 (from EightPortFlowResistanceParameters)true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp1 (from EightPortFlowResistanceParameters)false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn1 (from EightPortFlowResistanceParameters)2Flow exponent for side 1, n=1 for laminar, n=2 for turbulent
BooleanlinearizeFlowResistance1 (from EightPortFlowResistanceParameters)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM1 (from EightPortFlowResistanceParameters)0.1Fraction of nominal flow rate where flow transitions to laminar
Flow resistance › Medium 2
BooleancomputeFlowResistance2 (from EightPortFlowResistanceParameters)true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp2 (from EightPortFlowResistanceParameters)false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn2 (from EightPortFlowResistanceParameters)2Flow exponent for side 2, n=1 for laminar, n=2 for turbulent
BooleanlinearizeFlowResistance2 (from EightPortFlowResistanceParameters)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM2 (from EightPortFlowResistanceParameters)0.1Fraction of nominal flow rate where flow transitions to laminar
Flow resistance › Medium 3
BooleancomputeFlowResistance3 (from EightPortFlowResistanceParameters)true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp3 (from EightPortFlowResistanceParameters)false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn3 (from EightPortFlowResistanceParameters)2Flow exponent for side 3, n=1 for laminar, n=2 for turbulent
BooleanlinearizeFlowResistance3 (from EightPortFlowResistanceParameters)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM3 (from EightPortFlowResistanceParameters)0.1Fraction of nominal flow rate where flow transitions to laminar
Flow resistance › Medium 4
BooleancomputeFlowResistance4 (from EightPortFlowResistanceParameters)true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp4 (from EightPortFlowResistanceParameters)false= true, use m_flow = f(dp) else dp = f(m_flow)
Realn4 (from EightPortFlowResistanceParameters)2Flow exponent for side 4, n=1 for laminar, n=2 for turbulent
BooleanlinearizeFlowResistance4 (from EightPortFlowResistanceParameters)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM4 (from EightPortFlowResistanceParameters)0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics › Nominal condition
Modelica.Units.SI.Timetau1 (from EightPortHeatMassExchanger)30Time constant at nominal flow
Modelica.Units.SI.Timetau2 (from EightPortHeatMassExchanger)30Time constant at nominal flow
Modelica.Units.SI.Timetau3 (from EightPortHeatMassExchanger)30Time constant at nominal flow
Modelica.Units.SI.Timetau4 (from EightPortHeatMassExchanger)30Time constant at nominal flow
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamics (from EightPortHeatMassExchanger)Modelica.Fluid.Types.Dynamics.DynamicFreeInitialFormulation of energy balance
Initialization › Medium 1
Medium1.AbsolutePressurep1_start (from EightPortHeatMassExchanger)Medium1.p_defaultStart value of pressure
Medium1.TemperatureT1_start (from EightPortHeatMassExchanger)Medium1.T_defaultStart value of temperature
Medium1.MassFraction[Medium1.nX]X1_start (from EightPortHeatMassExchanger)Medium1.X_defaultStart value of mass fractions m_i/m
Medium1.ExtraProperty[Medium1.nC]C1_start (from EightPortHeatMassExchanger)fill(0, Medium1.nC)Start value of trace substances
Medium1.ExtraProperty[Medium1.nC]C1_nominal (from EightPortHeatMassExchanger)fill(1E-2, Medium1.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Initialization › Medium 2
Medium2.AbsolutePressurep2_start (from EightPortHeatMassExchanger)Medium2.p_defaultStart value of pressure
Medium2.TemperatureT2_start (from EightPortHeatMassExchanger)Medium2.T_defaultStart value of temperature
Medium2.MassFraction[Medium2.nX]X2_start (from EightPortHeatMassExchanger)Medium2.X_defaultStart value of mass fractions m_i/m
Medium2.ExtraProperty[Medium2.nC]C2_start (from EightPortHeatMassExchanger)fill(0, Medium2.nC)Start value of trace substances
Medium2.ExtraProperty[Medium2.nC]C2_nominal (from EightPortHeatMassExchanger)fill(1E-2, Medium2.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Initialization › Medium 3
Medium3.AbsolutePressurep3_start (from EightPortHeatMassExchanger)Medium3.p_defaultStart value of pressure
Medium3.TemperatureT3_start (from EightPortHeatMassExchanger)Medium3.T_defaultStart value of temperature
Medium3.MassFraction[Medium3.nX]X3_start (from EightPortHeatMassExchanger)Medium3.X_defaultStart value of mass fractions m_i/m
Medium3.ExtraProperty[Medium3.nC]C3_start (from EightPortHeatMassExchanger)fill(0, Medium3.nC)Start value of trace substances
Medium3.ExtraProperty[Medium3.nC]C3_nominal (from EightPortHeatMassExchanger)fill(1E-2, Medium3.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Initialization › Medium 4
Medium4.AbsolutePressurep4_start (from EightPortHeatMassExchanger)Medium4.p_defaultStart value of pressure
Medium4.TemperatureT4_start (from EightPortHeatMassExchanger)Medium4.T_defaultStart value of temperature
Medium4.MassFraction[Medium4.nX]X4_start (from EightPortHeatMassExchanger)Medium4.X_defaultStart value of mass fractions m_i/m
Medium4.ExtraProperty[Medium4.nC]C4_start (from EightPortHeatMassExchanger)fill(0, Medium4.nC)Start value of trace substances
Medium4.ExtraProperty[Medium4.nC]C4_nominal (from EightPortHeatMassExchanger)fill(1E-2, Medium4.nC)Nominal value of trace substances. (Set to typical order of magnitude.)

Connectors

TypeNameDefaultDescription
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aport_wall (from PartialInternalHEX)Thermal connection for borehole wall
Modelica.Fluid.Interfaces.FluidPort_aport_a1 (from EightPort)Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_bport_b1 (from EightPort)Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_aport_a2 (from EightPort)Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
Modelica.Fluid.Interfaces.FluidPort_bport_b2 (from EightPort)Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
Modelica.Fluid.Interfaces.FluidPort_aport_a3 (from EightPort)Fluid connector a1 (positive design flow direction is from port_a3 to port_b3)
Modelica.Fluid.Interfaces.FluidPort_bport_b3 (from EightPort)Fluid connector b2 (positive design flow direction is from port_a3 to port_b3)
Modelica.Fluid.Interfaces.FluidPort_aport_a4 (from EightPort)Fluid connector a1 (positive design flow direction is from port_a4 to port_b4)
Modelica.Fluid.Interfaces.FluidPort_bport_b4 (from EightPort)Fluid connector b2 (positive design flow direction is from port_a4 to port_b4)

Components

TypeNameDefaultDescription
Medium1.MassFlowRatem1_flow (from PartialEightPortInterface)port_a1.m_flowMass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction)
Modelica.Units.SI.Pressuredp1 (from PartialEightPortInterface)port_a1.p - port_b1.pPressure difference between port_a1 and port_b1
Medium2.MassFlowRatem2_flow (from PartialEightPortInterface)port_a2.m_flowMass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction)
Modelica.Units.SI.Pressuredp2 (from PartialEightPortInterface)port_a2.p - port_b2.pPressure difference between port_a2 and port_b2
Medium3.MassFlowRatem3_flow (from PartialEightPortInterface)port_a3.m_flowMass flow rate from port_a3 to port_b3 (m3_flow > 0 is design flow direction)
Modelica.Units.SI.Pressuredp3 (from PartialEightPortInterface)port_a3.p - port_b3.pPressure difference between port_a3 and port_b3
Medium4.MassFlowRatem4_flow (from PartialEightPortInterface)port_a4.m_flowMass flow rate from port_a4 to port_b4 (m4_flow > 0 is design flow direction)
Modelica.Units.SI.Pressuredp4 (from PartialEightPortInterface)port_a4.p - port_b4.pPressure difference between port_a4 and port_b4
Medium1.ThermodynamicStatesta_a1 (from PartialEightPortInterface)if allowFlowReversal1 then Medium1.setState_phX(port_a1.p, noEvent(actualStream(port_a1.h_outflow)), noEvent(actualStream(port_a1.Xi_outflow))) else Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow))Medium properties in port_a1
Medium1.ThermodynamicStatesta_b1 (from PartialEightPortInterface)if allowFlowReversal1 then Medium1.setState_phX(port_b1.p, noEvent(actualStream(port_b1.h_outflow)), noEvent(actualStream(port_b1.Xi_outflow))) else Medium1.setState_phX(port_b1.p, port_b1.h_outflow, port_b1.Xi_outflow)Medium properties in port_b1
Medium2.ThermodynamicStatesta_a2 (from PartialEightPortInterface)if allowFlowReversal2 then Medium2.setState_phX(port_a2.p, noEvent(actualStream(port_a2.h_outflow)), noEvent(actualStream(port_a2.Xi_outflow))) else Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow))Medium properties in port_a2
Medium2.ThermodynamicStatesta_b2 (from PartialEightPortInterface)if allowFlowReversal2 then Medium2.setState_phX(port_b2.p, noEvent(actualStream(port_b2.h_outflow)), noEvent(actualStream(port_b2.Xi_outflow))) else Medium2.setState_phX(port_b2.p, port_b2.h_outflow, port_b2.Xi_outflow)Medium properties in port_b2
Medium3.ThermodynamicStatesta_a3 (from PartialEightPortInterface)if allowFlowReversal3 then Medium3.setState_phX(port_a3.p, noEvent(actualStream(port_a3.h_outflow)), noEvent(actualStream(port_a3.Xi_outflow))) else Medium3.setState_phX(port_a3.p, inStream(port_a3.h_outflow), inStream(port_a3.Xi_outflow))Medium properties in port_a3
Medium3.ThermodynamicStatesta_b3 (from PartialEightPortInterface)if allowFlowReversal3 then Medium3.setState_phX(port_b3.p, noEvent(actualStream(port_b3.h_outflow)), noEvent(actualStream(port_b3.Xi_outflow))) else Medium3.setState_phX(port_b3.p, port_b3.h_outflow, port_b3.Xi_outflow)Medium properties in port_b3
Medium4.ThermodynamicStatesta_a4 (from PartialEightPortInterface)if allowFlowReversal4 then Medium4.setState_phX(port_a4.p, noEvent(actualStream(port_a4.h_outflow)), noEvent(actualStream(port_a4.Xi_outflow))) else Medium4.setState_phX(port_a4.p, inStream(port_a4.h_outflow), inStream(port_a4.Xi_outflow))Medium properties in port_a4
Medium4.ThermodynamicStatesta_b4 (from PartialEightPortInterface)if allowFlowReversal4 then Medium4.setState_phX(port_b4.p, noEvent(actualStream(port_b4.h_outflow)), noEvent(actualStream(port_b4.Xi_outflow))) else Medium4.setState_phX(port_b4.p, port_b4.h_outflow, port_b4.Xi_outflow)Medium properties in port_b4
Modelica.Units.SI.HeatFlowRateQ1_flow (from EightPortHeatMassExchanger)vol1.heatPort.Q_flowHeat flow rate into medium 1
Modelica.Units.SI.HeatFlowRateQ2_flow (from EightPortHeatMassExchanger)vol2.heatPort.Q_flowHeat flow rate into medium 2
Modelica.Units.SI.HeatFlowRateQ3_flow (from EightPortHeatMassExchanger)vol3.heatPort.Q_flowHeat flow rate into medium 1
Modelica.Units.SI.HeatFlowRateQ4_flow (from EightPortHeatMassExchanger)vol4.heatPort.Q_flowHeat flow rate into medium 2
Buildings.Fluid.MixingVolumes.MixingVolumevol1 (from EightPortHeatMassExchanger)Volume for fluid 1
Buildings.Fluid.MixingVolumes.MixingVolumevol2 (from EightPortHeatMassExchanger)Volume for fluid 2
Buildings.Fluid.MixingVolumes.MixingVolumevol3 (from EightPortHeatMassExchanger)Volume for fluid 3
Buildings.Fluid.MixingVolumes.MixingVolumevol4 (from EightPortHeatMassExchanger)Volume for fluid 4
Buildings.Fluid.FixedResistances.PressureDroppreDro1 (from EightPortHeatMassExchanger)Pressure drop model for fluid 1
Buildings.Fluid.FixedResistances.PressureDroppreDro2 (from EightPortHeatMassExchanger)Pressure drop model for fluid 2
Buildings.Fluid.FixedResistances.PressureDroppreDro3 (from EightPortHeatMassExchanger)Pressure drop model for fluid 3
Buildings.Fluid.FixedResistances.PressureDroppreDro4 (from EightPortHeatMassExchanger)Pressure drop model for fluid 4
Modelica.Blocks.Sources.RealExpressionRVol1Convective and thermal resistance at fluid 1
Modelica.Blocks.Sources.RealExpressionRVol2Convective and thermal resistance at fluid 2
Modelica.Blocks.Sources.RealExpressionRVol3Convective and thermal resistance at fluid 1
Modelica.Blocks.Sources.RealExpressionRVol4Convective and thermal resistance at fluid 1
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesTwoUTubeintRes2UTubInternal resistances for a double U-tube configuration
Modelica.Thermal.HeatTransfer.Components.ConvectiveResistorRConv1Pipe convective resistance
Modelica.Thermal.HeatTransfer.Components.ConvectiveResistorRConv2Pipe convective resistance
Modelica.Thermal.HeatTransfer.Components.ConvectiveResistorRConv3Pipe convective resistance
Modelica.Thermal.HeatTransfer.Components.ConvectiveResistorRConv4Pipe convective resistance

Revisions

  • August 3, 2026, by Michael Wetter:
    Removed duplicate empty Diagram annotation.
  • May 17, 2024, by Michael Wetter:
    Updated model due to removal of parameter dynFil.
    This is for IBPSA, #1885.
  • November 22, 2023, by Michael Wetter:
    Corrected use of getInstanceName() which was called inside a function which is not allowed.
    This is for IBPSA, #1814.
  • March 7, 2022, by Michael Wetter:
    Removed massDynamics.
    This is for #1542.
  • February 28, 2022, by Massimo Cimmino:
    Removed printDebug parameter from call to Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.internalResistancesTwoUTube.
    This is for IBPSA, #1582.
  • July 10, 2018, by Alex Laferrière:
    Updated documentation following major changes to the Buildings.Fluid.HeatExchangers.Ground package. Additionally, implemented a partial InternalHex model.
  • June 18, 2014, by Michael Wetter:
    Added initialization for temperatures and derivatives of capFil1 and capFil2 to avoid a warning during translation.
  • February 14, 2014, by Michael Wetter:
    Removed unused parameters B0 and B1.
  • January 24, 2014, by Michael Wetter:
    Revised implementation, added comments, replaced HeatTransfer.Windows.BaseClasses.ThermalConductor with resistance models from the Modelica Standard Library.
  • January 23, 2014, by Damien Picard:
    First implementation.