Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples

Example models to test base classes

Information

This package contains examples for the use of functions that can be found in Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXOneUTube InternalHEXOneUTube Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by singleUTubeResistances (ref)
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXTwoUTube InternalHEXTwoUTube Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by doubleUTubeResistances (ref)
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesOneUTube InternalResistancesOneUTube Validation of InternalResistancesOneUTube
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesTwoUTube InternalResistancesTwoUTube Validation of InternalResistancesTwoUTube

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXOneUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXOneUTube

Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by singleUTubeResistances (ref)

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXOneUTube

Information

This example simulates the interior thermal behavior of a single U-tube borehole segment.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
LengthhSegborFieDat.conDat.hBor/nSegLength of the internal heat exchanger [m]
ExampleborFieDatborFieDat( conDa...Borefield data

Modelica definition

model InternalHEXOneUTube "Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by singleUTubeResistances (ref)" extends Modelica.Icons.Example; parameter Integer nSeg(min=1) = 10 "Number of segments to use in vertical discretization of the boreholes"; parameter Modelica.SIunits.Length hSeg = borFieDat.conDat.hBor/nSeg "Length of the internal heat exchanger"; package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXOneUTube intHex( redeclare package Medium = Medium, hSeg=hSeg, dp1_nominal=10, dp2_nominal=10, borFieDat=borFieDat, m1_flow_nominal=borFieDat.conDat.mBor_flow_nominal, m2_flow_nominal=borFieDat.conDat.mBor_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, TFlu_start=285.15, TGro_start=285.15); Buildings.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=273.15 + 12); Buildings.Fluid.Sources.MassFlowSource_T boundary(nPorts=1, redeclare package Medium = Medium, m_flow=borFieDat.conDat.mBor_flow_nominal, T=293.15); Buildings.Fluid.Sources.MassFlowSource_T boundary1(nPorts=1, redeclare package Medium = Medium, m_flow=borFieDat.conDat.mBor_flow_nominal, T=293.15); Buildings.Fluid.Sources.Boundary_pT bou(nPorts=2, redeclare package Medium = Medium); Real Rb_sim(unit="(m.K)/W") = ((senTem.T + senTem1.T)/2 - intHex.port_wall.T)/max(-intHex.port_wall.Q_flow / hSeg,1); Buildings.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); Buildings.Fluid.Sensors.TemperatureTwoPort senTem1(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); Modelica.Blocks.Sources.RealExpression realExpression(y=Rb_sim); Modelica.Blocks.Sources.Constant Rb_ref(k=0.082399); Modelica.Blocks.Math.Add error(k2=-1); parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example borFieDat(conDat= Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example( use_Rb=false)) "Borefield data"; equation connect(boundary1.ports[1], intHex.port_a2); connect(boundary.ports[1], intHex.port_a1); connect(bou.ports[1], senTem.port_b); connect(senTem.port_a, intHex.port_b1); connect(senTem1.port_a, bou.ports[2]); connect(senTem1.port_b, intHex.port_b2); connect(realExpression.y, error.u1); connect(Rb_ref.y, error.u2); connect(fixedTemperature.port, intHex.port_wall); end InternalHEXOneUTube;

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXTwoUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXTwoUTube

Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by doubleUTubeResistances (ref)

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXTwoUTube

Information

This example simulates the interior thermal behavior of a double U-tube borehole segment.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
LengthhSegborFieDat.conDat.hBor/nSegLength of the internal heat exchanger [m]
ExampleborFieDatborFieDat( conDa...Borefield data

Modelica definition

model InternalHEXTwoUTube "Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by doubleUTubeResistances (ref)" extends Modelica.Icons.Example; parameter Integer nSeg(min=1) = 10 "Number of segments to use in vertical discretization of the boreholes"; parameter Modelica.SIunits.Length hSeg = borFieDat.conDat.hBor/nSeg "Length of the internal heat exchanger"; package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXTwoUTube intHex( TFlu_start(displayUnit="K") = 285.15, redeclare package Medium = Medium, hSeg=hSeg, dp1_nominal=10, dp2_nominal=10, dp3_nominal=10, dp4_nominal=10, dynFil=true, borFieDat=borFieDat, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, TGro_start(displayUnit="K") = 285.15, m1_flow_nominal=borFieDat.conDat.mBor_flow_nominal/2, m2_flow_nominal=borFieDat.conDat.mBor_flow_nominal/2, m3_flow_nominal=borFieDat.conDat.mBor_flow_nominal/2, m4_flow_nominal=borFieDat.conDat.mBor_flow_nominal/2); Buildings.HeatTransfer.Sources.FixedTemperature fixedTemperature(T=273.15 + 12); Buildings.Fluid.Sources.MassFlowSource_T boundary(nPorts=2, redeclare package Medium = Medium, m_flow=borFieDat.conDat.mBor_flow_nominal, T=293.15); Buildings.Fluid.Sources.MassFlowSource_T boundary1(nPorts=2, redeclare package Medium = Medium, m_flow=borFieDat.conDat.mBor_flow_nominal, T=288.15); Buildings.Fluid.Sources.Boundary_pT bou(nPorts=4, redeclare package Medium = Medium); Real Rb_sim(unit="(m.K)/W") = ((senTem.T + senTem1.T + senTem2.T + senTem3.T)/4 - intHex.port_wall.T)/max(-intHex.port_wall.Q_flow / hSeg,1); Buildings.Fluid.Sensors.TemperatureTwoPort senTem(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); Buildings.Fluid.Sensors.TemperatureTwoPort senTem1(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); Modelica.Blocks.Sources.RealExpression realExpression(y=Rb_sim); Modelica.Blocks.Sources.Constant Rb_ref(k=0.0443802); Modelica.Blocks.Math.Add error(k2=-1); Buildings.Fluid.Sensors.TemperatureTwoPort senTem2(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); Buildings.Fluid.Sensors.TemperatureTwoPort senTem3(redeclare package Medium = Medium, m_flow_nominal=borFieDat.conDat.mBor_flow_nominal); parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example borFieDat(conDat= Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example( borCon=Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel, use_Rb=false)) "Borefield data"; equation connect(fixedTemperature.port, intHex.port_wall); connect(boundary.ports[1], intHex.port_a1); connect(bou.ports[1], senTem.port_b); connect(senTem.port_a, intHex.port_b1); connect(realExpression.y, error.u1); connect(Rb_ref.y, error.u2); connect(boundary.ports[2], intHex.port_a3); connect(boundary1.ports[1], intHex.port_a4); connect(boundary1.ports[2], intHex.port_a2); connect(intHex.port_b2, senTem1.port_a); connect(senTem1.port_b, bou.ports[2]); connect(intHex.port_b4, senTem2.port_a); connect(senTem2.port_b, bou.ports[3]); connect(intHex.port_b3, senTem3.port_a); connect(senTem3.port_b, bou.ports[4]); end InternalHEXTwoUTube;

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesOneUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesOneUTube

Validation of InternalResistancesOneUTube

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesOneUTube

Information

This example tests the implementation of Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesOneUTube for the dynamic behavior of the filling material in a single U-tube borehole.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
LengthhSegborFieDat.conDat.hBor/nSegLength of the internal heat exchanger [m]
ThermalResistanceRgb_val0.0430511Grout node to borehole wall thermal resistance [K/W]
ThermalResistanceRgg_val0.00605573Grout node to grout node thermal resistance [K/W]
ThermalResistanceRCondGro_val0.14285Pipe to grout node thermal resistance [K/W]
TemperatureT_start298.15Initial temperature [K]
ExampleborFieDatborFieDat( conDa...Borefield data

Modelica definition

model InternalResistancesOneUTube "Validation of InternalResistancesOneUTube" extends Modelica.Icons.Example; parameter Integer nSeg(min=1) = 10 "Number of segments to use in vertical discretization of the boreholes"; parameter Modelica.SIunits.Length hSeg = borFieDat.conDat.hBor/nSeg "Length of the internal heat exchanger"; parameter Modelica.SIunits.ThermalResistance Rgb_val=0.0430511 "Grout node to borehole wall thermal resistance"; parameter Modelica.SIunits.ThermalResistance Rgg_val=0.00605573 "Grout node to grout node thermal resistance"; parameter Modelica.SIunits.ThermalResistance RCondGro_val=0.14285 "Pipe to grout node thermal resistance"; parameter Modelica.SIunits.Temperature T_start=298.15 "Initial temperature"; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesOneUTube intRes1UTub( hSeg=hSeg, T_start=T_start, borFieDat=borFieDat, Rgb_val=Rgb_val, RCondGro_val=RCondGro_val, Rgg_val=Rgg_val, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Thermal resistance and capacitances of the borehole"; Buildings.HeatTransfer.Sources.FixedTemperature TWal(T=T_start) "Borehole wall temperature"; Buildings.HeatTransfer.Sources.FixedTemperature TPip2(T=T_start + 15) "Wall temperature of pipe 2"; Buildings.HeatTransfer.Sources.PrescribedTemperature TPip1 "Wall temperature of pipe 1"; Modelica.Blocks.Sources.Ramp T_ramp( height=20, duration=600, offset=T_start) "Temperature ramp of pipe 1"; parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example borFieDat(conDat= Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example( use_Rb=false)) "Borefield data"; equation connect(TWal.port, intRes1UTub.port_wall); connect(TPip2.port, intRes1UTub.port_2); connect(TPip1.port, intRes1UTub.port_1); connect(T_ramp.y, TPip1.T); end InternalResistancesOneUTube;

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesTwoUTube Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesTwoUTube

Validation of InternalResistancesTwoUTube

Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesTwoUTube

Information

This example tests the implementation of Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesTwoUTube for the dynamic behavior of the filling material in a double U-tube borehole.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
LengthhSegborFieDat.conDat.hBor/nSegLength of the internal heat exchanger [m]
ThermalResistanceRgb_val0.572601Grout node to borehole wall thermal resistance [K/W]
ThermalResistanceRgg1_val0.0406121Grout node to grout node thermal resistance [K/W]
ThermalResistanceRgg2_val0.216904Thermal resistance between two grout nodes opposite to each other [K/W]
ThermalResistanceRCondGro_val0.195099Pipe to grout node thermal resistance [K/W]
TemperatureT_start298.15Initial temperature [K]
ExampleborFieDatborFieDat( conDa...Borefield data

Modelica definition

model InternalResistancesTwoUTube "Validation of InternalResistancesTwoUTube" extends Modelica.Icons.Example; parameter Integer nSeg(min=1) = 10 "Number of segments to use in vertical discretization of the boreholes"; parameter Modelica.SIunits.Length hSeg = borFieDat.conDat.hBor/nSeg "Length of the internal heat exchanger"; parameter Modelica.SIunits.ThermalResistance Rgb_val=0.572601 "Grout node to borehole wall thermal resistance"; parameter Modelica.SIunits.ThermalResistance Rgg1_val=0.0406121 "Grout node to grout node thermal resistance"; parameter Modelica.SIunits.ThermalResistance Rgg2_val=0.216904 "Thermal resistance between two grout nodes opposite to each other"; parameter Modelica.SIunits.ThermalResistance RCondGro_val=0.195099 "Pipe to grout node thermal resistance"; parameter Modelica.SIunits.Temperature T_start=298.15 "Initial temperature"; Buildings.HeatTransfer.Sources.FixedTemperature TWal(T=T_start) "Borehole wall temperature"; Buildings.HeatTransfer.Sources.FixedTemperature TPip2(T=T_start + 15) "Wall temperature of pipe 2"; Buildings.HeatTransfer.Sources.PrescribedTemperature TPip1 "Wall temperature of pipe 1"; Modelica.Blocks.Sources.Ramp T_ramp( height=20, duration=600, offset=T_start) "Temperature ramp of pipe 1"; parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example borFieDat(conDat= Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example( borCon=Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel, use_Rb=false)) "Borefield data"; Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesTwoUTube intRes2UTub( hSeg=hSeg, T_start=T_start, borFieDat=borFieDat, Rgb_val=Rgb_val, RCondGro_val=RCondGro_val, Rgg1_val=Rgg1_val, Rgg2_val=Rgg2_val, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Thermal resistance and capacitances of the borehole"; Buildings.HeatTransfer.Sources.FixedTemperature TPip3(T=T_start + 25) "Wall temperature of pipe 2"; Buildings.HeatTransfer.Sources.FixedTemperature TPip4(T=T_start + 10) "Wall temperature of pipe 2"; equation connect(T_ramp.y,TPip1. T); connect(TPip1.port, intRes2UTub.port_1); connect(TPip2.port, intRes2UTub.port_2); connect(TWal.port, intRes2UTub.port_wall); connect(TPip4.port, intRes2UTub.port_4); connect(TPip3.port, intRes2UTub.port_3); end InternalResistancesTwoUTube;