Buildings.DHC.Examples.Combined

Package of example models for DHC systems

Information

This package contains example models for district heating and cooling systems.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.DHC.Examples.Combined.SeriesConstantFlow SeriesConstantFlow Example of series connection with constant district water mass flow rate
Buildings.DHC.Examples.Combined.SeriesVariableFlow SeriesVariableFlow Example of series connection with variable district water mass flow rate
Buildings.DHC.Examples.Combined.SeriesVariableFlowAgentControl SeriesVariableFlowAgentControl Example of series connection with variable district water mass flow rate with updated agent controller
Buildings.DHC.Examples.Combined.BaseClasses BaseClasses Package with base classes that are used by multiple models

Buildings.DHC.Examples.Combined.SeriesConstantFlow Buildings.DHC.Examples.Combined.SeriesConstantFlow

Example of series connection with constant district water mass flow rate

Buildings.DHC.Examples.Combined.SeriesConstantFlow

Information

This is a model of a so-called "reservoir network" (Sommer 2020), i.e., a fifth generation district system with unidirectional mass flow rate in the district loop, and energy transfer stations connected in series. In this model, the temperature of the district loop is stabilized through the operation of the plant and the borefield. The main circulation pump has a constant mass flow rate. Each substation takes water from the main district loop and feeds its return water back into the main district loop downstream from the intake. The pipes of the main loop are designed for a pressure drop of dpDis_length_nominal=250 Pa/m at the design flow rate.

References

Sommer T., Sulzer M., Wetter M., Sotnikov A., Mennel S., Stettler C. The reservoir network: A new network topology for district heating and cooling. Energy, Volume 199, 15 May 2020, 117418.

Extends from Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries (Partial model for series network).

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
StringfilNam[nBui]{"modelica://Buildings/Resou...Library paths of the files with thermal loads as time series
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

model SeriesConstantFlow "Example of series connection with constant district water mass flow rate" extends Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries(redeclare Buildings.DHC.Loads.Combined.BuildingTimeSeriesWithETS bui[nBui](final filNam=filNam), datDes( mPumDis_flow_nominal=95, mPipDis_flow_nominal=95, dp_length_nominal=69.3, epsPla=0.935), pumSto(dp_nominal=30000)); parameter String filNam[nBui]={ "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissOffice_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissResidential_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissHospital_20190916.mos"} "Library paths of the files with thermal loads as time series"; Modelica.Blocks.Sources.Constant masFloMaiPum( k=datDes.mPumDis_flow_nominal) "Distribution pump mass flow rate"; Modelica.Blocks.Sources.Constant masFloDisPla( k=datDes.mPla_flow_nominal) "District water flow rate to plant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui]( k=fill(63 + 273.15, nBui)) "Hot water supply temperature set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui]( k=fill(15 + 273.15, nBui)) "Cold water temperature"; Networks.Distribution1Pipe_R dis( redeclare final package Medium = Medium, final nCon=nBui, show_TOut=true, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mCon_flow_nominal, final dp_length_nominal=datDes.dp_length_nominal, final lDis=datDes.lDis, final lEnd=datDes.lEnd, final allowFlowReversal=allowFlowReversalSer) "Distribution network"; Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17) "Sewage water temperature"; equation connect(masFloMaiPum.y, pumDis.m_flow_in); connect(pumSto.m_flow_in, masFloMaiPum.y); connect(masFloDisPla.y, pla.mPum_flow); connect(THotWatSupSet.y, bui.THotWatSupSet); connect(TColWat.y, bui.TColWat); connect(TDisWatSup.port_b, dis.port_aDisSup); connect(dis.port_bDisSup, TDisWatRet.port_a); connect(TSewWat.y, pla.TSewWat); connect(bui.port_bSerAmb, dis.ports_aCon); connect(dis.ports_bCon, bui.port_aSerAmb); end SeriesConstantFlow;

Buildings.DHC.Examples.Combined.SeriesVariableFlow Buildings.DHC.Examples.Combined.SeriesVariableFlow

Example of series connection with variable district water mass flow rate

Buildings.DHC.Examples.Combined.SeriesVariableFlow

Information

This model is identical to Buildings.DHC.Examples.Combined.SeriesConstantFlow except for the pipe diameter and the control of the main circulation pump. Rather than having a constant mass flow rate, the mass flow rate is varied based on the mixing temperatures after each agent. If these mixing temperatures are sufficiently far away from the minimum or maximum allowed loop temperature, then the mass flow rate is reduced to save pump energy.

Extends from Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries (Partial model for series network).

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
StringfilNam[nBui]{"modelica://Buildings/Resou...Library paths of the files with thermal loads as time series
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

model SeriesVariableFlow "Example of series connection with variable district water mass flow rate" extends Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries(redeclare Buildings.DHC.Loads.Combined.BuildingTimeSeriesWithETS bui[nBui](final filNam=filNam), datDes( mPumDis_flow_nominal=97.3, mPipDis_flow_nominal=69.5, dp_length_nominal=69.3, epsPla=0.91), pumSto(dp_nominal=30000)); parameter String filNam[nBui]={ "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissOffice_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissResidential_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissHospital_20190916.mos"} "Library paths of the files with thermal loads as time series"; Modelica.Blocks.Sources.Constant masFloDisPla( k=datDes.mPla_flow_nominal) "District water flow rate to plant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui]( k=fill(63 + 273.15, nBui)) "Hot water supply temperature set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui]( k=fill(15 + 273.15, nBui)) "Cold water temperature"; Buildings.DHC.Networks.Controls.MainPump1Pipe conPum( nMix=nBui, nSou=2, nBui=nBui, TMin=279.15, TMax=290.15, use_temperatureShift=false) "Main pump controller"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=datDes.mPumDis_flow_nominal) "Scale with nominal mass flow rate"; Networks.Distribution1Pipe_R dis( redeclare final package Medium = Medium, final nCon=nBui, show_TOut=true, final mDis_flow_nominal=datDes.mPipDis_flow_nominal, final mCon_flow_nominal=datDes.mCon_flow_nominal, final dp_length_nominal=datDes.dp_length_nominal, final lDis=datDes.lDis, final lEnd=datDes.lEnd, final allowFlowReversal=allowFlowReversalSer) "Distribution network"; Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17) "Sewage water temperature"; equation connect(THotWatSupSet.y, bui.THotWatSupSet); connect(TColWat.y, bui.TColWat); connect(pumDis.m_flow_in, gai.y); connect(conPum.y, gai.u); connect(dis.TOut, conPum.TMix); connect(TDisWatRet.T, conPum.TSouIn[1]); connect(TDisWatBorLvg.T, conPum.TSouIn[2]); connect(TDisWatBorLvg.T, conPum.TSouOut[1]); connect(TDisWatSup.T, conPum.TSouOut[2]); connect(gai.y, pumSto.m_flow_in); connect(masFloDisPla.y, pla.mPum_flow); connect(TSewWat.y, pla.TSewWat); connect(TDisWatSup.port_b, dis.port_aDisSup); connect(TDisWatRet.port_a, dis.port_bDisSup); connect(bui.port_aSerAmb, dis.ports_bCon); connect(bui.port_bSerAmb, dis.ports_aCon); connect(bui.QCoo_flow, conPum.QCoo_flow); end SeriesVariableFlow;

Buildings.DHC.Examples.Combined.SeriesVariableFlowAgentControl Buildings.DHC.Examples.Combined.SeriesVariableFlowAgentControl

Example of series connection with variable district water mass flow rate with updated agent controller

Buildings.DHC.Examples.Combined.SeriesVariableFlowAgentControl

Information

This model is an updated version of Buildings.DHC.Examples.Combined.SeriesVariableFlow. In particular the following have been updated:

References

Ettore Zanetti, David Blum, Michael Wetter (2023) Control development and sizing analysis for a 5th generation district heating and cooling network using Modelica, In Proceedings of the 15th International Modelica Conference. Aachen, Germany, Oct 9-11, 2023.

Extends from Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries (Partial model for series network).

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
StringfilNam[nBui]{"modelica://Buildings/Resou...Library paths of the files with thermal loads as time series
Lengthdiametersqrt(4*datDes.mPipDis_flow_n...Pipe diameter (without insulation) [m]
HeightlDisPip200Distribution pipes length [m]
RadiusrPipdiameter/2Pipe external radius [m]
RadiusthiGroLay0.5Dynamic ground layer thickness [m]
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

model SeriesVariableFlowAgentControl "Example of series connection with variable district water mass flow rate with updated agent controller" extends Buildings.DHC.Examples.Combined.BaseClasses.PartialSeries(redeclare Buildings.DHC.Loads.Combined.BuildingTimeSeriesWithETS bui[nBui](final filNam=filNam), datDes( mPumDis_flow_nominal=97.3, mPipDis_flow_nominal=69.5, mSto_flow_nominal=75, dpPla_nominal(displayUnit="bar") = 50000, TLooMin=279.15, dp_length_nominal=250, epsPla=0.91), pumSto(dp_nominal=40000)); parameter String filNam[nBui]={ "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissOffice_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissResidential_20190916.mos", "modelica://Buildings/Resources/Data/DHC/Loads/Examples/SwissHospital_20190916.mos"} "Library paths of the files with thermal loads as time series"; parameter Modelica.Units.SI.Length diameter=sqrt(4*datDes.mPipDis_flow_nominal/1000/1.5/Modelica.Constants.pi) "Pipe diameter (without insulation)"; parameter Modelica.Units.SI.Height lDisPip=200 "Distribution pipes length"; parameter Modelica.Units.SI.Radius rPip=diameter/2 "Pipe external radius"; parameter Modelica.Units.SI.Radius thiGroLay=0.5 "Dynamic ground layer thickness"; Modelica.Blocks.Sources.Constant masFloDisPla( k=datDes.mPla_flow_nominal) "District water flow rate to plant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui]( k=fill(63 + 273.15, nBui)) "Hot water supply temperature set point"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui]( k=fill(15 + 273.15, nBui)) "Cold water temperature"; Buildings.DHC.Networks.Controls.MainPump1Pipe conPum( nMix=nBui, nSou=2, nBui=nBui, TMin=279.15, TMax=290.15, dTSlo=1.5) "Main pump controller"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=datDes.mPumDis_flow_nominal) "Scale with nominal mass flow rate"; Modelica.Blocks.Sources.CombiTimeTable HXtemperature(table=[0,14 + 273.15; 60 *86400,12 + 273.15; 210*86400,20 + 273.15; 365*86400,14 + 273.15], extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic); Modelica.Blocks.Math.Product product1; .Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(k=datDes.mSto_flow_nominal) "Scale with nominal mass flow rate"; Fluid.Sensors.TemperatureTwoPort TDisWatSup1(redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water supply temperature"; Fluid.Sensors.TemperatureTwoPort TDisWatRet1(redeclare final package Medium = Medium, final m_flow_nominal=datDes.mPumDis_flow_nominal) "District water return temperature"; Fluid.FixedResistances.BuriedPipes.PipeGroundCoupling pipeGroundCouplingMulti[nBui + 3]( each lPip=lDisPip, each rPip=rPip, each thiGroLay=thiGroLay, each nSeg=1, redeclare parameter Buildings.HeatTransfer.Data.Soil.Generic soiDat( each k=2.3, each c=1000, each d=2600)); Buildings.DHC.Networks.Controls.AgentPump1Pipe pumPlantControlNsew( yPumMin=0, dToff=0.5, k=0.8, Ti=600, uLowHea=0.75, uHighHea=1.5, h=0.5); Buildings.DHC.Networks.Controls.AgentPump1Pipe pumPlantControlNsewSto( yPumMin=0, dToff=0.45, k=1.1, Ti=600, uLowHea=0.25, uHighHea=0.5, uLowCoo=0.15, uHighCoo=0.4); Networks.Distribution1PipePlugFlow_v dis( nCon=nBui, allowFlowReversal=allowFlowReversalSer, redeclare package Medium = Medium, show_TOut=true, mDis_flow_nominal=datDes.mPipDis_flow_nominal, mCon_flow_nominal=datDes.mCon_flow_nominal, lDis=datDes.lDis, lEnd=datDes.lEnd, dIns=0.02, kIns=0.2); Fluid.FixedResistances.PlugFlowPipe supDisPluFlo( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversalSer, m_flow_nominal=datDes.mPipDis_flow_nominal, length=lDisPip, dIns=0.02, kIns=0.2); Fluid.FixedResistances.PlugFlowPipe retDisPluFlo( redeclare package Medium = Medium, allowFlowReversal=allowFlowReversalSer, m_flow_nominal=datDes.mPipDis_flow_nominal, length=lDisPip, dIns=0.02, kIns=0.2); equation connect(THotWatSupSet.y, bui.THotWatSupSet); connect(TColWat.y, bui.TColWat); connect(pumDis.m_flow_in, gai.y); connect(conPum.y, gai.u); connect(TDisWatRet.T, conPum.TSouIn[1]); connect(TDisWatBorLvg.T, conPum.TSouIn[2]); connect(TDisWatBorLvg.T, conPum.TSouOut[1]); connect(TDisWatSup.T, conPum.TSouOut[2]); connect(masFloDisPla.y, product1.u1); connect(product1.y, pla.mPum_flow); connect(gai1.y, pumSto.m_flow_in); connect(TDisWatBorLvg.T, pumPlantControlNsew.TSouIn); connect(TDisWatSup.T,pumPlantControlNsew.TSouOut); connect(TDisWatSup1.T,pumPlantControlNsew.TSupDis); connect(TDisWatRet1.T,pumPlantControlNsew.TRetDis); connect(borFie.TBorAve, pumPlantControlNsewSto.TSou); connect(TDisWatRet.T, pumPlantControlNsewSto.TSouIn); connect(TDisWatBorLvg.T,pumPlantControlNsewSto.TSouOut); connect(TDisWatSup1.T,pumPlantControlNsewSto.TSupDis); connect(TDisWatRet1.T,pumPlantControlNsewSto.TRetDis); connect(pumPlantControlNsewSto.y, gai1.u); connect(pumPlantControlNsew.y, product1.u2); connect(TDisWatSup1.port_b, dis.port_aDisSup); connect(dis.port_bDisSup, TDisWatRet1.port_a); connect(dis.ports_bCon, bui.port_aSerAmb); connect(dis.ports_aCon, bui.port_bSerAmb); connect(dis.TOut, conPum.TMix); connect(TDisWatSup.port_b, supDisPluFlo.port_a); connect(supDisPluFlo.port_b, TDisWatSup1.port_a); connect(TDisWatRet1.port_b, retDisPluFlo.port_a); connect(retDisPluFlo.port_b, TDisWatRet.port_a); connect(pipeGroundCouplingMulti[1:(nBui+1)].heatPorts[1], dis.heatPorts); connect(supDisPluFlo.heatPort, pipeGroundCouplingMulti[nBui + 2].heatPorts[1]); connect(retDisPluFlo.heatPort, pipeGroundCouplingMulti[nBui + 3].heatPorts[1]); connect(HXtemperature.y[1], pla.TSewWat); connect(HXtemperature.y[1], pumPlantControlNsew.TSou); connect(bui.QCoo_flow, conPum.QCoo_flow); end SeriesVariableFlowAgentControl;