Buildings.DHC.Examples.Combined.BaseClasses

Package with base classes that are used by multiple models

Information

This package contains base classes that are used to construct the classes in Buildings.DHC.Examples.Combined.

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

Package Content

Name Description
Buildings.DHC.Examples.Combined.BaseClasses.Borefield Borefield Geothermal borefield model
Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries PartialSeries Partial model for series network
Buildings.DHC.Examples.Combined.BaseClasses.DesignDataSeries DesignDataSeries Record with design data for series network
Buildings.DHC.Examples.Combined.BaseClasses.Zurich Zurich Zurich

Buildings.DHC.Examples.Combined.BaseClasses.Borefield Buildings.DHC.Examples.Combined.BaseClasses.Borefield

Geothermal borefield model

Buildings.DHC.Examples.Combined.BaseClasses.Borefield

Information

This model represents a borefield composed of 350 boreholes, with the following main assumptions.

Extends from Buildings.Fluid.Geothermal.Borefields.TwoUTubes (Borefield model containing double U-tube boreholes).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernCel5Number of cells per aggregation level
IntegernSeg5Number of segments to use in vertical discretization of the boreholes
IntegernBorborFieDat.conDat.nBorNumber of boreholes
RealdxyBor10Distance between boreholes
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]
Diagnostics
Booleanshow_Ttrue= true, if actual temperature at port is computed
g-function
BooleanforceGFunCalcfalseSet to true to force the thermal response to be calculated at the start instead of checking whether this has been pre-computed
IntegernSegGFun12Number of segments to use in the calculation of the g-function
IntegernClu5Number of borehole clusters to use in the calculation of the g-function
Flow resistance
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
Conservation 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_start282.55Initial 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.02Vertical 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)
output RealOutputTBorAveAverage borehole wall temperature in the borefield [K]
output RealOutputQ_flowRate at which heat is extracted from soil [W]

Modelica definition

model Borefield "Geothermal borefield model" extends Buildings.Fluid.Geothermal.Borefields.TwoUTubes( final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tLoaAgg(displayUnit="h") = 3600, final nSeg=5, TExt0_start=282.55, final z0=10, final dT_dz=0.02, final dynFil=true, borFieDat( filDat=Buildings.Fluid.Geothermal.Borefields.Data.Filling.Bentonite( kFil=2.0, cFil=3040, dFil=1450), soiDat=Buildings.Fluid.Geothermal.Borefields.Data.Soil.SandStone( kSoi=2.3, cSoi=1000, dSoi=2600), conDat=Buildings.Fluid.Geothermal.Borefields.Data.Configuration.Example( borCon=Buildings.Fluid.Geothermal.Borefields.Types.BoreholeConfiguration.DoubleUTubeParallel, dp_nominal=35000, hBor=300, rBor=0.095, nBor=350, cooBor=cooBor, dBor=1, rTub=0.02, kTub=0.5, eTub=0.0037, xC=0.05)), show_T=true); /* Some parameters (such as nBor) cannot be propagated down to borFieDat.conDat otherwise Dymola fails to expand. We assign them literally within borFieDat.conDat and propagate them up here to compute dependent parameters. */ parameter Integer nBor = borFieDat.conDat.nBor "Number of boreholes"; parameter Real dxyBor = 10 "Distance between boreholes"; final parameter Modelica.Units.SI.Length cooBor[nBor,2]={dxyBor*{mod(i - 1, 10),floor((i - 1)/10)} for i in 1:nBor} "Cartesian coordinates of the boreholes in meters"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput Q_flow(final unit="W") "Rate at which heat is extracted from soil"; equation connect(gaiQ_flow.y, Q_flow); end Borefield;

Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries

Partial model for series network

Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries

Information

Partial model that is used by the reservoir network models. The reservoir network models extend this model, add controls, and configure some component sizes.

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

Parameters

TypeNameDefaultDescription
RealdpDis_length_nominal250Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m]
RealdpCon_length_nominal250Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m]
LengthdhSto Hydraulic diameter of the distribution pipe before each connection [m]
LengthdhPla Hydraulic diameter of the distribution pipe before each connection [m]
IntegernBuidatDes.nBuiNumber of buildings connected to DHC system
DesignDataSeriesdatDesdatDes(final mCon_flow_nomin...Design data
PartialBuildingWithETSbui[nBui]redeclare Buildings.DHC.Load...Building and ETS
Assumptions
BooleanallowFlowReversalSertrueSet to true to allow flow reversal in the service lines
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal for in-building systems

Modelica definition

partial model PartialSeries "Partial model for series network" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; constant Real facMul = 10 "Building loads multiplier factor"; parameter Real dpDis_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate - Distribution line"; parameter Real dpCon_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate - Connection line"; parameter Boolean allowFlowReversalSer = true "Set to true to allow flow reversal in the service lines"; parameter Boolean allowFlowReversalBui = false "Set to true to allow flow reversal for in-building systems"; parameter Modelica.Units.SI.Length dhSto(fixed=false,start=0.05,min=0.01) "Hydraulic diameter of the distribution pipe before each connection"; parameter Modelica.Units.SI.Length dhPla(fixed=false,start=0.05,min=0.01) "Hydraulic diameter of the distribution pipe before each connection"; parameter Integer nBui = datDes.nBui "Number of buildings connected to DHC system"; inner parameter Buildings.DHC.Examples.Combined.BaseClasses.DesignDataSeries datDes(final mCon_flow_nominal=bui.ets.mSerWat_flow_nominal, lEnd=100) "Design data"; // COMPONENTS Buildings.DHC.Examples.Combined.BaseClasses.Borefield borFie( redeclare final package Medium = Medium) "Bore field"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDis( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal, final allowFlowReversal=allowFlowReversalSer, dp_nominal=150E3) "Distribution pump"; Buildings.Fluid.Sources.Boundary_pT bou( redeclare final package Medium=Medium, nPorts=1) "Boundary pressure condition representing the expansion vessel"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumSto( redeclare final package Medium = Medium, m_flow_nominal=datDes.mSto_flow_nominal) "Bore field pump"; Buildings.DHC.Networks.Connections.Connection1Pipe_R conPla( redeclare final package Medium = Medium, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mPla_flow_nominal, lDis=50, final allowFlowReversal=allowFlowReversalSer, dhDis=dhPla) "Connection to the plant (pressure drop lumped in plant and network model)"; Buildings.DHC.Networks.Connections.Connection1Pipe_R conSto( redeclare final package Medium = Medium, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mSto_flow_nominal, lDis=50, final allowFlowReversal=allowFlowReversalSer, dhDis=dhSto) "Connection to the bore field (pressure drop lumped in plant and network model)"; Buildings.DHC.Plants.Heating.SewageHeatRecovery pla( redeclare final package Medium = Medium, final mSew_flow_nominal=datDes.mPla_flow_nominal, final mDis_flow_nominal=datDes.mPla_flow_nominal, final dpSew_nominal=datDes.dpPla_nominal, final dpDis_nominal=datDes.dpPla_nominal, final epsHex=datDes.epsPla) "Sewage heat recovery plant"; Fluid.Sensors.TemperatureTwoPort TDisWatSup( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water supply temperature"; Fluid.Sensors.TemperatureTwoPort TDisWatRet( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water return temperature"; Fluid.Sensors.TemperatureTwoPort TDisWatBorLvg( redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water borefield leaving temperature"; replaceable Buildings.DHC.Loads.Combined.BaseClasses.PartialBuildingWithETS bui[nBui] constrainedby Buildings.DHC.Loads.Combined.BaseClasses.PartialBuildingWithETS ( bui(each final facMul=facMul), redeclare each final package MediumBui = Medium, redeclare each final package MediumSer = Medium, each final allowFlowReversalBui=allowFlowReversalBui, each final allowFlowReversalSer=allowFlowReversalSer, each final TDisWatMin=datDes.TLooMin, each final TDisWatMax=datDes.TLooMax) "Building and ETS"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMaxSet[nBui]( k=bui.THeaWatSup_nominal) "Heating water supply temperature set point - Maximum value"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet[nBui]( k=bui.TChiWatSup_nominal) "Chilled water supply temperature set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMinSet[nBui]( each k=28 + 273.15) "Heating water supply temperature set point - Minimum value"; Buildings.Controls.OBC.CDL.Reals.MultiSum PPumETS( final nin=nBui) "ETS pump power"; Modelica.Blocks.Continuous.Integrator EPumETS( initType=Modelica.Blocks.Types.Init.InitialState) "ETS pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumDis( initType=Modelica.Blocks.Types.Init.InitialState) "Distribution pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumSto( initType=Modelica.Blocks.Types.Init.InitialState) "Storage pump electric energy"; Modelica.Blocks.Continuous.Integrator EPumPla(initType=Modelica.Blocks.Types.Init.InitialState) "Plant pump electric energy"; Buildings.Controls.OBC.CDL.Reals.MultiSum EPum(nin=4) "Total pump electric energy"; Buildings.Controls.OBC.CDL.Reals.MultiSum PHeaPump( final nin=nBui) "Heat pump power"; Modelica.Blocks.Continuous.Integrator EHeaPum( initType=Modelica.Blocks.Types.Init.InitialState) "Heat pump electric energy"; Buildings.Controls.OBC.CDL.Reals.MultiSum ETot(nin=2) "Total electric energy"; Buildings.DHC.Loads.BaseClasses.ConstraintViolation conVio( final uMin(final unit="K", displayUnit="degC")=datDes.TLooMin, final uMax(final unit="K", displayUnit="degC")=datDes.TLooMax, final nu=3, u(each final unit="K", each displayUnit="degC")) "Check if loop temperatures are within given range"; equation connect(borFie.port_b, conSto.port_aCon); connect(pumDis.port_b, conSto.port_aDis); connect(borFie.port_a, pumSto.port_b); connect(conSto.port_bCon, pumSto.port_a); connect(conPla.port_bDis, TDisWatSup.port_a); connect(TDisWatRet.port_b, pumDis.port_a); connect(conSto.port_bDis, TDisWatBorLvg.port_a); connect(TDisWatBorLvg.port_b, conPla.port_aDis); connect(THeaWatSupMaxSet.y, bui.THeaWatSupMaxSet); connect(TChiWatSupSet.y, bui.TChiWatSupSet); connect(pla.port_bSerAmb, conPla.port_aCon); connect(conPla.port_bCon, pla.port_aSerAmb); connect(THeaWatSupMinSet.y, bui.THeaWatSupMinSet); connect(bui.PPumETS, PPumETS.u); connect(PPumETS.y, EPumETS.u); connect(pumDis.P, EPumDis.u); connect(pumSto.P, EPumSto.u); connect(pla.PPum, EPumPla.u); connect(EPumETS.y, EPum.u[1]); connect(EPumPla.y, EPum.u[2]); connect(EPumDis.y, EPum.u[3]); connect(EPumSto.y, EPum.u[4]); connect(bui.PHea, PHeaPump.u); connect(PHeaPump.y, EHeaPum.u); connect(EHeaPum.y, ETot.u[1]); connect(EPum.y, ETot.u[2]); connect(TDisWatSup.T, conVio.u[1]); connect(TDisWatBorLvg.T, conVio.u[2]); connect(TDisWatRet.T, conVio.u[3]); connect(bou.ports[1], pumDis.port_b); end PartialSeries;

Buildings.DHC.Examples.Combined.BaseClasses.DesignDataSeries Buildings.DHC.Examples.Combined.BaseClasses.DesignDataSeries

Record with design data for series network

Information

This record contains parameter declarations used in example models of DHC systems.

Extends from Modelica.Icons.Record (Icon for records).

Parameters

TypeNameDefaultDescription
IntegernBui3Number of served buildings
MassFlowRatemPumDis_flow_nominal95Nominal mass flow rate of main distribution pump [kg/s]
MassFlowRatemPipDis_flow_nominalmPumDis_flow_nominalNominal mass flow rate for main pipe sizing [kg/s]
MassFlowRatemCon_flow_nominal[nBui] Nominal mass flow rate in each connection line [kg/s]
MassFlowRatemPla_flow_nominal11.45Plant HX nominal mass flow rate (primary = secondary) [kg/s]
MassFlowRatemSto_flow_nominal105Storage nominal mass flow rate [kg/s]
PressureDifferencedpPla_nominal50000Plant HX pressure drop at nomninal flow rate (primary = secondary) [Pa]
RealepsPla0.935Plant HX effectiveness (constant)
TemperatureTLooMin273.15 + 6Minimum loop temperature [K]
TemperatureTLooMax273.15 + 17Maximum loop temperature [K]
Realdp_length_nominal250Pressure drop per pipe length at nominal flow rate [Pa/m]
LengthlDis[nBui]fill(100, nBui)Length of the distribution pipe before each connection [m]
LengthlCon[nBui]fill(10, nBui)Length of each connection pipe (supply only, not counting return line) [m]
LengthlEndsum(lDis)Length of the end of the distribution line (after last connection) [m]

Modelica definition

record DesignDataSeries "Record with design data for series network" extends Modelica.Icons.Record; parameter Integer nBui = 3 "Number of served buildings"; parameter Modelica.Units.SI.MassFlowRate mPumDis_flow_nominal=95 "Nominal mass flow rate of main distribution pump"; parameter Modelica.Units.SI.MassFlowRate mPipDis_flow_nominal= mPumDis_flow_nominal "Nominal mass flow rate for main pipe sizing"; parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nBui] "Nominal mass flow rate in each connection line"; parameter Modelica.Units.SI.MassFlowRate mPla_flow_nominal=11.45 "Plant HX nominal mass flow rate (primary = secondary)"; parameter Modelica.Units.SI.MassFlowRate mSto_flow_nominal=105 "Storage nominal mass flow rate"; parameter Modelica.Units.SI.PressureDifference dpPla_nominal=50000 "Plant HX pressure drop at nomninal flow rate (primary = secondary)"; parameter Real epsPla = 0.935 "Plant HX effectiveness (constant)"; parameter Modelica.Units.SI.Temperature TLooMin=273.15 + 6 "Minimum loop temperature"; parameter Modelica.Units.SI.Temperature TLooMax=273.15 + 17 "Maximum loop temperature"; parameter Real dp_length_nominal(final unit="Pa/m") = 250 "Pressure drop per pipe length at nominal flow rate"; parameter Modelica.Units.SI.Length lDis[nBui]=fill(100, nBui) "Length of the distribution pipe before each connection"; parameter Modelica.Units.SI.Length lCon[nBui]=fill(10, nBui) "Length of each connection pipe (supply only, not counting return line)"; parameter Modelica.Units.SI.Length lEnd=sum(lDis) "Length of the end of the distribution line (after last connection)"; end DesignDataSeries;

Buildings.DHC.Examples.Combined.BaseClasses.Zurich Buildings.DHC.Examples.Combined.BaseClasses.Zurich

Zurich

Parameters

TypeNameDefaultDescription
TemperatureTSurMea282.98Mean annual surface temperature [K]
TemperatureDifferenceTSurAmp9.03Surface temperature amplitude [K]
DurationsinPha9132480Phase lag of soil surface temperature [s]

Modelica definition

record Zurich = Buildings.BoundaryConditions.GroundTemperature.ClimaticConstants.Generic ( TSurMea=282.98, TSurAmp=9.03, sinPha=9132480) "Zurich";