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 |
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,
redeclare replaceable Buildings.Templates.Components.Valves.TwoWayModulating
val(y_start=0)
) ;
Interfaces.Bus bus ;
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,
redeclare replaceable Buildings.Templates.Components.Valves.TwoWayModulating
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 ;
Controls.OBC.CDL.Reals.Sources.Constant TOut(k=coiEva.dat.datCoi.sta[1].nomVal.TConIn_nominal)
;
Controls.OBC.CDL.Reals.Sources.Constant XOut(k=0.015)
;
Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul(
redeclare final package Medium =
MediumAir)
;
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) ;
Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false)
;
Controls.OBC.CDL.Reals.Sources.Constant TAirEnt(k=coiEva.dat.datCoi.sta[1].nomVal.TEvaIn_nominal)
;
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) ;
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 models within
Buildings.Templates.Components.Dampers
by exposing them 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.Dampers.Modulating mod(
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1,
dp_nominal=50)) ;
Interfaces.Bus bus
;
Controls.OBC.CDL.Reals.Sources.Ramp y(height=1,
duration=10) ;
Buildings.Templates.Components.Dampers.PressureIndependent pre(
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1, dp_nominal=50))
;
Interfaces.Bus bus1
;
Buildings.Templates.Components.Dampers.TwoPosition two(
y_start=0,
redeclare final package Medium =
MediumAir,
dat(m_flow_nominal=1, dp_nominal=50)) ;
Interfaces.Bus bus2
;
Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[0,0; 1,1],
timeScale=10,
period=200) ;
Buildings.Templates.Components.Dampers.None non(
redeclare final package Medium =
MediumAir) ;
Fluid.FixedResistances.PressureDrop res(
redeclare final package Medium =
MediumAir,
final m_flow_nominal=mod.dat.m_flow_nominal,
final dp_nominal=mod.dat.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)
;
Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10)
;
Interfaces.Bus bus ;
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], bus.y1);
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);
end Fans;
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 models within
Buildings.Templates.Components.Valves
by exposing them 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=6) ;
Fluid.Sources.Boundary_pT bouLiqLvg(
redeclare final package Medium =
MediumLiq, nPorts=4)
;
Buildings.Templates.Components.Valves.ThreeWayModulating modThr(
redeclare final package Medium =
MediumLiq,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000))
;
Interfaces.Bus bus
;
Controls.OBC.CDL.Reals.Sources.Ramp y(height=1,
duration=10) ;
Buildings.Templates.Components.Valves.ThreeWayTwoPosition twoThr(
redeclare final package Medium =
MediumLiq,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus1
;
Buildings.Templates.Components.Valves.TwoWayModulating modTwo(
redeclare final package Medium =
MediumLiq,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus2
;
Controls.OBC.CDL.Logical.Sources.TimeTable y1(
table=[0,0; 1,1],
timeScale=10,
period=200) ;
Buildings.Templates.Components.Valves.TwoWayTwoPosition twoTwo(
redeclare final package Medium =
MediumLiq,
final energyDynamics=energyDynamics,
dat(
m_flow_nominal=1,
dpValve_nominal=5000,
dpFixed_nominal=5000)) ;
Interfaces.Bus bus3
;
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);
end Valves;