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 | 
|  InternalHEXOneUTube | Comparison of the effective borehole thermal resistance  from the thermal network of Bauer et al. with the resistance calculated by singleUTubeResistances (ref) | 
|  InternalHEXTwoUTube | Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by doubleUTubeResistances (ref) | 
|  InternalResistancesOneUTube | Validation of InternalResistancesOneUTube | 
|  InternalResistancesTwoUTube | Validation of InternalResistancesTwoUTube | 
Comparison of the effective borehole thermal resistance  from the thermal network of Bauer et al. with the resistance calculated by singleUTubeResistances (ref)
 
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
| Type | Name | Default | Description | 
|---|
| Integer | nSeg | 10 | Number of segments to use in vertical discretization of the boreholes | 
| Length | hSeg | borFieDat.conDat.hBor/nSeg | Length of the internal heat exchanger [m] | 
| Example | borFieDat | borFieDat(conDat=Buildings.F... | Borefield data | 
Modelica definition
model InternalHEXOneUTube
  
  
extends Modelica.Icons.Example;
  
parameter Integer nSeg(min=1) = 10
    ;
  
parameter Modelica.Units.SI.Length hSeg=borFieDat.conDat.hBor/nSeg
    ;
  
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))
    ;
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;
 
Comparison of the effective borehole thermal resistance from the thermal network of Bauer et al. with the resistance calculated by doubleUTubeResistances (ref)
 
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
| Type | Name | Default | Description | 
|---|
| Integer | nSeg | 10 | Number of segments to use in vertical discretization of the boreholes | 
| Length | hSeg | borFieDat.conDat.hBor/nSeg | Length of the internal heat exchanger [m] | 
| Example | borFieDat | borFieDat(conDat=Buildings.F... | Borefield data | 
Modelica definition
model InternalHEXTwoUTube
  
  
extends Modelica.Icons.Example;
  
parameter Integer nSeg(min=1) = 10
    ;
  
parameter Modelica.Units.SI.Length hSeg=borFieDat.conDat.hBor/nSeg
    ;
  
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,
    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))
    ;
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;
 
Validation of 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
| Type | Name | Default | Description | 
|---|
| Integer | nSeg | 10 | Number of segments to use in vertical discretization of the boreholes | 
| Length | hSeg | borFieDat.conDat.hBor/nSeg | Length of the internal heat exchanger [m] | 
| ThermalResistance | Rgb_val | 0.0430511 | Grout node to borehole wall thermal resistance [K/W] | 
| ThermalResistance | Rgg_val | 0.00605573 | Grout node to grout node thermal resistance [K/W] | 
| ThermalResistance | RCondGro_val | 0.14285 | Pipe to grout node thermal resistance [K/W] | 
| Temperature | T_start | 298.15 | Initial temperature [K] | 
| Example | borFieDat | borFieDat(conDat=Buildings.F... | Borefield data | 
Modelica definition
model InternalResistancesOneUTube 
  
extends Modelica.Icons.Example;
  
parameter Integer nSeg(min=1) = 10
    ;
  
parameter Modelica.Units.SI.Length hSeg=borFieDat.conDat.hBor/nSeg
    ;
  
parameter Modelica.Units.SI.ThermalResistance Rgb_val=0.0430511
    ;
  
parameter Modelica.Units.SI.ThermalResistance Rgg_val=0.00605573
    ;
  
parameter Modelica.Units.SI.ThermalResistance RCondGro_val=0.14285
    ;
  
parameter Modelica.Units.SI.Temperature T_start=298.15 ;
  
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)
                     ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TWal(T=T_start)
    ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TPip2(T=T_start + 15)
    ;
  
Buildings.HeatTransfer.Sources.PrescribedTemperature TPip1
    ;
  
Modelica.Blocks.Sources.Ramp T_ramp(
    height=20,
    duration=600,
    offset=T_start)
                   ;
  
parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example
    borFieDat(conDat=
        
Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example(
        use_Rb=false))
    ;
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;
 
Validation of 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
| Type | Name | Default | Description | 
|---|
| Integer | nSeg | 10 | Number of segments to use in vertical discretization of the boreholes | 
| Length | hSeg | borFieDat.conDat.hBor/nSeg | Length of the internal heat exchanger [m] | 
| ThermalResistance | Rgb_val | 0.572601 | Grout node to borehole wall thermal resistance [K/W] | 
| ThermalResistance | Rgg1_val | 0.0406121 | Grout node to grout node thermal resistance [K/W] | 
| ThermalResistance | Rgg2_val | 0.216904 | Thermal resistance between two grout nodes opposite to each other [K/W] | 
| ThermalResistance | RCondGro_val | 0.195099 | Pipe to grout node thermal resistance [K/W] | 
| Temperature | T_start | 298.15 | Initial temperature [K] | 
| Example | borFieDat | borFieDat(conDat=Buildings.F... | Borefield data | 
Modelica definition
model InternalResistancesTwoUTube 
  
extends Modelica.Icons.Example;
  
parameter Integer nSeg(min=1) = 10
    ;
  
parameter Modelica.Units.SI.Length hSeg=borFieDat.conDat.hBor/nSeg
    ;
  
parameter Modelica.Units.SI.ThermalResistance Rgb_val=0.572601
    ;
  
parameter Modelica.Units.SI.ThermalResistance Rgg1_val=0.0406121
    ;
  
parameter Modelica.Units.SI.ThermalResistance Rgg2_val=0.216904
    ;
  
parameter Modelica.Units.SI.ThermalResistance RCondGro_val=0.195099
    ;
  
parameter Modelica.Units.SI.Temperature T_start=298.15 ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TWal(T=T_start)
    ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TPip2(T=T_start + 15)
    ;
  
Buildings.HeatTransfer.Sources.PrescribedTemperature TPip1
    ;
  
Modelica.Blocks.Sources.Ramp T_ramp(
    height=20,
    duration=600,
    offset=T_start)
                   ;
  
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))
    ;
  
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)
                       ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TPip3(T=T_start + 25)
    ;
  
Buildings.HeatTransfer.Sources.FixedTemperature TPip4(T=T_start + 10)
    ;
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;