Buildings.DHC.ETS.Combined.Subsystems.Validation

Collection of validation models

Information

This package contains validation models for the classes in Buildings.DHC.ETS.Combined.Subsystems.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.DHC.ETS.Combined.Subsystems.Validation.Borefield Borefield Validation of the base subsystem model with geothermal borefield
Buildings.DHC.ETS.Combined.Subsystems.Validation.Chiller Chiller Validation of the base subsystem model with heat recovery chiller
Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatExchanger HeatExchanger Validation of the base subsystem model with district heat exchanger
Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPump HeatPump Validation of the base subsystem model with heat pump
Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPumpDHWTank HeatPumpDHWTank Validation of the base subsystem model with domestic hot water tank and heat pump
Buildings.DHC.ETS.Combined.Subsystems.Validation.SwitchBox SwitchBox Validation of flow switch box
Buildings.DHC.ETS.Combined.Subsystems.Validation.WatersideEconomizer WatersideEconomizer Validation of the base subsystem model with waterside economizer

Buildings.DHC.ETS.Combined.Subsystems.Validation.Borefield Buildings.DHC.ETS.Combined.Subsystems.Validation.Borefield

Validation of the base subsystem model with geothermal borefield

Buildings.DHC.ETS.Combined.Subsystems.Validation.Borefield

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.Borefield.

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

Parameters

TypeNameDefaultDescription
IntegernBorHol100Number of boreholes (must be a square number)
Distancedxy6Distance in x-axis (and y-axis) between borehole axes [m]
ExampledatBorFiedatBorFie(conDat=Fluid.Geoth...Borefield design data

Modelica definition

model Borefield "Validation of the base subsystem model with geothermal borefield" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; parameter Integer nBorHol=100 "Number of boreholes (must be a square number)"; parameter Modelica.Units.SI.Distance dxy=6 "Distance in x-axis (and y-axis) between borehole axes"; final parameter Modelica.Units.SI.Distance cooBor[nBorHol,2]= Buildings.DHC.ETS.BaseClasses.computeCoordinates( nBorHol, dxy) "Coordinates of boreholes"; Buildings.DHC.ETS.Combined.Subsystems.Borefield borFie( redeclare final package Medium=Medium, final datBorFie=datBorFie, dp_nominal=5E4, TBorWatEntMax=313.15) "Subsystem with heat recovery chiller"; Fluid.Sources.Boundary_pT conWat( redeclare package Medium=Medium, use_T_in=true, nPorts=2) "Condenser water boundary conditions"; Fluid.Sensors.TemperatureTwoPort senTInl( redeclare final package Medium=Medium, m_flow_nominal=borFie.pum.m_flow_nominal) "Water inlet temperature"; Fluid.Sensors.TemperatureTwoPort senTOut( redeclare final package Medium=Medium, m_flow_nominal=borFie.pum.m_flow_nominal) "Water outlet temperature"; parameter Fluid.Geothermal.Borefields.Data.Borefield.Example datBorFie( conDat=Fluid.Geothermal.Borefields.Data.Configuration.Example( cooBor=cooBor, dp_nominal=0)) "Borefield design data"; Modelica.Blocks.Sources.TimeTable TInlVal( y(final unit="K", displayUnit="degC"), table=[ 0,2; 2,2; 3,15; 7,15; 9,35; 10,45; 11,30; 20,30], timeScale=1000, offset=273.15) "Inlet temperature values"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( k=0) "Zero"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp u( duration=1000, startTime=2500) "Control signal"; equation connect(senTInl.port_b,conWat.ports[1]); connect(conWat.ports[2],senTOut.port_a); connect(senTInl.port_a,borFie.port_a); connect(borFie.port_b,senTOut.port_b); connect(TInlVal.y,conWat.T_in); connect(zer.y,borFie.yValIso_actual[2]); connect(u.y,borFie.u); connect(u.y,borFie.yValIso_actual[1]); end Borefield;

Buildings.DHC.ETS.Combined.Subsystems.Validation.Chiller Buildings.DHC.ETS.Combined.Subsystems.Validation.Chiller

Validation of the base subsystem model with heat recovery chiller

Buildings.DHC.ETS.Combined.Subsystems.Validation.Chiller

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.Chiller.

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

Parameters

TypeNameDefaultDescription
GenericdatChidatChi(QEva_flow_nominal=-1E...Chiller performance data

Modelica definition

model Chiller "Validation of the base subsystem model with heat recovery chiller" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; parameter Fluid.Chillers.Data.ElectricEIR.Generic datChi( QEva_flow_nominal=-1E6, COP_nominal=3, PLRMax=1, PLRMinUnl=0.3, PLRMin=0.3, etaMotor=1, mEva_flow_nominal=30, mCon_flow_nominal=30, TEvaLvg_nominal=280.15, capFunT={1,0,0,0,0,0}, EIRFunT={1,0,0,0,0,0}, EIRFunPLR={1,0,0}, TEvaLvgMin=276.15, TEvaLvgMax=288.15, TConEnt_nominal=313.15, TConEntMin=303.15, TConEntMax=333.15) "Chiller performance data"; Buildings.DHC.ETS.Combined.Subsystems.Chiller chi( redeclare final package Medium=Medium, final dat=datChi, dpCon_nominal=15E3, dpEva_nominal=15E3) "Subsystem with heat recovery chiller"; Fluid.Sources.Boundary_pT evaWat( redeclare package Medium=Medium, use_T_in=true, nPorts=2) "Evaporator water boundary conditions"; Fluid.Sources.Boundary_pT conWat( redeclare package Medium=Medium, use_T_in=true, nPorts=2) "Condenser water boundary conditions"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet( k=7+273.15, y(final unit="K", displayUnit="degC")) "Chilled water supply temperature set point"; Fluid.Sensors.TemperatureTwoPort senTHeaWatSup( redeclare final package Medium=Medium, m_flow_nominal=datChi.mCon_flow_nominal) "Heating water supply temperature"; Fluid.Sensors.TemperatureTwoPort senTChiWatSup( redeclare final package Medium=Medium, m_flow_nominal=datChi.mEva_flow_nominal) "Chilled water supply temperature"; Fluid.Sensors.TemperatureTwoPort senTHeaWatRet( redeclare final package Medium=Medium, m_flow_nominal=datChi.mCon_flow_nominal) "Heating water return temperature"; Fluid.Sensors.TemperatureTwoPort senTChiWatRet( redeclare final package Medium=Medium, m_flow_nominal=datChi.mEva_flow_nominal) "Chilled water return temperature"; Modelica.Blocks.Sources.BooleanExpression uHea( y=time < 4000) "Heating enable signal"; Modelica.Blocks.Sources.BooleanExpression uCoo( y=time >= 1000) "Cooling enable signal"; Modelica.Blocks.Sources.TimeTable THeaWatRet( y(final unit="K", displayUnit="degC"), table=[ 0,44; 2,44; 3,34; 4.5,34; 5,14; 10,14], timeScale=1000, offset=273.15) "Heating water return temperature values"; Modelica.Blocks.Sources.TimeTable TChiWatRet( y(final unit="K", displayUnit="degC"), table=[ 0,9; 1,9; 2,14; 3,14; 4,11; 5,11], timeScale=1000, offset=273.15) "Chilled water return temperature values"; equation connect(chi.port_bHeaWat,senTHeaWatSup.port_a); connect(senTHeaWatSup.port_b,conWat.ports[1]); connect(evaWat.ports[1],senTChiWatSup.port_b); connect(senTChiWatSup.port_a,chi.port_bChiWat); connect(conWat.ports[2],senTHeaWatRet.port_a); connect(senTHeaWatRet.port_b,chi.port_aHeaWat); connect(chi.port_aChiWat,senTChiWatRet.port_b); connect(senTChiWatRet.port_a,evaWat.ports[2]); connect(uCoo.y,chi.uCoo); connect(uHea.y,chi.uHea); connect(TChiWatSupSet.y,chi.TChiWatSupSet); connect(THeaWatRet.y,conWat.T_in); connect(TChiWatRet.y,evaWat.T_in); end Chiller;

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatExchanger Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatExchanger

Validation of the base subsystem model with district heat exchanger

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatExchanger

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger in a configuration where the primary flow rate is modulated by means of a two-way valve (see hexVal), and in a configuration where the primary flow rate is modulated by means of a variable speed pump (see hexPum).

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

Modelica definition

model HeatExchanger "Validation of the base subsystem model with district heat exchanger" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; Buildings.Fluid.Sources.Boundary_pT bou1Pum( redeclare package Medium = Medium, use_T_in=true, nPorts=2) "Primary boundary conditions"; Buildings.Fluid.Sources.Boundary_pT bou2( redeclare package Medium = Medium, use_T_in=true, nPorts=4) "Secondary boundary conditions"; Modelica.Blocks.Sources.BooleanExpression uHeaRej( y=time >= 3000) "Heat rejection enable signal"; Modelica.Blocks.Sources.BooleanExpression uEnaColRej( y=time >= 1000 and time < 3000) "Cold rejection enable signal"; Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger hexPum( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium, show_T=true, conCon=Buildings.DHC.ETS.Types.ConnectionConfiguration.Pump, dp1Hex_nominal=20E3, dp2Hex_nominal=20E3, Q_flow_nominal=1E6, T_a1_nominal=281.15, T_b1_nominal=277.15, T_a2_nominal=275.15, T_b2_nominal=279.15) "Heat exchanger with primary pump"; Buildings.Controls.OBC.CDL.Reals.Switch swi "Switch secondary temperature value depending on heat/cold rejection mode"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1OutPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m1_flow_nominal) "Primary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1InlPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m1_flow_nominal) "Primary inlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2OutPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal) "Secondary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2InlPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal) "Secondary inlet temperature"; Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger hexVal( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium, show_T=true, conCon=Buildings.DHC.ETS.Types.ConnectionConfiguration.TwoWayValve, dp1Hex_nominal=20E3, dp2Hex_nominal=20E3, Q_flow_nominal=1E6, T_a1_nominal=281.15, T_b1_nominal=277.15, T_a2_nominal=275.15, T_b2_nominal=279.15) "Heat exchanger with primary control valve"; Buildings.Fluid.Sources.Boundary_pT bou1InlVal( redeclare package Medium = Medium, p=Medium.p_default + 30E3, use_T_in=true, nPorts=1) "Primary boundary conditions"; Buildings.Fluid.Sources.Boundary_pT bou1OutVal(redeclare package Medium = Medium, nPorts=1) "Primary boundary conditions"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1InlVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m1_flow_nominal) "Primary inlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1OutVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m1_flow_nominal) "Primary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2OutVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m2_flow_nominal) "Secondary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2InlVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m2_flow_nominal) "Secondary inlet temperature"; Buildings.Controls.OBC.CDL.Logical.Or or2 "Compute enable signal for heat/cold rejection"; Modelica.Blocks.Sources.RealExpression yValIsoCon( y=if time >= 2500 then 1 else 0) "Condenser loop isolation valve opening"; Modelica.Blocks.Sources.RealExpression yValIsoEva( y=if time >= 500 then 1 else 0) "Evaporator loop isolation valve opening"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin sin1( amplitude=0.5, freqHz=1e-3, offset=0.5) "Control signal"; Buildings.Controls.OBC.CDL.Reals.Switch swi1 "Activate heat/cold rejection"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( k=0) "Zero"; Modelica.Blocks.Sources.TimeTable TColVal( y(final unit="K", displayUnit="degC"), table=[ 0,6; 2,6; 3,16; 4.5,16; 5,6; 10,6], timeScale=1000, offset=273.15) "Cold side temperature values"; Modelica.Blocks.Sources.TimeTable THotVal( y(final unit="K", displayUnit="degC"), table=[ 0,45; 2,45; 3,55; 4.5,55; 5,25; 10,25], timeScale=1000, offset=273.15) "Hot side temperature values"; Modelica.Blocks.Sources.TimeTable TSerWat( y(final unit="K", displayUnit="degC"), table=[ 0,8; 1,8; 2,13; 3,18; 4,6; 5,18], timeScale=1000, offset=273.15) "Service water temperature values"; equation connect(swi.y, bou2.T_in); connect(uEnaColRej.y,swi.u2); connect(hexPum.port_b1,senT1OutPum.port_a); connect(senT1OutPum.port_b, bou1Pum.ports[1]); connect(hexPum.port_a1,senT1InlPum.port_b); connect(senT1InlPum.port_a, bou1Pum.ports[2]); connect(hexPum.port_b2,senT2OutPum.port_a); connect(senT2OutPum.port_b, bou2.ports[1]); connect(bou2.ports[2], senT2InlPum.port_a); connect(senT2InlPum.port_b,hexPum.port_a2); connect(hexVal.port_a1,senT1InlVal.port_b); connect(senT1InlVal.port_a, bou1InlVal.ports[1]); connect(bou1OutVal.ports[1], senT1OutVal.port_b); connect(senT1OutVal.port_a,hexVal.port_b1); connect(hexVal.port_a2,senT2InlVal.port_b); connect(senT2OutVal.port_a,hexVal.port_b2); connect(uEnaColRej.y,or2.u2); connect(uHeaRej.y,or2.u1); connect(yValIsoCon.y,hexVal.yValIso_actual[1]); connect(yValIsoCon.y,hexPum.yValIso_actual[1]); connect(yValIsoEva.y,hexVal.yValIso_actual[2]); connect(yValIsoEva.y,hexPum.yValIso_actual[2]); connect(or2.y,swi1.u2); connect(sin1.y,swi1.u1); connect(zer.y,swi1.u3); connect(swi1.y,hexVal.u); connect(swi1.y,hexPum.u); connect(TColVal.y,swi.u1); connect(THotVal.y,swi.u3); connect(TSerWat.y, bou1Pum.T_in); connect(TSerWat.y, bou1InlVal.T_in); connect(senT2OutVal.port_b, bou2.ports[3]); connect(bou2.ports[4], senT2InlVal.port_a); end HeatExchanger;

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPump Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPump

Validation of the base subsystem model with heat pump

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPump

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.HeatPump.

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

Parameters

TypeNameDefaultDescription
TemperatureTCon_nominal273.15 + 30Nominal condenser outlet temperature [K]
TemperatureTAmb_nominal273.15 + 15Nominal ambient loop temperature to evaporator [K]
PowerQLoa_nominal1000Nominal load [W]

Modelica definition

model HeatPump "Validation of the base subsystem model with heat pump" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.Temperature TCon_nominal = 273.15+30 "Nominal condenser outlet temperature"; parameter Modelica.Units.SI.Temperature TAmb_nominal = 273.15+15 "Nominal ambient loop temperature to evaporator"; parameter Modelica.Units.SI.Power QLoa_nominal = 1000 "Nominal load"; Buildings.DHC.ETS.Combined.Subsystems.HeatPump heaPum( redeclare package Medium1 = Medium, redeclare package Medium2 = Medium, COP_nominal=2.3, TCon_nominal=TCon_nominal, TEva_nominal(displayUnit="K") = TAmb_nominal - heaPum.dT_nominal, dp1_nominal=6000, dp2_nominal=6000, Q1_flow_nominal=QLoa_nominal); Fluid.Sources.Boundary_pT supAmb( redeclare package Medium = Medium, p(displayUnit="bar"), T=TAmb_nominal, nPorts=1) "Ambient water supply"; Fluid.Sources.Boundary_pT sinAmb( redeclare package Medium = Medium, p(displayUnit="bar"), nPorts=1) "Sink for ambient water"; Fluid.Sources.Boundary_pT souLoa( redeclare final package Medium = Medium, T=TCon_nominal - heaPum.dT_nominal, nPorts=1) "Source for load (return from load)"; Modelica.Blocks.Sources.Sine sin(f=1/(86400/2)) "Load signal"; Modelica.Blocks.Nonlinear.Limiter limiter(uMax=1, uMin=0); Modelica.Blocks.Math.Gain gain(k=QLoa_nominal/(4200*5)); Modelica.Blocks.Sources.Step TSetCon( height=-2, offset=TCon_nominal, startTime=86400/2) "Set point of condenser outlet"; Fluid.Sources.Boundary_pT sinLoa(redeclare final package Medium = Medium, nPorts=1) "Sink for load"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold enaHea(t=1e-4) "Threshold comparison to enable heating"; Fluid.Sensors.TemperatureTwoPort senTLoaSup( redeclare final package Medium = Medium, final m_flow_nominal=QLoa_nominal/(4200*5), tau=0) "Load supply temperature sensor"; Fluid.Sensors.MassFlowRate senMasFloAmb(redeclare package Medium = Medium) "Mass flow rate sensor for ambient loop"; equation connect(sinAmb.ports[1], heaPum.port_b2); connect(sin.y, limiter.u); connect(limiter.y, gain.u); connect(heaPum.m1_flow, gain.y); connect(TSetCon.y, heaPum.TSupSet); connect(souLoa.ports[1], heaPum.port_a1); connect(enaHea.y, heaPum.uEna); connect(limiter.y, enaHea.u); connect(sinLoa.ports[1], senTLoaSup.port_b); connect(senTLoaSup.port_a, heaPum.port_b1); connect(heaPum.port_a2, senMasFloAmb.port_b); connect(senMasFloAmb.port_a, supAmb.ports[1]); end HeatPump;

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPumpDHWTank Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPumpDHWTank

Validation of the base subsystem model with domestic hot water tank and heat pump

Buildings.DHC.ETS.Combined.Subsystems.Validation.HeatPumpDHWTank

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank.

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

Parameters

TypeNameDefaultDescription
TemperatureDifferencedT_nominal5Nominal temperature difference across heat pump condensor and district supply/return water [K]
TemperatureTDisSup_nominal273.15 + 15Nominal district supply water temperature [K]
GenericDomesticHotWaterWithHeatExchangerdatWatHeadatWatHea(VTan=0.1892706, mD...Data for heat pump water heater with tank

Modelica definition

model HeatPumpDHWTank "Validation of the base subsystem model with domestic hot water tank and heat pump" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.TemperatureDifference dT_nominal = 5 "Nominal temperature difference across heat pump condensor and district supply/return water"; parameter Modelica.Units.SI.Temperature TDisSup_nominal = 273.15 + 15 "Nominal district supply water temperature"; Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank heaPum( redeclare package Medium1 = Medium, redeclare package Medium2 = Medium, datWatHea=datWatHea, COP_nominal=2.3, TCon_nominal=datWatHea.TDom_nominal + datWatHea.dTHexApp_nominal + dT_nominal, TEva_nominal(displayUnit="K") = TDisSup_nominal - dT_nominal, QHotWat_flow_nominal=datWatHea.QHex_flow_nominal, dT_nominal=dT_nominal, dp1_nominal=6000, dp2_nominal=6000); Fluid.Sources.Boundary_pT supAmbWat( redeclare package Medium = Medium, p(displayUnit="bar"), use_T_in=true, T=280.15, nPorts=1) "Ambient water supply"; Fluid.Sources.Boundary_pT sinAmbWat( redeclare package Medium = Medium, p(displayUnit="bar"), nPorts=1) "Sink for ambient water"; Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = Medium) "Mass flow rate sensor"; Modelica.Blocks.Sources.Constant TDisSup(k = TDisSup_nominal) "District supply temperature"; Fluid.Sources.Boundary_pT souDCW( redeclare final package Medium = Medium, T=283.15, nPorts=1) "Source for domestic cold water"; Buildings.DHC.ETS.BaseClasses.Junction dcwSpl( redeclare final package Medium = Medium, final m_flow_nominal=6000*{1,-1, -1}) "Splitter for domestic cold water"; Modelica.Blocks.Sources.CombiTimeTable sch( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/Data/DHC/Loads/HotWater/DHW_ApartmentMidRise.mos"), smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic) "Domestic hot water fixture draw fraction schedule"; Modelica.Blocks.Sources.Constant conTSetMix(k( final unit="K", displayUnit="degC") = 308.15) "Temperature setpoint for mixed water supply to fixture"; Loads.HotWater.ThermostaticMixingValve theMixVal(redeclare package Medium = Medium, mMix_flow_nominal=1.2*datWatHea.mDom_flow_nominal); parameter Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger datWatHea(VTan=0.1892706, mDom_flow_nominal=6.52944E-06*1000) "Data for heat pump water heater with tank"; Modelica.Blocks.Sources.BooleanConstant on "Enable"; equation connect(TDisSup.y,supAmbWat. T_in); connect(supAmbWat.ports[1], senMasFlo.port_a); connect(senMasFlo.port_b, heaPum.port_a2); connect(sinAmbWat.ports[1], heaPum.port_b2); connect(dcwSpl.port_1, souDCW.ports[1]); connect(dcwSpl.port_3, heaPum.port_a1); connect(sch.y[1], theMixVal.yMixSet); connect(conTSetMix.y, theMixVal.TMixSet); connect(dcwSpl.port_2, theMixVal.port_col); connect(theMixVal.port_hot, heaPum.port_b1); connect(on.y, heaPum.uEna); end HeatPumpDHWTank;

Buildings.DHC.ETS.Combined.Subsystems.Validation.SwitchBox Buildings.DHC.ETS.Combined.Subsystems.Validation.SwitchBox

Validation of flow switch box

Buildings.DHC.ETS.Combined.Subsystems.Validation.SwitchBox

Information

This model validates that Buildings.DHC.ETS.Combined.Subsystems.SwitchBox maintains a positive flow rate in the district line outside of the temporization period set by the controller.

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

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal1Nominal water mass flow rate [kg/s]

Modelica definition

model SwitchBox "Validation of flow switch box" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal water mass flow rate"; Fluid.Delays.DelayFirstOrder volSup( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, final m_flow_nominal=m_flow_nominal, tau=60, nPorts=3) "Mixing volume supply"; Fluid.Delays.DelayFirstOrder volRet( redeclare final package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, final m_flow_nominal=m_flow_nominal, tau=60, nPorts=3) "Mixing volume return"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pum1( redeclare package Medium = Medium, final m_flow_nominal=m_flow_nominal) "Chilled water HX secondary pump"; Buildings.DHC.ETS.BaseClasses.Pump_m_flow pum2( redeclare package Medium = Medium, final m_flow_nominal=m_flow_nominal) "Chilled water HX secondary pump"; Buildings.DHC.ETS.Combined.Subsystems.SwitchBox floSwiBox(final m_flow_nominal=m_flow_nominal, redeclare final package Medium = Medium, trueHoldDuration=300) "Flow switch box"; Fluid.Sensors.MassFlowRate senMasFlo( redeclare final package Medium = Medium) "District water mass flow rate"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant setMasFlo1(k=0.5) "Set point for mass flow rate (normalized)"; Fluid.Sources.Boundary_pT disWatBou(redeclare package Medium = Medium, nPorts=2) "District water boundary conditions"; Modelica.Blocks.Sources.CombiTimeTable setMasFlo2( tableName="tab1", table=[0,0; 0.6,1; 0.7,0; 1,1], extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, columns={2}, timeScale=1000) "Set point for mass flow rate (normalized)"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(final k= m_flow_nominal) "Scale with nominal mass flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k= m_flow_nominal) "Scale with nominal mass flow rate"; equation connect(pum1.port_b, volSup.ports[1]); connect(volSup.ports[2], pum2.port_a); connect(pum2.port_b, volRet.ports[1]); connect(volRet.ports[2], pum1.port_a); connect(floSwiBox.port_bSup, volSup.ports[3]); connect(floSwiBox.port_aRet, volRet.ports[3]); connect(floSwiBox.port_bRet, senMasFlo.port_a); connect(senMasFlo.port_b, disWatBou.ports[1]); connect(disWatBou.ports[2], floSwiBox.port_aSup); connect(pum1.m_flow_actual, floSwiBox.mRev_flow); connect(setMasFlo2.y[1], gai2.u); connect(gai2.y, pum2.m_flow_in); connect(setMasFlo1.y, gai1.u); connect(gai1.y, pum1.m_flow_in); connect(pum2.m_flow_actual, floSwiBox.mPos_flow); end SwitchBox;

Buildings.DHC.ETS.Combined.Subsystems.Validation.WatersideEconomizer Buildings.DHC.ETS.Combined.Subsystems.Validation.WatersideEconomizer

Validation of the base subsystem model with waterside economizer

Buildings.DHC.ETS.Combined.Subsystems.Validation.WatersideEconomizer

Information

This model validates Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer in a configuration where the primary flow rate is modulated by means of a two-way valve (see hexVal), and in a configuration where the primary flow rate is modulated by means of a variable speed pump (see hexPum).

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

Modelica definition

model WatersideEconomizer "Validation of the base subsystem model with waterside economizer" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model"; Buildings.Fluid.Sources.Boundary_pT bou1Pum( redeclare package Medium = Medium, use_T_in=true, nPorts=2) "Primary boundary conditions"; Buildings.Fluid.Movers.FlowControlled_dp pum2Pum( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=hexPum.m2_flow_nominal, addPowerToMedium=false, nominalValuesDefineDefaultPressureCurve=true, dp_nominal=25E4) "CHW pump"; Modelica.Blocks.Sources.BooleanExpression uCoo(y=time >= 1000) "Cooling enable signal"; Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer hexPum( redeclare final package Medium1=Medium, redeclare final package Medium2=Medium, show_T=true, conCon=Buildings.DHC.ETS.Types.ConnectionConfiguration.Pump, dp1Hex_nominal=3E4, dp2Hex_nominal=3E4, Q_flow_nominal=-1E6, T_a1_nominal=281.15, T_b1_nominal=291.15, T_a2_nominal=293.15, T_b2_nominal=283.15) "Heat exchanger with primary pump"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1OutPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m1_flow_nominal) "Primary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1InlPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m1_flow_nominal) "Primary inlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2OutPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal) "Secondary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2InlPum(redeclare final package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal) "Secondary inlet temperature"; Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer hexVal( redeclare final package Medium1=Medium, redeclare final package Medium2=Medium, show_T=true, conCon=Buildings.DHC.ETS.Types.ConnectionConfiguration.TwoWayValve, dp1Hex_nominal=3E4, dp2Hex_nominal=3E4, Q_flow_nominal=-1E6, T_a1_nominal=281.15, T_b1_nominal=291.15, T_a2_nominal=293.15, T_b2_nominal=283.15) "Heat exchanger with primary control valve"; Buildings.Fluid.Sources.Boundary_pT bou1InlVal( redeclare package Medium = Medium, p=Medium.p_default + 45E3, use_T_in=true, nPorts=1) "Primary boundary conditions"; Buildings.Fluid.Sources.Boundary_pT bou1OutVal(redeclare package Medium = Medium, nPorts=1) "Primary boundary conditions"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1InlVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m1_flow_nominal) "Primary inlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT1OutVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m1_flow_nominal) "Primary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2OutVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m2_flow_nominal) "Secondary outlet temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senT2InlVal(redeclare final package Medium = Medium, m_flow_nominal=hexVal.m2_flow_nominal) "Secondary inlet temperature"; Buildings.Fluid.Sensors.RelativePressure senRelPre(redeclare final package Medium = Medium); Modelica.Blocks.Sources.TimeTable TChiWatRet( y(final unit="K", displayUnit="degC"), table=[0,10; 2,15; 3,16; 4.5,16; 5,13; 10,9], timeScale=1000, offset=273.15) "Chilled water return temperature values"; Modelica.Blocks.Sources.TimeTable TSerWat( y(final unit="K", displayUnit="degC"), table=[ 0,8; 1,8; 2,13; 3,18; 4,6; 5,18], timeScale=1000, offset=273.15) "Service water temperature values"; Buildings.Fluid.Sources.Boundary_pT bou2( redeclare package Medium = Medium, use_T_in=true, nPorts=4) "Secondary boundary conditions"; Buildings.Fluid.FixedResistances.PressureDrop resPum( redeclare package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal, dp_nominal=20E4) "Pipe flow resistance"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp dpSet( height=15E4, duration=1000, offset=10E4, startTime=1500) "Differential pressure set point"; Buildings.Fluid.Movers.FlowControlled_dp pum2Val( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=hexPum.m2_flow_nominal, addPowerToMedium=false, nominalValuesDefineDefaultPressureCurve=true, dp_nominal=25E4) "CHW pump"; Buildings.Fluid.FixedResistances.PressureDrop resVal( redeclare package Medium = Medium, m_flow_nominal=hexPum.m2_flow_nominal, dp_nominal=20E4) "Pipe flow resistance"; Modelica.Blocks.Sources.RealExpression yEva(y=0) "Isolation valve signal"; equation connect(hexPum.port_b1,senT1OutPum.port_a); connect(senT1OutPum.port_b, bou1Pum.ports[1]); connect(hexPum.port_a1,senT1InlPum.port_b); connect(senT1InlPum.port_a, bou1Pum.ports[2]); connect(hexPum.port_b2,senT2OutPum.port_a); connect(senT2InlPum.port_b,hexPum.port_a2); connect(hexVal.port_a1,senT1InlVal.port_b); connect(senT1InlVal.port_a, bou1InlVal.ports[1]); connect(bou1OutVal.ports[1], senT1OutVal.port_b); connect(senT1OutVal.port_a,hexVal.port_b1); connect(hexVal.port_a2,senT2InlVal.port_b); connect(senT2OutVal.port_a,hexVal.port_b2); connect(hexVal.port_a1,senRelPre.port_a); connect(senRelPre.port_b,senT1OutVal.port_a); connect(TSerWat.y, bou1Pum.T_in); connect(TSerWat.y, bou1InlVal.T_in); connect(uCoo.y, hexVal.uCoo); connect(uCoo.y, hexPum.uCoo); connect(bou2.ports[1], senT2InlVal.port_a); connect(TChiWatRet.y, bou2.T_in); connect(pum2Pum.port_a, senT2OutPum.port_b); connect(resPum.port_a, pum2Pum.port_b); connect(dpSet.y, pum2Pum.dp_in); connect(senT2OutVal.port_b, pum2Val.port_a); connect(pum2Val.port_b, resVal.port_a); connect(dpSet.y, pum2Val.dp_in); connect(resVal.port_b, bou2.ports[2]); connect(yEva.y, hexVal.yValIsoEva_actual); connect(yEva.y, hexPum.yValIsoEva_actual); connect(bou2.ports[3], resPum.port_b); connect(senT2InlPum.port_a, bou2.ports[4]); end WatersideEconomizer;