Buildings.Templates.Components.HeatPumps.Validation

Package with validation models

Information

This package contains validation models.

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

Package Content

Name Description
Buildings.Templates.Components.HeatPumps.Validation.HeatPumpEquationFit HeatPumpEquationFit Validation model for heat pump component with equation fit model

Buildings.Templates.Components.HeatPumps.Validation.HeatPumpEquationFit Buildings.Templates.Components.HeatPumps.Validation.HeatPumpEquationFit

Validation model for heat pump component with equation fit model

Buildings.Templates.Components.HeatPumps.Validation.HeatPumpEquationFit

Information

This model validates the models Buildings.Templates.Components.HeatPumps.AirToWater and Buildings.Templates.Components.HeatPumps.WaterToWater in a configuration in which the heat pump components are exposed to a constant differential pressure and a varying return temperature.

The AWHP model is configured to represent either a non-reversible heat pump (suffix Nrv) or a reversible heat pump that switches between cooling and heating mode.

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

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterHW or CHW medium
HeatPumpdatHpAwNrvdatHpAwNrv(final cpHeaWat_de...Non-reversible AWHP parameters
HeatPumpdatHpAwdatHpAw(final cpHeaWat_defau...Reversible AWHP parameters parameters
HeatPumpdatHpWwdatHpWw(final cpHeaWat_defau...Reversible WWHP parameters parameters
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package MediumHW or CHW medium

Modelica definition

model HeatPumpEquationFit "Validation model for heat pump component with equation fit model" extends Modelica.Icons.Example; replaceable package Medium=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"; parameter Buildings.Templates.Components.Data.HeatPump datHpAwNrv( final cpHeaWat_default=hpAwNrv.cpHeaWat_default, final cpSou_default=hpAwNrv.cpSou_default, final typ=hpAwNrv.typ, final is_rev=hpAwNrv.is_rev, final typMod=hpAwNrv.typMod, mHeaWat_flow_nominal=datHpAw.capHea_nominal/abs(datHpAw.THeaWatSup_nominal - Buildings.Templates.Data.Defaults.THeaWatRetMed)/Buildings.Utilities.Psychrometrics.Constants.cpWatLiq, dpHeaWat_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp, capHea_nominal=500E3, THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed, TSouHea_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow, perFit(hea( P=datHpAwNrv.capHea_nominal/Buildings.Templates.Data.Defaults.COPHpAwHea, coeQ={-4.2670305442,-0.7381077035,6.0049480456,0,0}, coeP={-4.9107455513,5.3665308366,0.5447612754,0,0}, TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed, TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow))) "Non-reversible AWHP parameters"; parameter Buildings.Templates.Components.Data.HeatPump datHpAw( final cpHeaWat_default=hpAw.cpHeaWat_default, final cpSou_default=hpAw.cpSou_default, final typ=hpAw.typ, final is_rev=hpAw.is_rev, final typMod=hpAw.typMod, mHeaWat_flow_nominal=datHpAw.capHea_nominal/abs(datHpAw.THeaWatSup_nominal - Buildings.Templates.Data.Defaults.THeaWatRetMed)/Buildings.Utilities.Psychrometrics.Constants.cpWatLiq, dpHeaWat_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp, capHea_nominal=500E3, THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed, mChiWat_flow_nominal=datHpAw.capCoo_nominal/abs(datHpAw.TChiWatSup_nominal - Buildings.Templates.Data.Defaults.TChiWatRet)/Buildings.Utilities.Psychrometrics.Constants.cpWatLiq, capCoo_nominal=500E3, TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup, TSouCoo_nominal=Buildings.Templates.Data.Defaults.TOutHpCoo, TSouHea_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow, perFit(hea( P=datHpAw.capHea_nominal/Buildings.Templates.Data.Defaults.COPHpAwHea, coeQ={-4.2670305442,-0.7381077035,6.0049480456,0,0}, coeP={-4.9107455513,5.3665308366,0.5447612754,0,0}, TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed, TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow), coo( P=datHpAw.capCoo_nominal/Buildings.Templates.Data.Defaults.COPHpAwCoo, coeQ={-2.2545246871,6.9089257665,-3.6548225094,0,0}, coeP={-5.8086010402,1.6894933858,5.1167787436,0,0}, TRefLoa=Buildings.Templates.Data.Defaults.TChiWatRet, TRefSou=Buildings.Templates.Data.Defaults.TOutHpCoo))) "Reversible AWHP parameters parameters"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet(k=datHpAw.TChiWatSup_nominal, y(final unit="K", displayUnit="degC")) "CHWST setpoint"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupSet(k=datHpAw.THeaWatSup_nominal, y(final unit="K", displayUnit="degC")) "HW supply temperature setpoint"; AirToWater hpAw( is_rev=true, show_T=true, redeclare final package MediumHeaWat = Medium, final dat=datHpAw, final energyDynamics=energyDynamics) "Reversible AWHP"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin THeaWatRet( amplitude=datHpAw.THeaWatSup_nominal - datHpAw.THeaWatRet_nominal, freqHz=3/3000, y(final unit="K", displayUnit="degC"), offset=datHpAw.THeaWatRet_nominal, startTime=0) "HW return temperature value"; Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1( table=[ 0, 0; 0.5, 1], timeScale=1000, period=3000) "Heat pump Enable signal"; Fluid.Sensors.TemperatureTwoPort TSup(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Supply temperature"; Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1Hea( table=[ 0, 0; 2, 1], timeScale=1000, period=3000) "Heat pump heating mode signal"; Buildings.Controls.OBC.CDL.Reals.Switch TSetAct( y(final unit="K", displayUnit="degC")) "Active supply temperature setpoint"; Fluid.Sources.Boundary_pT sup( redeclare final package Medium=Medium, p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325, nPorts=3) "Boundary condition at distribution system supply"; Buildings.Controls.OBC.CDL.Reals.Sources.Sin TChiWatRet( amplitude=datHpAw.TChiWatRet_nominal - datHpAw.TChiWatSup_nominal, freqHz=3/3000, y(final unit="K", displayUnit="degC"), offset=datHpAw.TChiWatRet_nominal, startTime=0) "CHW return temperature value"; Fluid.Sources.Boundary_pT inlHp( redeclare final package Medium = Medium, use_p_in=true, use_T_in=true, nPorts=3) "Boundary conditions of CHW/HW at HP inlet"; Buildings.Controls.OBC.CDL.Reals.Switch TRetAct "Active return temperature"; Buildings.Controls.OBC.CDL.Reals.Switch pInl_rel "Active inlet gaupe pressure"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant pHeaWatInl( k=sup.p + hpAw.dpHeaWat_nominal) "HW inlet pressure"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant pChiWatInl( k=sup.p + hpAw.dpChiWat_nominal) "CHW inlet pressure"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat( filNam=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos")); Fluid.Sensors.TemperatureTwoPort TRet(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Return temperature"; AirToWater hpAwNrv( is_rev=false, final energyDynamics=energyDynamics, final dat=datHpAwNrv) "Non reversible AWHP"; Fluid.Sensors.TemperatureTwoPort TRet1(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Return temperature"; Fluid.Sensors.TemperatureTwoPort TSup1(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Supply temperature"; WaterToWater hpWw( is_rev=true, show_T=true, redeclare final package MediumHeaWat = Medium, final dat=datHpWw, final energyDynamics=energyDynamics, have_preDroChiHeaWat=false, have_preDroSou=false) "Reversible WWHP - CHW/HW and source fluid pressure drops computed externally"; parameter Data.HeatPump datHpWw( final cpHeaWat_default=hpWw.cpHeaWat_default, final cpSou_default=hpWw.cpSou_default, final typ=hpWw.typ, final is_rev=hpWw.is_rev, final typMod=hpWw.typMod, mHeaWat_flow_nominal=datHpAw.capHea_nominal/abs(datHpAw.THeaWatSup_nominal - Buildings.Templates.Data.Defaults.THeaWatRetMed)/Buildings.Utilities.Psychrometrics.Constants.cpWatLiq, dpHeaWat_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp, capHea_nominal=500E3, THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed, mChiWat_flow_nominal=datHpAw.capCoo_nominal/abs(datHpAw.TChiWatSup_nominal - Buildings.Templates.Data.Defaults.TChiWatRet)/Buildings.Utilities.Psychrometrics.Constants.cpWatLiq, capCoo_nominal=500E3, TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup, TSouCoo_nominal=Buildings.Templates.Data.Defaults.TSouHpCoo, TSouHea_nominal=Buildings.Templates.Data.Defaults.TSouHpHea, dpSouWwHea_nominal=Buildings.Templates.Data.Defaults.dpChiWatChi, mSouWwCoo_flow_nominal=datHpWw.mSouWwHea_flow_nominal, mSouWwHea_flow_nominal=datHpWw.mHeaWat_flow_nominal, perFit(hea( P=datHpAw.capHea_nominal/Buildings.Templates.Data.Defaults.COPHpWwHea, coeQ={-4.2670305442,-0.7381077035,6.0049480456,0,0}, coeP={-4.9107455513,5.3665308366,0.5447612754,0,0}, TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed, TRefSou=Buildings.Templates.Data.Defaults.TSouHpHea), coo( P=datHpAw.capCoo_nominal/Buildings.Templates.Data.Defaults.COPHpWwCoo, coeQ={-2.2545246871,6.9089257665,-3.6548225094,0,0}, coeP={-5.8086010402,1.6894933858,5.1167787436,0,0}, TRefLoa=Buildings.Templates.Data.Defaults.TChiWatRet, TRefSou=Buildings.Templates.Data.Defaults.TSouHpCoo))) "Reversible WWHP parameters parameters"; Fluid.Sensors.TemperatureTwoPort TRet2(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Return temperature"; Fluid.Sensors.TemperatureTwoPort TSup2(redeclare final package Medium = Medium, final m_flow_nominal=datHpAw.mChiWat_flow_nominal) "Supply temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp TSouHea( y(final unit="K", displayUnit="degC"), height=4, duration=500, offset=datHpWw.TSouHea_nominal, startTime=2400) "Source fluid supply temperature value"; Buildings.Controls.OBC.CDL.Reals.Sources.Ramp TSouCoo( y(final unit="K", displayUnit="degC"), height=-4, duration=500, offset=datHpWw.TSouCoo_nominal, startTime=1400) "Source fluid supply temperature value"; Buildings.Controls.OBC.CDL.Reals.Switch TSouAct "Active source fluid supply temperature"; Buildings.Controls.OBC.CDL.Reals.Switch pInl_rel1 "Active inlet gaupe pressure"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant pSouInlHea(k=retSou.p + hpWw.dpSouHea_nominal) "Source fluid inlet pressure"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant pSouInlCoo(k=retSou.p + hpWw.dpSouCoo_nominal) "Source fluid inlet pressure"; Fluid.Sources.Boundary_pT inlHpSou( redeclare final package Medium = Medium, use_p_in=true, use_T_in=true, nPorts=1) "Boundary conditions or source side fluid at HP inlet"; Fluid.Sources.Boundary_pT retSou( redeclare final package Medium=Medium, p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325, nPorts=1) "Boundary condition at source system return"; Fluid.FixedResistances.PressureDrop res( redeclare final package Medium = Medium, final m_flow_nominal=datHpWw.mHeaWat_flow_nominal, final dp_nominal=datHpWw.dpHeaWat_nominal) "CHW/HW pressure drop computed externally"; Fluid.FixedResistances.PressureDrop resSou( redeclare final package Medium = Medium, final m_flow_nominal=datHpWw.mSouWwHea_flow_nominal, final dp_nominal=datHpWw.dpSouWwHea_nominal) "Source fluid pressure drop computed externally"; protected Interfaces.Bus bus "HP control bus"; protected Interfaces.Bus bus1 "HP control bus"; protected Interfaces.Bus bus2 "HP control bus"; equation connect(y1Hea.y[1], TSetAct.u2); connect(TChiWatSupSet.y, TSetAct.u3); connect(THeaWatSupSet.y, TSetAct.u1); connect(TSup.port_b, sup.ports[1]); connect(THeaWatRet.y, TRetAct.u1); connect(y1Hea.y[1], TRetAct.u2); connect(TChiWatRet.y, TRetAct.u3); connect(hpAw.port_b, TSup.port_a); connect(TRetAct.y, inlHp.T_in); connect(y1Hea.y[1], bus.y1Hea); connect(y1.y[1], bus.y1); connect(TSetAct.y, bus.TSet); connect(pInl_rel.y, inlHp.p_in); connect(pHeaWatInl.y, pInl_rel.u1); connect(pChiWatInl.y, pInl_rel.u3); connect(y1Hea.y[1], pInl_rel.u2); connect(bus, hpAw.bus); connect(weaDat.weaBus, hpAw.busWea); connect(inlHp.ports[1], TRet.port_a); connect(TRet.port_b, hpAw.port_a); connect(bus1, hpAwNrv.bus); connect(y1.y[1], bus1.y1); connect(hpAwNrv.port_b, TSup1.port_a); connect(TRet1.port_b, hpAwNrv.port_a); connect(TSup1.port_b, sup.ports[2]); connect(inlHp.ports[2], TRet1.port_a); connect(weaDat.weaBus, hpAwNrv.busWea); connect(THeaWatSupSet.y, bus1.TSet); connect(hpWw.port_b, TSup2.port_a); connect(TSup2.port_b, sup.ports[3]); connect(inlHp.ports[3], TRet2.port_a); connect(bus2, hpWw.bus); connect(TSouHea.y, TSouAct.u1); connect(y1Hea.y[1], TSouAct.u2); connect(TSouCoo.y, TSouAct.u3); connect(pSouInlHea.y, pInl_rel1.u1); connect(pSouInlCoo.y, pInl_rel1.u3); connect(y1Hea.y[1], pInl_rel1.u2); connect(retSou.ports[1], hpWw.port_bSou); connect(TSouAct.y, inlHpSou.T_in); connect(pInl_rel1.y, inlHpSou.p_in); connect(TSetAct.y, bus2.TSet); connect(y1.y[1], bus2.y1); connect(y1Hea.y[1], bus2.y1Hea); connect(TRet2.port_b, res.port_a); connect(res.port_b, hpWw.port_a); connect(hpWw.port_aSou, resSou.port_b); connect(inlHpSou.ports[1], resSou.port_a); end HeatPumpEquationFit;