Buildings.Templates.Components.Validation

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
Buildings.Templates.Components.Validation.Coils Coils Validation model for coil components
Buildings.Templates.Components.Validation.Dampers Dampers Validation model for damper components
Buildings.Templates.Components.Validation.Fans Fans Validation model for fans components
Buildings.Templates.Components.Validation.PumpMultipleRecord PumpMultipleRecord Validation model for parameter propagation with the multiple-pump record
Buildings.Templates.Components.Validation.Pumps Pumps Validation model for pump components
Buildings.Templates.Components.Validation.Routing Routing Validation model for routing components
Buildings.Templates.Components.Validation.Sensors Sensors Validation model for sensor components
Buildings.Templates.Components.Validation.Valves Valves Validation model for valve components

Buildings.Templates.Components.Validation.Coils Buildings.Templates.Components.Validation.Coils

Validation model for coil components

Buildings.Templates.Components.Validation.Coils

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

TypeNameDefaultDescription
replaceable package MediumAirBuildings.Media.AirAir medium
replaceable package MediumLiqBuildings.Media.WaterHW or CHW medium
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumAirAir medium
replaceable package MediumLiqHW or CHW medium
BusbusControl bus
Busbus1Control bus
Busbus2Control bus
BusweaBusWeather data bus
Busbus3Control bus
Busbus4Control bus

Modelica definition

model Coils "Validation model for coil components" extends Modelica.Icons.Example; replaceable package MediumAir=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; replaceable package MediumLiq=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "HW or CHW medium"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; 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) "Boundary conditions for entering air"; 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) "Boundary conditions for entering CHW"; Fluid.Sources.Boundary_pT bouLiqLvg( redeclare final package Medium =MediumLiq, nPorts=2) "Boundary conditions for leaving liquid"; Fluid.Sources.Boundary_pT bouAirLvg( redeclare final package Medium =MediumAir, nPorts=6) "Boundary conditions for leaving air"; 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)) "Water-based cooling coil"; Interfaces.Bus bus "Control bus"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Coil/valve control signal"; 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)) "Water-based heating"; Interfaces.Bus bus1 "Control bus"; Fluid.Sources.Boundary_pT bouAirEntHea( redeclare final package Medium = MediumAir, p=bouAirLvg.p + coiHea.dat.dpAir_nominal, T=coiHea.dat.TAirEnt_nominal, nPorts=2) "Boundary conditions for entering air"; 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) "Boundary conditions for entering HW"; 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) "Electric heating"; Interfaces.Bus bus2 "Control bus"; Buildings.Templates.Components.Coils.EvaporatorVariableSpeed coiEva( redeclare final package MediumAir = MediumAir, dat(dpAir_nominal=200), final energyDynamics=energyDynamics) "Variable speed evaporator coil"; BoundaryConditions.WeatherData.Bus weaBus "Weather data bus"; Interfaces.Bus bus3 "Control bus"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TOut( k=coiEva.dat.datCoi.sta[1].nomVal.TConIn_nominal) "Outdoor temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant XOut(k=0.015) "Water mass fraction in outdoor air"; Buildings.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul(redeclare final package Medium = MediumAir) "Compute wet bulb temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant pOut(k=101325) "Outdoor pressure"; 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) "Boundary conditions for entering air"; Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false) "Compute wet bulb temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TAirEnt(k=coiEva.dat.datCoi.sta[ 1].nomVal.TEvaIn_nominal) "Entering air temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant phiAirEnt(k=coiEva.dat.datCoi.sta[ 1].nomVal.phiIn_nominal) "Enetring air relative humidity"; 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) "Multiple stage evaporator coil"; Buildings.Controls.OBC.CDL.Integers.Sources.TimeTable y1( table=[0,0; 1,1; 2,2], timeScale=50, period=200) "Coil/valve control signal"; Interfaces.Bus bus4 "Control bus"; 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) "Flow resistance"; Buildings.Templates.Components.Coils.None non( redeclare final package MediumAir =MediumAir) "No coilamper"; 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;

Buildings.Templates.Components.Validation.Dampers Buildings.Templates.Components.Validation.Dampers

Validation model for damper components

Buildings.Templates.Components.Validation.Dampers

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

TypeNameDefaultDescription
replaceable package MediumAirBuildings.Media.AirAir medium

Connectors

TypeNameDescription
replaceable package MediumAirAir medium
BusbusControl bus
Busbus1Control bus
Busbus2Control bus

Modelica definition

model Dampers "Validation model for damper components" extends Modelica.Icons.Example; replaceable package MediumAir=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; Fluid.Sources.Boundary_pT bouAirEnt( redeclare final package Medium = MediumAir, p=bouAirLvg.p + mod.dat.dp_nominal, nPorts=4) "Boundary conditions for entering air"; Fluid.Sources.Boundary_pT bouAirLvg( redeclare final package Medium =MediumAir, nPorts=4) "Boundary conditions for leaving air"; 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)) "Modulating damper"; Interfaces.Bus bus "Control bus"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Damper control signal"; 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)) "Pressure independent damper"; Interfaces.Bus bus1 "Control bus"; 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)) "Two-position damper"; Interfaces.Bus bus2 "Control bus"; Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[0,0; 1,1], timeScale=10, period=200) "Damper control signal"; Buildings.Templates.Components.Actuators.Damper non( final typ=Buildings.Templates.Components.Types.Damper.None, redeclare final package Medium = MediumAir) "No damper"; Fluid.FixedResistances.PressureDrop res( redeclare final package Medium = MediumAir, final m_flow_nominal=mod.m_flow_nominal, final dp_nominal=mod.dp_nominal) "Flow resistance"; 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;

Buildings.Templates.Components.Validation.Fans Buildings.Templates.Components.Validation.Fans

Validation model for fans components

Buildings.Templates.Components.Validation.Fans

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

TypeNameDefaultDescription
replaceable package MediumAirBuildings.Media.AirAir medium
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumAirAir medium
BusbusControl bus
Busbus1Control bus
Busbus2Control bus

Modelica definition

model Fans "Validation model for fans components" extends Modelica.Icons.Example; replaceable package MediumAir=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Fluid.Sources.Boundary_pT bou( redeclare final package Medium = MediumAir, nPorts=8) "Boundary conditions"; 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) "Fan array"; 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) "Ducts and coils equivalent flow resistance"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Fan control signal"; Interfaces.Bus bus "Control bus"; Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[0,0; 1,1], timeScale=10, period=100) "Fan start/stop signal"; 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)) "Variable speed fan"; Interfaces.Bus bus1 "Control bus"; 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)) "Constant speed fan"; 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) "Ducts and coils equivalent flow resistance"; 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) "Ducts and coils equivalent flow resistance"; Interfaces.Bus bus2 "Control bus"; Buildings.Templates.Components.Fans.None non( redeclare final package Medium = MediumAir) "No fan"; Fluid.FixedResistances.PressureDrop res3( redeclare final package Medium = MediumAir, final m_flow_nominal=1, final dp_nominal=1000) "Ducts and coils equivalent flow resistance"; 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;

Buildings.Templates.Components.Validation.PumpMultipleRecord Buildings.Templates.Components.Validation.PumpMultipleRecord

Validation model for parameter propagation with the multiple-pump record

Buildings.Templates.Components.Validation.PumpMultipleRecord

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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterFluid medium
MassFlowRatem_flow_nominal[nPum]{1,2}Mass flow rate - Each pump [kg/s]
PressureDifferencedp_nominal[nPum]{1,2} .* 1E4Total pressure rise - Each pump [Pa]
PumpMultipledatDefdatDef(final typ=Buildings.T...Parameter record - Default bindings for subrecord per
PumpMultipledatReddatRed(final typ=Buildings.T...Parameter record - Redeclaration of subrecord per
Stratos80slash1to12per1  
Stratos50slash1to12per2  
PumpMultipledatAssdatAss(final typ=Buildings.T...Parameter record - Assignment of subrecord per
PumpMultipledatPredatPre(final typ=Buildings.T...Parameter record - Assignment of pressure inside the subrecord per
Configuration
IntegernPum2Number of pumps

Connectors

TypeNameDescription
replaceable package MediumFluid medium

Modelica definition

model PumpMultipleRecord "Validation model for parameter propagation with the multiple-pump record" extends Modelica.Icons.Example; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Fluid medium"; parameter Integer nPum( final min=0, start=1)=2 "Number of pumps"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[nPum]( each start=1, each final min=0)={1, 2} "Mass flow rate - Each pump"; final parameter Modelica.Units.SI.VolumeFlowRate V_flow_nominal[nPum]= m_flow_nominal ./ datDef.rho_default "Mass flow rate - Each pump"; parameter Modelica.Units.SI.PressureDifference dp_nominal[nPum]( each start=0, each final min=0)={1, 2} .* 1E4 "Total pressure rise - Each pump"; 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 record - Default bindings for subrecord per"; 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 record - Redeclaration of subrecord 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 record - Assignment of subrecord per"; 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}))) "Parameter record - Assignment of pressure inside the subrecord per"; end PumpMultipleRecord;

Buildings.Templates.Components.Validation.Pumps Buildings.Templates.Components.Validation.Pumps

Validation model for pump components

Buildings.Templates.Components.Validation.Pumps

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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterLiquid medium
PumpSingledatPumdatPum(final typ=pum1.typ, m...Single pump parameters
PumpMultipledatPumMuldatPumMul(final typ=pumMul.t...Multiple pump parameters
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumLiquid medium

Modelica definition

model Pumps "Validation model for pump components" extends Modelica.Icons.Example; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Liquid medium"; parameter Data.PumpSingle datPum( final typ=pum1.typ, m_flow_nominal=1, dp_nominal=1E5) "Single pump parameters"; 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)) "Multiple pump parameters"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Buildings.Templates.Components.Pumps.Multiple pumMul( final energyDynamics=energyDynamics, redeclare final package Medium=Medium, nPum=2, final dat=datPumMul) "Two variable speed pumps in parallel with common speed command signal"; Buildings.Templates.Components.Pumps.Single pum1( final energyDynamics=energyDynamics, redeclare final package Medium = Medium, final dat=datPum) "Single variable speed pump"; Buildings.Templates.Components.Pumps.Single pum2( final energyDynamics=energyDynamics, redeclare final package Medium=Medium, final dat=datPum) "Single variable speed pump"; 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 junction"; 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 junction"; 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) "Fixed flow resistance"; 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 junction"; 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 junction"; 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)) "Fixed flow resistance"; 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) "Pump enable signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant y(k=1) "Pump speed command"; Fluid.Sources.Boundary_pT bou( redeclare final package Medium=Medium, nPorts=1) "Pressure boundary condition"; Fluid.Sources.Boundary_pT bou1(redeclare final package Medium = Medium, nPorts=1) "Pressure boundary condition"; Buildings.Templates.Components.Pumps.Multiple pumMulCst( have_var=false, final energyDynamics=energyDynamics, redeclare final package Medium = Medium, nPum=2, final dat=datPumMul) "Two constant speed pumps in parallel"; 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 junction"; 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 junction"; 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)) "Fixed flow resistance"; Fluid.Sources.Boundary_pT bou2(redeclare final package Medium = Medium, nPorts=1) "Pressure boundary condition"; Buildings.Templates.Components.Pumps.Multiple pumMulDed( have_varCom=false, final energyDynamics=energyDynamics, redeclare final package Medium = Medium, nPum=2, final dat=datPumMul) "Two variable speed pumps in parallel with dedicated speed command signal"; 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 junction"; 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 junction"; 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)) "Fixed flow resistance"; Fluid.Sources.Boundary_pT bou3(redeclare final package Medium = Medium, nPorts=1) "Pressure boundary condition"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant yDed[pumMulDed.nPum](each k =1) "Pump speed command"; protected Interfaces.Bus bus "Pump control bus"; Interfaces.Bus bus1 "Pump control bus"; Interfaces.Bus bus2 "Pump control bus"; Interfaces.Bus bus3 "Pump control bus"; Interfaces.Bus bus4 "Pump control bus"; 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;

Buildings.Templates.Components.Validation.Routing Buildings.Templates.Components.Validation.Routing

Validation model for routing components

Buildings.Templates.Components.Validation.Routing

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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterMedium
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumMedium

Modelica definition

model Routing "Validation model for routing components" extends Modelica.Icons.Example; replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Medium"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Fluid.Sources.Boundary_pT bouLiqEnt( redeclare final package Medium = Medium, p=bouLiqLvg.p + min(res.dp_nominal), nPorts=3) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg(redeclare final package Medium = Medium, nPorts=3) "Boundary conditions for leaving liquid"; Fluid.FixedResistances.PressureDrop res[3]( redeclare final package Medium = Medium, each m_flow_nominal=1, each dp_nominal=1000) "Flow resistance"; Buildings.Templates.Components.Routing.MultipleToMultiple mulMul( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, nPorts_a=3, m_flow_nominal=3) "Multiple to multiple without common leg"; Fluid.Sources.Boundary_pT bouLiqEnt1( redeclare final package Medium = Medium, p=bouLiqLvg.p + min(res1.dp_nominal) + min(res2.dp_nominal), nPorts=3) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg1(redeclare final package Medium = Medium, nPorts=3) "Boundary conditions for leaving liquid"; Fluid.FixedResistances.PressureDrop res1 [3]( redeclare final package Medium = Medium, each m_flow_nominal=1, each dp_nominal=1000) "Flow resistance"; Buildings.Templates.Components.Routing.MultipleToMultiple mulMulCom( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, nPorts_a=3, have_comLeg=true, m_flow_nominal=3) "Multiple to multiple with common leg"; Fluid.FixedResistances.PressureDrop res2[3]( redeclare final package Medium = Medium, each m_flow_nominal=1, each dp_nominal=1000) "Flow resistance"; Fluid.Sources.Boundary_pT bouLiqEnt2( redeclare final package Medium = Medium, p=bouLiqLvg.p + min(res3.dp_nominal), nPorts=3) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg2(redeclare final package Medium = Medium, nPorts=1) "Boundary conditions for leaving liquid"; Fluid.FixedResistances.PressureDrop res3 [3]( redeclare final package Medium = Medium, each m_flow_nominal=1, each dp_nominal=1000) "Flow resistance"; Buildings.Templates.Components.Routing.MultipleToSingle mulSin( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, nPorts=3, m_flow_nominal=3) "Multiple to single"; Fluid.Sources.Boundary_pT bouLiqEnt3( redeclare final package Medium = Medium, p=bouLiqLvg.p + min(res5.dp_nominal), nPorts=1) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg3(redeclare final package Medium = Medium, nPorts=3) "Boundary conditions for leaving liquid"; Buildings.Templates.Components.Routing.SingleToMultiple sinMul( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, nPorts=3, m_flow_nominal=3) "Single to multiple"; Fluid.FixedResistances.PressureDrop res5[3]( redeclare final package Medium = Medium, each m_flow_nominal=1, each dp_nominal=1000) "Flow resistance"; Fluid.Sources.Boundary_pT bouLiqEnt4( redeclare final package Medium = Medium, p=bouLiqLvg.p + res4.dp_nominal, nPorts=1) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg4(redeclare final package Medium = Medium, nPorts=1) "Boundary conditions for leaving liquid"; Buildings.Templates.Components.Routing.PassThroughFluid pas(redeclare final package Medium = Medium) "Pass through"; Fluid.FixedResistances.PressureDrop res4( redeclare final package Medium = Medium, m_flow_nominal=1, dp_nominal=1000) "Flow resistance"; 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;

Buildings.Templates.Components.Validation.Sensors Buildings.Templates.Components.Validation.Sensors

Validation model for sensor components

Buildings.Templates.Components.Validation.Sensors

Information

This model validates the models within Buildings.Templates.Components.Sensors.

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

Parameters

TypeNameDefaultDescription
replaceable package MediumAirBuildings.Media.AirAir medium

Connectors

TypeNameDescription
replaceable package MediumAirAir medium

Modelica definition

model Sensors "Validation model for sensor components" extends Modelica.Icons.Example; replaceable package MediumAir=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; Fluid.Sources.Boundary_pT bouAirEnt( redeclare final package Medium = MediumAir, p=bouAirLvg.p + res.dp_nominal, nPorts=6) "Boundary conditions for entering air"; Fluid.Sources.Boundary_pT bouAirLvg(redeclare final package Medium = MediumAir, nPorts=6) "Boundary conditions for leaving air"; Buildings.Templates.Components.Sensors.HumidityRatio hum(redeclare final package Medium = MediumAir, m_flow_nominal=1) "Humidity ratio"; Fluid.FixedResistances.PressureDrop res( redeclare final package Medium = MediumAir, final m_flow_nominal=1, final dp_nominal=100) "Flow resistance"; Fluid.FixedResistances.PressureDrop res1( redeclare final package Medium = MediumAir, final m_flow_nominal=1, final dp_nominal=100) "Flow resistance"; Buildings.Templates.Components.Sensors.SpecificEnthalpy ent(redeclare final package Medium = MediumAir, m_flow_nominal=1) "Specific enthalpy"; Buildings.Templates.Components.Sensors.DifferentialPressure dp(redeclare final package Medium = MediumAir) "Differential pressure"; Fluid.FixedResistances.PressureDrop res2( redeclare final package Medium = MediumAir, final m_flow_nominal=1, final dp_nominal=100) "Flow resistance"; Buildings.Templates.Components.Sensors.Temperature tem(redeclare final package Medium = MediumAir, m_flow_nominal=1) "Temperature"; Buildings.Templates.Components.Sensors.VolumeFlowRate vol(redeclare final package Medium = MediumAir, m_flow_nominal=1, typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.AFMS) "Volume flow rate"; Fluid.FixedResistances.PressureDrop res3( redeclare final package Medium = MediumAir, final m_flow_nominal=1, final dp_nominal=100) "Flow resistance"; Buildings.Templates.Components.Sensors.DifferentialPressure noDp(redeclare final package Medium = MediumAir, have_sen=false) "No differential pressure sensor"; 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;

Buildings.Templates.Components.Validation.Valves Buildings.Templates.Components.Validation.Valves

Validation model for valve components

Buildings.Templates.Components.Validation.Valves

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

TypeNameDefaultDescription
replaceable package MediumLiqBuildings.Media.WaterLiquid medium
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumLiqLiquid medium
BusbusControl bus
Busbus1Control bus
Busbus2Control bus
Busbus3Control bus

Modelica definition

model Valves "Validation model for valve components" extends Modelica.Icons.Example; replaceable package MediumLiq=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Liquid medium"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.FixedInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; Fluid.Sources.Boundary_pT bouLiqEnt( redeclare final package Medium = MediumLiq, p=bouLiqLvg.p + modThr.dat.dpValve_nominal + modThr.dat.dpFixed_nominal, nPorts=7) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg( redeclare final package Medium =MediumLiq, nPorts=5) "Boundary conditions for leaving liquid"; 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)) "Three-way modulating valve"; Interfaces.Bus bus "Control bus"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Damper control signal"; 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)) "Three-way two position valve"; Interfaces.Bus bus1 "Control bus"; 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)) "Two-way modulating valve"; Interfaces.Bus bus2 "Control bus"; Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[0,0; 1,1], timeScale=10, period=200) "Damper control signal"; 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)) "Two-way two-position valve"; Interfaces.Bus bus3 "Control bus"; Actuators.Valve non( redeclare final package Medium = MediumLiq, typ=Buildings.Templates.Components.Types.Valve.None) "No valve"; 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) "Flow resistance"; 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;