Buildings.Templates.Plants.HeatPumps.Components.Interfaces

Interface classes

Information

This package contains interface classes.

Extends from Modelica.Icons.InterfacesPackage (Icon for packages containing interfaces).

Package Content

Name Description
Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController PartialController Interface for heat pump plant controller
Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialHeatPumpGroup PartialHeatPumpGroup Interface for heat pump group

Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController

Interface for heat pump plant controller

Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController

Information

This partial class provides a standard interface for heat pump plant controllers.

Parameters

TypeNameDefaultDescription
Controllerdatdat(cfg=cfg)Parameter record for controller
Booleanhave_senVHeaWatPri Set to true for plants with primary HW flow sensor
Booleanhave_senVHeaWatLoo Set to true for plants with HW loop flow sensor
Booleanhave_senVHeaWatSec Set to true for plants with secondary HW flow sensor
Booleanhave_senVChiWatPri Set to true for plants with primary CHW flow sensor
Booleanhave_senVChiWatLoo Set to true for plants with CHW loop flow sensor
Booleanhave_senVChiWatSec Set to true for plants with secondary CHW flow sensor
Booleanhave_senTHeaWatPriRet Set to true for plants with primary HW return temperature sensor
Booleanhave_senTHeaWatLooRet Set to true for plants with HW loop return temperature sensor
Booleanhave_senTChiWatPriRet Set to true for plants with primary CHW return temperature sensor
Booleanhave_senTChiWatLooRet Set to true for plants with CHW loop return temperature sensor
Booleanhave_senTHeaWatSecSup Set to true for plants with secondary HW supply temperature sensor
Booleanhave_senTChiWatSecSup Set to true for plants with secondary CHW supply temperature sensor
Booleanhave_senTHeaWatSecRet Set to true for plants with secondary HW return temperature sensor
Booleanhave_senTChiWatSecRet Set to true for plants with secondary CHW return temperature sensor
Configuration
HeatPumpPlantcfgcfg(typCtl=typ, nAirHan=nAir...Plant configuration parameters
Controllertyp Type of controller
IntegernAirHan Number of air handling units served by the plant
IntegernEquZon Number of terminal units (zone equipment) served by the plant
Sensors
Booleanhave_senTPriRet_selectfalseSet to true for plants with primary CHW/HW return temperature sensor
Booleanhave_senTLooRet_selectfalseSet to true for plants with CHW/HW loop return temperature sensor (load side of minimum flow bypass)
Booleanhave_senDpHeaWatRemWirfalseSet to true for remote HW differential pressure sensor(s) hardwired to plant or pump controller
IntegernSenDpHeaWatRem1Number of remote HW differential pressure sensors used for HW pump speed control
Booleanhave_senDpChiWatRemWirhave_senDpHeaWatRemWirSet to true for remote CHW differential pressure sensor(s) hardwired to plant or pump controller
IntegernSenDpChiWatRem1Number of remote CHW differential pressure sensors used for CHW pump speed control
Plant enable
Booleanhave_inpSchfalseSet to true to provide schedule via software input point

Connectors

TypeNameDescription
BusbusPlant control bus
BusbusAirHan[nAirHan]Air handling unit control bus
BusbusEquZon[nEquZon]Terminal unit control bus

Modelica definition

block PartialController "Interface for heat pump plant controller" /* * The following bindings are for parameters that are propagated *up* * from the controller to the plant configuration record. * All other configuration parameters (e.g. nHp) are propagated *down* * from the plant configuration record to the controller. */ parameter Buildings.Templates.Plants.HeatPumps.Configuration.HeatPumpPlant cfg( typCtl=typ, nAirHan=nAirHan, nEquZon=nEquZon, have_senDpHeaWatRemWir=have_senDpHeaWatRemWir, nSenDpHeaWatRem=nSenDpHeaWatRem, have_senDpChiWatRemWir=have_senDpChiWatRemWir, nSenDpChiWatRem=nSenDpChiWatRem) "Plant configuration parameters"; parameter Buildings.Templates.Plants.HeatPumps.Components.Data.Controller dat( cfg=cfg) "Parameter record for controller"; final parameter Integer nHp = cfg.nHp "Number of heat pumps (excluding polyvalent HPs)"; final parameter Integer nPhp = cfg.nPhp "Number of polyvalent heat pumps"; parameter Buildings.Templates.Plants.HeatPumps.Types.Controller typ "Type of controller"; parameter Integer nAirHan( final min=if typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop and nEquZon == 0 then 1 else 0, start=0) "Number of air handling units served by the plant"; parameter Integer nEquZon( final min=if typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop and nAirHan == 0 then 1 else 0, start=0) "Number of terminal units (zone equipment) served by the plant"; // Sensor configuration: see the code comments in // Buildings.Templates.Plants.Controls.HeatPumps.AirToWater // for the rationale to enable the parameters *_select below. parameter Boolean have_senTPriRet_select(start=false) = false "Set to true for plants with primary CHW/HW return temperature sensor"; parameter Boolean have_senTLooRet_select(start=false) = false "Set to true for plants with CHW/HW loop return temperature sensor (load side of minimum flow bypass)"; parameter Boolean have_senDpHeaWatRemWir = false "Set to true for remote HW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpHeaWatRem( final min=if typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop then 1 else 0) = 1 "Number of remote HW differential pressure sensors used for HW pump speed control"; parameter Boolean have_senDpChiWatRemWir = have_senDpHeaWatRemWir "Set to true for remote CHW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpChiWatRem( final min=if typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop then 1 else 0) = 1 "Number of remote CHW differential pressure sensors used for CHW pump speed control"; parameter Boolean have_inpSch(start=false) = false "Set to true to provide schedule via software input point"; final parameter Real schHea[:, 2] = dat.schHea "Heating mode enable schedule"; final parameter Real schCoo[:, 2] = dat.schCoo "Cooling mode enable schedule"; // Bind the following disabled parameters to the corresponding controller // parameters in derived class to avoid duplicating final assignment equations. parameter Boolean have_senVHeaWatPri(start=false) "Set to true for plants with primary HW flow sensor"; parameter Boolean have_senVHeaWatLoo(start=false) "Set to true for plants with HW loop flow sensor"; parameter Boolean have_senVHeaWatSec(start=false) "Set to true for plants with secondary HW flow sensor"; parameter Boolean have_senVChiWatPri(start=false) "Set to true for plants with primary CHW flow sensor"; parameter Boolean have_senVChiWatLoo(start=false) "Set to true for plants with CHW loop flow sensor"; parameter Boolean have_senVChiWatSec(start=false) "Set to true for plants with secondary CHW flow sensor"; parameter Boolean have_senTHeaWatPriRet(start=false) "Set to true for plants with primary HW return temperature sensor"; parameter Boolean have_senTHeaWatLooRet(start=false) "Set to true for plants with HW loop return temperature sensor"; parameter Boolean have_senTChiWatPriRet(start=false) "Set to true for plants with primary CHW return temperature sensor"; parameter Boolean have_senTChiWatLooRet(start=false) "Set to true for plants with CHW loop return temperature sensor"; parameter Boolean have_senTHeaWatSecSup(start=false) "Set to true for plants with secondary HW supply temperature sensor"; parameter Boolean have_senTChiWatSecSup(start=false) "Set to true for plants with secondary CHW supply temperature sensor"; parameter Boolean have_senTHeaWatSecRet(start=false) "Set to true for plants with secondary HW return temperature sensor"; parameter Boolean have_senTChiWatSecRet(start=false) "Set to true for plants with secondary CHW return temperature sensor"; Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus "Plant control bus"; Buildings.Templates.AirHandlersFans.Interfaces.Bus busAirHan[nAirHan] if nAirHan > 0 "Air handling unit control bus"; Buildings.Templates.ZoneEquipment.Interfaces.Bus busEquZon[nEquZon] if nEquZon > 0 "Terminal unit control bus"; Controls.PrimaryPumpSignalRouting rouPumChiWatPri( final typ=cfg.typPumChiWatPri, final typArr=cfg.typArrPumPri, final nPum=cfg.nPumChiWatPri, nHp=if cfg.have_pumChiWatPriDedHp then cfg.nHp else 0, final nPhp=cfg.nPhp) if cfg.typPumChiWatPri <> Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None and typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop "Primary CHW pump signal routing"; Controls.PrimaryPumpSignalRouting rouPumHeaWatPri( final typ=cfg.typPumHeaWatPri, final typArr=cfg.typArrPumPri, final nPum=cfg.nPumHeaWatPri, nHp=cfg.nHp, final nPhp=cfg.nPhp) if cfg.typPumHeaWatPri <> Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None and typ <> Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop "Primary HW pump signal routing"; protected Buildings.Templates.Components.Interfaces.Bus busHp[nHp] if cfg.have_hp "Heat pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumHeaWatPri if cfg.typPumHeaWatPri <> Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None "Primary HW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumHeaWatSec if cfg.typPumHeaWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary HW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumChiWatPri if cfg.typPumChiWatPri <> Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None "Primary CHW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumChiWatSec if cfg.typPumHeaWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary CHW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpInlIso[nHp] if cfg.have_hp and cfg.have_heaWat and cfg.have_valHpInlIso "Heat pump inlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpOutIso[nHp] if cfg.have_hp and cfg.have_heaWat and cfg.have_valHpOutIso "Heat pump outlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatHpInlIso[nHp] if cfg.have_hp and cfg.have_chiWat and cfg.have_valHpInlIso "Heat pump inlet CHW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatHpOutIso[nHp] if cfg.have_hp and cfg.have_chiWat and cfg.have_valHpOutIso "Heat pump outlet CHW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busPumChiWatHrc if cfg.have_hrc "Sidestream HRC CHW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumHeaWatHrc if cfg.have_hrc "Sidestream HRC HW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busHrc if cfg.have_hrc "Sidestream HRC control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatMinByp if cfg.have_valHeaWatMinByp "HW minimum flow bypass valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatMinByp if cfg.have_valChiWatMinByp "CHW minimum flow bypass valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatPhpInlIso[nPhp] if cfg.have_php and cfg.have_heaWat and cfg.have_valPhpInlIso "Polyvalent HP inlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatPhpOutIso[nPhp] if cfg.have_php and cfg.have_heaWat and cfg.have_valPhpOutIso "Polyvalent HP outlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatPhpInlIso[nPhp] if cfg.have_php and cfg.have_chiWat and cfg.have_valPhpInlIso "Polyvalent HP inlet CHW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatPhpOutIso[nPhp] if cfg.have_php and cfg.have_chiWat and cfg.have_valPhpOutIso "Polyvalent HP outlet CHW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busPhp[nPhp] if cfg.have_php "Polyvalent HP control bus"; equation /* Control point connection - start */ connect(busHp, bus.hp); connect(busHrc, bus.hrc); connect(busPumChiWatHrc, bus.pumChiWatHrc); connect(busPumChiWatPri, bus.pumChiWatPri); connect(busPumChiWatSec, bus.pumChiWatSec); connect(busPumHeaWatHrc, bus.pumHeaWatHrc); connect(busPumHeaWatPri, bus.pumHeaWatPri); connect(busPumHeaWatSec, bus.pumHeaWatSec); connect(busPhp, bus.php); connect(busValChiWatHpInlIso, bus.valChiWatHpInlIso); connect(busValChiWatHpOutIso, bus.valChiWatHpOutIso); connect(busValChiWatPhpInlIso, bus.valChiWatPhpInlIso); connect(busValChiWatPhpOutIso, bus.valChiWatPhpOutIso); connect(busValChiWatMinByp, bus.valChiWatMinByp); connect(busValHeaWatHpInlIso, bus.valHeaWatHpInlIso); connect(busValHeaWatHpOutIso, bus.valHeaWatHpOutIso); connect(busValHeaWatPhpInlIso, bus.valHeaWatPhpInlIso); connect(busValHeaWatPhpOutIso, bus.valHeaWatPhpOutIso); connect(busValHeaWatMinByp, bus.valHeaWatMinByp); /* Control point connection - stop */ connect(rouPumChiWatPri.bus, busPumChiWatPri); connect(rouPumHeaWatPri.bus, busPumHeaWatPri); end PartialController;

Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialHeatPumpGroup Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialHeatPumpGroup

Interface for heat pump group

Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialHeatPumpGroup

Information

This partial class provides a standard interface for heat pump group models.

Parameters

TypeNameDefaultDescription
replaceable package MediumHeaWatBuildings.Media.WaterHW medium
replaceable package MediumChiWatMediumHeaWatCHW medium
replaceable package MediumSouBuildings.Media.WaterSource-side medium
replaceable package MediumAirBuildings.Media.AirAir medium
HeatPumpGroupdatdat(have_hp=have_hp, have_ph...Design and operating parameters
Configuration
Booleanhave_hptrueSet to true for plants with non-reversible or reversible heat pumps
Booleanhave_phpfalseSet to true for plants with polyvalent heat pumps
IntegernHp Number of heat pumps (excluding polyvalent units)
IntegernPhp0Number of polyvalent heat pumps
HeatPumptypHp Equipment type
Booleanis_rev Set to true for reversible heat pumps, false for heating only
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Assumptions
BooleanallowFlowReversaltrueLoad side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal
BooleanallowFlowReversalSoutrueSource side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal
Booleanhave_dpChiHeaWattrueSet to true for CHW/HW pressure drop computed by this model, false for external computation
Booleanhave_dpSoutrueSet to true for source fluid pressure drop computed by this model, false for external computation
Advanced
StringidEqu[nHp + nPhp] nHp then "HR-" + String(i - nHp) else "HP-" + String(i) for i in 1:nHp + nPhp}">(if typHp == Buildings.Templ...Equipment identifier
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
replaceable package MediumHeaWatHW medium
replaceable package MediumChiWatCHW medium
replaceable package MediumSouSource-side medium
replaceable package MediumAirAir medium
FluidPorts_bports_bChiHeaWatHp[nHp]CHW/HW supply – Heat pumps
FluidPorts_aports_aChiHeaWatHp[nHp]CHW/HW return – Heat pumps
FluidPorts_bports_bSou[nHp + nPhp]Source fluid return (from heat pumps)
FluidPorts_aports_aSou[nHp + nPhp]Source fluid supply (to heat pumps)
FluidPorts_bports_bHeaWatPhp[nPhp]HW supply – Polyvalent heat pumps
FluidPorts_bports_bChiWatPhp[nPhp]CHW supply – Polyvalent heat pumps
FluidPorts_aports_aHeaWatPhp[nPhp]HW return – Polyvalent heat pumps
FluidPorts_aports_aChiWatPhp[nPhp]CHW return – Polyvalent heat pumps
BusbusPlant control bus
BusbusWeaWeather bus

Modelica definition

model PartialHeatPumpGroup "Interface for heat pump group" replaceable package MediumHeaWat = Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "HW medium"; replaceable package MediumChiWat = MediumHeaWat constrainedby Modelica.Media.Interfaces.PartialMedium "CHW medium"; /* * Derived classes representing AWHP shall use: * redeclare final package MediumSou = MediumAir */ replaceable package MediumSou = Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Source-side medium"; replaceable package MediumAir = Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air medium"; parameter Boolean have_hp = true "Set to true for plants with non-reversible or reversible heat pumps"; parameter Boolean have_php=false "Set to true for plants with polyvalent heat pumps"; parameter Integer nHp "Number of heat pumps (excluding polyvalent units)"; parameter Integer nPhp=0 "Number of polyvalent heat pumps"; parameter Buildings.Templates.Components.Types.HeatPump typHp "Equipment type"; parameter Boolean is_rev "Set to true for reversible heat pumps, false for heating only"; parameter Buildings.Templates.Plants.HeatPumps.Components.Data.HeatPumpGroup dat( have_hp=have_hp, have_php=have_php, typHp=typHp, is_rev=is_rev, cpHeaWat_default=cpHeaWat_default, cpChiWatPhp_default=cpChiWat_default, cpSou_default=cpSou_default) "Design and operating parameters"; final parameter Buildings.Templates.Components.Data.HeatPump datHp[nHp]( each final typMod=if is_rev then Buildings.Templates.Components.Types.HeatPumpCapability.Reversible else Buildings.Templates.Components.Types.HeatPumpCapability.HeatingOnly, each final typ=typHp, each final cpHeaWat_default=cpHeaWat_default, each final cpSou_default=cpSou_default, final mHeaWat_flow_nominal=fill(dat.mHeaWatHp_flow_nominal, nHp), final mSouWwCoo_flow_nominal=fill(dat.mSouWwCooHp_flow_nominal, nHp), final TSouHea_nominal=fill(dat.TSouHeaHp_nominal, nHp), final mChiWat_flow_nominal=fill(dat.mChiWatHp_flow_nominal, nHp), final dpSouWwHea_nominal=fill(dat.dpSouWwHeaHp_nominal, nHp), final THeaWatSup_nominal=fill(dat.THeaWatSupHp_nominal, nHp), final dpHeaWat_nominal=fill(dat.dpHeaWatHp_nominal, nHp), final mSouWwHea_flow_nominal=fill(dat.mSouWwHeaHp_flow_nominal, nHp), final TSouCoo_nominal=fill(dat.TSouCooHp_nominal, nHp), each final perHea=dat.perHeaHp, each final perCoo=dat.perCooHp, final capCoo_nominal=fill(dat.capCooHp_nominal, nHp), final TChiWatSup_nominal=fill(dat.TChiWatSupHp_nominal, nHp), final capHea_nominal=fill(dat.capHeaHp_nominal, nHp), final P_min=fill(dat.PHp_min, nHp)) if have_hp "Design and operating parameters - Each HP"; final parameter Buildings.Templates.Components.Data.HeatPump datPhp[nPhp]( each final typMod=Buildings.Templates.Components.Types.HeatPumpCapability.Polyvalent, each final typ=typHp, each final cpHeaWat_default=cpHeaWat_default, each final cpChiWatPhp_default=cpChiWat_default, each final cpSou_default=cpSou_default, final mHeaWat_flow_nominal=fill(dat.mHeaWatPhp_flow_nominal, nPhp), final mSouWwCoo_flow_nominal=fill(dat.mSouWwCooPhp_flow_nominal, nPhp), final TSouHea_nominal=fill(dat.TSouHeaPhp_nominal, nPhp), final mChiWat_flow_nominal=fill(dat.mChiWatPhp_flow_nominal, nPhp), final dpSouWwHea_nominal=fill(dat.dpSouWwHeaPhp_nominal, nPhp), final THeaWatSup_nominal=fill(dat.THeaWatSupPhp_nominal, nPhp), final dpHeaWat_nominal=fill(dat.dpHeaWatPhp_nominal, nPhp), final dpChiWatPhp_nominal=fill(dat.dpChiWatPhp_nominal, nPhp), final mSouWwHea_flow_nominal=fill(dat.mSouWwHeaPhp_flow_nominal, nPhp), final TSouCoo_nominal=fill(dat.TSouCooPhp_nominal, nPhp), each final perPhp=dat.perPhp, final capCoo_nominal=fill(dat.capCooPhp_nominal, nPhp), final TChiWatSup_nominal=fill(dat.TChiWatSupPhp_nominal, nPhp), final capHea_nominal=fill(dat.capHeaPhp_nominal, nPhp), final capCooShc_nominal=fill(dat.capCooShcPhp_nominal, nPhp), final capHeaShc_nominal=fill(dat.capHeaShcPhp_nominal, nPhp), final P_min=fill(dat.PPhp_min, nPhp)) if have_php "Design and operating parameters - Each polyvalent HP"; final parameter Modelica.Units.SI.MassFlowRate mHeaWatHp_flow_nominal = dat.mHeaWatHp_flow_nominal "Design HW mass flow rate - Each heat pump"; final parameter Modelica.Units.SI.HeatFlowRate capHeaHp_nominal = dat.capHeaHp_nominal "Design heating capacity - Each heat pump"; final parameter Modelica.Units.SI.HeatFlowRate QHeaHp_flow_nominal = abs(capHeaHp_nominal) "Design heating heat flow rate - Each heat pump"; final parameter Modelica.Units.SI.PressureDifference dpHeaWatHp_nominal = dat.dpHeaWatHp_nominal "Design HW pressure drop - Each heat pump"; final parameter Modelica.Units.SI.Temperature THeaWatSupHp_nominal = dat.THeaWatSupHp_nominal "Design HW supply temperature - Each heat pump"; final parameter Modelica.Units.SI.Temperature THeaWatRetHp_nominal = dat.THeaWatRetHp_nominal "Design HW return temperature - Each heat pump"; final parameter Modelica.Units.SI.MassFlowRate mChiWatHp_flow_nominal = dat.mChiWatHp_flow_nominal "Design CHW mass flow rate - Each heat pump"; final parameter Modelica.Units.SI.PressureDifference dpChiWatHp_nominal = dat.dpChiWatHp_nominal "Design CHW pressure drop - Each heat pump"; final parameter Modelica.Units.SI.HeatFlowRate capCooHp_nominal = dat.capCooHp_nominal "Design cooling capacity - Each heat pump"; final parameter Modelica.Units.SI.HeatFlowRate QCooHp_flow_nominal = -abs(capCooHp_nominal) "Design cooling heat flow rate - Each heat pump"; final parameter Modelica.Units.SI.Temperature TChiWatSupHp_nominal = dat.TChiWatSupHp_nominal "Design CHW supply temperature - Each heat pump"; final parameter Modelica.Units.SI.Temperature TChiWatRetHp_nominal = dat.TChiWatRetHp_nominal "Design CHW return temperature - Each heat pump"; final parameter Modelica.Units.SI.MassFlowRate mSouHeaHp_flow_nominal = dat.mSouHeaHp_flow_nominal "Design source fluid mass flow rate in heating mode - Each heat pump"; final parameter Modelica.Units.SI.PressureDifference dpSouHeaHp_nominal = dat.dpSouHeaHp_nominal "Design source fluid pressure drop in heating mode - Each heat pump"; final parameter Modelica.Units.SI.MassFlowRate mSouCooHp_flow_nominal = dat.mSouCooHp_flow_nominal "Design source fluid mass flow rate in cooling mode - Each heat pump"; final parameter Modelica.Units.SI.PressureDifference dpSouCooHp_nominal = dat.dpSouCooHp_nominal "Designs source fluid pressure drop in cooling mode - Each heat pump"; final parameter Modelica.Units.SI.Temperature TSouCooHp_nominal = dat.TSouCooHp_nominal "Design OAT or source fluid supply temperature (condenser entering) in cooling mode - Each heat pump"; final parameter Modelica.Units.SI.Temperature TSouHeaHp_nominal = dat.TSouHeaHp_nominal "Design OAT or source fluid supply temperature (evaporator entering) in heating mode - Each heat pump"; parameter Modelica.Fluid.Types.Dynamics energyDynamics = Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Boolean allowFlowReversal = true "Load side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal"; parameter Boolean allowFlowReversalSou = true "Source side flow reversal: false to simplify equations, assuming, but not enforcing, no flow reversal"; parameter Boolean have_dpChiHeaWat = true "Set to true for CHW/HW pressure drop computed by this model, false for external computation"; parameter Boolean have_dpSou = true "Set to true for source fluid pressure drop computed by this model, false for external computation"; parameter String idEqu[nHp +nPhp] = (if typHp == Buildings.Templates.Components.Types.HeatPump.AirToWater then "AW" elseif typHp == Buildings.Templates.Components.Types.HeatPump.WaterToWater then "WW" else "") .+ {if i > nHp then "HR-" + String(i - nHp) else "HP-" + String(i) for i in 1:nHp +nPhp} "Equipment identifier"; final parameter MediumHeaWat.SpecificHeatCapacity cpHeaWat_default = MediumHeaWat.specificHeatCapacityCp(staHeaWat_default) "HW default specific heat capacity"; final parameter MediumHeaWat.ThermodynamicState staHeaWat_default = MediumHeaWat.setState_pTX( T=THeaWatSupHp_nominal, p=MediumHeaWat.p_default, X=MediumHeaWat.X_default) "HW default state"; final parameter MediumChiWat.SpecificHeatCapacity cpChiWat_default = MediumChiWat.specificHeatCapacityCp(staChiWat_default) "CHW default specific heat capacity"; final parameter MediumChiWat.ThermodynamicState staChiWat_default = MediumChiWat.setState_pTX( T=TChiWatSupHp_nominal, p=MediumChiWat.p_default, X=MediumChiWat.X_default) "CHW default state"; final parameter MediumSou.SpecificHeatCapacity cpSou_default = MediumSou.specificHeatCapacityCp(staSou_default) "Source fluid default specific heat capacity"; final parameter MediumSou.ThermodynamicState staSou_default = MediumSou.setState_pTX( T=TSouHeaHp_nominal, p=MediumSou.p_default, X=MediumSou.X_default) "Source fluid default state"; // Diagnostics parameter Boolean show_T = false "= true, if actual temperature at port is computed"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWatHp[nHp]( redeclare each final package Medium=MediumHeaWat, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), each h_outflow( start=MediumHeaWat.h_default, nominal=MediumHeaWat.h_default)) if have_hp "CHW/HW supply – Heat pumps"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWatHp[nHp]( redeclare each final package Medium=MediumHeaWat, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow( start=MediumHeaWat.h_default, nominal=MediumHeaWat.h_default)) if have_hp "CHW/HW return – Heat pumps"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bSou[nHp +nPhp]( redeclare each final package Medium=MediumSou, each m_flow( max=if allowFlowReversalSou then +Modelica.Constants.inf else 0), each h_outflow(start=MediumSou.h_default, nominal=MediumSou.h_default)) "Source fluid return (from heat pumps)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aSou[nHp +nPhp]( redeclare each final package Medium=MediumSou, each m_flow( min=if allowFlowReversalSou then -Modelica.Constants.inf else 0), each h_outflow(start=MediumSou.h_default, nominal=MediumSou.h_default)) "Source fluid supply (to heat pumps)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bHeaWatPhp[nPhp]( redeclare each final package Medium=MediumHeaWat, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), each h_outflow( start=MediumHeaWat.h_default, nominal=MediumHeaWat.h_default)) if have_php "HW supply – Polyvalent heat pumps"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiWatPhp[nPhp]( redeclare each final package Medium=MediumChiWat, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), each h_outflow( start=MediumChiWat.h_default, nominal=MediumChiWat.h_default)) if have_php "CHW supply – Polyvalent heat pumps"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aHeaWatPhp[nPhp]( redeclare each final package Medium=MediumHeaWat, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow( start=MediumHeaWat.h_default, nominal=MediumHeaWat.h_default)) if have_php "HW return – Polyvalent heat pumps"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiWatPhp[nPhp]( redeclare each final package Medium=MediumChiWat, each m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), each h_outflow( start=MediumChiWat.h_default, nominal=MediumChiWat.h_default)) if have_php "CHW return – Polyvalent heat pumps"; Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus "Plant control bus"; Buildings.BoundaryConditions.WeatherData.Bus busWea if typHp == Buildings.Templates.Components.Types.HeatPump.AirToWater "Weather bus"; MediumSou.ThermodynamicState sta_aSou[nHp +nPhp] = MediumSou.setState_phX( ports_aSou.p, noEvent(actualStream(ports_aSou.h_outflow)), noEvent(actualStream(ports_aSou.Xi_outflow))) if show_T "Source medium properties in port_aSou"; MediumSou.ThermodynamicState sta_bSou[nHp +nPhp] = MediumSou.setState_phX( ports_bSou.p, noEvent(actualStream(ports_bSou.h_outflow)), noEvent(actualStream(ports_bSou.Xi_outflow))) if show_T "Source medium properties in port_bSou"; MediumHeaWat.ThermodynamicState sta_aChiHeaWatHp[nHp] = MediumHeaWat.setState_phX( ports_aChiHeaWatHp.p, noEvent(actualStream(ports_aChiHeaWatHp.h_outflow)), noEvent(actualStream(ports_aChiHeaWatHp.Xi_outflow))) if show_T and have_hp "Source medium properties in port_aChiHeaWatHp"; MediumHeaWat.ThermodynamicState sta_bChiHeaWatHp[nHp] = MediumHeaWat.setState_phX( ports_bChiHeaWatHp.p, noEvent(actualStream(ports_bChiHeaWatHp.h_outflow)), noEvent(actualStream(ports_bChiHeaWatHp.Xi_outflow))) if show_T and have_hp "Source medium properties in port_bChiHeaWatHp"; MediumHeaWat.ThermodynamicState sta_aHeaWatPhp[nPhp] = MediumHeaWat.setState_phX( ports_aHeaWatPhp.p, noEvent(actualStream(ports_aHeaWatPhp.h_outflow)), noEvent(actualStream(ports_aHeaWatPhp.Xi_outflow))) if show_T and have_php "Source medium properties in port_aHeaWatPhp"; MediumHeaWat.ThermodynamicState sta_bHeaWatPhp[nPhp] = MediumHeaWat.setState_phX( ports_bHeaWatPhp.p, noEvent(actualStream(ports_bHeaWatPhp.h_outflow)), noEvent(actualStream(ports_bHeaWatPhp.Xi_outflow))) if show_T and have_php "Source medium properties in port_bHeaWatPhp"; MediumChiWat.ThermodynamicState sta_aChiWatPhp[nPhp] = MediumChiWat.setState_phX( ports_aChiWatPhp.p, noEvent(actualStream(ports_aChiWatPhp.h_outflow)), noEvent(actualStream(ports_aChiWatPhp.Xi_outflow))) if show_T and have_php "Source medium properties in port_aChiWatPhp"; MediumChiWat.ThermodynamicState sta_bChiWatPhp[nPhp] = MediumChiWat.setState_phX( ports_bChiWatPhp.p, noEvent(actualStream(ports_bChiWatPhp.h_outflow)), noEvent(actualStream(ports_bChiWatPhp.Xi_outflow))) if show_T and have_php "Source medium properties in port_bChiWatPhp"; protected Buildings.Templates.Components.Interfaces.Bus busHp[nHp] if have_hp "Heat pump control bus"; protected Buildings.Templates.Components.Interfaces.Bus busPhp[nPhp] if have_php "Polyvalent HP control bus"; equation connect(bus.hp, busHp); connect(bus.php, busPhp); end PartialHeatPumpGroup;