Package with validation models
Information
This package contains validation models for the classes within
Buildings.Templates.Components.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
Coils
|
Validation model for coil components |
Dampers
|
Validation model for damper components |
Fans
|
Validation model for fans components |
PumpMultipleRecord
|
Validation model for parameter propagation with the multiple-pump record |
Pumps
|
Validation model for pump components |
Routing
|
Validation model for routing components |
Sensors
|
Validation model for sensor components |
Valves
|
Validation model for valve components |
Validation model for coil components
Information
This model validates the models within
Buildings.Templates.Components.Coils
by exposing them to a fixed pressure difference on
the air side.
Models representing a water-based coil with valve
are also exposed to a fixed pressure difference on the
water side, and a varying valve opening from fully closed
to fully open position.
Other coil models are controlled with a signal varying
from 0 to 1.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package MediumAir | Buildings.Media.Air | Air medium |
replaceable package MediumLiq | Buildings.Media.Water | HW or CHW medium |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package MediumAir | Air medium |
replaceable package MediumLiq | HW or CHW medium |
Bus | bus | Control bus |
Bus | bus1 | Control bus |
Bus | bus2 | Control bus |
Bus | weaBus | Weather data bus |
Bus | bus3 | Control bus |
Bus | bus4 | Control bus |
Modelica definition
model Coils
extends Modelica.Icons.Example;
replaceable package MediumAir=
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
;
replaceable package MediumLiq=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Fluid.Sources.Boundary_pT bouAirEntCoo(
redeclare final package Medium =
MediumAir,
X={coiCoo.dat.wAirEnt_nominal/(1 + coiCoo.dat.wAirEnt_nominal),1 - coiCoo.dat.wAirEnt_nominal
/(1 + coiCoo.dat.wAirEnt_nominal)},
p=bouAirLvg.p + coiCoo.dat.dpAir_nominal,
T=coiCoo.dat.TAirEnt_nominal,
nPorts=2) ;
Fluid.Sources.Boundary_pT bouChiWatEnt(
redeclare final package Medium =
MediumLiq,
p=bouLiqLvg.p + coiCoo.dat.dpWat_nominal + coiCoo.dat.dpValve_nominal,
T=coiCoo.dat.TWatEnt_nominal,
nPorts=1) ;
Fluid.Sources.Boundary_pT bouLiqLvg(
redeclare final package Medium =
MediumLiq, nPorts=2)
;
Fluid.Sources.Boundary_pT bouAirLvg(
redeclare final package Medium =
MediumAir, nPorts=6) ;
Buildings.Templates.Components.Coils.WaterBasedCooling coiCoo(
redeclare final package MediumAir=
MediumAir,
redeclare final package MediumChiWat=
MediumLiq,
dat(
mAir_flow_nominal=1,
dpAir_nominal=200,
mWat_flow_nominal=1,
dpWat_nominal=2E4,
dpValve_nominal=coiCoo.dat.dpWat_nominal,
cap_nominal=-5E4,
TWatEnt_nominal=280.15,
TAirEnt_nominal=308.15,
wAirEnt_nominal=0.017),
final energyDynamics=energyDynamics,
val(y_start=0)) ;
Interfaces.Bus bus ;
Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1,
duration=10) ;
Buildings.Templates.Components.Coils.WaterBasedHeating coiHea(
redeclare final package MediumAir =
MediumAir,
redeclare final package MediumHeaWat=
MediumLiq,
dat(
mAir_flow_nominal=1,
dpAir_nominal=200,
mWat_flow_nominal=1,
dpWat_nominal=2E4,
dpValve_nominal=coiCoo.dat.dpWat_nominal,
cap_nominal=5E4,
TWatEnt_nominal=323.15,
TAirEnt_nominal=263.15),
final energyDynamics=energyDynamics,
val(y_start=0)) ;
Interfaces.Bus bus1 ;
Fluid.Sources.Boundary_pT bouAirEntHea(
redeclare final package Medium =
MediumAir,
p=bouAirLvg.p + coiHea.dat.dpAir_nominal,
T=coiHea.dat.TAirEnt_nominal,
nPorts=2) ;
Fluid.Sources.Boundary_pT bouHeaWatEnt(
redeclare final package Medium =
MediumLiq,
p=bouLiqLvg.p + coiHea.dat.dpWat_nominal + coiHea.dat.dpValve_nominal,
T=coiHea.dat.TWatEnt_nominal,
nPorts=1) ;
Buildings.Templates.Components.Coils.ElectricHeating coiEle(
redeclare final package MediumAir =
MediumAir,
dat(
mAir_flow_nominal=1,
dpAir_nominal=200,
cap_nominal=5E4),
final energyDynamics=energyDynamics) ;
Interfaces.Bus bus2 ;
Buildings.Templates.Components.Coils.EvaporatorVariableSpeed coiEva(
redeclare final package MediumAir =
MediumAir,
dat(dpAir_nominal=200),
final energyDynamics=energyDynamics) ;
BoundaryConditions.WeatherData.Bus weaBus ;
Interfaces.Bus bus3 ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TOut(
k=coiEva.dat.datCoi.sta[1].nomVal.TConIn_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant XOut(k=0.015)
;
Buildings.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul(
redeclare final
package Medium =
MediumAir) ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant pOut(k=101325)
;
Fluid.Sources.Boundary_pT bouAirEntCoo1(
redeclare final package Medium =
MediumAir,
use_Xi_in=true,
p=bouAirLvg.p + coiEva.dat.dpAir_nominal,
T=coiEva.dat.datCoi.sta[1].nomVal.TEvaIn_nominal,
nPorts=2) ;
Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TAirEnt(k=coiEva.dat.datCoi.sta[
1].nomVal.TEvaIn_nominal) ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant phiAirEnt(k=coiEva.dat.datCoi.sta[
1].nomVal.phiIn_nominal) ;
Buildings.Templates.Components.Coils.EvaporatorMultiStage coiMul(
redeclare final package MediumAir =
MediumAir,
dat(
redeclare Buildings.Fluid.DXSystems.Cooling.AirSource.Data.DoubleSpeed.Lennox_SCA240H4B
datCoi,
dpAir_nominal=200),
final energyDynamics=energyDynamics) ;
Buildings.Controls.OBC.CDL.Integers.Sources.TimeTable y1(
table=[0,0; 1,1; 2,2],
timeScale=50,
period=200) ;
Interfaces.Bus bus4 ;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=coiCoo.dat.mAir_flow_nominal,
final dp_nominal=coiCoo.dat.dpAir_nominal) ;
Buildings.Templates.Components.Coils.None non(
redeclare final package MediumAir =
MediumAir) ;
equation
connect(bouAirEntCoo.ports[1], coiCoo.port_a);
connect(coiCoo.port_b, bouAirLvg.ports[1]);
connect(bouChiWatEnt.ports[1], coiCoo.port_aSou);
connect(bouLiqLvg.ports[1], coiCoo.port_bSou);
connect(y.y, bus.y);
connect(bus, coiCoo.bus);
connect(coiHea.bus, bus1);
connect(y.y, bus1.y);
connect(bouAirEntHea.ports[1], coiHea.port_a);
connect(coiHea.port_b, bouAirLvg.ports[2]);
connect(bouHeaWatEnt.ports[1], coiHea.port_aSou);
connect(coiHea.port_bSou, bouLiqLvg.ports[2]);
connect(bouAirEntHea.ports[2], coiEle.port_a);
connect(coiEle.bus, bus2);
connect(coiEle.port_b, bouAirLvg.ports[3]);
connect(y.y, bus2.y);
connect(coiEva.port_b, bouAirLvg.ports[4]);
connect(bus3, coiEva.bus);
connect(weaBus, coiEva.busWea);
connect(y.y, bus3.y);
connect(TOut.y, weaBus.TDryBul);
connect(TOut.y, wetBul.TDryBul);
connect(pOut.y, wetBul.p);
connect(wetBul.TWetBul, weaBus.TWetBul);
connect(XOut.y, wetBul.Xi[1]);
connect(bouAirEntCoo1.ports[1], coiEva.port_a);
connect(phiAirEnt.y, x_pTphi.phi);
connect(TAirEnt.y, x_pTphi.T);
connect(x_pTphi.X[1], bouAirEntCoo1.Xi_in[1]);
connect(coiMul.port_b, bouAirLvg.ports[5]);
connect(bouAirEntCoo1.ports[2], coiMul.port_a);
connect(weaBus, coiMul.busWea);
connect(y1.y[1], bus4.y);
connect(coiMul.bus, bus4);
connect(res.port_b, non.port_a);
connect(non.port_b, bouAirLvg.ports[6]);
connect(bouAirEntCoo.ports[2], res.port_a);
end Coils;
Validation model for damper components
Information
This model validates the various configurations of the model
Buildings.Templates.Components.Actuators.Damper
by exposing this model to a fixed pressure difference
and a control signal varying from 0 to 1.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package MediumAir | Buildings.Media.Air | Air medium |
Connectors
Type | Name | Description |
replaceable package MediumAir | Air medium |
Bus | bus | Control bus |
Bus | bus1 | Control bus |
Bus | bus2 | Control bus |
Modelica definition
model Dampers
extends Modelica.Icons.Example;
replaceable package MediumAir=
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
;
Fluid.Sources.Boundary_pT bouAirEnt(
redeclare final package Medium =
MediumAir,
p=bouAirLvg.p + mod.dat.dp_nominal,
nPorts=4) ;
Fluid.Sources.Boundary_pT bouAirLvg(
redeclare final package Medium =
MediumAir, nPorts=4)
;
Buildings.Templates.Components.Actuators.Damper mod(
final typ=Buildings.Templates.Components.Types.Damper.Modulating,
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1,
dp_nominal=50))
;
Interfaces.Bus bus
;
Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1,
duration=10) ;
Buildings.Templates.Components.Actuators.Damper pre(
final typ=Buildings.Templates.Components.Types.Damper.PressureIndependent,
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1, dp_nominal=50))
;
Interfaces.Bus bus1
;
Buildings.Templates.Components.Actuators.Damper two(
final typ=Buildings.Templates.Components.Types.Damper.TwoPosition,
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1, dp_nominal=50)) ;
Interfaces.Bus bus2
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[0,0; 1,1],
timeScale=10,
period=200) ;
Buildings.Templates.Components.Actuators.Damper non(
final typ=Buildings.Templates.Components.Types.Damper.None,
redeclare final package Medium =
MediumAir)
;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=mod.m_flow_nominal,
final dp_nominal=mod.dp_nominal) ;
equation
connect(bouAirEnt.ports[1], mod.port_a);
connect(mod.port_b, bouAirLvg.ports[1]);
connect(y.y, bus.y);
connect(bus, mod.bus);
connect(bouAirEnt.ports[2], pre.port_a);
connect(pre.port_b, bouAirLvg.ports[2]);
connect(bus1, pre.bus);
connect(y.y, bus1.y);
connect(bouAirEnt.ports[3], two.port_a);
connect(two.port_b, bouAirLvg.ports[3]);
connect(bus2, two.bus);
connect(y1.y[1], bus2.y1);
connect(non.port_b, bouAirLvg.ports[4]);
connect(bouAirEnt.ports[4], res.port_a);
connect(res.port_b, non.port_a);
end Dampers;
Validation model for fans components
Information
This model validates the models within
Buildings.Templates.Components.Fans
by exposing them to a control signal varying from 0 to 1
and connecting them to an air loop with a fixed flow resistance, which
is sized based on the nominal operating point of the fan model.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package MediumAir | Buildings.Media.Air | Air medium |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package MediumAir | Air medium |
Bus | bus | Control bus |
Bus | bus1 | Control bus |
Bus | bus2 | Control bus |
Modelica definition
model Fans
extends Modelica.Icons.Example;
replaceable package MediumAir=
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Fluid.Sources.Boundary_pT bou(
redeclare final package Medium =
MediumAir,
nPorts=8) ;
Buildings.Templates.Components.Fans.ArrayVariable arr(
redeclare final package Medium=
MediumAir,
have_senFlo=true,
final energyDynamics=energyDynamics,
dat(m_flow_nominal=1, dp_nominal=1000),
nFan=4)
;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium=
MediumAir,
final m_flow_nominal=arr.dat.m_flow_nominal,
final dp_nominal=arr.dat.dp_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10)
;
Interfaces.Bus bus ;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[0,0; 1,1],
timeScale=10,
period=100) ;
Buildings.Templates.Components.Fans.SingleVariable var(
redeclare final package Medium=
MediumAir,
have_senFlo=true,
final energyDynamics=energyDynamics,
dat(m_flow_nominal=1, dp_nominal=1000)) ;
Interfaces.Bus bus1 ;
Buildings.Templates.Components.Fans.SingleConstant cst(
redeclare final package Medium=
MediumAir,
have_senFlo=true,
final energyDynamics=energyDynamics,
dat(m_flow_nominal=1, dp_nominal=1000)) ;
Fluid.FixedResistances.PressureDrop res1(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=cst.dat.m_flow_nominal,
final dp_nominal=cst.dat.dp_nominal)
;
Fluid.FixedResistances.PressureDrop res2(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=var.dat.m_flow_nominal,
final dp_nominal=var.dat.dp_nominal)
;
Interfaces.Bus bus2
;
Buildings.Templates.Components.Fans.None non(
redeclare final package Medium =
MediumAir)
;
Fluid.FixedResistances.PressureDrop res3(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=1,
final dp_nominal=1000)
;
equation
connect(bou.ports[1], arr.port_a);
connect(res.port_b, bou.ports[2]);
connect(arr.port_b, res.port_a);
connect(y.y, bus.y);
connect(bus, arr.bus);
connect(y1.y[1], bus1.y1);
connect(cst.port_b, res1.port_a);
connect(bou.ports[3], cst.port_a);
connect(res1.port_b, bou.ports[4]);
connect(res2.port_b, bou.ports[5]);
connect(bou.ports[6], var.port_a);
connect(var.port_b, res2.port_a);
connect(bus2, var.bus);
connect(bus1, cst.bus);
connect(y.y, bus2.y);
connect(bou.ports[7], non.port_a);
connect(non.port_b, res3.port_a);
connect(res3.port_b, bou.ports[8]);
connect(y1.y[1], bus2.y1);
connect(y1.y[1], bus.y1);
end Fans;
Validation model for parameter propagation with the multiple-pump record
Information
This model validates the parameter propagation within the record class
Buildings.Templates.Components.Data.PumpMultiple.
The instance datDef
illustrates the default pressure curve
assignment based on the design parameters.
The instance datRed
illustrates the modification of the
pressure curve by redeclaring the subrecord per
.
In this case, all elements per[i]
are equal.
The instances datAss
and datPre
illustrate
the modification of the pressure curve by assigning either the whole
subrecord per
or its component per.pressure
.
This allows assigning different pressure curves to the elements per[i]
.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Fluid medium |
MassFlowRate | m_flow_nominal[nPum] | {1,2} | Mass flow rate - Each pump [kg/s] |
PressureDifference | dp_nominal[nPum] | {1,2} .* 1E4 | Total pressure rise - Each pump [Pa] |
PumpMultiple | datDef | datDef(final typ=Buildings.T... | Parameter record - Default bindings for subrecord per |
PumpMultiple | datRed | datRed(final typ=Buildings.T... | Parameter record - Redeclaration of subrecord per |
Stratos80slash1to12 | per1 | | |
Stratos50slash1to12 | per2 | | |
PumpMultiple | datAss | datAss(final typ=Buildings.T... | Parameter record - Assignment of subrecord per |
PumpMultiple | datPre | datPre(final typ=Buildings.T... | Parameter record - Assignment of pressure inside the subrecord per |
Configuration |
Integer | nPum | 2 | Number of pumps |
Connectors
Type | Name | Description |
replaceable package Medium | Fluid medium |
Modelica definition
model PumpMultipleRecord
extends Modelica.Icons.Example;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Integer nPum(
final min=0,
start=1)=2
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[nPum](
each start=1,
each final min=0)={1, 2}
;
final parameter Modelica.Units.SI.VolumeFlowRate V_flow_nominal[nPum]=
m_flow_nominal ./ datDef.rho_default
;
parameter Modelica.Units.SI.PressureDifference dp_nominal[nPum](
each start=0,
each final min=0)={1, 2} .* 1E4
;
parameter Buildings.Templates.Components.Data.PumpMultiple datDef(
final typ=Buildings.Templates.Components.Types.Pump.Multiple,
final nPum=nPum,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dp_nominal)
;
parameter Buildings.Templates.Components.Data.PumpMultiple datRed(
final typ=Buildings.Templates.Components.Types.Pump.Multiple,
final nPum=nPum,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dp_nominal,
redeclare Buildings.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12 per)
;
parameter Buildings.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12 per1;
parameter Buildings.Fluid.Movers.Data.Pumps.Wilo.Stratos50slash1to12 per2;
parameter Buildings.Templates.Components.Data.PumpMultiple datAss(
final typ=Buildings.Templates.Components.Types.Pump.Multiple,
final nPum=nPum,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dp_nominal,
per={per1, per2})
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPre(
final typ=Buildings.Templates.Components.Types.Pump.Multiple,
final nPum=nPum,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dp_nominal,
per(pressure(
V_flow={{0, 2, 4} * m_flow_nominal[i] / datPre.rho_default
for i
in 1:nPum},
dp={{2, 1.5, 0.8} * dp_nominal[i]
for i
in 1:nPum})))
;
end PumpMultipleRecord;
Validation model for pump components
Information
This model validates the models within
Buildings.Templates.Components.Pumps
by connecting each pump component to a water loop with a
fixed flow resistance, which
is sized based on the pump's nominal operating point.
Two identical parallel pumps are modeled with either
one instance of
Buildings.Templates.Components.Pumps.Multiple
or two instances of
Buildings.Templates.Components.Pumps.Single.
The multiple pump component is configured to represent
variable speed pumps with dedicated speed command signals
(component pumMulDed
),
variable speed pumps with common speed command
signal (component pumMul
) or constant speed pumps
(component pumMulCst
).
The single pump components (pum1
and pum2
)
are configured to represent variable speed pumps.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Liquid medium |
PumpSingle | datPum | datPum(final typ=pum1.typ, m... | Single pump parameters |
PumpMultiple | datPumMul | datPumMul(final typ=pumMul.t... | Multiple pump parameters |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package Medium | Liquid medium |
Modelica definition
model Pumps
extends Modelica.Icons.Example;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Data.PumpSingle datPum(
final typ=pum1.typ,
m_flow_nominal=1,
dp_nominal=1E5) ;
parameter Data.PumpMultiple datPumMul(
final typ=pumMul.typ,
final nPum=pumMul.nPum,
m_flow_nominal=
fill(1, datPumMul.nPum),
dp_nominal=
fill(1E5, datPumMul.nPum))
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Buildings.Templates.Components.Pumps.Multiple pumMul(
final energyDynamics=energyDynamics,
redeclare final package Medium=
Medium,
nPum=2,
final dat=datPumMul)
;
Buildings.Templates.Components.Pumps.Single pum1(
final energyDynamics=energyDynamics,
redeclare final package Medium =
Medium,
final dat=datPum) ;
Buildings.Templates.Components.Pumps.Single pum2(
final energyDynamics=energyDynamics,
redeclare final package Medium=
Medium,
final dat=datPum) ;
Fluid.FixedResistances.Junction junInl(
redeclare final package Medium=
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal) * {1,-1,-1},
final dp_nominal=
fill(0,3))
;
Fluid.FixedResistances.Junction junOut(
redeclare final package Medium=
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal) * {1,-1,1},
final dp_nominal=
fill(0,3))
;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
Medium,
final m_flow_nominal=pum1.m_flow_nominal + pum2.m_flow_nominal,
final dp_nominal=pum1.dp_nominal - pum1.dpValChe_nominal)
;
Fluid.FixedResistances.Junction junInl1(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,-1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.Junction junOut1(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.PressureDrop resMul(
redeclare final package Medium =
Medium,
final m_flow_nominal=
sum(pumMul.m_flow_nominal),
final dp_nominal=
max(pumMul.dp_nominal .- pumMul.dpValChe_nominal))
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[
0, 0, 0;
1, 1, 0;
2, 1, 1;
3, 0, 0],
timeScale=100,
period=300) ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant y(k=1) ;
Fluid.Sources.Boundary_pT bou(
redeclare final package Medium=
Medium, nPorts=1)
;
Fluid.Sources.Boundary_pT bou1(
redeclare final package Medium =
Medium,
nPorts=1)
;
Buildings.Templates.Components.Pumps.Multiple pumMulCst(
have_var=false,
final energyDynamics=energyDynamics,
redeclare final package Medium =
Medium,
nPum=2,
final dat=datPumMul) ;
Fluid.FixedResistances.Junction junInl2(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,-1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.Junction junOut2(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.PressureDrop resMulCst(
redeclare final package Medium =
Medium,
final m_flow_nominal=
sum(pumMulCst.m_flow_nominal),
final dp_nominal=
max(pumMulCst.dp_nominal .- pumMulCst.dpValChe_nominal))
;
Fluid.Sources.Boundary_pT bou2(
redeclare final package Medium =
Medium,
nPorts=1)
;
Buildings.Templates.Components.Pumps.Multiple pumMulDed(
have_varCom=false,
final energyDynamics=energyDynamics,
redeclare final package Medium =
Medium,
nPum=2,
final dat=datPumMul)
;
Fluid.FixedResistances.Junction junInl3(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,-1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.Junction junOut3(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=
sum(datPumMul.m_flow_nominal)*{1,-1,1},
final dp_nominal=
fill(0, 3))
;
Fluid.FixedResistances.PressureDrop resMulDed(
redeclare final package Medium =
Medium,
final m_flow_nominal=
sum(pumMulDed.m_flow_nominal),
final dp_nominal=
max(pumMulDed.dp_nominal .- pumMulDed.dpValChe_nominal))
;
Fluid.Sources.Boundary_pT bou3(
redeclare final package Medium =
Medium,
nPorts=1)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yDed[pumMulDed.nPum](
each k
=1) ;
protected
Interfaces.Bus bus ;
Interfaces.Bus bus1 ;
Interfaces.Bus bus2 ;
Interfaces.Bus bus3 ;
Interfaces.Bus bus4 ;
equation
connect(pum1.port_b, junOut.port_1);
connect(junInl.port_2, pum1.port_a);
connect(junInl.port_3, pum2.port_a);
connect(pum2.port_b, junOut.port_3);
connect(junOut.port_2, res.port_a);
connect(res.port_b, junInl.port_1);
connect(junOut1.port_2, resMul.port_a);
connect(junInl1.port_2, pumMul.ports_a[1]);
connect(pumMul.ports_b[1], junOut1.port_1);
connect(pumMul.ports_b[2], junOut1.port_3);
connect(junInl1.port_3, pumMul.ports_a[2]);
connect(resMul.port_b, junInl1.port_1);
connect(bus1, pum2.bus);
connect(y1.y[2], bus1.y1);
connect(y.y, bus1.y);
connect(y1.y[1], bus.y1);
connect(y.y, bus.y);
connect(bus, pum1.bus);
connect(bus2, pumMul.bus);
connect(y1.y[1:2], bus2.y1);
connect(y.y, bus2.y);
connect(bou.ports[1], junInl.port_1);
connect(bou1.ports[1], junInl1.port_1);
connect(junOut2.port_2, resMulCst.port_a);
connect(junInl2.port_2, pumMulCst.ports_a[1]);
connect(pumMulCst.ports_b[1], junOut2.port_1);
connect(pumMulCst.ports_b[2], junOut2.port_3);
connect(junInl2.port_3, pumMulCst.ports_a[2]);
connect(resMulCst.port_b, junInl2.port_1);
connect(bus3, pumMulCst.bus);
connect(bou2.ports[1],junInl2. port_1);
connect(y1.y[1:2], bus3.y1);
connect(junOut3.port_2, resMulDed.port_a);
connect(junInl3.port_2, pumMulDed.ports_a[1]);
connect(pumMulDed.ports_b[1], junOut3.port_1);
connect(pumMulDed.ports_b[2], junOut3.port_3);
connect(junInl3.port_3, pumMulDed.ports_a[2]);
connect(resMulDed.port_b, junInl3.port_1);
connect(bus4, pumMulDed.bus);
connect(bou3.ports[1],junInl3. port_1);
connect(y1.y, bus4.y1);
connect(yDed.y, bus4.y);
end Pumps;
Validation model for routing components
Information
This model validates the models within
Buildings.Templates.Components.Routing
by exposing them to a fixed pressure difference.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package Medium | Medium |
Modelica definition
model Routing
extends Modelica.Icons.Example;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Fluid.Sources.Boundary_pT bouLiqEnt(
redeclare final package Medium =
Medium,
p=bouLiqLvg.p +
min(res.dp_nominal),
nPorts=3) ;
Fluid.Sources.Boundary_pT bouLiqLvg(
redeclare final package Medium =
Medium,
nPorts=3)
;
Fluid.FixedResistances.PressureDrop res[3](
redeclare final package Medium =
Medium,
each m_flow_nominal=1,
each dp_nominal=1000) ;
Buildings.Templates.Components.Routing.MultipleToMultiple mulMul(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
nPorts_a=3,
m_flow_nominal=3) ;
Fluid.Sources.Boundary_pT bouLiqEnt1(
redeclare final package Medium =
Medium,
p=bouLiqLvg.p +
min(res1.dp_nominal) +
min(res2.dp_nominal),
nPorts=3) ;
Fluid.Sources.Boundary_pT bouLiqLvg1(
redeclare final package Medium =
Medium,
nPorts=3)
;
Fluid.FixedResistances.PressureDrop res1
[3](
redeclare final package Medium =
Medium,
each m_flow_nominal=1,
each dp_nominal=1000) ;
Buildings.Templates.Components.Routing.MultipleToMultiple mulMulCom(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
nPorts_a=3,
have_comLeg=true,
m_flow_nominal=3) ;
Fluid.FixedResistances.PressureDrop res2[3](
redeclare final package Medium =
Medium,
each m_flow_nominal=1,
each dp_nominal=1000) ;
Fluid.Sources.Boundary_pT bouLiqEnt2(
redeclare final package Medium =
Medium,
p=bouLiqLvg.p +
min(res3.dp_nominal),
nPorts=3) ;
Fluid.Sources.Boundary_pT bouLiqLvg2(
redeclare final package Medium =
Medium,
nPorts=1)
;
Fluid.FixedResistances.PressureDrop res3
[3](
redeclare final package Medium =
Medium,
each m_flow_nominal=1,
each dp_nominal=1000) ;
Buildings.Templates.Components.Routing.MultipleToSingle mulSin(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
nPorts=3,
m_flow_nominal=3) ;
Fluid.Sources.Boundary_pT bouLiqEnt3(
redeclare final package Medium =
Medium,
p=bouLiqLvg.p +
min(res5.dp_nominal),
nPorts=1) ;
Fluid.Sources.Boundary_pT bouLiqLvg3(
redeclare final package Medium =
Medium,
nPorts=3)
;
Buildings.Templates.Components.Routing.SingleToMultiple sinMul(
redeclare final package Medium =
Medium,
final energyDynamics=energyDynamics,
nPorts=3,
m_flow_nominal=3) ;
Fluid.FixedResistances.PressureDrop res5[3](
redeclare final package Medium =
Medium,
each m_flow_nominal=1,
each dp_nominal=1000) ;
Fluid.Sources.Boundary_pT bouLiqEnt4(
redeclare final package Medium =
Medium,
p=bouLiqLvg.p + res4.dp_nominal,
nPorts=1) ;
Fluid.Sources.Boundary_pT bouLiqLvg4(
redeclare final package Medium =
Medium,
nPorts=1)
;
Buildings.Templates.Components.Routing.PassThroughFluid pas(
redeclare final
package Medium =
Medium) ;
Fluid.FixedResistances.PressureDrop res4(
redeclare final package Medium =
Medium,
m_flow_nominal=1,
dp_nominal=1000) ;
equation
connect(res.port_b, mulMul.ports_a);
connect(mulMul.ports_b, bouLiqLvg.ports);
connect(bouLiqEnt.ports, res.port_a);
connect(res1.port_b, mulMulCom.ports_a);
connect(bouLiqEnt1.ports, res1.port_a);
connect(mulMulCom.ports_b, res2.port_a);
connect(res2.port_b, bouLiqLvg1.ports);
connect(res3.port_b, mulSin.ports_a);
connect(bouLiqEnt2.ports,res3. port_a);
connect(mulSin.port_b, bouLiqLvg2.ports[1]);
connect(bouLiqEnt3.ports[1], sinMul.port_a);
connect(sinMul.ports_b, res5.port_a);
connect(res5.port_b, bouLiqLvg3.ports);
connect(pas.port_b, bouLiqLvg4.ports[1]);
connect(bouLiqEnt4.ports[1], res4.port_a);
connect(res4.port_b, pas.port_a);
end Routing;
Validation model for sensor components
Information
This model validates the models within
Buildings.Templates.Components.Sensors.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package MediumAir | Buildings.Media.Air | Air medium |
Connectors
Type | Name | Description |
replaceable package MediumAir | Air medium |
Modelica definition
model Sensors
extends Modelica.Icons.Example;
replaceable package MediumAir=
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
;
Fluid.Sources.Boundary_pT bouAirEnt(
redeclare final package Medium =
MediumAir,
p=bouAirLvg.p + res.dp_nominal,
nPorts=6) ;
Fluid.Sources.Boundary_pT bouAirLvg(
redeclare final package Medium =
MediumAir, nPorts=6) ;
Buildings.Templates.Components.Sensors.HumidityRatio hum(
redeclare final
package Medium =
MediumAir, m_flow_nominal=1) ;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=1,
final dp_nominal=100) ;
Fluid.FixedResistances.PressureDrop res1(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=1,
final dp_nominal=100) ;
Buildings.Templates.Components.Sensors.SpecificEnthalpy ent(
redeclare final
package Medium =
MediumAir, m_flow_nominal=1) ;
Buildings.Templates.Components.Sensors.DifferentialPressure dp(
redeclare
final package Medium =
MediumAir) ;
Fluid.FixedResistances.PressureDrop res2(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=1,
final dp_nominal=100) ;
Buildings.Templates.Components.Sensors.Temperature tem(
redeclare final
package Medium =
MediumAir, m_flow_nominal=1) ;
Buildings.Templates.Components.Sensors.VolumeFlowRate vol(
redeclare final
package Medium =
MediumAir, m_flow_nominal=1,
typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.AFMS) ;
Fluid.FixedResistances.PressureDrop res3(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=1,
final dp_nominal=100) ;
Buildings.Templates.Components.Sensors.DifferentialPressure noDp(
redeclare
final package Medium =
MediumAir, have_sen=false)
;
equation
connect(bouAirEnt.ports[1], res.port_a);
connect(res.port_b, hum.port_a);
connect(hum.port_b, bouAirLvg.ports[1]);
connect(res1.port_b, ent.port_a);
connect(ent.port_b, bouAirLvg.ports[2]);
connect(bouAirEnt.ports[2], res1.port_a);
connect(bouAirEnt.ports[3], dp.port_a);
connect(dp.port_b, bouAirLvg.ports[3]);
connect(res2.port_b, tem.port_a);
connect(res3.port_b, vol.port_a);
connect(tem.port_b, bouAirLvg.ports[4]);
connect(vol.port_b, bouAirLvg.ports[5]);
connect(bouAirEnt.ports[4], res2.port_a);
connect(bouAirEnt.ports[5], res3.port_a);
connect(bouAirEnt.ports[6], noDp.port_a);
connect(noDp.port_b, bouAirLvg.ports[6]);
end Sensors;
Validation model for valve components
Information
This model validates the various configurations of the model
Buildings.Templates.Components.Actuators.Valve
by exposing this model to a fixed pressure difference
and a control signal varying from 0 to 1.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package MediumLiq | Buildings.Media.Water | Liquid medium |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package MediumLiq | Liquid medium |
Bus | bus | Control bus |
Bus | bus1 | Control bus |
Bus | bus2 | Control bus |
Bus | bus3 | Control bus |
Modelica definition
model Valves
extends Modelica.Icons.Example;
replaceable package MediumLiq=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.FixedInitial
;
Fluid.Sources.Boundary_pT bouLiqEnt(
redeclare final package Medium =
MediumLiq,
p=bouLiqLvg.p + modThr.dat.dpValve_nominal + modThr.dat.dpFixed_nominal,
nPorts=7) ;
Fluid.Sources.Boundary_pT bouLiqLvg(
redeclare final package Medium =
MediumLiq, nPorts=5)
;
Actuators.Valve modThr(
redeclare final package Medium =
MediumLiq,
typ=Buildings.Templates.Components.Types.Valve.ThreeWayModulating,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000))
;
Interfaces.Bus bus
;
Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10)
;
Actuators.Valve twoThr(
redeclare final package Medium =
MediumLiq,
typ=Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus1
;
Actuators.Valve modTwo(
redeclare final package Medium =
MediumLiq,
typ=Buildings.Templates.Components.Types.Valve.TwoWayModulating,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus2
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[0,0; 1,1],
timeScale=10,
period=200) ;
Actuators.Valve twoTwo(
redeclare final package Medium =
MediumLiq,
typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus3
;
Actuators.Valve non(
redeclare final package Medium =
MediumLiq,
typ=Buildings.Templates.Components.Types.Valve.None)
;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
MediumLiq,
final m_flow_nominal=modTwo.m_flow_nominal,
final dp_nominal=modTwo.dpValve_nominal + modTwo.dpFixed_nominal)
;
equation
connect(bouLiqEnt.ports[1], modThr.port_a);
connect(modThr.port_b,bouLiqLvg. ports[1]);
connect(y.y, bus.y);
connect(bus, modThr.bus);
connect(bouLiqEnt.ports[3], twoThr.port_a);
connect(twoThr.port_b, bouLiqLvg.ports[2]);
connect(bus1, twoThr.bus);
connect(bouLiqEnt.ports[2], modTwo.port_a);
connect(modTwo.port_b, bouLiqLvg.ports[3]);
connect(bus2, modTwo.bus);
connect(y.y, bus2.y);
connect(y1.y[1], bus1.y1);
connect(bus3, twoTwo.bus);
connect(y1.y[1],bus3. y1);
connect(bouLiqEnt.ports[4], twoTwo.port_a);
connect(twoTwo.port_b, bouLiqLvg.ports[4]);
connect(bouLiqEnt.ports[5], modThr.portByp_a);
connect(bouLiqEnt.ports[6], twoThr.portByp_a);
connect(non.port_b, bouLiqLvg.ports[5]);
connect(bouLiqEnt.ports[7], res.port_a);
connect(res.port_b, non.port_a);
end Valves;