This example illustrates different borehole models using different mass
and energy dynamics.
model BoreholeDynamics
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water;
parameter Integer nSeg(min=1) = 10
;
parameter Modelica.Units.SI.Temperature T_start=273.15 + 22
;
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube
borHolOneUTubDyn(
redeclare package Medium = Medium,
borFieDat=borFieUTubDat,
m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
dp_nominal=borFieUTubDat.conDat.dp_nominal,
dynFil=true,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
TGro_start = {T_start
for i
in 1:nSeg},
TFlu_start={Medium.T_default
for i
in 1:nSeg})
;
Buildings.Fluid.Sources.MassFlowSource_T sou(
redeclare package Medium = Medium,
nPorts=1,
use_T_in=false,
m_flow=borFieUTubDat.conDat.mBor_flow_nominal,
T=303.15) ;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
use_p_in=false,
use_T_in=false,
nPorts=1,
p=101330,
T=283.15) ;
parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example
borFieUTubDat ;
Buildings.Fluid.Sensors.TemperatureTwoPort TBorIn(m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
redeclare package Medium = Medium,
tau=0)
;
Buildings.Fluid.Sensors.TemperatureTwoPort TBor1UTubDyn(
m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
redeclare package Medium = Medium,
tau=0)
;
Modelica.Thermal.HeatTransfer.Components.ThermalCollector therCol1(m=nSeg)
;
Modelica.Blocks.Sources.Constant TGroUn(k=T_start)
;
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube borHolOneUTubSteSta(
redeclare package Medium = Medium,
borFieDat=borFieUTubDat,
m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
dp_nominal=borFieUTubDat.conDat.dp_nominal,
dynFil=false,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
TGro_start = {T_start
for i
in 1:nSeg},
TFlu_start={Medium.T_default
for i
in 1:nSeg})
;
Buildings.Fluid.Sources.MassFlowSource_T sou1(
redeclare package Medium = Medium,
nPorts=1,
use_T_in=false,
m_flow=borFieUTubDat.conDat.mBor_flow_nominal,
T=303.15) ;
Buildings.Fluid.Sources.Boundary_pT sin1(
redeclare package Medium = Medium,
use_p_in=false,
use_T_in=false,
nPorts=1,
p=101330,
T=283.15) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TBorIn1(
m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
redeclare package Medium = Medium,
tau=0) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TBor1UTubSteSta(
m_flow_nominal=borFieUTubDat.conDat.mBor_flow_nominal,
redeclare package Medium = Medium,
tau=0) ;
Modelica.Thermal.HeatTransfer.Components.ThermalCollector therCol2(m=nSeg)
;
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube borHol2UTubDyn(
redeclare package Medium = Medium,
dp_nominal=borFie2UTubDat.conDat.dp_nominal,
dynFil=true,
m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
borFieDat=borFie2UTubDat,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
TGro_start = {T_start
for i
in 1:nSeg},
TFlu_start={Medium.T_default
for i
in 1:nSeg})
;
Buildings.Fluid.Sources.MassFlowSource_T sou2(
redeclare package Medium = Medium,
nPorts=1,
use_T_in=false,
m_flow=borFie2UTubDat.conDat.mBor_flow_nominal,
T=303.15) ;
Buildings.Fluid.Sources.Boundary_pT sin2(
redeclare package Medium = Medium,
use_p_in=false,
use_T_in=false,
nPorts=1,
p=101330,
T=283.15) ;
parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Example
borFie2UTubDat(conDat=
Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example(
borCon=Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel))
;
Buildings.Fluid.Sensors.TemperatureTwoPort TBorIn2(
redeclare package Medium =
Medium, m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
tau=0)
;
Buildings.Fluid.Sensors.TemperatureTwoPort TBor2UTubDyn(
redeclare package Medium =
Medium, m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
tau=0)
;
Modelica.Thermal.HeatTransfer.Components.ThermalCollector therCol3(m=nSeg)
;
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube borHol2UTubSteSta(
redeclare package Medium = Medium,
dp_nominal=borFie2UTubDat.conDat.dp_nominal,
dynFil=false,
m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
borFieDat=borFie2UTubDat,
nSeg=nSeg,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
TGro_start = {T_start
for i
in 1:nSeg},
TFlu_start={Medium.T_default
for i
in 1:nSeg})
;
Buildings.Fluid.Sources.MassFlowSource_T sou3(
redeclare package Medium = Medium,
nPorts=1,
use_T_in=false,
m_flow=borFie2UTubDat.conDat.mBor_flow_nominal,
T=303.15) ;
Buildings.Fluid.Sources.Boundary_pT sin3(
redeclare package Medium = Medium,
use_p_in=false,
use_T_in=false,
nPorts=1,
p=101330,
T=283.15) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TBorIn3(
redeclare package Medium = Medium,
m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
tau=0)
;
Buildings.Fluid.Sensors.TemperatureTwoPort TBor2UTubSteSta(
redeclare package Medium = Medium,
m_flow_nominal=borFie2UTubDat.conDat.mBor_flow_nominal,
tau=0)
;
Modelica.Thermal.HeatTransfer.Components.ThermalCollector therCol4(m=nSeg)
;
Buildings.HeatTransfer.Sources.PrescribedTemperature
prescribedTemperature;
Buildings.HeatTransfer.Sources.PrescribedTemperature
prescribedTemperature1;
Buildings.HeatTransfer.Sources.PrescribedTemperature
prescribedTemperature2;
Buildings.HeatTransfer.Sources.PrescribedTemperature
prescribedTemperature3;
equation
connect(sou.ports[1],TBorIn. port_a);
connect(TBorIn.port_b, borHolOneUTubDyn.port_a);
connect(borHolOneUTubDyn.port_b, TBor1UTubDyn.port_a);
connect(TBor1UTubDyn.port_b, sin.ports[1]);
connect(therCol1.port_a, borHolOneUTubDyn.port_wall);
connect(sou1.ports[1], TBorIn1.port_a);
connect(TBorIn1.port_b, borHolOneUTubSteSta.port_a);
connect(borHolOneUTubSteSta.port_b, TBor1UTubSteSta.port_a);
connect(TBor1UTubSteSta.port_b, sin1.ports[1]);
connect(therCol2.port_a, borHolOneUTubSteSta.port_wall);
connect(sou2.ports[1], TBorIn2.port_a);
connect(TBorIn2.port_b, borHol2UTubDyn.port_a);
connect(borHol2UTubDyn.port_b, TBor2UTubDyn.port_a);
connect(TBor2UTubDyn.port_b, sin2.ports[1]);
connect(therCol3.port_a, borHol2UTubDyn.port_wall);
connect(sou3.ports[1], TBorIn3.port_a);
connect(TBorIn3.port_b, borHol2UTubSteSta.port_a);
connect(borHol2UTubSteSta.port_b, TBor2UTubSteSta.port_a);
connect(TBor2UTubSteSta.port_b, sin3.ports[1]);
connect(therCol4.port_a, borHol2UTubSteSta.port_wall);
connect(TGroUn.y, prescribedTemperature.T);
connect(therCol1.port_b, prescribedTemperature.port);
connect(therCol2.port_b, prescribedTemperature1.port);
connect(TGroUn.y, prescribedTemperature1.T);
connect(therCol3.port_b, prescribedTemperature2.port);
connect(prescribedTemperature2.T, prescribedTemperature1.T);
connect(therCol4.port_b, prescribedTemperature3.port);
connect(prescribedTemperature3.T, prescribedTemperature1.T);
end BoreholeDynamics;