Collection of validation models
Information
This package contains validation models for the classes in
Buildings.Experimental.DHC.Loads.
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 |
FlowDistributionPumpControl
|
Validation of the pump head computation in FlowDistribution |
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.SIunits.Temperature T_aHeaWat_nominal(
min=273.15,
displayUnit="degC")=273.15+40
;
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC")=T_aHeaWat_nominal-5
;
parameter Modelica.SIunits.Temperature T_aLoaHea_nominal(
min=273.15,
displayUnit="degC")=273.15+20
;
parameter Modelica.SIunits.MassFlowRate mLoaHea_flow_nominal(
min=0)=1
;
parameter Modelica.SIunits.PressureDifference dp_nominal=nLoa*1500*2+2*500+30000
;
parameter Real facMul=10
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal=
sum(
ter.mHeaWat_flow_nominal)*facMul
;
final parameter Modelica.SIunits.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.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)
;
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.RealReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealReplicator 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.SIunits.Temperature T_aHeaWat_nominal=273.15+40
;
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC")=T_aHeaWat_nominal-5
;
parameter Modelica.SIunits.Temperature T_aLoaHea_nominal=273.15+20
;
parameter Modelica.SIunits.MassFlowRate mLoaHea_flow_nominal=1
;
parameter Modelica.SIunits.Time tau=120
;
parameter Real facMul=10
;
final parameter Modelica.SIunits.MassFlowRate mCon_flow_nominal[nLoa]=ter.mHeaWat_flow_nominal*facMul
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal=
sum(
mCon_flow_nominal)
;
final parameter Modelica.SIunits.PressureDifference dp_nominal=
sum(
dis.con.pipDisSup.dp_nominal)+
sum(
dis.con.pipDisRet.dp_nominal)+
max(
ter.dpSou_nominal)
;
final parameter Modelica.SIunits.HeatFlowRate QHea_flow_nominal=
Loads.BaseClasses.getPeakLoad(
string="#Peak space heating load",
filNam=
Modelica.Utilities.Files.loadResource(filNam))/facMul
;
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.RealReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep1(
nout=nLoa)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare package Medium=Medium1,
use_T_in=true,
nPorts=2)
;
BaseClasses.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.SIunits.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 pump head computation in FlowDistribution
Information
This model validates the pump head computation algorithm implemented in
Buildings.Experimental.DHC.Loads.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.SIunits.MassFlowRate mLoaHea_flow_nominal=1
;
parameter Modelica.SIunits.Temperature T_aHeaWat_nominal=273.15+40
;
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC")=T_aHeaWat_nominal-5
;
parameter Modelica.SIunits.Temperature T_aLoaHea_nominal=273.15+20
;
parameter Modelica.SIunits.Time tau=120
;
parameter Modelica.SIunits.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.SIunits.PressureDifference dpSet=
max(
terUniHea.dpSou_nominal)
;
final parameter Modelica.SIunits.MassFlowRate mCon_flow_nominal[nLoa]=
terUniHea.mHeaWat_flow_nominal*facMul
;
final parameter Modelica.SIunits.MassFlowRate m_flow_nominal=
sum(
mCon_flow_nominal)
;
final parameter Modelica.SIunits.PressureDifference dp_nominal=
max(
terUniHea.dpSou_nominal)+2*nLoa*5000
;
final parameter Modelica.SIunits.HeatFlowRate QHea_flow_nominal=
Loads.BaseClasses.getPeakLoad(
string="#Peak space heating load",
filNam=
Modelica.Utilities.Files.loadResource(filNam))/facMul
;
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.RealReplicator reaRep(
nout=nLoa)
;
Buildings.Controls.OBC.CDL.Routing.RealReplicator reaRep1(
nout=nLoa)
;
BaseClasses.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.FlowDistribution disCstDp(
redeclare package Medium=Medium1,
m_flow_nominal=m_flow_nominal,
have_pum=true,
typCtr=Buildings.Experimental.DHC.Loads.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)
;
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)
;
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.FlowDistribution disCstSpe(
redeclare package Medium=Medium1,
m_flow_nominal=m_flow_nominal,
have_pum=true,
typCtr=Buildings.Experimental.DHC.Loads.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.SIunits.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;
Validation of the model SimpleRoomODE
Information
This example validates
Buildings.Experimental.DHC.Loads.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.SIunits.HeatFlowRate QHea_flow_nominal=112000
;
parameter Modelica.SIunits.HeatFlowRate QCoo_flow_nominal=-200000
;
parameter Modelica.SIunits.Time tau=1800
;
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.Gain gai(
k=QHea_flow_nominal)
;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow
;
Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office romHeaUnm
;
Buildings.Controls.OBC.CDL.Continuous.Gain gai1(
k=0.7)
;
HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlow1
;
Buildings.Experimental.DHC.Loads.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.Gain gai2(
k=QCoo_flow_nominal)
;
Buildings.Experimental.DHC.Loads.SimpleRoomODE rooOdeCoo(
TOutHea_nominal=273.15,
TIndHea_nominal=293.15,
QHea_flow_nominal=QHea_flow_nominal,
tau=tau)
;
Buildings.Controls.OBC.CDL.Continuous.Gain 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"))
;
Examples.BaseClasses.GeojsonExportRC.OfficeBuilding.Office romCooMet
;
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.SIunits.Temperature T_aHeaWat_nominal(
min=273.15,
displayUnit="degC")=273.15+40
;
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
min=273.15,
displayUnit="degC")=T_aHeaWat_nominal-5
;
parameter Modelica.SIunits.Temperature T_aLoaHea_nominal(
min=273.15,
displayUnit="degC")=273.15+20
;
parameter Modelica.SIunits.Temperature T_bLoaHea_nominal(
min=273.15,
displayUnit="degC")=T_aLoaHea_nominal+12
;
parameter Modelica.SIunits.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.SIunits.MassFlowRate mLoaHea_flow_nominal(
min=0)=mLoaHeaUni_flow_nominal*facMul
;
parameter Modelica.SIunits.HeatFlowRate QHeaUni_flow_nominal(
min=0)=1000
;
final parameter Modelica.SIunits.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)
;
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")) ;
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)
;
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;