Package with models for the validation of the bi-directional district heating and cooling system models
Information
This package contains models that validate the district heating and cooling models.
The examples plot various outputs, which have been verified against
analytical solutions or by inspecting their change due to parametric changes.
These model outputs are stored as reference data to
allow continuous validation whenever models in the library change.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
HeatingCoolingHotWaterSmall
|
Validation model for a system with heating, cooling and hot water |
IdealSmallSystem
|
Validation model for a small system |
Validation model for a system with heating, cooling and hot water
Information
This model validates a small ideal bi-directional heating and cooling network.
The heating and cooling heat flow rates extracted from the district supply
are prescribed by time series.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
HeatFlowRate | Q_flow_nominal | 6E5 | Nominal heat flow rate, positive for heating, negative for cooling [W] |
Real | R_nominal | 100 | Pressure drop per meter at nominal flow rate [Pa/m] |
Design parameter |
Temperature | TSetHeaLea | 273.15 + 12 | Set point for leaving fluid temperature warm supply [K] |
Temperature | TSetCooLea | 273.15 + 16 | Set point for leaving fluid temperature cold supply [K] |
TemperatureDifference | dT_nominal | TSetCooLea - TSetHeaLea | Temperature difference between warm and cold pipe [K] |
Connectors
Type | Name | Description |
Bus | weaBus | |
Modelica definition
model HeatingCoolingHotWaterSmall
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal=6E5
;
parameter Modelica.Units.SI.Temperature TSetHeaLea=273.15 + 12
;
parameter Modelica.Units.SI.Temperature TSetCooLea=273.15 + 16
;
parameter Modelica.Units.SI.TemperatureDifference dT_nominal(
min=0.5,
displayUnit="K") = TSetCooLea - TSetHeaLea
;
parameter Real R_nominal(unit="Pa/m") = 100
;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=Q_flow_nominal/
4200/dT_nominal ;
Plants.HeatingCoolingCarnot_T pla(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT pSet(
redeclare package Medium = Medium,
nPorts=1) ;
Buildings.Fluid.FixedResistances.Pipe pip(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
thicknessIns=0.2,
lambdaIns=0.04,
length=50,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
v_nominal=2,
dp_nominal=50*R_nominal,
useMultipleHeatPorts=true,
nSeg=1);
Buildings.Fluid.FixedResistances.Pipe pip1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
thicknessIns=0.2,
lambdaIns=0.04,
length=50,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
v_nominal=2,
dp_nominal=50*R_nominal,
useMultipleHeatPorts=true,
nSeg=1);
Obsolete.DistrictHeatingCooling.SubStations.VaporCompression.HeatingCoolingHotwaterTimeSeries_dT
larOff(
redeclare package Medium = Medium,
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/Data/Obsolete/DistrictHeatingCooling/SubStations/VaporCompression/RefBldgLargeOfficeNew2004_7.1_5.0_3C_USA_CA_SAN_FRANCISCO.mos"),
TOut_nominal=273.15) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"),
computeWetBulbTemperature=false) ;
Obsolete.DistrictHeatingCooling.SubStations.VaporCompression.HeatingCoolingHotwaterTimeSeries_dT
ret(
redeclare package Medium = Medium,
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/Data/Obsolete/DistrictHeatingCooling/SubStations/VaporCompression/RefBldgStand-aloneRetailNew2004_7.1_5.0_3C_USA_CA_SAN_FRANCISCO.mos"),
TOut_nominal=273.15) ;
Plants.LakeWaterHeatExchanger_T bayWatHex(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
dpHex_nominal=10000)
;
BoundaryConditions.WeatherData.Bus weaBus;
Buildings.Fluid.FixedResistances.Junction splSup(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false) ;
Buildings.Fluid.FixedResistances.Junction splRet(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false) ;
Modelica.Blocks.Sources.CombiTimeTable watTem(
tableOnFile=true,
tableName="tab1",
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative,
y(
each unit="K"),
fileName=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/Data/Obsolete/DistrictHeatingCooling/Plants/AlamedaOceanT.mos"))
;
protected
Modelica.Blocks.Sources.Constant TSetC(k=TSetCooLea)
;
Modelica.Blocks.Sources.Constant TSetH(k=TSetHeaLea)
;
equation
connect(pip.port_b, splSup.port_1);
connect(splSup.port_3, larOff.port_a);
connect(splSup.port_2, ret.port_a);
connect(larOff.port_b, splRet.port_3);
connect(pip1.port_a, splRet.port_1);
connect(splRet.port_2, ret.port_b);
connect(TSetH.y, pla.TSetHea);
connect(TSetC.y, pla.TSetCoo);
connect(pip.port_a, bayWatHex.port_b1);
connect(bayWatHex.port_a1, pla.port_b);
connect(bayWatHex.port_b2, pla.port_a);
connect(bayWatHex.port_a2, pip1.port_b);
connect(bayWatHex.TSetHea, TSetH.y);
connect(pSet.ports[1], pla.port_a);
connect(weaDat.weaBus, weaBus);
connect(pla.TSink, weaBus.TDryBul);
connect(weaBus, larOff.weaBus);
connect(weaBus, ret.weaBus);
connect(bayWatHex.TSouWat, watTem.y[1]);
connect(bayWatHex.TSouHea, weaBus.TDryBul);
connect(bayWatHex.TSetCoo, TSetC.y);
connect(bayWatHex.TSouCoo, weaBus.TDryBul);
end HeatingCoolingHotWaterSmall;
Validation model for a small system
Information
This model validates a small ideal bi-directional heating and cooling network.
The heating and cooling heat flow rates extracted from the district supply
are prescribed by time series.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
HeatFlowRate | Q_flow_nominal | 0.5E6 | Nominal heat flow rate, positive for heating, negative for cooling [W] |
Real | R_nominal | 100 | Pressure drop per meter at nominal flow rate [Pa/m] |
Design parameter |
Temperature | TSetHeaLea | 273.15 + 8 | Set point for leaving fluid temperature warm supply [K] |
Temperature | TSetCooLea | 273.15 + 14 | Set point for leaving fluid temperature cold supply [K] |
TemperatureDifference | dT_nominal | TSetCooLea - TSetHeaLea | Temperature difference between warm and cold pipe [K] |
Modelica definition
model IdealSmallSystem
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal=0.5E6
;
parameter Modelica.Units.SI.Temperature TSetHeaLea=273.15 + 8
;
parameter Modelica.Units.SI.Temperature TSetCooLea=273.15 + 14
;
parameter Modelica.Units.SI.TemperatureDifference dT_nominal(
min=0.5,
displayUnit="K") = TSetCooLea - TSetHeaLea
;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=Q_flow_nominal/
4200/dT_nominal ;
parameter Real R_nominal(unit="Pa/m") = 100
;
Plants.Ideal_T pla(
redeclare package Medium = Medium,
show_T=true,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT pSet(
redeclare package Medium = Medium,
nPorts=1) ;
Obsolete.DistrictHeatingCooling.SubStations.Heating hea1(
redeclare package Medium = Medium, Q_flow_nominal=200E3)
;
Obsolete.DistrictHeatingCooling.SubStations.Heating hea2(
redeclare package Medium = Medium, Q_flow_nominal=100E3)
;
Obsolete.DistrictHeatingCooling.SubStations.Cooling coo1(
redeclare package Medium = Medium, Q_flow_nominal=-150E3)
;
Obsolete.DistrictHeatingCooling.SubStations.Cooling coo2(
redeclare package Medium = Medium, Q_flow_nominal=-100E3)
;
Buildings.Fluid.FixedResistances.Pipe pip(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
nSeg=3,
thicknessIns=0.2,
lambdaIns=0.04,
length=50,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial);
Buildings.Fluid.FixedResistances.Pipe pip1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
nSeg=3,
thicknessIns=0.2,
lambdaIns=0.04,
length=50,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial);
Modelica.Blocks.Sources.CombiTimeTable
QHea1(table=[0,200E3; 6,200E3; 6,50E3;
18,50E3; 18,75E3; 24,75E3], timeScale=3600, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic)
;
Modelica.Blocks.Sources.CombiTimeTable
QHea2(table=[0,100E3; 6,100E3; 6,50E3;
18,50E3; 18,75E3; 24,75E3], timeScale=3600, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic)
;
Modelica.Blocks.Sources.CombiTimeTable
QCoo1(table=[0,-100E3; 6,-80E3; 6,
-50E3; 12,-20E3; 18,-150E3; 24,-100E3], timeScale=3600, extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic) ;
Modelica.Blocks.Sources.CombiTimeTable
QCoo2(table=[0,-10E3; 9,-100E3; 9,
-50E3; 18,-50E3; 18,-150E3; 24,-100E3], timeScale=3600, extrapolation=
Modelica.Blocks.Types.Extrapolation.Periodic) ;
Buildings.Fluid.FixedResistances.Junction spl(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
Buildings.Fluid.FixedResistances.Junction spl1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
Buildings.Fluid.FixedResistances.Junction spl2(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
Buildings.Fluid.FixedResistances.Junction spl3(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
Buildings.Fluid.FixedResistances.Junction spl4(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
Buildings.Fluid.FixedResistances.Junction spl5(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal*{1,1,1},
dp_nominal=40*R_nominal*{0,1,1},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
tau=5*60,
from_dp=false);
protected
Modelica.Blocks.Sources.Constant TSetC(k=TSetCooLea)
;
Modelica.Blocks.Sources.Constant TSetH(k=TSetHeaLea)
;
equation
connect(pla.port_b, pip.port_a);
connect(pla.port_a, pip1.port_b);
connect(pSet.ports[1], pip1.port_b);
connect(QHea1.y[1], hea1.Q_flow);
connect(QHea2.y[1], hea2.Q_flow);
connect(QCoo1.y[1], coo1.Q_flow);
connect(QCoo2.y[1], coo2.Q_flow);
connect(pip.port_b, spl.port_1);
connect(spl.port_2, spl1.port_1);
connect(spl1.port_2, spl2.port_1);
connect(spl.port_3, hea1.port_a);
connect(spl1.port_3, hea2.port_a);
connect(spl2.port_2, coo2.port_b);
connect(coo1.port_b, spl2.port_3);
connect(pip1.port_a, spl3.port_1);
connect(spl3.port_3, hea1.port_b);
connect(hea2.port_b, spl4.port_3);
connect(spl4.port_1, spl3.port_2);
connect(spl4.port_2, spl5.port_1);
connect(spl5.port_3, coo1.port_a);
connect(spl5.port_2, coo2.port_a);
connect(TSetH.y, pla.TSetHea);
connect(TSetC.y, pla.TSetCoo);
end IdealSmallSystem;