Buildings.Experimental.DHC.Loads.BaseClasses.Examples

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
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ1Valve CouplingRCZ1Valve Example illustrating the coupling of a building model to heating water and chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ6 CouplingRCZ6 Example illustrating the coupling of a building model to heating water and chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ1 CouplingSpawnZ1 Example illustrating the coupling of a building model to heating water and chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ6 CouplingSpawnZ6 Example illustrating the coupling of a building model to heating water and chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeries CouplingTimeSeries Example illustrating the coupling of a building model to heating water and chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeriesSingleLoop CouplingTimeSeriesSingleLoop Example illustrating the coupling of a building model to heating water or chilled water loops
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses BaseClasses Package with base classes

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ1Valve Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ1Valve

Example illustrating the coupling of a building model to heating water and chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ1Valve

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

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

Modelica definition

model CouplingRCZ1Valve "Example illustrating the coupling of a building model to heating water and chilled water loops" 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")) "Weather data reader"; package Medium1=Buildings.Media.Water "Source side medium"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.BuildingRCZ1Valve bui( nPorts_aHeaWat=1, nPorts_aChiWat=1, nPorts_bHeaWat=1, nPorts_bChiWat=1) "Building"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for heating water"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=bui.terUni.T_aHeaWat_nominal) "Heating water supply temperature"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=bui.terUni.T_aChiWat_nominal) "Chilled water supply temperature"; Buildings.Fluid.Sources.Boundary_pT sinChiWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for chilled water"; Buildings.Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Buildings.Fluid.Sources.Boundary_pT supChiWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; 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;

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ6 Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ6

Example illustrating the coupling of a building model to heating water and chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingRCZ6

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

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

Modelica definition

model CouplingRCZ6 "Example illustrating the coupling of a building model to heating water and chilled water loops" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Fluid in the pipes"; 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")) "Weather data reader"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.BuildingRCZ6 bui( nPorts_aHeaWat=1, nPorts_aChiWat=1, nPorts_bHeaWat=1, nPorts_bChiWat=1) "Building"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for heating water"; Buildings.Fluid.Sources.Boundary_pT sinChilWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for chilled water"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=max( bui.terUni.T_aHeaWat_nominal)) "Heating water supply temperature"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=min( bui.terUni.T_aChiWat_nominal)) "Chilled water supply temperature"; Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Fluid.Sources.Boundary_pT supChiWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; 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;

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ1 Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ1

Example illustrating the coupling of a building model to heating water and chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ1

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

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

Modelica definition

model CouplingSpawnZ1 "Example illustrating the coupling of a building model to heating water and chilled water loops" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.BuildingSpawnZ1 bui( nPorts_aHeaWat=1, nPorts_aChiWat=1, nPorts_bHeaWat=1, nPorts_bChiWat=1) "Building"; Buildings.Fluid.Sources.MassFlowSource_T supHeaWat( use_m_flow_in=true, redeclare final package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=bui.terUni.T_aHeaWat_nominal) "Heating water supply temperature"; Modelica.Blocks.Sources.RealExpression mHeaWat_flow( y=bui.disFloHea.mReqTot_flow) "Heating water flow rate"; Buildings.Fluid.Sources.MassFlowSource_T supChiWat( use_m_flow_in=true, redeclare final package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=bui.terUni.T_aChiWat_nominal) "Chilled water supply temperature"; Modelica.Blocks.Sources.RealExpression mChiWat_flow( y=bui.disFloCoo.mReqTot_flow) "Chilled water flow rate"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare package Medium=Medium1, nPorts=1) "Sink for heating water"; Buildings.Fluid.Sources.Boundary_pT sinChiWat( redeclare package Medium=Medium1, nPorts=1) "Sink for chilled water"; 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;

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ6 Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ6

Example illustrating the coupling of a building model to heating water and chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingSpawnZ6

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

Simulation with Dymola requires minimum version 2020x and setting Hidden.AvoidDoubleComputation=true, see Buildings.ThermalZones.EnergyPlus_9_6_0.UsersGuide.

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

Modelica definition

model CouplingSpawnZ6 "Example illustrating the coupling of a building model to heating water and chilled water loops" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.BuildingSpawnZ6 bui( nPorts_aHeaWat=1, nPorts_aChiWat=1, nPorts_bHeaWat=1, nPorts_bChiWat=1) "Building"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for heating water"; Buildings.Fluid.Sources.Boundary_pT sinChiWat( redeclare final package Medium=Medium1, nPorts=1) "Sink for chilled water"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=max( bui.terUni.T_aHeaWat_nominal)) "Heating water supply temperature"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=min( bui.terUni.T_aChiWat_nominal)) "Chilled water supply temperature"; Fluid.Sources.Boundary_pT supHeaWat( redeclare final package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Fluid.Sources.Boundary_pT supChiWat( redeclare final package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; 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;

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeries Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeries

Example illustrating the coupling of a building model to heating water and chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeries

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

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

Parameters

TypeNameDefaultDescription
TimeperAve600Period for time averaged variables [s]

Modelica definition

model CouplingTimeSeries "Example illustrating the coupling of a building model to heating water and chilled water loops" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; parameter Modelica.Units.SI.Time perAve=600 "Period for time averaged variables"; Buildings.Experimental.DHC.Loads.BaseClasses.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) "Building"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare package Medium=Medium1, nPorts=1) "Sink for heating water"; Buildings.Fluid.Sources.Boundary_pT sinChiWat( redeclare package Medium=Medium1, nPorts=1) "Sink for chilled water"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=bui.T_aHeaWat_nominal) "Heating water supply temperature"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=bui.T_aChiWat_nominal) "Chilled water supply temperature"; Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Fluid.Sources.Boundary_pT supChiWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; Modelica.Blocks.Continuous.Integrator EHeaReq( y(unit="J")) "Time integral of heating load"; Modelica.Blocks.Continuous.Integrator EHeaAct( y(unit="J")) "Actual energy used for heating"; Modelica.Blocks.Continuous.Integrator ECooReq( y(unit="J")) "Time integral of cooling load"; Modelica.Blocks.Continuous.Integrator ECooAct( y(unit="J")) "Actual energy used for cooling"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveHeaReq_flow(y(unit= "W"), final delta=perAve) "Time average of heating load"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveHeaAct_flow(y(unit= "W"), final delta=perAve) "Time average of heating heat flow rate"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveCooReq_flow(y(unit= "W"), final delta=perAve) "Time average of cooling load"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveCooAct_flow(y(unit= "W"), final delta=perAve) "Time average of cooling heat flow rate"; 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;

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeriesSingleLoop Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeriesSingleLoop

Example illustrating the coupling of a building model to heating water or chilled water loops

Buildings.Experimental.DHC.Loads.BaseClasses.Examples.CouplingTimeSeriesSingleLoop

Information

This example illustrates the use of Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding, Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit and Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution in a configuration with

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

Parameters

TypeNameDefaultDescription
TimeperAve600Period for time averaged variables [s]

Modelica definition

model CouplingTimeSeriesSingleLoop "Example illustrating the coupling of a building model to heating water or chilled water loops" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; parameter Modelica.Units.SI.Time perAve=600 "Period for time averaged variables"; Buildings.Experimental.DHC.Loads.BaseClasses.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) "Building wint cooling only"; Buildings.Fluid.Sources.Boundary_pT sinChiWat( redeclare package Medium=Medium1, nPorts=1) "Sink for chilled water"; Modelica.Blocks.Sources.RealExpression TChiWatSup( y=buiCoo.T_aChiWat_nominal) "Chilled water supply temperature"; Fluid.Sources.Boundary_pT supChiWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Chilled water supply"; Modelica.Blocks.Continuous.Integrator ECooReq( y(unit="J")) "Time integral of cooling load"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveCooReq_flow(y(unit= "W"), final delta=perAve) "Time average of cooling load"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveCooAct_flow(y(unit= "W"), final delta=perAve) "Time average of cooling heat flow rate"; Modelica.Blocks.Continuous.Integrator ECooAct( y(unit="J")) "Actual energy used for cooling"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.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) "Building with heating only"; Modelica.Blocks.Sources.RealExpression THeaWatSup( y=buiHea.T_aHeaWat_nominal) "Heating water supply temperature"; Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=1) "Heating water supply"; Fluid.Sources.Boundary_pT sinHeaWat( redeclare package Medium=Medium1, nPorts=1) "Sink for heating water"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveHeaReq_flow(y(unit= "W"), final delta=perAve) "Time average of heating load"; Modelica.Blocks.Continuous.Integrator EHeaReq( y(unit="J")) "Time integral of heating load"; Modelica.Blocks.Continuous.Integrator EHeaAct( y(unit="J")) "Actual energy used for heating"; Buildings.Controls.OBC.CDL.Continuous.MovingAverage QAveHeaAct_flow(y(unit= "W"), final delta=perAve) "Time average of heating heat flow rate"; 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;