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 |
SeriesConstantFlow
|
Example of series connection with constant district water mass flow rate |
SeriesVariableFlow
|
Example of series connection with variable district water mass flow rate |
SeriesVariableFlowAgentControl
|
Example of series connection with variable district water mass flow rate with updated agent controller |
BaseClasses
|
Package with base classes that are used by multiple models |
Example of series connection with constant district water mass flow rate
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
Type | Name | Default | Description |
Real | dpDis_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m] |
Real | dpCon_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m] |
Length | dhSto | | Hydraulic diameter of the distribution pipe before each connection [m] |
Length | dhPla | | Hydraulic diameter of the distribution pipe before each connection [m] |
Integer | nBui | datDes.nBui | Number of buildings connected to DHC system |
String | filNam[nBui] | {"modelica://Buildings/Resou... | Library paths of the files with thermal loads as time series |
Assumptions |
Boolean | allowFlowReversalSer | true | Set to true to allow flow reversal in the service lines |
Boolean | allowFlowReversalBui | false | Set to true to allow flow reversal for in-building systems |
Modelica definition
model SeriesConstantFlow
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"}
;
Modelica.Blocks.Sources.Constant masFloMaiPum(
k=datDes.mPumDis_flow_nominal)
;
Modelica.Blocks.Sources.Constant masFloDisPla(
k=datDes.mPla_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui](
k=
fill(63 + 273.15, nBui))
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui](
k=
fill(15 + 273.15, nBui))
;
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) ;
Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17)
;
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;
Example of series connection with variable district water mass flow rate
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
Type | Name | Default | Description |
Real | dpDis_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m] |
Real | dpCon_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m] |
Length | dhSto | | Hydraulic diameter of the distribution pipe before each connection [m] |
Length | dhPla | | Hydraulic diameter of the distribution pipe before each connection [m] |
Integer | nBui | datDes.nBui | Number of buildings connected to DHC system |
String | filNam[nBui] | {"modelica://Buildings/Resou... | Library paths of the files with thermal loads as time series |
Assumptions |
Boolean | allowFlowReversalSer | true | Set to true to allow flow reversal in the service lines |
Boolean | allowFlowReversalBui | false | Set to true to allow flow reversal for in-building systems |
Modelica definition
model SeriesVariableFlow
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"}
;
Modelica.Blocks.Sources.Constant masFloDisPla(
k=datDes.mPla_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui](
k=
fill(63 + 273.15, nBui))
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui](
k=
fill(15 + 273.15, nBui))
;
Buildings.DHC.Networks.Controls.MainPump1Pipe conPum(
nMix=nBui,
nSou=2,
nBui=nBui,
TMin=279.15,
TMax=290.15,
use_temperatureShift=false) ;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=datDes.mPumDis_flow_nominal)
;
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) ;
Modelica.Blocks.Sources.Constant TSewWat(k=273.15 + 17)
;
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;
Example of series connection with variable district water mass flow rate with updated agent controller
Information
This model is an updated version of
Buildings.DHC.Examples.Combined.SeriesVariableFlow.
In particular the following have been updated:
-
The sewage water temperature, mass flow rate and ground temperature are not constant and instead have a seasonal yearly profile.
-
The distribution network pripes now use the plug-flow model to add transport delay and ground coupling to the distribution network.
-
The borefield and sewagre heat exchanger circulation pumps are controlled by an agent specific controller
Buildings.DHC.Networks.Controls.AgentPump1Pipe.
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
Type | Name | Default | Description |
Real | dpDis_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Distribution line [Pa/m] |
Real | dpCon_length_nominal | 250 | Pressure drop per pipe length at nominal flow rate - Connection line [Pa/m] |
Length | dhSto | | Hydraulic diameter of the distribution pipe before each connection [m] |
Length | dhPla | | Hydraulic diameter of the distribution pipe before each connection [m] |
Integer | nBui | datDes.nBui | Number of buildings connected to DHC system |
String | filNam[nBui] | {"modelica://Buildings/Resou... | Library paths of the files with thermal loads as time series |
Length | diameter | sqrt(4*datDes.mPipDis_flow_n... | Pipe diameter (without insulation) [m] |
Height | lDisPip | 200 | Distribution pipes length [m] |
Radius | rPip | diameter/2 | Pipe external radius [m] |
Radius | thiGroLay | 0.5 | Dynamic ground layer thickness [m] |
Assumptions |
Boolean | allowFlowReversalSer | true | Set to true to allow flow reversal in the service lines |
Boolean | allowFlowReversalBui | false | Set to true to allow flow reversal for in-building systems |
Modelica definition
model SeriesVariableFlowAgentControl
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"}
;
parameter Modelica.Units.SI.Length diameter=
sqrt(4*datDes.mPipDis_flow_nominal/1000/1.5/Modelica.Constants.pi)
;
parameter Modelica.Units.SI.Height lDisPip=200 ;
parameter Modelica.Units.SI.Radius rPip=diameter/2 ;
parameter Modelica.Units.SI.Radius thiGroLay=0.5
;
Modelica.Blocks.Sources.Constant masFloDisPla(
k=datDes.mPla_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet[nBui](
k=
fill(63 + 273.15, nBui))
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat[nBui](
k=
fill(15 + 273.15, nBui))
;
Buildings.DHC.Networks.Controls.MainPump1Pipe conPum(
nMix=nBui,
nSou=2,
nBui=nBui,
TMin=279.15,
TMax=290.15,
dTSlo=1.5) ;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(k=datDes.mPumDis_flow_nominal)
;
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)
;
Fluid.Sensors.TemperatureTwoPort TDisWatSup1(
redeclare final package Medium =
Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TDisWatRet1(
redeclare final package Medium =
Medium,
final m_flow_nominal=datDes.mPumDis_flow_nominal)
;
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;