Buildings.Fluid.Geothermal.Borefields.BaseClasses

Base classes used in Buildings.Fluid.HeatExchangers.Ground

Information

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

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

Package Content

Name Description
Buildings.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield PartialBorefield Borefield model using single U-tube borehole heat exchanger configuration.Calculates the average fluid temperature T_fts of the borefield for a given (time dependent) load Q_flow
Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes Boreholes Package with borehole heat exchangers
Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer HeatTransfer Package with ground heat transfer models

Buildings.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield Buildings.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield

Borefield model using single U-tube borehole heat exchanger configuration.Calculates the average fluid temperature T_fts of the borefield for a given (time dependent) load Q_flow

Buildings.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield

Information

This model simulates a borefield containing one or multiple boreholes using the parameters in the borFieDat record.

Heat transfer to the soil is modeled using only one borehole heat exchanger (To be added in an extended model). The fluid mass flow rate into the 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 thermal interaction between the borehole wall and the surrounding soil is modeled using Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.GroundTemperatureResponse, which uses a cell-shifting load aggregation technique to calculate the borehole wall temperature after calculating and/or read (from a previous calculation) the borefield's thermal response factor.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
TimetLoaAgg300Time 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
PartialBoreholeborHolredeclare Buildings.Fluid.Ge...Borehole
Nominal condition
MassFlowRatem_flow_nominalborFieDat.conDat.mBorFie_flo...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominalborFieDat.conDat.dp_nominalPressure 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]
BooleanforceGFunCalcfalseSet to true to force the thermal response to be calculated at the start instead of checking whether this has been pre-computed
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
BooleancomputeFlowResistance(borFieDat.conDat.dp_nominal...=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
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.
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_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)
replaceable package MediumMedium in the component
output RealOutputTBorAveAverage borehole wall temperature in the borefield [K]

Modelica definition

partial model PartialBorefield "Borefield model using single U-tube borehole heat exchanger configuration.Calculates the average fluid temperature T_fts of the borefield for a given (time dependent) load Q_flow" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal=borFieDat.conDat.mBorFie_flow_nominal); extends Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters( final dp_nominal=borFieDat.conDat.dp_nominal, final computeFlowResistance=(borFieDat.conDat.dp_nominal > Modelica.Constants.eps)); replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; constant Real mSenFac(min=1)=1 "Factor for scaling the sensible thermal mass of the volume"; // Assumptions 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"; // Simulation parameters parameter Modelica.SIunits.Time tLoaAgg=300 "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"; parameter Boolean forceGFunCalc = false "Set to true to force the thermal response to be calculated at the start instead of checking whether this has been pre-computed"; // General parameters of borefield parameter Buildings.Fluid.Geothermal.Borefields.Data.Borefield.Template borFieDat "Borefield data"; // Temperature gradient in undisturbed soil parameter Modelica.SIunits.Temperature TExt0_start=283.15 "Initial far field temperature"; parameter Modelica.SIunits.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.SIunits.Temperature TGro_start[nSeg]=TExt_start "Start value of grout temperature"; parameter Modelica.SIunits.Temperature TFlu_start[nSeg]=TGro_start "Start value of fluid temperature"; parameter Modelica.SIunits.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"; // Dynamics of filling material parameter Boolean dynFil=true "Set to false to remove the dynamics of the filling material."; Modelica.Blocks.Interfaces.RealOutput TBorAve(final quantity="ThermodynamicTemperature", final unit="K", displayUnit = "degC", start=TExt0_start) "Average borehole wall temperature in the borefield"; Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.GroundTemperatureResponse groTemRes( final tLoaAgg=tLoaAgg, final nCel=nCel, final borFieDat=borFieDat, final forceGFunCalc=forceGFunCalc) "Ground temperature response"; replaceable Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole borHol constrainedby Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole( redeclare final package Medium = Medium, final borFieDat=borFieDat, final nSeg=nSeg, final m_flow_nominal=m_flow_nominal/borFieDat.conDat.nBor, final dp_nominal=dp_nominal, final allowFlowReversal=allowFlowReversal, final m_flow_small=m_flow_small, final show_T=show_T, final computeFlowResistance=computeFlowResistance, final from_dp=from_dp, final linearizeFlowResistance=linearizeFlowResistance, final deltaM=deltaM, final energyDynamics=energyDynamics, final p_start=p_start, final mSenFac=mSenFac, final dynFil=dynFil, final TFlu_start=TFlu_start, final TGro_start=TGro_start) "Borehole"; protected parameter Modelica.SIunits.Height z[nSeg]={borFieDat.conDat.hBor/nSeg*(i - 0.5) for i in 1:nSeg} "Distance from the surface to the considered segment"; Buildings.Fluid.BaseClasses.MassFlowRateMultiplier masFloDiv( redeclare final package Medium = Medium, final k=borFieDat.conDat.nBor) "Division of flow rate"; Buildings.Fluid.BaseClasses.MassFlowRateMultiplier masFloMul( redeclare final package Medium = Medium, final k=borFieDat.conDat.nBor) "Mass flow multiplier"; Modelica.Blocks.Math.Gain gaiQ_flow(k=borFieDat.conDat.nBor) "Gain to multiply the heat extracted by one borehole by the number of boreholes"; Buildings.Utilities.Math.Average AveTBor(nin=nSeg) "Average temperature of all the borehole segments"; 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[nSeg] "Heat flow rate of all segments of the borehole"; Buildings.HeatTransfer.Sources.PrescribedTemperature TemBorWal[nSeg] "Borewall temperature"; Modelica.Blocks.Math.Add TSoiDis[nSeg](each final k1=1, each final k2=1) "Addition of undisturbed soil temperature and change of soil temperature"; Modelica.Blocks.Math.Sum QTotSeg_flow( final nin=nSeg, final k = ones(nSeg)) "Total heat flow rate for all segments of this borehole"; Modelica.Blocks.Routing.Replicator repDelTBor(final nout=nSeg) "Signal replicator for temperature difference of the borehole"; equation connect(masFloMul.port_b, port_b); connect(masFloDiv.port_b, port_a); connect(masFloDiv.port_a, borHol.port_a); connect(borHol.port_b, masFloMul.port_a); connect(QBorHol.port_a, borHol.port_wall); connect(QBorHol.Q_flow, QTotSeg_flow.u); connect(groTemRes.delTBor, repDelTBor.u); connect(TSoiDis.u1, repDelTBor.y); connect(TSoiDis.u2, TSoiUnd.y); connect(QTotSeg_flow.y, gaiQ_flow.u); connect(gaiQ_flow.y, groTemRes.QBor_flow); connect(TSoiDis.y, TemBorWal.T); connect(QBorHol.port_b, TemBorWal.port); connect(TSoiDis.y, AveTBor.u); connect(AveTBor.y, TBorAve); end PartialBorefield;