Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes

Package with borehole heat exchangers

Information

This package contains models for borehole heat exchangers.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube OneUTube Single U-tube borehole heat exchanger
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube TwoUTube Double U-tube borehole heat exchanger
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples Examples Example files for borehole heat exchanger
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses BaseClasses Base classes for Borehole

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube

Single U-tube borehole heat exchanger

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube

Information

Model of a single U-tube borehole heat exchanger. The borehole heat exchanger is vertically discretized into nseg elements of height h=hBor⁄nseg. Each segment contains a model for the heat transfer in the borehole, with a uniform borehole wall boundary temperature given by the port_wall port.

The heat transfer in the borehole is computed using a convective heat transfer coefficient that depends on the fluid velocity, a heat resistance between the two pipes, and a heat resistance between the pipes and the borehole wall. The heat capacity of the fluid and the heat capacity of the grout are taken into account. The vertical heat flow is assumed to be zero.

Extends from Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole (Partial model to implement multi-segment boreholes).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
TemplateborFieDat Borefield parameters
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
BooleancomputeFlowResistancedp_nominal > Modelica.Consta...=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Initialization
TemperatureTGro_start[nSeg] Start value of grout temperature [K]
TemperatureTFlu_start[nSeg]TGro_startStart value of fluid temperature [K]
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
BooleandynFiltrueSet to false to remove the dynamics of the filling material

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
HeatPort_aport_wall[nSeg]Thermal connection for borehole wall

Modelica definition

model OneUTube "Single U-tube borehole heat exchanger" extends Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXOneUTube intHex[nSeg]( redeclare each final package Medium = Medium, each final hSeg=borFieDat.conDat.hBor/nSeg, each final from_dp1=from_dp, each final from_dp2=from_dp, each final linearizeFlowResistance1=linearizeFlowResistance, each final linearizeFlowResistance2=linearizeFlowResistance, each final deltaM1=deltaM, each final deltaM2=deltaM, each final energyDynamics=energyDynamics, each final dynFil=dynFil, each final mSenFac=mSenFac, final dp1_nominal={if i == 1 then dp_nominal else 0 for i in 1:nSeg}, each final dp2_nominal=0, each final m1_flow_nominal=m_flow_nominal, each final m2_flow_nominal=m_flow_nominal, each final borFieDat=borFieDat, each final allowFlowReversal1=allowFlowReversal, each final allowFlowReversal2=allowFlowReversal, each final show_T=show_T, each final p1_start=p_start, each final p2_start=p_start, final TFlu_start=TFlu_start, final TGro_start=TGro_start) "Borehole segments"; equation connect(port_a, intHex[1].port_a1); connect(port_b, intHex[1].port_b2); connect(intHex[nSeg].port_b1, intHex[nSeg].port_a2); for i in 1:nSeg - 1 loop connect(intHex[i].port_b1, intHex[i + 1].port_a1); connect(intHex[i].port_a2, intHex[i + 1].port_b2); end for; connect(intHex.port_wall, port_wall); end OneUTube;

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube

Double U-tube borehole heat exchanger

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube

Information

Model of a double U-tube borehole heat exchanger. The borehole heat exchanger is vertically discretized into nseg elements of height h=hBor⁄nseg. Each segment contains a model for the heat transfer in the borehole, with a uniform borehole wall boundary temperature given by the port_wall port.

The heat transfer in the borehole is computed using a convective heat transfer coefficient that depends on the fluid velocity, a heat resistance between each pair of pipes, and a heat resistance between the pipes and the borehole wall. The heat capacity of the fluid and the heat capacity of the grout are taken into account. The vertical heat flow is assumed to be zero.

Extends from Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole (Partial model to implement multi-segment boreholes).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
TemplateborFieDat Borefield parameters
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
BooleancomputeFlowResistancedp_nominal > Modelica.Consta...=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Initialization
TemperatureTGro_start[nSeg] Start value of grout temperature [K]
TemperatureTFlu_start[nSeg]TGro_startStart value of fluid temperature [K]
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
BooleandynFiltrueSet to false to remove the dynamics of the filling material

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
HeatPort_aport_wall[nSeg]Thermal connection for borehole wall

Modelica definition

model TwoUTube "Double U-tube borehole heat exchanger" extends Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXTwoUTube intHex[nSeg]( redeclare each final package Medium = Medium, each final borFieDat=borFieDat, each final hSeg=borFieDat.conDat.hBor/nSeg, final dp1_nominal={if i == 1 and borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then dp_nominal elseif i == 1 and borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeSeries then dp_nominal/2 else 0 for i in 1:nSeg}, final dp3_nominal={if i == 1 and borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then dp_nominal elseif i == 1 and borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeSeries then dp_nominal/2 else 0 for i in 1:nSeg}, each final dp2_nominal=0, each final dp4_nominal=0, each final show_T=show_T, each final energyDynamics=energyDynamics, each final m1_flow_nominal=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then m_flow_nominal/2 else m_flow_nominal, each final m2_flow_nominal=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then m_flow_nominal/2 else m_flow_nominal, each final m3_flow_nominal=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then m_flow_nominal/2 else m_flow_nominal, each final m4_flow_nominal=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then m_flow_nominal/2 else m_flow_nominal, each final m1_flow_small=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then borFieDat.conDat.mBor_flow_small/2 else borFieDat.conDat.mBor_flow_small, each final m2_flow_small=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then borFieDat.conDat.mBor_flow_small/2 else borFieDat.conDat.mBor_flow_small, each final m3_flow_small=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then borFieDat.conDat.mBor_flow_small/2 else borFieDat.conDat.mBor_flow_small, each final m4_flow_small=if borFieDat.conDat.borCon == Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel then borFieDat.conDat.mBor_flow_small/2 else borFieDat.conDat.mBor_flow_small, each final dynFil=dynFil, each final mSenFac=mSenFac, each final allowFlowReversal1=allowFlowReversal, each final allowFlowReversal2=allowFlowReversal, each final allowFlowReversal3=allowFlowReversal, each final allowFlowReversal4=allowFlowReversal, each final from_dp1=from_dp, each final linearizeFlowResistance1=linearizeFlowResistance, each final deltaM1=deltaM, each final from_dp2=from_dp, each final linearizeFlowResistance2=linearizeFlowResistance, each final deltaM2=deltaM, each final from_dp3=from_dp, each final linearizeFlowResistance3=linearizeFlowResistance, each final deltaM3=deltaM, each final from_dp4=from_dp, each final linearizeFlowResistance4=linearizeFlowResistance, each final deltaM4=deltaM, each final p1_start=p_start, each final p2_start=p_start, each final p3_start=p_start, each final p4_start=p_start, final TFlu_start=TFlu_start, final TGro_start=TGro_start) "Discretized borehole segments"; equation // Couple borehole port_a and port_b to first borehole segment. connect(port_a, intHex[1].port_a1); connect(port_b, intHex[1].port_b4); if borFieDat.conDat.borCon == Types.BoreholeConfiguration.DoubleUTubeParallel then // 2U-tube in parallel: couple both U-tube to each other. connect(port_a, intHex[1].port_a3); connect(port_b, intHex[1].port_b2); elseif borFieDat.conDat.borCon == Types.BoreholeConfiguration.DoubleUTubeSeries then // 2U-tube in serie: couple both U-tube to each other. connect(intHex[1].port_b2, intHex[1].port_a3); end if; // Couple each layer to the next one for i in 1:nSeg - 1 loop connect(intHex[i].port_b1, intHex[i + 1].port_a1); connect(intHex[i].port_a2, intHex[i + 1].port_b2); connect(intHex[i].port_b3, intHex[i + 1].port_a3); connect(intHex[i].port_a4, intHex[i + 1].port_b4); end for; // Close U-tube at bottom layer connect(intHex[nSeg].port_b1, intHex[nSeg].port_a2); connect(intHex[nSeg].port_b3, intHex[nSeg].port_a4); connect(intHex.port_wall, port_wall); end TwoUTube;