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.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, redeclare replaceable Buildings.Templates.Components.Valves.TwoWayModulating val(y_start=0) "Two-way modulating valve") "Water-based cooling coil"; Interfaces.Bus bus "Control bus"; 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, redeclare replaceable Buildings.Templates.Components.Valves.TwoWayModulating val(y_start=0) "Two-way modulating valve") "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"; Controls.OBC.CDL.Reals.Sources.Constant TOut(k=coiEva.dat.datCoi.sta[1].nomVal.TConIn_nominal) "Outdoor temperature"; Controls.OBC.CDL.Reals.Sources.Constant XOut(k=0.015) "Water mass fraction in outdoor air"; Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul( redeclare final package Medium = MediumAir) "Compute wet bulb temperature"; 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"; Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false) "Compute wet bulb temperature"; Controls.OBC.CDL.Reals.Sources.Constant TAirEnt(k=coiEva.dat.datCoi.sta[1].nomVal.TEvaIn_nominal) "Entering air temperature"; 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"; 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 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

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.Dampers.Modulating mod( y_start=0, redeclare final package Medium = MediumAir, dat(m_flow_nominal=1, dp_nominal=50)) "Modulating damper"; Interfaces.Bus bus "Control bus"; Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Damper control signal"; Buildings.Templates.Components.Dampers.PressureIndependent pre( 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.Dampers.TwoPosition two( y_start=0, redeclare final package Medium = MediumAir, dat(m_flow_nominal=1, dp_nominal=50)) "Two-position damper"; Interfaces.Bus bus2 "Control bus"; Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[0,0; 1,1], timeScale=10, period=200) "Damper control signal"; Buildings.Templates.Components.Dampers.None non( redeclare final package Medium = MediumAir) "No damper"; 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) "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"; Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Fan control signal"; Interfaces.Bus bus "Control bus"; 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], 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;

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 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

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=6) "Boundary conditions for entering liquid"; Fluid.Sources.Boundary_pT bouLiqLvg( redeclare final package Medium =MediumLiq, nPorts=4) "Boundary conditions for leaving liquid"; 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)) "Three-way modulating valve"; Interfaces.Bus bus "Control bus"; Controls.OBC.CDL.Reals.Sources.Ramp y(height=1, duration=10) "Damper control signal"; 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)) "Three-way two position valve"; Interfaces.Bus bus1 "Control bus"; 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)) "Two-way modulating valve"; Interfaces.Bus bus2 "Control bus"; Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[0,0; 1,1], timeScale=10, period=200) "Damper control signal"; 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)) "Two-way two-position valve"; Interfaces.Bus bus3 "Control bus"; 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;