Buildings.Experimental.DHC.Loads.BaseClasses.Validation

Collection of validation models

Information

This package contains models that validate the base classes in Buildings.Experimental.DHC.Loads.BaseClasses.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution1 BenchmarkFlowDistribution1 Performance benchmark of building heating water flow distribution modeling
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution2 BenchmarkFlowDistribution2 Performance benchmark of building heating water flow distribution modeling
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BuildingWithETS BuildingWithETS Validation of the base class PartialBuildingWithPartialETS
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.FlowDistributionPumpControl FlowDistributionPumpControl Validation of the pump head computation in FlowDistribution
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.GetPeakLoad GetPeakLoad Model that validates the getPeakLoad function
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.SimpleRoomODE SimpleRoomODE Validation of the model SimpleRoomODE
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.TerminalUnitScaling TerminalUnitScaling Validation of the scaling factor of the terminal unit model
Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses BaseClasses Package with base classes

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution1 Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution1

Performance benchmark of building heating water flow distribution modeling

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution1

Information

This model is part of a computational performance benchmark between

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

Parameters

TypeNameDefaultDescription
StringfilNam"modelica://Buildings/Resour...File name with thermal loads as time series
IntegernLoa5Number of served loads
PressureDifferencedp_nominalnLoa*1500*2 + 2*500 + 30000Nominal pressure drop in the distribution line [Pa]
Nominal condition
TemperatureT_aHeaWat_nominal273.15 + 40Heating water inlet temperature at nominal conditions [K]
TemperatureT_bHeaWat_nominalT_aHeaWat_nominal - 5Heating water outlet temperature at nominal conditions [K]
TemperatureT_aLoaHea_nominal273.15 + 20Load side inlet temperature at nominal conditions in heating mode [K]
MassFlowRatemLoaHea_flow_nominal1Load side mass flow rate at nominal conditions in heating mode [kg/s]
Scaling
RealfacMul10Mulitplier factor for terminal units

Modelica definition

model BenchmarkFlowDistribution1 "Performance benchmark of building heating water flow distribution modeling" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; package Medium2=Buildings.Media.Air "Load side medium"; parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos" "File name with thermal loads as time series"; parameter Integer nLoa=5 "Number of served loads"; parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal( min=273.15, displayUnit="degC") = 273.15 + 40 "Heating water inlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal( min=273.15, displayUnit="degC") = T_aHeaWat_nominal - 5 "Heating water outlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal( min=273.15, displayUnit="degC") = 273.15 + 20 "Load side inlet temperature at nominal conditions in heating mode"; parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal(min=0) = 1 "Load side mass flow rate at nominal conditions in heating mode"; parameter Modelica.Units.SI.PressureDifference dp_nominal=nLoa*1500*2 + 2*500 + 30000 "Nominal pressure drop in the distribution line"; parameter Real facMul=10 "Mulitplier factor for terminal units"; final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=sum(ter.mHeaWat_flow_nominal) *facMul "Nominal mass flow rate in the distribution line"; final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal(min=Modelica.Constants.eps) = Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string= "#Peak space heating load", filNam=Modelica.Utilities.Files.loadResource( filNam))/facMul "Design heating heat flow rate (>=0)"; Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution disFloHea( redeclare package Medium=Medium1, m_flow_nominal=m_flow_nominal, have_pum=true, dp_nominal=dp_nominal, nPorts_a1=nLoa, nPorts_b1=nLoa) "Heating water distribution system"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating ter[nLoa]( each final facMul=facMul, redeclare each final package Medium1=Medium1, redeclare each final package Medium2=Medium2, each final QHea_flow_nominal=QHea_flow_nominal, each final mLoaHea_flow_nominal=mLoaHea_flow_nominal, each final T_aHeaWat_nominal=T_aHeaWat_nominal, each final T_bHeaWat_nominal=T_bHeaWat_nominal, each final T_aLoaHea_nominal=T_aLoaHea_nominal) "Heating terminal unit"; Modelica.Blocks.Sources.CombiTimeTable loa( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource( filNam), extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, y(each unit="W"), offset={0,0,0}, columns={2,3,4}, smoothness=Modelica.Blocks.Types.Smoothness.MonotoneContinuousDerivative1) "Reader for thermal loads (y[1] is cooling load, y[2] is heating load)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet( k=293.15, y(final unit="K", displayUnit="degC")) "Minimum temperature set point"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep( nout=nLoa) "Repeat input to output an array"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1( nout=nLoa) "Repeat input to output an array"; 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, p=300000, nPorts=1) "Sink for heating water"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup( k=max( ter.T_aHeaWat_nominal)) "Supply temperature"; equation connect(ter.port_bHeaWat,disFloHea.ports_a1); connect(disFloHea.ports_b1,ter.port_aHeaWat); connect(reaRep.y,ter.TSetHea); connect(loa.y[2],reaRep1.u); connect(reaRep1.y,ter.QReqHea_flow); connect(supHeaWat.ports[1],disFloHea.port_a); connect(disFloHea.port_b,sinHeaWat.ports[1]); connect(ter.mReqHeaWat_flow,disFloHea.mReq_flow); connect(THeaWatSup.y,supHeaWat.T_in); connect(minTSet.y,reaRep.u); end BenchmarkFlowDistribution1;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution2 Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution2

Performance benchmark of building heating water flow distribution modeling

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BenchmarkFlowDistribution2

Information

This model is part of a computational performance benchmark between

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

Parameters

TypeNameDefaultDescription
StringfilNam"modelica://Buildings/Resour...File name with thermal loads as time series
IntegernLoa5Number of served loads
Nominal condition
TemperatureT_aHeaWat_nominal273.15 + 40Heating water inlet temperature at nominal conditions [K]
TemperatureT_bHeaWat_nominalT_aHeaWat_nominal - 5Heating water outlet temperature at nominal conditions [K]
TemperatureT_aLoaHea_nominal273.15 + 20Load side inlet temperature at nominal conditions in heating mode [K]
MassFlowRatemLoaHea_flow_nominal1Load side mass flow rate at nominal conditions in heating mode [kg/s]
Scaling
RealfacMul10Mulitplier factor for terminal units
Dynamics
Nominal condition
Timetau120Time constant of fluid temperature variation at nominal flow rate [s]

Modelica definition

model BenchmarkFlowDistribution2 "Performance benchmark of building heating water flow distribution modeling" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; package Medium2=Buildings.Media.Air "Load side medium"; parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos" "File name with thermal loads as time series"; parameter Integer nLoa=5 "Number of served loads"; parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal=273.15 + 40 "Heating water inlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal( min=273.15, displayUnit="degC") = T_aHeaWat_nominal - 5 "Heating water outlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal=273.15 + 20 "Load side inlet temperature at nominal conditions in heating mode"; parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal=1 "Load side mass flow rate at nominal conditions in heating mode"; parameter Modelica.Units.SI.Time tau=120 "Time constant of fluid temperature variation at nominal flow rate"; parameter Real facMul=10 "Mulitplier factor for terminal units"; final parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nLoa]=ter.mHeaWat_flow_nominal *facMul "Nominal mass flow rate in each connection line"; final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=sum( mCon_flow_nominal) "Nominal mass flow rate in the distribution line"; final parameter Modelica.Units.SI.PressureDifference dp_nominal=sum(dis.con.pipDisSup.dp_nominal) + sum(dis.con.pipDisRet.dp_nominal) + max(ter.dpSou_nominal) "Nominal pressure drop in the distribution line"; final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal= Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string="#Peak space heating load", filNam= Modelica.Utilities.Files.loadResource(filNam))/facMul "Design heating heat flow rate (>=0)"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeatingValve ter[nLoa]( each final facMul=facMul, redeclare each final package Medium1=Medium1, redeclare each final package Medium2=Medium2, each final QHea_flow_nominal=QHea_flow_nominal, each final mLoaHea_flow_nominal=mLoaHea_flow_nominal, each final T_aHeaWat_nominal=T_aHeaWat_nominal, each final T_bHeaWat_nominal=T_bHeaWat_nominal, each final T_aLoaHea_nominal=T_aLoaHea_nominal) "Heating terminal unit"; Modelica.Blocks.Sources.CombiTimeTable loa( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource( filNam), extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, y(each unit="W"), offset={0,0,0}, columns={2,3,4}, smoothness=Modelica.Blocks.Types.Smoothness.MonotoneContinuousDerivative1) "Reader for thermal loads (y[1] is cooling load, y[2] is heating load)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet( k=293.15, y(final unit="K", displayUnit="degC")) "Minimum temperature set point"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep( nout=nLoa) "Repeat input to output an array"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1( nout=nLoa) "Repeat input to output an array"; Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=2) "Heating water supply"; Buildings.Experimental.DHC.Networks.Distribution2Pipe dis( redeclare final package Medium=Medium1, nCon=nLoa, allowFlowReversal=false, mDis_flow_nominal=m_flow_nominal, mCon_flow_nominal=mCon_flow_nominal, dpDis_nominal=fill( 1500, nLoa)); Fluid.Movers.FlowControlled_dp pum( redeclare package Medium=Medium1, per( final motorCooledByFluid=false), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=m_flow_nominal, addPowerToMedium=false, nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, dp_nominal=dp_nominal); Fluid.MixingVolumes.MixingVolume vol( final prescribedHeatFlowRate=true, redeclare final package Medium=Medium1, V=m_flow_nominal*tau/rho_default, final mSenFac=1, final m_flow_nominal=m_flow_nominal, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, nPorts=2) "Volume for fluid stream"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpPum( k=dp_nominal) "Prescribed head"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup( k=max( ter.T_aHeaWat_nominal)) "Supply temperature"; protected parameter Medium1.ThermodynamicState sta_default=Medium1.setState_pTX( T=Medium1.T_default, p=Medium1.p_default, X=Medium1.X_default); parameter Modelica.Units.SI.Density rho_default=Medium1.density(sta_default) "Density, used to compute fluid volume"; equation connect(loa.y[2],reaRep1.u); connect(reaRep.y,ter.TSetHea); connect(reaRep1.y,ter.QReqHea_flow); connect(ter.port_bHeaWat,dis.ports_aCon); connect(dis.ports_bCon,ter.port_aHeaWat); connect(pum.port_b,dis.port_aDisSup); connect(dis.port_bDisRet,supHeaWat.ports[1]); connect(vol.ports[1],pum.port_a); connect(supHeaWat.ports[2],vol.ports[2]); connect(THeaWatSup.y,supHeaWat.T_in); connect(dpPum.y,pum.dp_in); connect(reaRep.u,minTSet.y); end BenchmarkFlowDistribution2;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BuildingWithETS Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BuildingWithETS

Validation of the base class PartialBuildingWithPartialETS

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BuildingWithETS

Information

This model validates Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuildingWithPartialETS for various types of district system.

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

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal1Nominal mass flow rate [kg/s]
HeatFlowRateQHeaWat_flow_nominal1E4Nominal mass flow rate [W]
HeatFlowRateQChiWat_flow_nominal-1E4Nominal mass flow rate [W]

Modelica definition

model BuildingWithETS "Validation of the base class PartialBuildingWithPartialETS" extends Modelica.Icons.Example; import TypDisSys=Buildings.Experimental.DHC.Types.DistrictSystemType "District system type enumeration"; package MediumW=Buildings.Media.Water "Water"; package MediumS=Modelica.Media.Water.WaterIF97_ph ( h_default=2770E3) "Steam"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate"; parameter Modelica.Units.SI.HeatFlowRate QHeaWat_flow_nominal=1E4 "Nominal mass flow rate"; parameter Modelica.Units.SI.HeatFlowRate QChiWat_flow_nominal=-1E4 "Nominal mass flow rate"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiHeaGen1( redeclare final package MediumSerHea_a=MediumS, redeclare final package MediumSer=MediumW, redeclare final package MediumBui=MediumW, nPorts_heaWat=1, bui( final have_heaWat=true), ets( final typ=TypDisSys.HeatingGeneration1, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal)) "Building and ETS component - Heating only (steam)"; Fluid.Sources.MassFlowSource_T souDisSup( redeclare final package Medium=MediumS, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet( redeclare final package Medium=MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo( redeclare final package Medium1=MediumS, redeclare final package Medium2=MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiComGen1( redeclare final package MediumSerHea_a=MediumS, redeclare final package MediumSer=MediumW, redeclare final package MediumBui=MediumW, nPorts_heaWat=1, nPorts_chiWat=1, bui( final have_heaWat=true, final have_chiWat=true), ets( final typ=TypDisSys.CombinedGeneration1, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal)) "Building and ETS component - Combined heating (steam) and cooling"; Fluid.Sources.MassFlowSource_T souDisSup1( redeclare final package Medium=MediumS, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet1( redeclare final package Medium=MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo1( redeclare final package Medium1=MediumS, redeclare final package Medium2 = Media.Water, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Fluid.Sources.MassFlowSource_T souDisSup2( redeclare final package Medium=MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet2( redeclare final package Medium=MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo2( redeclare final package Medium1=MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Fluid.Sources.MassFlowSource_T souDisSup3( redeclare final package Medium=MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet3( redeclare final package Medium=MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo3( redeclare final package Medium1=MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiCoo( redeclare final package MediumSer=MediumW, redeclare final package MediumBui=MediumW, nPorts_chiWat=1, bui( final have_chiWat=true), ets( final typ=TypDisSys.Cooling, final m_flow_nominal=m_flow_nominal, final have_chiWat=true, QChiWat_flow_nominal=QChiWat_flow_nominal)) "Building and ETS component - Cooling only"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiComGen2to4( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, nPorts_chiWat=1, bui( final have_heaWat=true, final have_chiWat=true), ets( final typ=TypDisSys.CombinedGeneration2to4, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal)) "Building and ETS component - Combined heating and cooling"; Fluid.Sources.MassFlowSource_T souDisSup5( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet5( redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo5( redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Fluid.Sources.MassFlowSource_T souDisSup6( redeclare final package Medium =MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet6( redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo6( redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiHeaGen2to4( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, bui( final have_heaWat=true), ets( final typ=TypDisSys.HeatingGeneration2to4, final m_flow_nominal= m_flow_nominal, final have_heaWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal)) "Building and ETS component - Heating only"; Fluid.Sources.MassFlowSource_T souDisSup7( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet7( redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo7( redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Fluid.Sources.MassFlowSource_T souDisSup4( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet4(redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo4(redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiComGen5( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, nPorts_chiWat=1, bui(final have_heaWat=true, final have_chiWat=true), ets( final typ=TypDisSys.CombinedGeneration5, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal)) "Building and ETS component - Combined heating and cooling (ambient)"; Fluid.Sources.MassFlowSource_T souDisSup8( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet8(redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo8(redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiTesOutETS( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, nPorts_chiWat=1, bui(final have_heaWat=true, final have_chiWat=true), ets( final typ=TypDisSys.CombinedGeneration5, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal, final have_fan=true, final have_pum=true, final have_eleHea=true, final have_eleCoo=true)) "Building and ETS component - Testing ETS output connectors"; Fluid.Sources.MassFlowSource_T souDisSup9( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet9(redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo9(redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiTesOutETSBui( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, nPorts_chiWat=1, bui( final have_heaWat=true, final have_chiWat=true, final have_fan=true, final have_pum=true, final have_eleHea=true, final have_eleCoo=true), ets( final typ=TypDisSys.CombinedGeneration5, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal, final have_fan=true, final have_pum=true, final have_eleHea=true, final have_eleCoo=true)) "Building and ETS component - Testing ETS and building output connectors"; Fluid.Sources.MassFlowSource_T souDisSup10( redeclare final package Medium = MediumW, m_flow=m_flow_nominal, nPorts=1) "Source for district supply"; Fluid.Sources.Boundary_pT sinDisRet10(redeclare final package Medium = MediumW, nPorts=1) "Sink for district return"; Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo10(redeclare final package Medium1 = MediumW, final m_flow_nominal=m_flow_nominal) "Change in enthalpy flow rate "; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.BuildingWithETS buiTesFacMul( redeclare final package MediumSer = MediumW, redeclare final package MediumBui = MediumW, nPorts_heaWat=1, nPorts_chiWat=1, facMul=2, bui( final have_heaWat=true, final have_chiWat=true, final have_fan=true, final have_pum=true, final have_eleHea=true, final have_eleCoo=true), ets( final typ=TypDisSys.CombinedGeneration5, final m_flow_nominal=m_flow_nominal, final have_heaWat=true, final have_chiWat=true, QHeaWat_flow_nominal=QHeaWat_flow_nominal, QChiWat_flow_nominal=QChiWat_flow_nominal, final have_fan=true, final have_pum=true, final have_eleHea=true, final have_eleCoo=true)) "Building and ETS component - Testing scaling factor"; equation connect(souDisSup.ports[1],senDifEntFlo.port_a1); connect(senDifEntFlo.port_b2,sinDisRet.ports[1]); connect(souDisSup1.ports[1],senDifEntFlo1.port_a1); connect(senDifEntFlo1.port_b2,sinDisRet1.ports[1]); connect(souDisSup2.ports[1],senDifEntFlo2.port_a1); connect(senDifEntFlo2.port_b2,sinDisRet2.ports[1]); connect(souDisSup3.ports[1],senDifEntFlo3.port_a1); connect(sinDisRet3.ports[1],senDifEntFlo3.port_b2); connect(senDifEntFlo.port_b1, buiHeaGen1.port_aSerHea); connect(senDifEntFlo.port_a2, buiHeaGen1.port_bSerHea); connect(senDifEntFlo1.port_b1, buiComGen1.port_aSerHea); connect(buiComGen1.port_bSerHea, senDifEntFlo1.port_a2); connect(senDifEntFlo2.port_b1, buiComGen1.port_aSerCoo); connect(buiComGen1.port_bSerCoo, senDifEntFlo2.port_a2); connect(senDifEntFlo3.port_b1, buiCoo.port_aSerCoo); connect(buiCoo.port_bSerCoo, senDifEntFlo3.port_a2); connect(souDisSup5.ports[1],senDifEntFlo5.port_a1); connect(senDifEntFlo5.port_b2,sinDisRet5.ports[1]); connect(souDisSup6.ports[1],senDifEntFlo6.port_a1); connect(senDifEntFlo6.port_b2,sinDisRet6.ports[1]); connect(senDifEntFlo5.port_b1, buiComGen2to4.port_aSerHea); connect(buiComGen2to4.port_bSerHea, senDifEntFlo5.port_a2); connect(senDifEntFlo6.port_b1, buiComGen2to4.port_aSerCoo); connect(buiComGen2to4.port_bSerCoo, senDifEntFlo6.port_a2); connect(souDisSup7.ports[1], senDifEntFlo7.port_a1); connect(senDifEntFlo7.port_b2, sinDisRet7.ports[1]); connect(senDifEntFlo7.port_b1, buiHeaGen2to4.port_aSerHea); connect(senDifEntFlo7.port_a2, buiHeaGen2to4.port_bSerHea); connect(souDisSup4.ports[1],senDifEntFlo4.port_a1); connect(sinDisRet4.ports[1],senDifEntFlo4.port_b2); connect(senDifEntFlo4.port_b1,buiComGen5. port_aSerAmb); connect(buiComGen5.port_bSerAmb,senDifEntFlo4. port_a2); connect(souDisSup8.ports[1],senDifEntFlo8.port_a1); connect(sinDisRet8.ports[1],senDifEntFlo8.port_b2); connect(senDifEntFlo8.port_b1,buiTesOutETS. port_aSerAmb); connect(buiTesOutETS.port_bSerAmb,senDifEntFlo8. port_a2); connect(souDisSup9.ports[1],senDifEntFlo9.port_a1); connect(sinDisRet9.ports[1],senDifEntFlo9.port_b2); connect(senDifEntFlo9.port_b1,buiTesOutETSBui. port_aSerAmb); connect(buiTesOutETSBui.port_bSerAmb,senDifEntFlo9. port_a2); connect(souDisSup10.ports[1],senDifEntFlo10. port_a1); connect(sinDisRet10.ports[1],senDifEntFlo10. port_b2); connect(senDifEntFlo10.port_b1,buiTesFacMul. port_aSerAmb); connect(buiTesFacMul.port_bSerAmb,senDifEntFlo10. port_a2); end BuildingWithETS;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.FlowDistributionPumpControl Buildings.Experimental.DHC.Loads.BaseClasses.Validation.FlowDistributionPumpControl

Validation of the pump head computation in FlowDistribution

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.FlowDistributionPumpControl

Information

This model validates the pump head computation algorithm implemented in Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution.

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

Parameters

TypeNameDefaultDescription
StringfilNam"modelica://Buildings/Resour...File name with thermal loads as time series
IntegernLoa5Number of served loads
PressureDifferencedpDis_nominal[nLoa]1/2 .* cat(1, {dp_nominal*0....Pressure drop between each connected unit at nominal conditions (supply line) [Pa]
PressureDifferencedpSetmax(terUniHea.dpSou_nominal)Pressure difference set point [Pa]
Scaling
RealfacMul10Scaling factor for terminal units
Nominal condition
MassFlowRatemLoaHea_flow_nominal1Load side mass flow rate at nominal conditions in heating mode [kg/s]
TemperatureT_aHeaWat_nominal273.15 + 40Heating water inlet temperature at nominal conditions [K]
TemperatureT_bHeaWat_nominalT_aHeaWat_nominal - 5Heating water outlet temperature at nominal conditions [K]
TemperatureT_aLoaHea_nominal273.15 + 20Load side inlet temperature at nominal conditions in heating mode [K]
Dynamics
Nominal condition
Timetau120Time constant of fluid temperature variation at nominal flow rate [s]

Modelica definition

model FlowDistributionPumpControl "Validation of the pump head computation in FlowDistribution" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; package Medium2=Buildings.Media.Air "Load side medium"; parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos" "File name with thermal loads as time series"; parameter Integer nLoa=5 "Number of served loads"; parameter Real facMul=10 "Scaling factor for terminal units"; parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal=1 "Load side mass flow rate at nominal conditions in heating mode"; parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal=273.15 + 40 "Heating water inlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal( min=273.15, displayUnit="degC") = T_aHeaWat_nominal - 5 "Heating water outlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal=273.15 + 20 "Load side inlet temperature at nominal conditions in heating mode"; parameter Modelica.Units.SI.Time tau=120 "Time constant of fluid temperature variation at nominal flow rate"; parameter Modelica.Units.SI.PressureDifference dpDis_nominal[nLoa]( each min=0, each displayUnit="Pa") = 1/2 .* cat( 1, {dp_nominal*0.2}, fill(dp_nominal*0.8/(nLoa - 1), nLoa - 1)) "Pressure drop between each connected unit at nominal conditions (supply line)"; parameter Modelica.Units.SI.PressureDifference dpSet=max(terUniHea.dpSou_nominal) "Pressure difference set point"; final parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nLoa]= terUniHea.mHeaWat_flow_nominal*facMul "Nominal mass flow rate in each connection line"; final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=sum( mCon_flow_nominal) "Nominal mass flow rate in the distribution line"; final parameter Modelica.Units.SI.PressureDifference dp_nominal=max(terUniHea.dpSou_nominal) + 2*nLoa*5000 "Nominal pressure drop in the distribution line"; final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal= Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string="#Peak space heating load", filNam= Modelica.Utilities.Files.loadResource(filNam))/facMul "Design heating heat flow rate (>=0)"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeatingValve terUniHea[nLoa]( redeclare each final package Medium1=Medium1, redeclare each final package Medium2=Medium2, each final facMul=facMul, each final QHea_flow_nominal=QHea_flow_nominal, each final mLoaHea_flow_nominal=mLoaHea_flow_nominal, each final T_aHeaWat_nominal=T_aHeaWat_nominal, each final T_bHeaWat_nominal=T_bHeaWat_nominal, each final T_aLoaHea_nominal=T_aLoaHea_nominal, each final have_speVar=false) "Heating terminal unit"; Modelica.Blocks.Sources.CombiTimeTable loa( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource( filNam), extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, y(each unit="W"), offset={0,0,0}, columns={2,3,4}, smoothness=Modelica.Blocks.Types.Smoothness.MonotoneContinuousDerivative1) "Reader for thermal loads (y[1] is cooling load, y[2] is heating load)"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet( k=20+273.15, y(final unit="K", displayUnit="degC")) "Minimum temperature set point"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep( nout=nLoa) "Repeat input to output an array"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1( nout=nLoa) "Repeat input to output an array"; Buildings.Experimental.DHC.Networks.Distribution2Pipe dis( redeclare final package Medium=Medium1, final nCon=nLoa, final allowFlowReversal=false, final iConDpSen=nLoa, final mDis_flow_nominal=m_flow_nominal, final mCon_flow_nominal=mCon_flow_nominal, final dpDis_nominal=dpDis_nominal) "Distribution network"; Fluid.Movers.FlowControlled_dp pumCstDp( redeclare package Medium=Medium1, per( final motorCooledByFluid=false), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=m_flow_nominal, addPowerToMedium=false, nominalValuesDefineDefaultPressureCurve=true, use_inputFilter=false, dp_nominal=dp_nominal, prescribeSystemPressure=true) "Pump controlled to track a pressure drop over the last connected load"; Fluid.MixingVolumes.MixingVolume vol( final prescribedHeatFlowRate=true, redeclare final package Medium=Medium1, V=m_flow_nominal*tau/rho_default, final mSenFac=1, final m_flow_nominal=m_flow_nominal, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, nPorts=2) "Volume for fluid stream"; Fluid.Sources.Boundary_pT supHeaWat1( redeclare package Medium=Medium1, use_T_in=true, nPorts=3) "Heating water source"; Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution disCstDp( redeclare package Medium=Medium1, m_flow_nominal=m_flow_nominal, have_pum=true, typCtr=Buildings.Experimental.DHC.Loads.BaseClasses.Types.PumpControlType.ConstantDp, dp_nominal=dp_nominal, dpDis_nominal=dpDis_nominal, dpMin=dpSet, mUni_flow_nominal=mCon_flow_nominal, nPorts_a1=nLoa, nPorts_b1=nLoa) "Distribution system with pump controlled to track a pressure drop over the last connected unit"; Fluid.Sources.Boundary_pT sinHeaWat( redeclare package Medium=Medium1, p=300000, nPorts=3) "Sink for heating water"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating terUniHea1[nLoa]( redeclare each final package Medium1=Medium1, redeclare each final package Medium2=Medium2, each final facMul=facMul, each final QHea_flow_nominal=QHea_flow_nominal, each final mLoaHea_flow_nominal=mLoaHea_flow_nominal, each final T_aHeaWat_nominal=T_aHeaWat_nominal, each final T_bHeaWat_nominal=T_bHeaWat_nominal, each final T_aLoaHea_nominal=T_aLoaHea_nominal, each final have_speVar=false) "Heating terminal unit"; Fluid.Movers.SpeedControlled_y pumCstSpe( redeclare package Medium=Medium1, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, per( pressure( V_flow=m_flow_nominal/rho_default .* {0,1,2}, dp=dp_nominal .* {1.5,1,0.5})), addPowerToMedium=false, use_inputFilter=false) "Pump controlled at constant speed"; Fluid.Movers.BaseClasses.IdealSource pipPre( redeclare final package Medium=Medium1, dp_start=dp_nominal, m_flow_start=m_flow_nominal, m_flow_small=1E-4*m_flow_nominal, final show_T=false, final show_V_flow=false, final control_m_flow=true, final control_dp=false) "Fictitious pipe used to prescribe pump flow rate"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one1( k=1) "Constant one"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating terUniHea2[nLoa]( redeclare each final package Medium1=Medium1, redeclare each final package Medium2=Medium2, each final facMul=facMul, each final QHea_flow_nominal=QHea_flow_nominal, each final mLoaHea_flow_nominal=mLoaHea_flow_nominal, each final T_aHeaWat_nominal=T_aHeaWat_nominal, each final T_bHeaWat_nominal=T_bHeaWat_nominal, each final T_aLoaHea_nominal=T_aLoaHea_nominal, each final have_speVar=false) "Heating terminal unit"; Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution disCstSpe( redeclare package Medium=Medium1, m_flow_nominal=m_flow_nominal, have_pum=true, typCtr=Buildings.Experimental.DHC.Loads.BaseClasses.Types.PumpControlType.ConstantSpeed, dp_nominal=dp_nominal, dpDis_nominal=dpDis_nominal, dpMin=dpSet, mUni_flow_nominal=mCon_flow_nominal, nPorts_a1=5, nPorts_b1=5) "Distribution system with pump controlled at constant speed"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup( k=T_aHeaWat_nominal) "Heating water supply temperature"; Fluid.Sources.Boundary_pT supHeaWat( redeclare package Medium=Medium1, use_T_in=true, nPorts=2) "Heating water source"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant setDp( k=dpSet) "Pressure difference set-point"; protected parameter Medium1.ThermodynamicState sta_default=Medium1.setState_pTX( T=Medium1.T_default, p=Medium1.p_default, X=Medium1.X_default); parameter Modelica.Units.SI.Density rho_default=Medium1.density(sta_default) "Density, used to compute fluid volume"; equation connect(loa.y[2],reaRep1.u); connect(reaRep.y,terUniHea.TSetHea); connect(reaRep1.y,terUniHea.QReqHea_flow); connect(terUniHea.port_bHeaWat,dis.ports_aCon); connect(dis.ports_bCon,terUniHea.port_aHeaWat); connect(pumCstDp.port_b,dis.port_aDisSup); connect(vol.ports[1],pumCstDp.port_a); connect(disCstDp.port_b,sinHeaWat.ports[1]); connect(supHeaWat1.ports[1],disCstDp.port_a); connect(terUniHea1.port_bHeaWat,disCstDp.ports_a1); connect(disCstDp.ports_b1,terUniHea1.port_aHeaWat); connect(reaRep.y,terUniHea1.TSetHea); connect(reaRep1.y,terUniHea1.QReqHea_flow); connect(terUniHea1.mReqHeaWat_flow,disCstDp.mReq_flow); connect(supHeaWat1.ports[2],pumCstSpe.port_a); connect(pumCstSpe.port_b,pipPre.port_a); connect(pipPre.port_b,sinHeaWat.ports[2]); connect(one1.y,pumCstSpe.y); connect(supHeaWat1.ports[3],disCstSpe.port_a); connect(disCstSpe.port_b,sinHeaWat.ports[3]); connect(disCstSpe.ports_b1[1:5],terUniHea2.port_aHeaWat); connect(terUniHea2.port_bHeaWat,disCstSpe.ports_a1[1:5]); connect(terUniHea2.mReqHeaWat_flow,disCstSpe.mReq_flow); connect(reaRep.y,terUniHea2.TSetHea); connect(reaRep1.y,terUniHea2.QReqHea_flow); connect(disCstSpe.mReqTot_flow,pipPre.m_flow_in); connect(THeaWatSup.y,supHeaWat1.T_in); connect(dis.port_bDisRet,supHeaWat.ports[1]); connect(supHeaWat.ports[2],vol.ports[2]); connect(THeaWatSup.y,supHeaWat.T_in); connect(minTSet.y,reaRep.u); connect(dis.dp,pumCstDp.dpMea); connect(setDp.y,pumCstDp.dp_in); end FlowDistributionPumpControl;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.GetPeakLoad Buildings.Experimental.DHC.Loads.BaseClasses.Validation.GetPeakLoad

Model that validates the getPeakLoad function

Information

This model tests reading the peak loads from the load file. If the wrong values are read, then the simulation stops with an error.

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

Parameters

TypeNameDefaultDescription
HeatFlowRateQCoo_flowBuildings.Experimental.DHC.L...Peak heat flow rate [W]
HeatFlowRateQHea_flowBuildings.Experimental.DHC.L...Peak heat flow rate [W]
HeatFlowRateQWatHea_flowBuildings.Experimental.DHC.L...Peak water heating flow rate [W]

Modelica definition

model GetPeakLoad "Model that validates the getPeakLoad function" extends Modelica.Icons.Example; parameter Modelica.Units.SI.HeatFlowRate QCoo_flow= Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string= "#Peak space cooling load", filNam=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/Data/Experimental/DHC/Loads/BaseClasses/Validation/RefBldgLargeOfficeNew2004_7.1_5.0_3C_USA_CA_SAN_FRANCISCO.mos")) "Peak heat flow rate"; parameter Modelica.Units.SI.HeatFlowRate QHea_flow= Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string= "#Peak space heating load", filNam=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/Data/Experimental/DHC/Loads/BaseClasses/Validation/RefBldgLargeOfficeNew2004_7.1_5.0_3C_USA_CA_SAN_FRANCISCO.mos")) "Peak heat flow rate"; parameter Modelica.Units.SI.HeatFlowRate QWatHea_flow= Buildings.Experimental.DHC.Loads.BaseClasses.getPeakLoad(string= "#Peak water heating load", filNam=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/Data/Experimental/DHC/Loads/BaseClasses/Validation/RefBldgLargeOfficeNew2004_7.1_5.0_3C_USA_CA_SAN_FRANCISCO.mos")) "Peak water heating flow rate"; equation assert( abs( QCoo_flow-(-383165.6989)) < 1E-3, "Error in reading the peak heating load. Read "+String( QCoo_flow)); assert( abs( QHea_flow-893931.4335) < 1E-3, "Error in reading the peak heating load. Read "+String( QHea_flow)); assert( abs( QWatHea_flow-19496.90012) < 1E-3, "Error in reading the peak water heating load. Read "+String( QWatHea_flow)); end GetPeakLoad;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.SimpleRoomODE Buildings.Experimental.DHC.Loads.BaseClasses.Validation.SimpleRoomODE

Validation of the model SimpleRoomODE

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.SimpleRoomODE

Information


This example validates Buildings.Experimental.DHC.Loads.BaseClasses.SimpleRoomODE by comparison with Buildings.ThermalZones.ReducedOrder.RC.TwoElements.

A first instance of the reduced order model is used to assess the heating and cooling loads. A second instance is used to assess the indoor air temperature variation when the rate at which heating or cooling is provided is lower than the load. That second instance is used as a reference for the validation.

Eventually the validation is performed with two sets of ambient conditions, one requiring heating, and the second requiring cooling.

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

Parameters

TypeNameDefaultDescription
Timetau1800Time constant of the indoor temperature [s]
Nominal condition
HeatFlowRateQHea_flow_nominal112000Design heating heat flow rate (for TInd=TIndHea_nominal, TOut=TOutHea_nominal, with no internal gains, no solar radiation) [W]
HeatFlowRateQCoo_flow_nominal-200000Design cooling heat flow rate [W]

Modelica definition

model SimpleRoomODE "Validation of the model SimpleRoomODE" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; package Medium2=Buildings.Media.Air "Load side medium"; parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal=112000 "Design heating heat flow rate (for TInd=TIndHea_nominal, TOut=TOutHea_nominal, with no internal gains, no solar radiation)"; parameter Modelica.Units.SI.HeatFlowRate QCoo_flow_nominal=-200000 "Design cooling heat flow rate"; parameter Modelica.Units.SI.Time tau=1800 "Time constant of the indoor temperature"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office romHeaMet "ROM where the heating load is always met"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat( TDryBulSou=Buildings.BoundaryConditions.Types.DataSource.Parameter, TDryBul=276.15, 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.Controls.Continuous.LimPID conHea( controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti=10); Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet( k=293.15, y(final unit="K", displayUnit="degC")) "Minimum temperature set point"; Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai(k= QHea_flow_nominal) "Scaling"; HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow "Prescribed heat flow rate"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office romHeaUnm "ROM where the heating load is not met"; Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(k=0.7) "Scaling "; HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow1 "Prescribed heat flow rate"; Buildings.Experimental.DHC.Loads.BaseClasses.SimpleRoomODE rooOdeHea( TOutHea_nominal=273.15, TIndHea_nominal=293.15, QHea_flow_nominal=QHea_flow_nominal, tau=tau) "ODE heated room model"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant maxTSet( k=297.15, y(final unit="K", displayUnit="degC")) "Maximum temperature set point"; Buildings.Controls.Continuous.LimPID conCoo( controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti=10, reverseActing=false) "PI controller tracking the room maximum temperature"; Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai2(k= QCoo_flow_nominal) "Scaling"; Buildings.Experimental.DHC.Loads.BaseClasses.SimpleRoomODE rooOdeCoo( TOutHea_nominal=273.15, TIndHea_nominal=293.15, QHea_flow_nominal=QHea_flow_nominal, tau=tau) "ODE cooled room model"; Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai3(k=0.8) "Scaling"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat1( TDryBulSou=Buildings.BoundaryConditions.Types.DataSource.Parameter, TDryBul=293.15, 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.GeojsonExportRC.OfficeBuilding.Office romCooMet "ROM where the cooling load is always met"; Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office romCooUnm "ROM where the cooling load is not met"; HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow2 "Prescribed heat flow rate"; HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow3 "Prescribed heat flow rate"; equation connect(weaDat.weaBus,romHeaMet.weaBus); connect(romHeaMet.TAir,conHea.u_m); connect(conHea.y,gai.u); connect(gai.y,prescribedHeatFlow.Q_flow); connect(prescribedHeatFlow.port,romHeaMet.port_a); connect(conCoo.y,gai2.u); connect(gai1.y,prescribedHeatFlow1.Q_flow); connect(gai1.y,rooOdeHea.QAct_flow); connect(gai2.y,rooOdeCoo.QReq_flow); connect(prescribedHeatFlow1.port,romHeaUnm.port_a); connect(gai2.y,gai3.u); connect(gai3.y,rooOdeCoo.QAct_flow); connect(weaDat.weaBus,romHeaUnm.weaBus); connect(weaDat1.weaBus,romCooMet.weaBus); connect(weaDat1.weaBus,romCooUnm.weaBus); connect(romCooMet.TAir,conCoo.u_m); connect(gai.y,gai1.u); connect(gai.y,rooOdeHea.QReq_flow); connect(gai3.y,prescribedHeatFlow2.Q_flow); connect(prescribedHeatFlow2.port,romCooUnm.port_a); connect(gai2.y,prescribedHeatFlow3.Q_flow); connect(prescribedHeatFlow3.port,romCooMet.port_a); connect(minTSet.y,conHea.u_s); connect(minTSet.y,rooOdeHea.TSet); connect(maxTSet.y,conCoo.u_s); connect(maxTSet.y,rooOdeCoo.TSet); end SimpleRoomODE;

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.TerminalUnitScaling Buildings.Experimental.DHC.Loads.BaseClasses.Validation.TerminalUnitScaling

Validation of the scaling factor of the terminal unit model

Buildings.Experimental.DHC.Loads.BaseClasses.Validation.TerminalUnitScaling

Information

This example validates the use of the unit multiplier and zone multiplier factors for models of terminal units inheriting from Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit.

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

Parameters

TypeNameDefaultDescription
RealfacMul2Multiplier factor
Nominal condition
TemperatureT_aHeaWat_nominal273.15 + 40Heating water inlet temperature at nominal conditions [K]
TemperatureT_bHeaWat_nominalT_aHeaWat_nominal - 5Heating water outlet temperature at nominal conditions [K]
TemperatureT_aLoaHea_nominal273.15 + 20Load side inlet temperature at nominal conditions in heating mode [K]
TemperatureT_bLoaHea_nominalT_aLoaHea_nominal + 12Load side ourtlet temperature at nominal conditions in heating mode [K]
MassFlowRatemLoaHeaUni_flow_nominalQHeaUni_flow_nominal/(T_bLoa...Load side mass flow rate at nominal conditions for 1 unit [kg/s]
HeatFlowRateQHeaUni_flow_nominal1000Design heating heat flow rate (>=0) for 1 unit [W]

Modelica definition

model TerminalUnitScaling "Validation of the scaling factor of the terminal unit model" extends Modelica.Icons.Example; package Medium1=Buildings.Media.Water "Source side medium"; package Medium2=Buildings.Media.Air "Load side medium"; parameter Real facMul=2 "Multiplier factor"; parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal( min=273.15, displayUnit="degC") = 273.15 + 40 "Heating water inlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal( min=273.15, displayUnit="degC") = T_aHeaWat_nominal - 5 "Heating water outlet temperature at nominal conditions"; parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal( min=273.15, displayUnit="degC") = 273.15 + 20 "Load side inlet temperature at nominal conditions in heating mode"; parameter Modelica.Units.SI.Temperature T_bLoaHea_nominal( min=273.15, displayUnit="degC") = T_aLoaHea_nominal + 12 "Load side ourtlet temperature at nominal conditions in heating mode"; parameter Modelica.Units.SI.MassFlowRate mLoaHeaUni_flow_nominal(min=0) = QHeaUni_flow_nominal/(T_bLoaHea_nominal - T_aLoaHea_nominal)/ Medium2.specificHeatCapacityCp(Medium2.setState_pTX(Medium2.p_default, T_aLoaHea_nominal)) "Load side mass flow rate at nominal conditions for 1 unit"; final parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal(min=0) = mLoaHeaUni_flow_nominal*facMul "Load side mass flow rate at nominal conditions"; parameter Modelica.Units.SI.HeatFlowRate QHeaUni_flow_nominal(min=0) = 1000 "Design heating heat flow rate (>=0) for 1 unit"; final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal= QHeaUni_flow_nominal*facMul "Design heating heat flow rate (>=0)"; Buildings.Fluid.Sources.MassFlowSource_T supHeaWat( use_m_flow_in=true, redeclare package Medium=Medium1, use_T_in=false, T=T_aHeaWat_nominal, nPorts=1) "Heating water supply"; Buildings.Fluid.Sources.Boundary_pT sinHeaWat( redeclare package Medium=Medium1, p=300000, nPorts=3) "Sink for heating water"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating ter( have_speVar=false, redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, final QHea_flow_nominal=QHea_flow_nominal, final mLoaHea_flow_nominal=mLoaHea_flow_nominal, final T_aHeaWat_nominal=T_aHeaWat_nominal, final T_bHeaWat_nominal=T_bHeaWat_nominal, final T_aLoaHea_nominal=T_aLoaHea_nominal) "Terminal unit with no multiplier"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSet(k=293.15, y( final unit="K", displayUnit="degC")) "Temperature set point"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating terUniMul( have_speVar=false, redeclare package Medium1=Medium1, redeclare package Medium2=Medium2, final QHea_flow_nominal=QHeaUni_flow_nominal, final facMul=facMul, final mLoaHea_flow_nominal=mLoaHeaUni_flow_nominal, final T_aHeaWat_nominal=T_aHeaWat_nominal, final T_bHeaWat_nominal=T_bHeaWat_nominal, final T_aLoaHea_nominal=T_aLoaHea_nominal) "Terminal unit with unit multiplier"; Fluid.Sources.MassFlowSource_T supHeaWat1( use_m_flow_in=true, redeclare package Medium=Medium1, use_T_in=false, T=T_aHeaWat_nominal, nPorts=1) "Heating water supply"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram( height=1.2*QHea_flow_nominal, duration=500) "Required heat flow rate"; Buildings.Experimental.DHC.Loads.BaseClasses.Validation.BaseClasses.FanCoil2PipeHeating terUniMulZonMul( facMulZon=facMul, have_speVar=false, redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, final QHea_flow_nominal=QHeaUni_flow_nominal, final facMul=facMul, final mLoaHea_flow_nominal=mLoaHeaUni_flow_nominal, final T_aHeaWat_nominal=T_aHeaWat_nominal, final T_bHeaWat_nominal=T_bHeaWat_nominal, final T_aLoaHea_nominal=T_aLoaHea_nominal) "Terminal unit with unit multiplier and zone multiplier"; Fluid.Sources.MassFlowSource_T supHeaWat2( use_m_flow_in=true, redeclare package Medium = Medium1, use_T_in=false, T=T_aHeaWat_nominal, nPorts=1) "Heating water supply"; equation connect(ter.mReqHeaWat_flow, supHeaWat.m_flow_in); connect(supHeaWat.ports[1], ter.port_aHeaWat); connect(ter.port_bHeaWat, sinHeaWat.ports[1]); connect(terUniMul.port_bHeaWat,sinHeaWat.ports[2]); connect(supHeaWat1.ports[1],terUniMul.port_aHeaWat); connect(terUniMul.mReqHeaWat_flow,supHeaWat1.m_flow_in); connect(ram.y, ter.QReqHea_flow); connect(ram.y,terUniMul.QReqHea_flow); connect(TSet.y, ter.TSetHea); connect(TSet.y, terUniMul.TSetHea); connect(terUniMulZonMul.port_bHeaWat, sinHeaWat.ports[3]); connect(supHeaWat2.ports[1], terUniMulZonMul.port_aHeaWat); connect(TSet.y, terUniMulZonMul.TSetHea); connect(ram.y, terUniMulZonMul.QReqHea_flow); connect(terUniMulZonMul.mReqHeaWat_flow, supHeaWat2.m_flow_in); end TerminalUnitScaling;