Example models integrating multiple components
Information
This package contains advanced examples illustrating the use of the models in
Buildings.Experimental.DHC.Loads.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
CouplingRCZ1Valve
|
Example illustrating the coupling of a building model to heating water and chilled water loops |
CouplingRCZ6
|
Example illustrating the coupling of a building model to heating water and chilled water loops |
CouplingSpawnZ1
|
Example illustrating the coupling of a building model to heating water and chilled water loops |
CouplingSpawnZ6
|
Example illustrating the coupling of a building model to heating water and chilled water loops |
CouplingTimeSeries
|
Example illustrating the coupling of a building model to heating water and chilled water loops |
CouplingTimeSeriesSingleLoop
|
Example illustrating the coupling of a building model to heating water or chilled water loops |
BaseClasses
|
Package with base classes |
Example illustrating the coupling of a building model to heating water and chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
a one-zone building model based on a one-element reduced order model, and
-
secondary pumps and mixing valves controlling the heating and chilled water
supply temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CouplingRCZ1Valve
extends Modelica.Icons.Example;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=Buildings.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
package Medium1=
Buildings.Media.Water
;
BaseClasses.BuildingRCZ1Valve bui(
nPorts_aHeaWat=1,
nPorts_aChiWat=1,
nPorts_bHeaWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=bui.terUni.T_aHeaWat_nominal)
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=bui.terUni.T_aChiWat_nominal)
;
Buildings.Fluid.Sources.Boundary_pT sinChiWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT supChiWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
equation
connect(weaDat.weaBus,bui.weaBus);
connect(supHeaWat.T_in,THeaWatSup.y);
connect(TChiWatSup.y,supChiWat.T_in);
connect(supHeaWat.ports[1],bui.ports_aHeaWat[1]);
connect(supChiWat.ports[1],bui.ports_aChiWat[1]);
connect(bui.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(bui.ports_bChiWat[1],sinChiWat.ports[1]);
end CouplingRCZ1Valve;
Example illustrating the coupling of a building model to heating water and chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
a six-zone building model based on a two-element reduced order model (from
GeoJSON export), and
-
secondary pumps.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CouplingRCZ6
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=Buildings.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
BaseClasses.BuildingRCZ6 bui(
nPorts_aHeaWat=1,
nPorts_aChiWat=1,
nPorts_bHeaWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT sinChilWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=
max(
bui.terUni.T_aHeaWat_nominal))
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=
min(
bui.terUni.T_aChiWat_nominal))
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT supChiWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
equation
connect(weaDat.weaBus,bui.weaBus);
connect(supHeaWat.T_in,THeaWatSup.y);
connect(TChiWatSup.y,supChiWat.T_in);
connect(supHeaWat.ports[1],bui.ports_aHeaWat[1]);
connect(supChiWat.ports[1],bui.ports_aChiWat[1]);
connect(bui.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(bui.ports_bChiWat[1],sinChilWat.ports[1]);
end CouplingRCZ6;
Example illustrating the coupling of a building model to heating water and chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
a one-zone building model based on an EnergyPlus envelope model, and
-
no secondary pumps.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CouplingSpawnZ1
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
Buildings.Experimental.DHC.Loads.Examples.BaseClasses.BuildingSpawnZ1 bui(
nPorts_aHeaWat=1,
nPorts_aChiWat=1,
nPorts_bHeaWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.MassFlowSource_T supHeaWat(
use_m_flow_in=true,
redeclare final package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=bui.terUni.T_aHeaWat_nominal)
;
Modelica.Blocks.Sources.RealExpression mHeaWat_flow(
y=bui.disFloHea.mReqTot_flow)
;
Buildings.Fluid.Sources.MassFlowSource_T supChiWat(
use_m_flow_in=true,
redeclare final package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=bui.terUni.T_aChiWat_nominal)
;
Modelica.Blocks.Sources.RealExpression mChiWat_flow(
y=bui.disFloCoo.mReqTot_flow)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT sinChiWat(
redeclare package Medium=Medium1,
nPorts=1)
;
equation
connect(THeaWatSup.y,supHeaWat.T_in);
connect(mHeaWat_flow.y,supHeaWat.m_flow_in);
connect(TChiWatSup.y,supChiWat.T_in);
connect(mChiWat_flow.y,supChiWat.m_flow_in);
connect(supHeaWat.ports[1],bui.ports_aHeaWat[1]);
connect(supChiWat.ports[1],bui.ports_aChiWat[1]);
connect(bui.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(bui.ports_bChiWat[1],sinChiWat.ports[1]);
end CouplingSpawnZ1;
Example illustrating the coupling of a building model to heating water and chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
a six-zone building model based on an EnergyPlus envelope model (from
GeoJSON export), and
-
secondary pumps.
Simulation with Dymola requires minimum version 2020x and setting
Hidden.AvoidDoubleComputation=true
, see
Buildings.ThermalZones.EnergyPlus.UsersGuide.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CouplingSpawnZ6
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
BaseClasses.BuildingSpawnZ6 bui(
nPorts_aHeaWat=1,
nPorts_aChiWat=1,
nPorts_bHeaWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT sinChiWat(
redeclare final package Medium=Medium1,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=
max(
bui.terUni.T_aHeaWat_nominal))
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=
min(
bui.terUni.T_aChiWat_nominal))
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare final package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT supChiWat(
redeclare final package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
equation
connect(supHeaWat.T_in,THeaWatSup.y);
connect(TChiWatSup.y,supChiWat.T_in);
connect(supHeaWat.ports[1],bui.ports_aHeaWat[1]);
connect(supChiWat.ports[1],bui.ports_aChiWat[1]);
connect(bui.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(sinChiWat.ports[1],bui.ports_bChiWat[1]);
end CouplingSpawnZ6;
Example illustrating the coupling of a building model to heating water and chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
space heating and cooling loads provided as time series, and
-
secondary pumps.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Time | perAve | 600 | Period for time averaged variables [s] |
Modelica definition
model CouplingTimeSeries
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
parameter Modelica.SIunits.Time perAve=600
;
Buildings.Experimental.DHC.Loads.Examples.BaseClasses.BuildingTimeSeries bui(
filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos",
facMulHea=10,
facMulCoo=40,
nPorts_aHeaWat=1,
nPorts_aChiWat=1,
nPorts_bHeaWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
nPorts=1)
;
Buildings.Fluid.Sources.Boundary_pT sinChiWat(
redeclare package Medium=Medium1,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=bui.T_aHeaWat_nominal)
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=bui.T_aChiWat_nominal)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT supChiWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Modelica.Blocks.Continuous.Integrator EHeaReq(
y(unit="J"))
;
Modelica.Blocks.Continuous.Integrator EHeaAct(
y(unit="J"))
;
Modelica.Blocks.Continuous.Integrator ECooReq(
y(unit="J"))
;
Modelica.Blocks.Continuous.Integrator ECooAct(
y(unit="J"))
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveHeaReq_flow(
y(unit="W"),
final delta=perAve)
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveHeaAct_flow(
y(unit="W"),
final delta=perAve)
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveCooReq_flow(
y(unit="W"),
final delta=perAve)
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveCooAct_flow(
y(unit="W"),
final delta=perAve)
;
equation
connect(supHeaWat.T_in,THeaWatSup.y);
connect(TChiWatSup.y,supChiWat.T_in);
connect(supHeaWat.ports[1],bui.ports_aHeaWat[1]);
connect(supChiWat.ports[1],bui.ports_aChiWat[1]);
connect(bui.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(sinChiWat.ports[1],bui.ports_bChiWat[1]);
connect(bui.QHea_flow,EHeaAct.u);
connect(bui.QReqHea_flow,EHeaReq.u);
connect(bui.QReqCoo_flow,ECooReq.u);
connect(bui.QCoo_flow,ECooAct.u);
connect(bui.QReqHea_flow,QAveHeaReq_flow.u);
connect(bui.QHea_flow,QAveHeaAct_flow.u);
connect(bui.QReqCoo_flow,QAveCooReq_flow.u);
connect(bui.QCoo_flow,QAveCooAct_flow.u);
end CouplingTimeSeries;
Example illustrating the coupling of a building model to heating water or chilled water loops
Information
This example illustrates the use of
Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding,
Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
and
Buildings.Experimental.DHC.Loads.FlowDistribution
in a configuration with
-
a single connection with a heating water distribution system, see
component
buiHea
(resp. with a chilled water distribution
system, see component buiCoo
),
-
space heating and cooling loads provided as time series, and
-
secondary pumps.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Time | perAve | 600 | Period for time averaged variables [s] |
Modelica definition
model CouplingTimeSeriesSingleLoop
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
parameter Modelica.SIunits.Time perAve=600
;
Buildings.Experimental.DHC.Loads.Examples.BaseClasses.BuildingTimeSeries buiCoo(
have_heaWat=false,
filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos",
facMulCoo=40,
nPorts_aChiWat=1,
nPorts_bChiWat=1)
;
Buildings.Fluid.Sources.Boundary_pT sinChiWat(
redeclare package Medium=Medium1,
nPorts=1)
;
Modelica.Blocks.Sources.RealExpression TChiWatSup(
y=buiCoo.T_aChiWat_nominal)
;
Fluid.Sources.Boundary_pT supChiWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Modelica.Blocks.Continuous.Integrator ECooReq(
y(unit="J"))
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveCooReq_flow(
y(unit="W"),
final delta=perAve)
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveCooAct_flow(
y(unit="W"),
final delta=perAve)
;
Modelica.Blocks.Continuous.Integrator ECooAct(
y(unit="J"))
;
BaseClasses.BuildingTimeSeries buiHea(
have_chiWat=false,
filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos",
facMulHea=10,
nPorts_aChiWat=1,
nPorts_bChiWat=1,
nPorts_aHeaWat=1,
nPorts_bHeaWat=1)
;
Modelica.Blocks.Sources.RealExpression THeaWatSup(
y=buiHea.T_aHeaWat_nominal)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
nPorts=1)
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveHeaReq_flow(
y(unit="W"),
final delta=perAve)
;
Modelica.Blocks.Continuous.Integrator EHeaReq(
y(unit="J"))
;
Modelica.Blocks.Continuous.Integrator EHeaAct(
y(unit="J"))
;
Buildings.Controls.OBC.CDL.Continuous.MovingMean QAveHeaAct_flow(
y(unit="W"),
final delta=perAve)
;
equation
connect(TChiWatSup.y,supChiWat.T_in);
connect(supChiWat.ports[1],buiCoo.ports_aChiWat[1]);
connect(sinChiWat.ports[1],buiCoo.ports_bChiWat[1]);
connect(buiCoo.QReqCoo_flow,ECooReq.u);
connect(buiCoo.QReqCoo_flow,QAveCooReq_flow.u);
connect(buiCoo.QCoo_flow,ECooAct.u);
connect(buiCoo.QCoo_flow,QAveCooAct_flow.u);
connect(THeaWatSup.y,supHeaWat.T_in);
connect(supHeaWat.ports[1],buiHea.ports_aHeaWat[1]);
connect(buiHea.ports_bHeaWat[1],sinHeaWat.ports[1]);
connect(buiHea.QReqHea_flow,EHeaReq.u);
connect(buiHea.QReqHea_flow,QAveHeaReq_flow.u);
connect(buiHea.QHea_flow,EHeaAct.u);
connect(buiHea.QHea_flow,QAveHeaAct_flow.u);
end CouplingTimeSeriesSingleLoop;