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 |
BenchmarkFlowDistribution1
|
Performance benchmark of building heating water flow distribution modeling |
BenchmarkFlowDistribution2
|
Performance benchmark of building heating water flow distribution modeling |
BuildingWithETS
|
Validation of the base class PartialBuildingWithPartialETS |
FlowDistributionPumpControl
|
Validation of the pump head computation in FlowDistribution |
GetPeakLoad
|
Model that validates the getPeakLoad function |
SimpleRoomODE
|
Validation of the model SimpleRoomODE |
TerminalUnitScaling
|
Validation of the scaling factor of the terminal unit model |
BaseClasses
|
Package with base classes |
Performance benchmark of building heating water flow distribution modeling
Information
This model is part of a computational performance benchmark between
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
String | filNam | "modelica://Buildings/Resour... | File name with thermal loads as time series |
Integer | nLoa | 5 | Number of served loads |
PressureDifference | dp_nominal | nLoa*1500*2 + 2*500 + 30000 | Nominal pressure drop in the distribution line [Pa] |
Nominal condition |
Temperature | T_aHeaWat_nominal | 273.15 + 40 | Heating water inlet temperature at nominal conditions [K] |
Temperature | T_bHeaWat_nominal | T_aHeaWat_nominal - 5 | Heating water outlet temperature at nominal conditions [K] |
Temperature | T_aLoaHea_nominal | 273.15 + 20 | Load side inlet temperature at nominal conditions in heating mode [K] |
MassFlowRate | mLoaHea_flow_nominal | 1 | Load side mass flow rate at nominal conditions in heating mode [kg/s] |
Scaling |
Real | facMul | 10 | Mulitplier factor for terminal units |
Modelica definition
model BenchmarkFlowDistribution1
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
package Medium2=
Buildings.Media.Air
;
parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos"
;
parameter Integer nLoa=5
;
parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal(
min=273.15,
displayUnit="degC") = 273.15 + 40
;
parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC") = T_aHeaWat_nominal - 5
;
parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal(
min=273.15,
displayUnit="degC") = 273.15 + 20
;
parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal(min=0) = 1
;
parameter Modelica.Units.SI.PressureDifference dp_nominal=nLoa*1500*2 + 2*500
+ 30000 ;
parameter Real facMul=10
;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=
sum(ter.mHeaWat_flow_nominal)
*facMul ;
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 ;
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)
;
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)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet(
k=293.15,
y(
final unit="K",
displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1(
nout=nLoa)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
p=300000,
nPorts=1)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup(
k=
max(
ter.T_aHeaWat_nominal))
;
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;
Performance benchmark of building heating water flow distribution modeling
Information
This model is part of a computational performance benchmark between
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
String | filNam | "modelica://Buildings/Resour... | File name with thermal loads as time series |
Integer | nLoa | 5 | Number of served loads |
Nominal condition |
Temperature | T_aHeaWat_nominal | 273.15 + 40 | Heating water inlet temperature at nominal conditions [K] |
Temperature | T_bHeaWat_nominal | T_aHeaWat_nominal - 5 | Heating water outlet temperature at nominal conditions [K] |
Temperature | T_aLoaHea_nominal | 273.15 + 20 | Load side inlet temperature at nominal conditions in heating mode [K] |
MassFlowRate | mLoaHea_flow_nominal | 1 | Load side mass flow rate at nominal conditions in heating mode [kg/s] |
Scaling |
Real | facMul | 10 | Mulitplier factor for terminal units |
Dynamics |
Nominal condition |
Time | tau | 120 | Time constant of fluid temperature variation at nominal flow rate [s] |
Modelica definition
model BenchmarkFlowDistribution2
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
package Medium2=
Buildings.Media.Air
;
parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos"
;
parameter Integer nLoa=5
;
parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal=273.15 + 40
;
parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC") = T_aHeaWat_nominal - 5
;
parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal=273.15 + 20
;
parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal=1
;
parameter Modelica.Units.SI.Time tau=120
;
parameter Real facMul=10
;
final parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nLoa]=ter.mHeaWat_flow_nominal
*facMul ;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=
sum(
mCon_flow_nominal) ;
final parameter Modelica.Units.SI.PressureDifference dp_nominal=
sum(dis.con.pipDisSup.dp_nominal)
+
sum(dis.con.pipDisRet.dp_nominal) +
max(ter.dpSou_nominal)
;
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
;
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)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet(
k=293.15,
y(
final unit="K",
displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1(
nout=nLoa)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=2)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dpPum(
k=dp_nominal)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup(
k=
max(
ter.T_aHeaWat_nominal))
;
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)
;
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;
Validation of the base class PartialBuildingWithPartialETS
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
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | 1 | Nominal mass flow rate [kg/s] |
HeatFlowRate | QHeaWat_flow_nominal | 1E4 | Nominal mass flow rate [W] |
HeatFlowRate | QChiWat_flow_nominal | -1E4 | Nominal mass flow rate [W] |
Modelica definition
model BuildingWithETS
extends Modelica.Icons.Example;
import TypDisSys=
Buildings.Experimental.DHC.Types.DistrictSystemType
;
package MediumW=
Buildings.Media.Water
;
package MediumS=
Modelica.Media.Water.WaterIF97_ph (
h_default=2770E3)
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1
;
parameter Modelica.Units.SI.HeatFlowRate QHeaWat_flow_nominal=1E4
;
parameter Modelica.Units.SI.HeatFlowRate QChiWat_flow_nominal=-1E4
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup(
redeclare final package Medium=MediumS,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet(
redeclare final package Medium=MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo(
redeclare final package Medium1=MediumS,
redeclare final package Medium2=MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup1(
redeclare final package Medium=MediumS,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet1(
redeclare final package Medium=MediumW,
nPorts=1)
;
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)
;
Fluid.Sources.MassFlowSource_T souDisSup2(
redeclare final package Medium=MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet2(
redeclare final package Medium=MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo2(
redeclare final package Medium1=MediumW,
final m_flow_nominal=m_flow_nominal)
;
Fluid.Sources.MassFlowSource_T souDisSup3(
redeclare final package Medium=MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet3(
redeclare final package Medium=MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo3(
redeclare final package Medium1=MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup5(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet5(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo5(
redeclare final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
Fluid.Sources.MassFlowSource_T souDisSup6(
redeclare final package Medium =MediumW,
m_flow=m_flow_nominal, nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet6(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo6(
redeclare final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup7(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet7(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo7(
redeclare final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
Fluid.Sources.MassFlowSource_T souDisSup4(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet4(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo4(
redeclare
final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup8(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet8(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo8(
redeclare
final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup9(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet9(
redeclare final package Medium = MediumW,
nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo9(
redeclare
final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
Fluid.Sources.MassFlowSource_T souDisSup10(
redeclare final package Medium = MediumW,
m_flow=m_flow_nominal,
nPorts=1)
;
Fluid.Sources.Boundary_pT sinDisRet10(
redeclare final package Medium =
MediumW, nPorts=1)
;
Buildings.Experimental.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate senDifEntFlo10(
redeclare
final package Medium1 = MediumW,
final m_flow_nominal=m_flow_nominal)
;
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))
;
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;
Validation of the pump head computation in FlowDistribution
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
Type | Name | Default | Description |
String | filNam | "modelica://Buildings/Resour... | File name with thermal loads as time series |
Integer | nLoa | 5 | Number of served loads |
PressureDifference | dpDis_nominal[nLoa] | 1/2 .* cat(1, {dp_nominal*0.... | Pressure drop between each connected unit at nominal conditions (supply line) [Pa] |
PressureDifference | dpSet | max(terUniHea.dpSou_nominal) | Pressure difference set point [Pa] |
Scaling |
Real | facMul | 10 | Scaling factor for terminal units |
Nominal condition |
MassFlowRate | mLoaHea_flow_nominal | 1 | Load side mass flow rate at nominal conditions in heating mode [kg/s] |
Temperature | T_aHeaWat_nominal | 273.15 + 40 | Heating water inlet temperature at nominal conditions [K] |
Temperature | T_bHeaWat_nominal | T_aHeaWat_nominal - 5 | Heating water outlet temperature at nominal conditions [K] |
Temperature | T_aLoaHea_nominal | 273.15 + 20 | Load side inlet temperature at nominal conditions in heating mode [K] |
Dynamics |
Nominal condition |
Time | tau | 120 | Time constant of fluid temperature variation at nominal flow rate [s] |
Modelica definition
model FlowDistributionPumpControl
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
package Medium2=
Buildings.Media.Air
;
parameter String filNam="modelica://Buildings/Resources/Data/Experimental/DHC/Loads/Examples/SwissResidential_20190916.mos"
;
parameter Integer nLoa=5
;
parameter Real facMul=10
;
parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal=1
;
parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal=273.15 + 40
;
parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC") = T_aHeaWat_nominal - 5
;
parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal=273.15 + 20
;
parameter Modelica.Units.SI.Time tau=120
;
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))
;
parameter Modelica.Units.SI.PressureDifference dpSet=
max(terUniHea.dpSou_nominal)
;
final parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal[nLoa]=
terUniHea.mHeaWat_flow_nominal*facMul
;
final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=
sum(
mCon_flow_nominal) ;
final parameter Modelica.Units.SI.PressureDifference dp_nominal=
max(terUniHea.dpSou_nominal)
+ 2*nLoa*5000 ;
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
;
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)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTSet(
k=20+273.15,
y(
final unit="K",
displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaRep1(
nout=nLoa)
;
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)
;
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)
;
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)
;
Fluid.Sources.Boundary_pT supHeaWat1(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=3)
;
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)
;
Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
p=300000,
nPorts=3)
;
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)
;
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)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one1(
k=1)
;
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)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant THeaWatSup(
k=T_aHeaWat_nominal)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=2)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant setDp(
k=dpSet)
;
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)
;
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;
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
Type | Name | Default | Description |
HeatFlowRate | QCoo_flow | Buildings.Experimental.DHC.L... | Peak heat flow rate [W] |
HeatFlowRate | QHea_flow | Buildings.Experimental.DHC.L... | Peak heat flow rate [W] |
HeatFlowRate | QWatHea_flow | Buildings.Experimental.DHC.L... | Peak water heating flow rate [W] |
Modelica definition
model GetPeakLoad
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"))
;
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"))
;
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"))
;
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;
Validation of the model 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
Type | Name | Default | Description |
Time | tau | 1800 | Time constant of the indoor temperature [s] |
Nominal condition |
HeatFlowRate | QHea_flow_nominal | 112000 | Design heating heat flow rate (for TInd=TIndHea_nominal, TOut=TOutHea_nominal,
with no internal gains, no solar radiation) [W] |
HeatFlowRate | QCoo_flow_nominal | -200000 | Design cooling heat flow rate [W] |
Modelica definition
model SimpleRoomODE
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
package Medium2=
Buildings.Media.Air
;
parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal=112000 ;
parameter Modelica.Units.SI.HeatFlowRate QCoo_flow_nominal=-200000
;
parameter Modelica.Units.SI.Time tau=1800
;
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office
romHeaMet
;
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"))
;
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"))
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai(k=
QHea_flow_nominal) ;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow
;
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office
romHeaUnm
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai1(k=0.7)
;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow1
;
Buildings.Experimental.DHC.Loads.BaseClasses.SimpleRoomODE rooOdeHea(
TOutHea_nominal=273.15,
TIndHea_nominal=293.15,
QHea_flow_nominal=QHea_flow_nominal,
tau=tau)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant maxTSet(
k=297.15,
y(
final unit="K",
displayUnit="degC"))
;
Buildings.Controls.Continuous.LimPID conCoo(
controllerType=Modelica.Blocks.Types.SimpleController.PI,
Ti=10,
reverseActing=false)
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai2(k=
QCoo_flow_nominal) ;
Buildings.Experimental.DHC.Loads.BaseClasses.SimpleRoomODE rooOdeCoo(
TOutHea_nominal=273.15,
TIndHea_nominal=293.15,
QHea_flow_nominal=QHea_flow_nominal,
tau=tau)
;
Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter gai3(k=0.8)
;
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"))
;
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office
romCooMet
;
Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office
romCooUnm
;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow2
;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow3
;
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;
Validation of the scaling factor of the terminal unit model
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
Type | Name | Default | Description |
Real | facMul | 2 | Multiplier factor |
Nominal condition |
Temperature | T_aHeaWat_nominal | 273.15 + 40 | Heating water inlet temperature at nominal conditions [K] |
Temperature | T_bHeaWat_nominal | T_aHeaWat_nominal - 5 | Heating water outlet temperature at nominal conditions [K] |
Temperature | T_aLoaHea_nominal | 273.15 + 20 | Load side inlet temperature at nominal conditions in heating mode [K] |
Temperature | T_bLoaHea_nominal | T_aLoaHea_nominal + 12 | Load side ourtlet temperature at nominal conditions in heating mode [K] |
MassFlowRate | mLoaHeaUni_flow_nominal | QHeaUni_flow_nominal/(T_bLoa... | Load side mass flow rate at nominal conditions for 1 unit [kg/s] |
HeatFlowRate | QHeaUni_flow_nominal | 1000 | Design heating heat flow rate (>=0) for 1 unit [W] |
Modelica definition
model TerminalUnitScaling
extends Modelica.Icons.Example;
package Medium1=
Buildings.Media.Water
;
package Medium2=
Buildings.Media.Air
;
parameter Real facMul=2
;
parameter Modelica.Units.SI.Temperature T_aHeaWat_nominal(
min=273.15,
displayUnit="degC") = 273.15 + 40
;
parameter Modelica.Units.SI.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC") = T_aHeaWat_nominal - 5
;
parameter Modelica.Units.SI.Temperature T_aLoaHea_nominal(
min=273.15,
displayUnit="degC") = 273.15 + 20
;
parameter Modelica.Units.SI.Temperature T_bLoaHea_nominal(
min=273.15,
displayUnit="degC") = T_aLoaHea_nominal + 12
;
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))
;
final parameter Modelica.Units.SI.MassFlowRate mLoaHea_flow_nominal(min=0) =
mLoaHeaUni_flow_nominal*facMul
;
parameter Modelica.Units.SI.HeatFlowRate QHeaUni_flow_nominal(min=0) = 1000
;
final parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal=
QHeaUni_flow_nominal*facMul ;
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)
;
Buildings.Fluid.Sources.Boundary_pT sinHeaWat(
redeclare package Medium=Medium1,
p=300000,
nPorts=3)
;
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)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSet(k=293.15, y(
final unit="K", displayUnit="degC")) ;
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)
;
Fluid.Sources.MassFlowSource_T supHeaWat1(
use_m_flow_in=true,
redeclare package Medium=Medium1,
use_T_in=false,
T=T_aHeaWat_nominal,
nPorts=1)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram(
height=1.2*QHea_flow_nominal,
duration=500)
;
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)
;
Fluid.Sources.MassFlowSource_T supHeaWat2(
use_m_flow_in=true,
redeclare package Medium = Medium1,
use_T_in=false,
T=T_aHeaWat_nominal,
nPorts=1)
;
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;