Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses

Base classes used in Buildings.Fluid.Geothermal.ZonedBorefields

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.Geothermal.ZonedBorefields.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.PartialStorage PartialStorage Partial model for borehole thermal energy storage with independent borefield zones
Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.HeatTransfer HeatTransfer Package with ground heat transfer models

Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.PartialStorage Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.PartialStorage

Partial model for borehole thermal energy storage with independent borefield zones

Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.PartialStorage

Information

This model simulates a borehole thermal energy storage system with multiple zones of boreholes. Boreholes within the same zone are connected in parallel. The borefield configuration and thermal parameters are defined in the borFieDat record.

Heat transfer to the soil is modeled using one borehole heat exchanger (To be added in an extended model) per borefield zone. The fluid mass flow rate into each borehole is divided to reflect the per-borehole fluid mass flow rate. The borehole model calculates the dynamics within the borehole itself using an axial discretization and a resistance-capacitance network for the internal thermal resistances between the individual pipes and between each pipe and the borehole wall.

The ground thermal response at each borehole segment is evaluated using analytical thermal response factors. Spatial and temporal superposition are used to evaluate the total temperature change at each of the borehole segments.

Extends from Buildings.Fluid.Geothermal.ZonedBorefields.Interfaces.PartialTwoNPortsInterface (Partial model with two vectors of ports and declaration of quantities for bore field models), Buildings.Fluid.Geothermal.ZonedBorefields.Interfaces.TwoNPortsFlowResistanceParameters (Parameters for flow resistance for models with two N ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPortsnZonNumber of fluid ports on each side
TimetLoaAgg3600.0Time resolution of load aggregation [s]
IntegernCel5Number of cells per aggregation level
IntegernSeg10Number of segments to use in vertical discretization of the boreholes
TemplateborFieDat Borefield data record
PartialBoreholeborHol[nZon]redeclare Buildings.Fluid.Ge...Borehole
Nominal condition
MassFlowRatem_flow_nominal[nPorts]borFieDat.conDat.mZon_flow_n...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal[nPorts]borFieDat.conDat.dp_nominalPressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small[nPorts]1E-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
BooleancomputeFlowResistance[nPorts]{_dp_nominal > Modelica.Cons...=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp[nPorts]fill(false, nPorts)= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance[nPorts]fill(false, nPorts)= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM[nPorts]fill(0.1, nPorts)Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureTFlu_start[nSeg]TGro_startStart value of fluid temperature [K]
Soil
TemperatureTExt0_start283.15Initial far field temperature [K]
TemperatureTExt_start[nSeg]{if z[i] >= z0 then TExt0_st...Temperature of the undisturbed ground [K]
Filling material
TemperatureTGro_start[nSeg]TExt_startStart value of grout temperature [K]
Temperature profile
Heightz010Depth below which the temperature gradient starts [m]
RealdT_dz0.01Vertical temperature gradient of the undisturbed soil for h below z0 [K/m]

Connectors

TypeNameDescription
FluidPort_aport_a[nPorts]Fluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPorts]Fluid connector b (positive design flow direction is from port_a to port_b)
replaceable package MediumMedium in the borehole pipes
output RealOutputTBorAve[nZon]Average borehole wall temperature in the borefield [K]
output RealOutputQBorAve[nZon]Average (per borehole) heat transfer rate in each zone [W]

Modelica definition

partial model PartialStorage "Partial model for borehole thermal energy storage with independent borefield zones" extends Buildings.Fluid.Geothermal.ZonedBorefields.Interfaces.PartialTwoNPortsInterface ( final nPorts=nZon, final m_flow_nominal=borFieDat.conDat.mZon_flow_nominal); extends Buildings.Fluid.Geothermal.ZonedBorefields.Interfaces.TwoNPortsFlowResistanceParameters ( final nPorts=nZon, final dp_nominal=borFieDat.conDat.dp_nominal, final computeFlowResistance={_dp_nominal > Modelica.Constants.eps for _dp_nominal in borFieDat.conDat.dp_nominal}); replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the borehole pipes"; // Simulation parameters parameter Modelica.Units.SI.Time tLoaAgg = 3600.0 "Time resolution of load aggregation"; parameter Integer nCel(min=1) = 5 "Number of cells per aggregation level"; parameter Integer nSeg(min=1) = 10 "Number of segments to use in vertical discretization of the boreholes"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; // Initialization parameter Medium.AbsolutePressure p_start = Medium.p_default "Start value of pressure"; // Temperature gradient in undisturbed soil parameter Modelica.Units.SI.Temperature TExt0_start=283.15 "Initial far field temperature"; parameter Modelica.Units.SI.Temperature TExt_start[nSeg]= {if z[i] >= z0 then TExt0_start + (z[i] - z0)*dT_dz else TExt0_start for i in 1:nSeg} "Temperature of the undisturbed ground"; parameter Modelica.Units.SI.Temperature TGro_start[nSeg]=TExt_start "Start value of grout temperature"; parameter Modelica.Units.SI.Temperature TFlu_start[nSeg]=TGro_start "Start value of fluid temperature"; parameter Modelica.Units.SI.Height z0=10 "Depth below which the temperature gradient starts"; parameter Real dT_dz(final unit="K/m", min=0) = 0.01 "Vertical temperature gradient of the undisturbed soil for h below z0"; // General parameters of borefield parameter Buildings.Fluid.Geothermal.ZonedBorefields.Data.Borefield.Template borFieDat "Borefield data record"; final parameter Integer nZon(min=1) = borFieDat.conDat.nZon "Total number of independent bore field zones"; final parameter Integer[nZon] nBorPerZon(each min=1) = borFieDat.conDat.nBorPerZon "Number of boreholes per borefield zone"; // Models replaceable Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole borHol[nZon] constrainedby Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole ( redeclare each final package Medium = Medium, final borFieDat=zonDat, each final nSeg=nSeg, final m_flow_nominal=borFieDat.conDat.mZon_flow_nominal, final dp_nominal=dp_nominal, each final allowFlowReversal=allowFlowReversal, final m_flow_small=m_flow_small, each final show_T=show_T, final computeFlowResistance=computeFlowResistance, final from_dp=from_dp, final linearizeFlowResistance=linearizeFlowResistance, final deltaM=deltaM, each final energyDynamics=energyDynamics, each final p_start=p_start, each final mSenFac=mSenFac, each final TFlu_start=TFlu_start, each final TGro_start=TGro_start) "Borehole"; Buildings.Fluid.Geothermal.ZonedBorefields.BaseClasses.HeatTransfer.GroundTemperatureResponse groTemRes( final tLoaAgg=tLoaAgg, final nCel=nCel, final nSeg=nSeg, final borFieDat=borFieDat) "Ground thermal response"; Modelica.Blocks.Interfaces.RealOutput TBorAve[nZon]( each quantity="ThermodynamicTemperature", each unit="K", each displayUnit="degC", each start=TExt0_start) "Average borehole wall temperature in the borefield"; Modelica.Blocks.Interfaces.RealOutput QBorAve[nZon]( each quantity="HeatFlowRate", each unit="W") "Average (per borehole) heat transfer rate in each zone"; protected constant Real mSenFac(min=1)=1 "Factor for scaling the sensible thermal mass of the volume"; parameter Modelica.Units.SI.Height z[nSeg]={borFieDat.conDat.hBor/nSeg*(i - 0.5) for i in 1:nSeg} "Distance from the surface to the considered segment"; // General parameters of the boreholes. These records are required because // the borehole model expects a configuration record from the // Buildings.Fluid.Geothermal.Borefields that is different from the record in // the Buildings.Fluid.Geothermal.ZonedBorefields package. final parameter Borefields.Data.Borefield.Template zonDat[nZon]( each filDat=borFieDat.filDat, each soiDat=borFieDat.soiDat, conDat=zonConDat) "Data record for the boreholes"; final parameter Borefields.Data.Configuration.Template zonConDat[nZon]( each borCon=borFieDat.conDat.borCon, each use_Rb=borFieDat.conDat.use_Rb, each Rb=borFieDat.conDat.Rb, mBor_flow_nominal=borFieDat.conDat.mBor_flow_nominal, mBorFie_flow_nominal=borFieDat.conDat.mZon_flow_nominal, dp_nominal=borFieDat.conDat.dp_nominal, each hBor=borFieDat.conDat.hBor, each rBor=borFieDat.conDat.rBor, each dBor=borFieDat.conDat.dBor, nBor=borFieDat.conDat.nBorPerZon, each cooBor=borFieDat.conDat.cooBor, each rTub=borFieDat.conDat.rTub, each kTub=borFieDat.conDat.kTub, each eTub=borFieDat.conDat.eTub, each xC=borFieDat.conDat.xC, mBor_flow_small=borFieDat.conDat.mBor_flow_small) "Configuration data record for each borehole zone"; Buildings.Fluid.BaseClasses.MassFlowRateMultiplier masFloDiv[nZon]( redeclare final package Medium = Medium, final k=nBorPerZon) "Division of flow rate"; Buildings.Fluid.BaseClasses.MassFlowRateMultiplier masFloMul[nZon]( redeclare final package Medium = Medium, final k=nBorPerZon) "Mass flow multiplier"; Modelica.Blocks.Sources.Constant TSoiUnd[nSeg]( k = TExt_start, y(each unit="K", each displayUnit="degC")) "Undisturbed soil temperature"; Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor QBorHol[nZon,nSeg] "Heat flow rate of all segments of all boreholes"; Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TemBorWal[nZon,nSeg] "Borewall temperature at each segment"; Modelica.Blocks.Math.Add TSoiDisl[nZon,nSeg](each final k1=1, each final k2=1) "Addition of undisturbed soil temperature and change of soil temperature"; Modelica.Blocks.Routing.Replicator repTSoiUnd[nSeg](each final nout=nZon) "Signal replicator for temperature difference of the borehole"; Buildings.Utilities.Math.Average aveTBor[nZon](each final nin=nSeg) "Average temperature of all the borehole segments in each zone"; Modelica.Blocks.Math.Sum aveQBor[nZon](each nin=nSeg) "Average (per borehole) heat transfer rate, equal to the sum of the heat transfer rates att all segments along a borehole"; equation connect(borHol.port_wall, QBorHol.port_a); connect(TemBorWal.port, QBorHol.port_b); connect(QBorHol.Q_flow, groTemRes.QBor_flow); connect(TSoiUnd.y, repTSoiUnd.u); for i in 1:nZon loop for j in 1:nSeg loop connect(repTSoiUnd[j].y[i], TSoiDisl[i,j].u2); end for; end for; connect(groTemRes.delTBor, TSoiDisl.u1); connect(TSoiDisl.y, TemBorWal.T); connect(TSoiDisl.y, aveTBor.u); connect(aveTBor.y, TBorAve); connect(port_a, masFloDiv.port_b); connect(masFloDiv.port_a, borHol.port_a); connect(borHol.port_b, masFloMul.port_a); connect(masFloMul.port_b, port_b); connect(aveQBor.y, QBorAve); connect(QBorHol.Q_flow, aveQBor.u); end PartialStorage;