Buildings.Templates.Plants.HeatPumps

Heat pump plants

Information

This package contains templates for heat pump plants.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Templates.Plants.HeatPumps.AirToWater AirToWater Air-to-water heat pump plant
Buildings.Templates.Plants.HeatPumps.Components Components Package with component models
Buildings.Templates.Plants.HeatPumps.Configuration Configuration Records for configuration parameters
Buildings.Templates.Plants.HeatPumps.Data Data Records for design and operating parameters
Buildings.Templates.Plants.HeatPumps.Types Types Package with type definitions
Buildings.Templates.Plants.HeatPumps.Validation Validation Package with validation models
Buildings.Templates.Plants.HeatPumps.Interfaces Interfaces Interface classes

Buildings.Templates.Plants.HeatPumps.AirToWater Buildings.Templates.Plants.HeatPumps.AirToWater

Air-to-water heat pump plant

Buildings.Templates.Plants.HeatPumps.AirToWater

Information

Description

This template represents an air-to-water heat pump plant with closed-loop controls. While the heat pump plant configuration can be changed through parameters, the image below shows a typical configuration with two reversible air-to-water heat pumps, a primary-secondary distribution system and a sidestream heat recovery chiller. For a detailed schematic of the actual plant configuration, refer to the diagram view of the plant component. In Dymola, for example, you can access this by right-clicking the component pla in the model Buildings.Templates.Plants.HeatPumps.Validation.AirToWater and selecting "Show Component" from the context menu.

Image of heat pump plant

Currently, only identical heat pumps are supported. Although the template can accommodate any number of identical heat pumps, the graphical feedback for system configuration via the diagram layer is only accurate for up to 6 devices.

The supported plant configurations are enumerated in the table below. The first option displayed in bold characters corresponds to the default configuration.

Configuration parameterOptionsNotes
Function Heating and cooling
Heating-only
The plant always provides heating hot water.
Setting the parameter have_chiWat to true (default setting) allows modeling a plant that provides both heating hot water and chilled water.
Heat recovery Without sidestream heat recovery chiller
With sidestream heat recovery chiller
This option is only available for heating and cooling plants. When selected, the template includes a chiller and its associated dedicated primary CHW and CW pumps. The chiller is considered connected in a sidestream configuration to both the CHW return and the HW return.
Type of distribution Constant primary-variable secondary centralized
Variable primary-only
It is assumed that the HW and the CHW loops have the same type of distribution, as specified by this parameter.
Most AWHPs on the market use a reverse cycle for defrosting. This requires maximum primary flow during defrost cycles. Consequently, variable primary plants commonly adopt a high minimum flow setpoint, typically close to the design flow rate, effectively operating akin to constant primary plants but with variable speed pumps controlling the loop differential pressure. While the flow rate directed towards the loads varies, the bypass valve control loop ensures a constant primary flow for a given number of staged units.
"Centralized secondary pumps" refers to configurations with a single group of secondary pumps that is typically integrated into the plant.
Distributed secondary pumps with multiple secondary loops served by dedicated secondary pumps are currently not supported.
Type of primary pump arrangement Dedicated
Headered
It is assumed that the HW and the CHW loops have the same type of primary pump arrangement, as specified by this parameter.
Separate dedicated primary CHW pumps False
True
This option is only available for heating and cooling plants with dedicated primary pumps. If this option is not selected (default setting), each AWHP uses a common dedicated primary pump for HW and CHW – this pump is then denoted as the primary HW pump. Otherwise, each AWHP relies on a separate dedicated HW pump and a separate dedicated CHW pump.
Type of primary HW pumps Variable speed
Constant speed
For constant primary-variable secondary distributions, the variable speed primary pumps are commanded at fixed speeds, determined during the Testing, Adjusting and Balancing phase to provide design AWHP flow in heating and cooling modes. The same intent is achieved with constant speed primary pumps through the use of balancing valves.
Type of primary CHW pumps Variable speed
Constant speed
See the note above on primary HW pumps.
HW buffer tank HW buffer tank in the primary supply
HW buffer tank in the primary return
No HW buffer tank
By default, the HW buffer tank is considered integrated into the primary supply to mitigate the impact of defrost cycles on the temperature of the HW supplied to the loads. This assumes that the buffer tank is well-mixed.
The default sizing of the tank corresponds to 4 min of the design primary flow rate. This is based on manufacturer recommendations, which account for the fact that defrost cycles can take 3 to 5 min to complete.
CHW buffer tank CHW buffer tank in the primary return
CHW buffer tank in the primary supply
No CHW buffer tank
By default, the CHW buffer tank is considered integrated into the primary return to mitigate the impact of rapid load variations on the plant controls. This assumes that the buffer tank is well-mixed.
The default sizing of the tank corresponds to 2 min of the design primary flow rate, based on manufacturer recommendations.
Controller Closed-loop controls with supply temperature and differential pressure reset
Most parts of the sequence of operation are similar to that described in ASHRAE, 2021 for chiller plants.
See the documentation of Buildings.Templates.Plants.Controls.HeatPumps.AirToWater for more details.
An open loop controller is also available for validation purposes.

Control points

The control sequence implemented in this template requires the external input points specified in the documentation of the controller Buildings.Templates.Plants.HeatPumps.Components.Controls.AirToWater.

Implementation details

The pressure drops of the heat pump CHW and HW heat exchangers are calculated within the isolation valve component valIso based on lumped flow coefficients for the sake of computational efficiency.

References

Extends from Buildings.Templates.Plants.HeatPumps.Interfaces.PartialHeatPumpPlant (Interface class for heat pump plant).

Parameters

TypeNameDefaultDescription
replaceable package MediumHeaWatWaterHW medium
replaceable package MediumHotWatWaterDHW medium
replaceable package MediumChiWatWaterCHW medium
replaceable package MediumSouWaterSource-side medium
replaceable package MediumAirAirAir medium
HeatPumpPlantdat Design and operating parameters
Configuration
Booleanhave_chiWattrueSet to true if the plant provides CHW
Booleanhave_hrc_selectfalseSet to true for plants with a sidestream heat recovery chiller
DistributiontypDis_select1Buildings.Templates.Plants.H...Type of distribution system
DistributiontypDis_select2 Type of distribution system
Heat pumps
HeatPumptypBuildings.Templates.Componen...Type of heat pump
IntegernHp Total number of heat pumps
Booleanis_revhave_chiWatSet to true for reversible heat pumps, false for heating only
Primary loop
PumpArrangementtypArrPumPriBuildings.Templates.Componen...Type of primary pump arrangement
PumpsPrimarytypPumHeaWatPri_select1Buildings.Templates.Plants.H...Type of primary HW pumps
IntegernPumHeaWatPri_selectnHpNumber of primary HW pumps
IntegrationPointtypTanHeaWat_selectBuildings.Templates.Componen...Specify if there is a HW buffer tank and where it is integrated into the system
Booleanhave_pumChiWatPriDed_selectfalseSet to true for plants with separate dedicated primary CHW pumps
PumpsPrimarytypPumChiWatPri_select1typPumHeaWatPriType of primary CHW pumps
IntegernPumChiWatPri_selectnHpNumber of primary CHW pumps
IntegrationPointtypTanChiWat_selectBuildings.Templates.Componen...Specify if there is a CHW buffer tank and where it is integrated into the system
Secondary HW loop
IntegernPumHeaWatSec_selectnHpNumber of secondary HW pumps
Secondary CHW loop
IntegernPumChiWatSec_selectnHpNumber of secondary CHW pumps
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for all valves
Booleanis_dpBalYPumSetCalfalseSet to true to automatically size balancing valves or evaluate pump speed providing design flow
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
replaceable package MediumChiWatCHW medium
replaceable package MediumSouSource-side medium
FluidPort_aport_aHeaWatHW return
FluidPort_bport_bHeaWatHW supply
FluidPort_aport_aChiWatCHW return
FluidPort_bport_bChiWatCHW supply
BusbusPlant control bus
BusbusAirHan[cfg.nAirHan]Air handling unit control bus
BusbusEquZon[cfg.nEquZon]Terminal unit control bus
BusbusWeaWeather bus

Modelica definition

model AirToWater "Air-to-water heat pump plant" extends Buildings.Templates.Plants.HeatPumps.Interfaces.PartialHeatPumpPlant( redeclare final package MediumChiWat=MediumHeaWat, redeclare final package MediumSou=MediumAir, redeclare Buildings.Templates.Plants.HeatPumps.Components.Controls.AirToWater ctl(ctl( final yPumHeaWatPriSet=yPumHeaWatPriSet, final yPumChiWatPriSet=yPumChiWatPriSet)), final typ=Buildings.Templates.Components.Types.HeatPump.AirToWater, final is_rev=have_chiWat, final cfg( final typMod=hp.typMod)); parameter Boolean is_dpBalYPumSetCal(start=false)=false "Set to true to automatically size balancing valves or evaluate pump speed providing design flow"; // The check valve pressure drop is scaled for configurations with common dedicated CHW and HW pumps. final parameter Modelica.Units.SI.PressureDifference dpValCheHeaWat_nominal= dat.dpValCheHeaWat_nominal * (hp.mHeaWatHp_flow_nominal / max(dat.pumHeaWatPri.m_flow_nominal))^2 "Primary HW pump check valve pressure drop at design HW flow rate"; final parameter Modelica.Units.SI.PressureDifference dpValCheChiWat_nominal= if have_chiWat then ( if typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None then dat.dpValCheHeaWat_nominal * (hp.mChiWatHp_flow_nominal / max(dat.pumHeaWatPri.m_flow_nominal))^2 else dat.dpValCheChiWat_nominal) else 0 "Primary (CHW or common HW and CHW) pump check valve pressure drop at design CHW flow rate"; final parameter Modelica.Units.SI.PressureDifference dpBalHeaWatHp_nominal= if is_dpBalYPumSetCal and typPumHeaWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant then Buildings.Templates.Utilities.computeBalancingPressureDrop( m_flow_nominal=hp.mHeaWatHp_flow_nominal, dp_nominal=hp.dpHeaWatHp_nominal + max(valIso.dpValveHeaWat_nominal) * ( (if have_valHpInlIso then 1 else 0) + (if have_valHpOutIso then 1 else 0)) + dpValCheHeaWat_nominal, datPum=dat.pumHeaWatPriSin[1]) else dat.dpBalHeaWatHp_nominal "HP HW balancing valve pressure drop at design HW flow"; final parameter Modelica.Units.SI.PressureDifference dpBalChiWatHp_nominal= if is_dpBalYPumSetCal and (typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant or have_chiWat and not have_pumChiWatPriDed and typPumHeaWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant) then Buildings.Templates.Utilities.computeBalancingPressureDrop( m_flow_nominal=hp.mChiWatHp_flow_nominal, dp_nominal=hp.dpChiWatHp_nominal + max(valIso.dpValveChiWat_nominal) * ( (if have_valHpInlIso then 1 else 0) + (if have_valHpOutIso then 1 else 0)) + dpValCheChiWat_nominal, datPum=if cfg.typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant then dat.pumChiWatPriSin[1] else dat.pumHeaWatPriSin[1]) else dat.dpBalChiWatHp_nominal "HP CHW balancing valve pressure drop at design CHW flow"; final parameter Real yPumHeaWatPriSet( final fixed=false, final max=2, final min=0, start=1, final unit="1") "Primary pump speed providing design heat pump flow in heating mode"; final parameter Real yPumChiWatPriSet( final fixed=false, final max=2, final min=0, start=1, final unit="1") "Primary pump speed providing design heat pump flow in cooling mode"; // Heat pumps, dedicated primary pumps and isolation valves // The handling of HP pressure drop is accounted for within the isolation valve component. Buildings.Templates.Plants.HeatPumps.Components.HeatPumpGroups.AirToWater hp( redeclare final package MediumHeaWat=MediumHeaWat, redeclare final package MediumAir=MediumAir, final nHp=nHp, final is_rev=is_rev, final energyDynamics=energyDynamics, final have_dpChiHeaWatHp=false, final have_dpSou=false, final dat=dat.hp, final allowFlowReversal=allowFlowReversal, final allowFlowReversalSou=false) "Heat pump group"; Components.PumpsPrimaryDedicated pumPri( redeclare final package Medium=MediumHeaWat, final nHp=nHp, final typArrPumPri=typArrPumPri, final have_pumChiWatPriDed=have_pumChiWatPriDed, final have_pumHeaWatPriVar=have_pumHeaWatPriVar, final have_pumChiWatPriVar=have_pumChiWatPriVar, final datPumHeaWat=dat.pumHeaWatPri, final datPumChiWat=dat.pumChiWatPri, final dpValCheHeaWat_nominal=fill(dat.dpValCheHeaWat_nominal, pumPri.nPum), final dpValCheChiWat_nominal=fill(dat.dpValCheChiWat_nominal, if have_pumChiWatPriDed then pumPri.nPum else 0), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal) "Dedicated primary pumps"; Components.ValvesIsolation valIso( redeclare final package Medium=MediumHeaWat, final nHp=nHp, final have_chiWat=have_chiWat, final have_valHpInlIso=have_valHpInlIso, final have_valHpOutIso=have_valHpOutIso, final have_pumChiWatPriDed=have_pumChiWatPriDed, final mHeaWatHp_flow_nominal=fill(dat.hp.mHeaWatHp_flow_nominal, nHp), final dpHeaWatHp_nominal=fill(dat.hp.dpHeaWatHp_nominal, nHp), final dpBalHeaWatHp_nominal=fill(dpBalHeaWatHp_nominal, nHp), final mChiWatHp_flow_nominal=fill(dat.hp.mChiWatHp_flow_nominal, nHp), final dpBalChiWatHp_nominal=fill(dpBalChiWatHp_nominal, nHp), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, linearized=linearized) "Heat pump isolation valves"; // Primary CHW loop Buildings.Templates.Components.Pumps.Multiple pumChiWatPri( final energyDynamics=energyDynamics, redeclare final package Medium=MediumChiWat, final dat=dat.pumChiWatPri, final dpValChe_nominal=fill(dpValCheChiWat_nominal, nPumChiWatPri), final nPum=nPumChiWatPri, final have_var=have_pumChiWatPriVar, final have_varCom=true, final allowFlowReversal=allowFlowReversal) if have_chiWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Headered primary CHW pumps"; Buildings.Templates.Components.Routing.SingleToMultiple inlPumChiWatPri( redeclare final package Medium = MediumChiWat, final nPorts=nPumChiWatPri, final m_flow_nominal=mChiWatPri_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_chiWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Primary CHW pumps inlet manifold"; Buildings.Templates.Components.Routing.MultipleToSingle outPumChiWatPri( redeclare final package Medium = MediumChiWat, final nPorts=nPumChiWatPri, final m_flow_nominal=mChiWatPri_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_chiWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Primary CHW pumps outlet manifold"; Buildings.Templates.Components.Routing.PassThroughFluid supChiWatPri( redeclare final package Medium = MediumChiWat, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_chiWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated "Primary CHW supply pipe - Plant with dedicated primary CHW pumps"; Buildings.Templates.Components.Sensors.VolumeFlowRate VChiWatPri_flow( redeclare final package Medium = MediumChiWat, final m_flow_nominal=mChiWatPri_flow_nominal, final allowFlowReversal=allowFlowReversal, final have_sen=ctl.have_senVChiWatPri, final text_flip=false, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter, icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply) if have_chiWat "Primary CHW volume flow rate"; Buildings.Templates.Components.Routing.Junction junChiWatBypSup( redeclare final package Medium=MediumChiWat, final m_flow_nominal=mChiWatPri_flow_nominal * {1, - 1, - 1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving) if have_chiWat "Fluid junction"; Buildings.Templates.Components.Sensors.Temperature TChiWatPriSup( redeclare final package Medium = MediumChiWat, final have_sen=true, final m_flow_nominal=mChiWatPri_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_chiWat "Primary CHW supply temperature"; Buildings.Templates.Components.Routing.Junction junChiWatBypRet( redeclare final package Medium = MediumChiWat, final m_flow_nominal=mChiWatPri_flow_nominal*{1,-1,1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=Buildings.Templates.Components.Types.IntegrationPoint.Supply) if have_chiWat "Fluid junction"; Buildings.Templates.Components.Sensors.Temperature TChiWatPriRet( redeclare final package Medium = MediumChiWat, final have_sen=ctl.have_senTChiWatPriRet, final m_flow_nominal=mChiWatPri_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) if have_chiWat "Primary CHW return temperature"; Buildings.Templates.Components.Actuators.Valve valChiWatMinByp( redeclare final package Medium=MediumChiWat, final dat=dat.valChiWatMinByp, final typ=if have_valChiWatMinByp then Buildings.Templates.Components.Types.Valve.TwoWayModulating else Buildings.Templates.Components.Types.Valve.None, final chaTwo=Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.Linear, final allowFlowReversal=allowFlowReversal, final energyDynamics=energyDynamics, linearized=linearized, from_dp=true) if have_valChiWatMinByp or have_bypChiWatFix "CHW minimum flow bypass valve or fixed bypass depending on type of distribution"; Buildings.Templates.Components.Tanks.Buffer tanChiWatSup( redeclare final package Medium = MediumChiWat, final have_tan=typTanChiWat == Buildings.Templates.Components.Types.IntegrationPoint.Supply, final V=dat.VTanChiWat, final m_flow_nominal=mChiWatPri_flow_nominal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal) if have_chiWat "CHW buffer tank"; Buildings.Templates.Components.Tanks.Buffer tanChiWatRet( redeclare final package Medium = MediumChiWat, final have_tan=typTanChiWat == Buildings.Templates.Components.Types.IntegrationPoint.Return, final V=dat.VTanChiWat, final m_flow_nominal=mChiWatPri_flow_nominal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal) if have_chiWat "CHW buffer tank"; // Secondary CHW loop Buildings.Templates.Components.Pumps.Multiple pumChiWatSec( final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, redeclare final package Medium=MediumChiWat, final nPum=nPumChiWatSec, final have_var=true, final have_varCom=true, final dat=dat.pumChiWatSec) if have_chiWat and typPumChiWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary CHW pumps"; Buildings.Templates.Components.Routing.SingleToMultiple inlPumChiWatSec( redeclare final package Medium = MediumChiWat, final nPorts=nPumChiWatSec, final m_flow_nominal=mChiWat_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_chiWat and typPumChiWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary CHW pumps inlet manifold"; Buildings.Templates.Components.Routing.MultipleToSingle outPumChiWatSec( redeclare final package Medium = MediumChiWat, final nPorts=nPumChiWatSec, final m_flow_nominal=mChiWat_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_chiWat and typPumChiWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary CHW pumps outlet manifold"; Buildings.Templates.Components.Routing.PassThroughFluid supChiWatSec( redeclare final package Medium = MediumChiWat, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_chiWat and typPumChiWatSec <> Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary CHW supply pipe - Plant without secondary CHW pumps"; Buildings.Templates.Components.Sensors.VolumeFlowRate VChiWatSec_flow( redeclare final package Medium = MediumChiWat, final m_flow_nominal=mChiWat_flow_nominal, final allowFlowReversal=allowFlowReversal, final have_sen=ctl.have_senVChiWatSec, final text_flip=false, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply) if have_chiWat "Secondary CHW volume flow rate"; Buildings.Templates.Components.Sensors.Temperature TChiWatSecSup( redeclare final package Medium = MediumChiWat, final have_sen=ctl.have_senTChiWatSecSup, final m_flow_nominal=mChiWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_chiWat "Secondary CHW supply temperature"; Buildings.Templates.Components.Sensors.Temperature TChiWatSecRet( redeclare final package Medium = MediumChiWat, final have_sen=ctl.have_senTChiWatSecRet, final m_flow_nominal=mChiWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) if have_chiWat "Secondary CHW return temperature"; Buildings.Templates.Components.Sensors.DifferentialPressure dpChiWatLoc( redeclare final package Medium = MediumChiWat, text_rotation=90) if have_chiWat and not ctl.have_senDpChiWatRemWir "Local CHW ∆p sensor"; // Primary HW loop Buildings.Templates.Components.Routing.SingleToMultiple inlPumHeaWatPri( redeclare final package Medium = MediumHeaWat, final nPorts=nPumHeaWatPri, final m_flow_nominal=mHeaWatPri_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_heaWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Primary HW pumps inlet manifold"; Buildings.Templates.Components.Pumps.Multiple pumHeaWatPri( final energyDynamics=energyDynamics, redeclare final package Medium=MediumHeaWat, final dat=dat.pumHeaWatPri, final dpValChe_nominal=fill(dpValCheHeaWat_nominal, nPumHeaWatPri), final nPum=nPumHeaWatPri, final have_var=have_pumHeaWatPriVar, final have_varCom=true, final allowFlowReversal=allowFlowReversal) if have_heaWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Headered primary HW pumps"; Buildings.Templates.Components.Routing.MultipleToSingle outPumHeaWatPri( redeclare final package Medium = MediumHeaWat, final nPorts=nPumHeaWatPri, final m_flow_nominal=mHeaWatPri_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if have_heaWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Primary HW pumps outlet manifold"; Buildings.Templates.Components.Routing.PassThroughFluid supHeaWatPri( redeclare final package Medium = MediumHeaWat, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_heaWat and typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated "Primary HW supply pipe - Plant with dedicated primary HW pumps"; Buildings.Templates.Components.Sensors.VolumeFlowRate VHeaWatPri_flow( redeclare final package Medium = MediumHeaWat, final m_flow_nominal=mHeaWatPri_flow_nominal, final allowFlowReversal=allowFlowReversal, final have_sen=ctl.have_senVHeaWatPri, final text_flip=false, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter, icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply) "Primary HW volume flow rate"; Buildings.Templates.Components.Routing.Junction junHeaWatBypSup( redeclare final package Medium=MediumHeaWat, final m_flow_nominal=mHeaWatPri_flow_nominal * {1, - 1, - 1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving) if have_heaWat "Fluid junction"; Buildings.Templates.Components.Sensors.Temperature THeaWatPriSup( redeclare final package Medium = MediumHeaWat, final have_sen=true, final m_flow_nominal=mHeaWatPri_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) "Primary HW supply temperature"; Buildings.Templates.Components.Sensors.Temperature THeaWatPriRet( redeclare final package Medium = MediumHeaWat, final have_sen=ctl.have_senTHeaWatPriRet, final m_flow_nominal=mHeaWatPri_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) "Primary HW return temperature"; Buildings.Templates.Components.Routing.Junction junHeaWatBypRet( redeclare final package Medium = MediumHeaWat, final m_flow_nominal=mHeaWatPri_flow_nominal*{1,-1,1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=Buildings.Templates.Components.Types.IntegrationPoint.Supply) if have_heaWat "Fluid junction"; Buildings.Templates.Components.Actuators.Valve valHeaWatMinByp( redeclare final package Medium = MediumHeaWat, final dat=dat.valHeaWatMinByp, final typ=if have_valHeaWatMinByp then Buildings.Templates.Components.Types.Valve.TwoWayModulating else Buildings.Templates.Components.Types.Valve.None, final chaTwo=Buildings.Templates.Components.Types.ValveCharacteristicTwoWay.Linear, final allowFlowReversal=allowFlowReversal, final energyDynamics=energyDynamics, linearized=linearized, from_dp=true) if have_valHeaWatMinByp or have_bypHeaWatFix "HW minimum flow bypass valve or fixed bypass depending on type of distribution"; Buildings.Templates.Components.Tanks.Buffer tanHeaWatSup( redeclare final package Medium = MediumHeaWat, final have_tan=typTanHeaWat == Buildings.Templates.Components.Types.IntegrationPoint.Supply, final V=dat.VTanHeaWat, final m_flow_nominal=mHeaWatPri_flow_nominal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal) if have_heaWat "HW buffer tank"; Buildings.Templates.Components.Tanks.Buffer tanHeaWatRet( redeclare final package Medium = MediumHeaWat, final have_tan=typTanHeaWat == Buildings.Templates.Components.Types.IntegrationPoint.Return, final V=dat.VTanHeaWat, final m_flow_nominal=mHeaWatPri_flow_nominal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal) if have_heaWat "HW buffer tank"; // Secondary HW loop Buildings.Templates.Components.Pumps.Multiple pumHeaWatSec( final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, redeclare final package Medium=MediumHeaWat, final nPum=nPumHeaWatSec, final have_var=true, final have_varCom=true, final dat=dat.pumHeaWatSec) if typPumHeaWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary HW pumps"; Buildings.Templates.Components.Routing.SingleToMultiple inlPumHeaWatSec( redeclare final package Medium = MediumHeaWat, final nPorts=nPumHeaWatSec, final m_flow_nominal=mHeaWat_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if typPumHeaWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary HW pumps inlet manifold"; Buildings.Templates.Components.Routing.MultipleToSingle outPumHeaWatSec( redeclare final package Medium = MediumHeaWat, final nPorts=nPumHeaWatSec, final m_flow_nominal=mHeaWat_flow_nominal, final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final icon_dy=300) if typPumHeaWatSec == Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary HW pumps outlet manifold"; Buildings.Templates.Components.Routing.PassThroughFluid supHeaWatSec( redeclare final package Medium = MediumHeaWat, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) if have_heaWat and typPumHeaWatSec <> Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.Centralized "Secondary HW supply pipe - Plant without secondary HW pumps"; Buildings.Templates.Components.Sensors.VolumeFlowRate VHeaWatSec_flow( redeclare final package Medium = MediumHeaWat, final m_flow_nominal=mHeaWat_flow_nominal, final allowFlowReversal=allowFlowReversal, final have_sen=ctl.have_senVHeaWatSec, final text_flip=false, final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply) "Secondary HW volume flow rate"; Buildings.Templates.Components.Sensors.Temperature THeaWatSecSup( redeclare final package Medium = MediumHeaWat, final have_sen=ctl.have_senTHeaWatSecSup, final m_flow_nominal=mHeaWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply, final allowFlowReversal=allowFlowReversal) "Secondary HW supply temperature"; Buildings.Templates.Components.Sensors.Temperature THeaWatSecRet( redeclare final package Medium = MediumHeaWat, final have_sen=ctl.have_senTHeaWatSecRet, final m_flow_nominal=mHeaWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) "Secondary HW return temperature"; Buildings.Templates.Components.Sensors.DifferentialPressure dpHeaWatLoc( redeclare final package Medium = MediumHeaWat, text_rotation=90) if have_heaWat and not ctl.have_senDpHeaWatRemWir "Local HW ∆p sensor"; Components.HeatRecoveryChiller hrc( redeclare final package MediumChiWat=MediumChiWat, redeclare final package MediumHeaWat=MediumHeaWat, final allowFlowReversal1=allowFlowReversal, final allowFlowReversal2=allowFlowReversal, final show_T=show_T, final datPumChiWat=dat.pumChiWatHrc, final datPumHeaWat=dat.pumHeaWatHrc, final datHrc=dat.hrc, final energyDynamics=energyDynamics) if have_hrc "Sidestream heat recovery chiller"; Buildings.Templates.Components.Routing.Junction junHeaWatHrcEnt( redeclare final package Medium = MediumHeaWat, final m_flow_nominal=mHeaWat_flow_nominal*{1,-1,-1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=if have_hrc then Buildings.Templates.Components.Types.IntegrationPoint.Return else Buildings.Templates.Components.Types.IntegrationPoint.None) if have_heaWat "Fluid junction"; Buildings.Templates.Components.Routing.Junction junHeaWatHrcLvg( redeclare final package Medium = MediumHeaWat, final m_flow_nominal=mHeaWat_flow_nominal*{1,-1,1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=if have_hrc then Buildings.Templates.Components.Types.IntegrationPoint.Supply else Buildings.Templates.Components.Types.IntegrationPoint.None) if have_heaWat "Fluid junction"; Buildings.Templates.Components.Routing.Junction junChiWatHrcEnt( redeclare final package Medium = MediumChiWat, final m_flow_nominal=mChiWat_flow_nominal*{1,-1,-1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=if have_hrc then Buildings.Templates.Components.Types.IntegrationPoint.Return else Buildings.Templates.Components.Types.IntegrationPoint.None) if have_chiWat "Fluid junction"; Buildings.Templates.Components.Routing.Junction junChiWatHrcLvg( redeclare final package Medium = MediumChiWat, final m_flow_nominal=mChiWat_flow_nominal*{1,-1,1}, final energyDynamics=energyDynamics, dp_nominal=fill(0, 3), final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, icon_pipe1=Buildings.Templates.Components.Types.IntegrationPoint.Return, icon_pipe3=if have_hrc then Buildings.Templates.Components.Types.IntegrationPoint.Supply else Buildings.Templates.Components.Types.IntegrationPoint.None) if have_chiWat "Fluid junction"; Buildings.Templates.Components.Sensors.Temperature TChiWatRetUpsHrc( redeclare final package Medium = MediumChiWat, final have_sen=have_hrc, final m_flow_nominal=mChiWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) if have_chiWat "CHW return temperature upstream of HRC"; Buildings.Templates.Components.Sensors.Temperature THeaWatRetUpsHrc( redeclare final package Medium = MediumHeaWat, final have_sen=have_hrc, final m_flow_nominal=mHeaWat_flow_nominal, final typ=Buildings.Templates.Components.Types.SensorTemperature.InWell, final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Return, final allowFlowReversal=allowFlowReversal) "HW return temperature upstream of HRC"; Fluid.Sources.Boundary_pT bouHeaWat( redeclare final package Medium = MediumHeaWat, p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325, nPorts=1) if have_heaWat "Pressure boundary condition mimicking expansion tank"; initial equation // Calculation of pump speed providing design flow. if is_dpBalYPumSetCal and have_heaWat and typDis==Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Variable2 and typPumHeaWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable then 0=Buildings.Templates.Utilities.computeBalancingPressureDrop( m_flow_nominal=hp.mHeaWatHp_flow_nominal, dp_nominal=max(valIso.dpHeaWat_nominal) + dpValCheHeaWat_nominal, datPum=dat.pumHeaWatPriSin[1], r_N=yPumHeaWatPriSet); else yPumHeaWatPriSet=dat.ctl.yPumHeaWatPriSet; end if; if is_dpBalYPumSetCal and have_chiWat and typDis==Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Variable2 and (typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable or typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None and typPumHeaWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable) then 0=Buildings.Templates.Utilities.computeBalancingPressureDrop( m_flow_nominal=hp.mChiWatHp_flow_nominal, dp_nominal=max(valIso.dpChiWat_nominal) + dpValCheChiWat_nominal, datPum=if typPumChiWatPri==Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable then dat.pumChiWatPriSin[1] else dat.pumHeaWatPriSin[1], r_N=yPumChiWatPriSet); else yPumChiWatPriSet=dat.ctl.yPumChiWatPriSet; end if; if is_dpBalYPumSetCal then if have_heaWat then assert(dpBalHeaWatHp_nominal>=0, "In "+ getInstanceName() + ": "+ "The calculated pressure drop for the HW balancing valve is negative, "+ "indicating that the primary pump curve needs to be revised."); assert(yPumHeaWatPriSet >= 0.1 and yPumHeaWatPriSet <= 2, "In "+ getInstanceName() + ": "+ "The calculated primary pump speed to provide the design HW flow is out of bounds, "+ "indicating that the primary pump curve needs to be revised."); end if; if have_chiWat then assert(dpBalChiWatHp_nominal>=0, "In "+ getInstanceName() + ": "+ "The calculated pressure drop for the CHW balancing valve is negative, "+ "indicating that the primary pump curve needs to be revised."); assert(yPumChiWatPriSet >= 0.1 and yPumChiWatPriSet <= 2, "In "+ getInstanceName() + ": "+ "The calculated primary pump speed to provide the design CHW flow is out of bounds, "+ "indicating that the primary pump curve needs to be revised."); end if; end if; equation /* Control point connection - start */ connect(busWea, hp.busWea); connect(bus, hp.bus); connect(bus, hrc.bus); connect(bus, pumPri.bus); connect(bus, valIso.bus); connect(bus.pumChiWatPri, pumChiWatPri.bus); connect(bus.pumHeaWatPri, pumHeaWatPri.bus); connect(bus.pumChiWatSec, pumChiWatSec.bus); connect(bus.pumHeaWatSec, pumHeaWatSec.bus); connect(bus.valChiWatMinByp, valChiWatMinByp.bus); connect(bus.valHeaWatMinByp, valHeaWatMinByp.bus); connect(VChiWatPri_flow.y, bus.VChiWatPri_flow); connect(VHeaWatPri_flow.y, bus.VHeaWatPri_flow); connect(VChiWatSec_flow.y, bus.VChiWatSec_flow); connect(VHeaWatSec_flow.y, bus.VHeaWatSec_flow); connect(TChiWatPriSup.y, bus.TChiWatPriSup); connect(THeaWatPriSup.y, bus.THeaWatPriSup); connect(TChiWatPriRet.y, bus.TChiWatPriRet); connect(THeaWatPriRet.y, bus.THeaWatPriRet); connect(TChiWatSecSup.y, bus.TChiWatSecSup); connect(THeaWatSecSup.y, bus.THeaWatSecSup); connect(TChiWatSecRet.y, bus.TChiWatSecRet); connect(THeaWatSecRet.y, bus.THeaWatSecRet); connect(THeaWatRetUpsHrc.y, bus.THeaWatRetUpsHrc); connect(TChiWatRetUpsHrc.y, bus.TChiWatRetUpsHrc); connect(dpHeaWatLoc.y, bus.dpHeaWatLoc); connect(dpChiWatLoc.y, bus.dpChiWatLoc); /* Control point connection - stop */ connect(pumChiWatPri.ports_b, outPumChiWatPri.ports_a); connect(inlPumChiWatPri.ports_b, pumChiWatPri.ports_a); connect(valIso.port_bChiWat, inlPumChiWatPri.port_a); connect(hp.ports_bChiHeaWat, pumPri.ports_aChiHeaWatHp); connect(pumPri.ports_bChiHeaWat, valIso.ports_aChiHeaWatHp); connect(pumPri.ports_bHeaWat, valIso.ports_aHeaWatHp); connect(pumPri.ports_bChiWat, valIso.ports_aChiWatHp); connect(outPumChiWatPri.port_b, VChiWatPri_flow.port_a); connect(VChiWatPri_flow.port_b, TChiWatPriSup.port_a); connect(pumChiWatSec.ports_b, outPumChiWatSec.ports_a); connect(inlPumChiWatSec.ports_b, pumChiWatSec.ports_a); connect(valIso.port_bChiWat, supChiWatPri.port_a); connect(supChiWatPri.port_b, VChiWatPri_flow.port_a); connect(valIso.ports_bChiHeaWatHp, pumPri.ports_aChiHeaWat); connect(pumPri.ports_bChiHeaWatHp, hp.ports_aChiHeaWat); connect(supChiWatSec.port_b, VChiWatSec_flow.port_a); connect(port_bChiWat, dpChiWatLoc.port_a); connect(dpChiWatLoc.port_b, port_aChiWat); connect(port_bHeaWat, dpHeaWatLoc.port_a); connect(dpHeaWatLoc.port_b, port_aHeaWat); connect(pumHeaWatPri.ports_b, outPumHeaWatPri.ports_a); connect(inlPumHeaWatPri.ports_b, pumHeaWatPri.ports_a); connect(outPumHeaWatPri.port_b, VHeaWatPri_flow.port_a); connect(VHeaWatPri_flow.port_b, THeaWatPriSup.port_a); connect(pumHeaWatSec.ports_b, outPumHeaWatSec.ports_a); connect(inlPumHeaWatSec.ports_b, pumHeaWatSec.ports_a); connect(supHeaWatPri.port_b, VHeaWatPri_flow.port_a); connect(supHeaWatSec.port_b, VHeaWatSec_flow.port_a); connect(outPumHeaWatSec.port_b, VHeaWatSec_flow.port_a); connect(valIso.port_bHeaWat, inlPumHeaWatPri.port_a); connect(VHeaWatSec_flow.port_b, port_bHeaWat); connect(valIso.port_bHeaWat, supHeaWatPri.port_a); connect(junChiWatBypSup.port_2, TChiWatSecSup.port_a); connect(TChiWatSecSup.port_b, inlPumChiWatSec.port_a); connect(junChiWatBypRet.port_1, TChiWatSecRet.port_b); connect(junHeaWatBypSup.port_2, THeaWatSecSup.port_a); connect(THeaWatSecSup.port_b, inlPumHeaWatSec.port_a); connect(THeaWatSecSup.port_b, supHeaWatSec.port_a); connect(TChiWatSecSup.port_b, supChiWatSec.port_a); connect(junHeaWatBypRet.port_1, THeaWatSecRet.port_b); connect(outPumChiWatSec.port_b, VChiWatSec_flow.port_a); connect(TChiWatPriRet.port_b, valIso.port_aChiWat); connect(junHeaWatHrcEnt.port_2, junHeaWatHrcLvg.port_1); connect(junHeaWatHrcLvg.port_2, THeaWatSecRet.port_a); connect(junHeaWatHrcEnt.port_3, hrc.port_a1); connect(hrc.port_b1, junHeaWatHrcLvg.port_3); connect(junChiWatHrcEnt.port_3, hrc.port_a2); connect(junChiWatHrcEnt.port_2, junChiWatHrcLvg.port_1); connect(junChiWatHrcLvg.port_2, TChiWatSecRet.port_a); connect(hrc.port_b2, junChiWatHrcLvg.port_3); connect(port_aChiWat, TChiWatRetUpsHrc.port_a); connect(TChiWatRetUpsHrc.port_b, junChiWatHrcEnt.port_1); connect(port_aHeaWat, THeaWatRetUpsHrc.port_a); connect(THeaWatRetUpsHrc.port_b, junHeaWatHrcEnt.port_1); connect(junChiWatBypSup.port_3, valChiWatMinByp.port_a); connect(valChiWatMinByp.port_b, junChiWatBypRet.port_3); connect(junHeaWatBypSup.port_3, valHeaWatMinByp.port_a); connect(valHeaWatMinByp.port_b, junHeaWatBypRet.port_3); connect(VChiWatSec_flow.port_b, port_bChiWat); connect(TChiWatPriSup.port_b, tanChiWatSup.port_a); connect(tanChiWatSup.port_b, junChiWatBypSup.port_1); connect(junChiWatBypRet.port_2, tanChiWatRet.port_a); connect(tanChiWatRet.port_b, TChiWatPriRet.port_a); connect(THeaWatPriSup.port_b, tanHeaWatSup.port_a); connect(tanHeaWatSup.port_b, junHeaWatBypSup.port_1); connect(junHeaWatBypRet.port_2, tanHeaWatRet.port_a); connect(tanHeaWatRet.port_b, THeaWatPriRet.port_a); connect(bouHeaWat.ports[1], THeaWatPriRet.port_b); connect(THeaWatPriRet.port_b, valIso.port_aHeaWat); end AirToWater;