Buildings.DHC.ETS.Combined

Package of models for DHC energy transfer stations

Information

This package contains models for energy transfer stations used in district heating and cooling systems.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger HeatPumpHeatExchanger Model of a substation with heat pump for heating, heat pump for domestic hot water, and compressor-less cooling
Buildings.DHC.ETS.Combined.HeatPumpHeatExchangerDHWTank HeatPumpHeatExchangerDHWTank Model of a substation with heat pump for heating, heat pump with storage tank for domestic hot water, and compressor-less cooling
Buildings.DHC.ETS.Combined.HeatRecoveryHeatPump HeatRecoveryHeatPump An ETS model with a heat recovery heat pump producing CHW, HHW, and DHW
Buildings.DHC.ETS.Combined.Controls Controls Package of control blocks for fifth generation DHC ETS
Buildings.DHC.ETS.Combined.Subsystems Subsystems Package of models for subsystems of fifth generation DHC ETS
Buildings.DHC.ETS.Combined.Data Data Package for data records
Buildings.DHC.ETS.Combined.Examples Examples Package of example models of energy transfer stations for combined heating and cooling
Buildings.DHC.ETS.Combined.Validation Validation Collection of validation models
Buildings.DHC.ETS.Combined.BaseClasses BaseClasses Package with base classes

Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger

Model of a substation with heat pump for heating, heat pump for domestic hot water, and compressor-less cooling

Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger

Information

This model uses the base energy transfer station defined in Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger.

Domestic Hot Water

Domestic hot water is produced using a dedicated water-to-water heat pump on-demand with no storage.

Heating is enabled based on the input signal uSHW which is held for 15 minutes, meaning that, when enabled, the mode remains active for at least 15 minutes and, when disabled, the mode cannot be enabled again for at least 15 minutes. The enable signal should be computed externally based on a schedule (to lock out the system during off-hours), ideally in conjunction with the number of requests or any other signal representative of the load.

When enabled,

Extends from Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger (Partial model of a substation with heat pump and compressor-less cooling).

Parameters

TypeNameDefaultDescription
replaceable package MediumSerWaterService side medium
replaceable package MediumSerHea_aWaterService side medium at heating inlet
replaceable package MediumBuiWaterBuilding side medium
Genericfue[nFue] Fuel type
Booleanhave_varFloContrueSet to true for heat pumps with variable condenser flow
Booleanhave_varFloEvatrueSet to true for heat pumps with variable evaporator flow
RealratFloMin0.3Minimum condenser mass flow rate (ratio to nominal) [1]
Configuration
Booleanhave_hotWatfalseSet to true if the ETS supplies hot water
Nominal condition
HeatFlowRateQHeaWat_flow_nominal0Nominal capacity of heating system (>=0) [W]
HeatFlowRateQHotWat_flow_nominal0Nominal capacity of hot water production system (>=0) [W]
HeatFlowRateQChiWat_flow_nominal0Nominal capacity of cooling system (<=0) [W]
TemperatureDifferencedT_nominal5Water temperature drop/increase accross load and source-side HX (always positive) [K]
TemperatureTHeaWatSup_nominal313.15Heating water supply temperature [K]
TemperatureTHotWatSup_nominal336.15Domestic hot water supply temperature to fixtures [K]
TemperatureTColWat_nominal288.15Cold water temperature (for hot water production) [K]
Pressuredp_nominal50000Pressure difference at nominal flow rate (for each flow leg) [Pa]
RealCOPHeaWat_nominal COP of heat pump for heating water production [1]
RealCOPHotWat_nominal COP of heat pump for hot water production [1]
DHC system
TemperatureTDisWatMin District water minimum temperature [K]
TemperatureTDisWatMax District water maximum temperature [K]
Nominal conditions
TemperatureTChiWatSup_nominal291.15Chilled water supply temperature [K]
Assumptions
BooleanallowFlowReversalSerfalseSet to true to allow flow reversal on service side
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal on building side
Dynamics
DynamicsmixingVolumeEnergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance for mixing volume at inlet and outlet

Connectors

TypeNameDescription
FluidPorts_aports_aHeaWat[nPorts_aHeaWat]Fluid connectors for heating water return (from building)
FluidPorts_bports_bHeaWat[nPorts_bHeaWat]Fluid connectors for heating water supply (to building)
FluidPorts_aports_aChiWat[nPorts_aChiWat]Fluid connectors for chilled water return (from building)
FluidPorts_bports_bChiWat[nPorts_bChiWat]Fluid connectors for chilled water supply (to building)
FluidPort_aport_aSerAmbFluid connector for ambient water service supply line
FluidPort_bport_bSerAmbFluid connector for ambient water service return line
FluidPort_aport_aSerHeaFluid connector for heating service supply line
FluidPort_bport_bSerHeaFluid connector for heating service return line
FluidPort_aport_aSerCooFluid connector for cooling service supply line
FluidPort_bport_bSerCooFluid connector for cooling service return line
output RealOutputPHeaPower drawn by heating system [W]
output RealOutputPCooPower drawn by cooling system [W]
output RealOutputPFanPower drawn by fan motors [W]
output RealOutputPPumPower drawn by pump motors [W]
output RealOutputQFue_flow[nFue]Fuel energy input rate [W]
BusweaBusWeather data bus
input BooleanInputuCooCooling enable signal
input BooleanInputuHeaHeating enable signal
input BooleanInputuSHWSHW production enable signal
input RealInputTHeaWatSupSetHeating water supply temperature set point [K]
input RealInputTHotWatSupSetDomestic hot water temperature set point for supply to fixtures [K]
input RealInputTColWatCold water temperature [K]
input RealInputQReqHotWat_flowService hot water load [W]
input RealInputTChiWatSupSetChilled water supply temperature set point [K]
output RealOutputmHea_flowDistrict water mass flow rate used for heating service [kg/s]
output RealOutputmCoo_flowDistrict water mass flow rate used for cooling service [kg/s]

Modelica definition

model HeatPumpHeatExchanger "Model of a substation with heat pump for heating, heat pump for domestic hot water, and compressor-less cooling" extends Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger ( volMix_a(nPorts=4), volMix_b(nPorts=4)); Buildings.DHC.ETS.Combined.Subsystems.HeatPump proHotWat( redeclare final package Medium1 = MediumBui, redeclare final package Medium2 = MediumSer, final COP_nominal=COPHotWat_nominal, final TCon_nominal=THotWatSup_nominal, final TEva_nominal=TDisWatMin - dT_nominal, dT_nominal=dT_nominal, final Q1_flow_nominal=QHotWat_flow_nominal, final allowFlowReversal1=allowFlowReversalBui, final allowFlowReversal2=allowFlowReversalSer, final dp1_nominal=dp_nominal, final dp2_nominal=dp_nominal) if have_hotWat "Subsystem for hot water production"; Buildings.Fluid.Sources.Boundary_pT souColWat( redeclare final package Medium = MediumBui, use_T_in=true, nPorts=1) if have_hotWat "Source for cold water"; Buildings.Fluid.Sources.Boundary_pT sinSHW(redeclare final package Medium = MediumBui, nPorts=1) if have_hotWat "Sink for service hot water"; Buildings.Controls.OBC.CDL.Reals.Divide div1 if have_hotWat "Compute mass flow rate from load"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(final k= cpBui_default) if have_hotWat "Times Cp"; Buildings.Controls.OBC.CDL.Reals.Subtract delT if have_hotWat "Compute DeltaT needed on condenser side"; equation connect(souColWat.ports[1], proHotWat.port_a1); connect(sinSHW.ports[1], proHotWat.port_b1); connect(THotWatSupSet, proHotWat.TSupSet); connect(enaSHW.y, proHotWat.uEna); connect(proHotWat.PPum, PPumHeaTot.u[2]); connect(proHotWat.mEva_flow, masFloHeaTot.u[2]); connect(proHotWat.mEva_flow, masFloHea.u2); connect(proHotWat.PHea, PHeaTot.u[2]); connect(TColWat, souColWat.T_in); connect(proHotWat.port_a2, volMix_a.ports[4]); connect(proHotWat.port_b2, volMix_b.ports[4]); connect(gai.y,div1. u2); connect(QReqHotWat_flow,div1. u1); connect(delT.y,gai. u); connect(TColWat,delT. u2); connect(THotWatSupSet,delT. u1); connect(div1.y, proHotWat.m1_flow); end HeatPumpHeatExchanger;

Buildings.DHC.ETS.Combined.HeatPumpHeatExchangerDHWTank Buildings.DHC.ETS.Combined.HeatPumpHeatExchangerDHWTank

Model of a substation with heat pump for heating, heat pump with storage tank for domestic hot water, and compressor-less cooling

Buildings.DHC.ETS.Combined.HeatPumpHeatExchangerDHWTank

Information

This model uses the base energy transfer station defined in Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger.

Domestic Hot Water

Domestic hot water is produced using a dedicated water-to-water heat pump with storage tank.

Heating is enabled based on the input signal uSHW which is held for 15 minutes, meaning that, when enabled, the mode remains active for at least 15 minutes and, when disabled, the mode cannot be enabled again for at least 15 minutes. The enable signal should be computed externally based on a schedule (to lock out the system during off-hours), ideally in conjunction with the number of requests or any other signal representative of the load.

When enabled,

Extends from Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger (Partial model of a substation with heat pump and compressor-less cooling).

Parameters

TypeNameDefaultDescription
replaceable package MediumSerWaterService side medium
replaceable package MediumSerHea_aWaterService side medium at heating inlet
replaceable package MediumBuiWaterBuilding side medium
Genericfue[nFue] Fuel type
Booleanhave_varFloContrueSet to true for heat pumps with variable condenser flow
Booleanhave_varFloEvatrueSet to true for heat pumps with variable evaporator flow
RealratFloMin0.3Minimum condenser mass flow rate (ratio to nominal) [1]
GenericDomesticHotWaterWithHeatExchangerdatWatHea Performance data
Configuration
Booleanhave_hotWatfalseSet to true if the ETS supplies hot water
Nominal condition
HeatFlowRateQHeaWat_flow_nominal0Nominal capacity of heating system (>=0) [W]
HeatFlowRateQHotWat_flow_nominal0Nominal capacity of hot water production system (>=0) [W]
HeatFlowRateQChiWat_flow_nominal0Nominal capacity of cooling system (<=0) [W]
TemperatureDifferencedT_nominal5Water temperature drop/increase accross load and source-side HX (always positive) [K]
TemperatureTHeaWatSup_nominal313.15Heating water supply temperature [K]
TemperatureTHotWatSup_nominal336.15Domestic hot water supply temperature to fixtures [K]
TemperatureTColWat_nominal288.15Cold water temperature (for hot water production) [K]
Pressuredp_nominal50000Pressure difference at nominal flow rate (for each flow leg) [Pa]
RealCOPHeaWat_nominal COP of heat pump for heating water production [1]
RealCOPHotWat_nominal COP of heat pump for hot water production [1]
DHC system
TemperatureTDisWatMin District water minimum temperature [K]
TemperatureTDisWatMax District water maximum temperature [K]
Nominal conditions
TemperatureTChiWatSup_nominal291.15Chilled water supply temperature [K]
Assumptions
BooleanallowFlowReversalSerfalseSet to true to allow flow reversal on service side
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal on building side
Dynamics
DynamicsmixingVolumeEnergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance for mixing volume at inlet and outlet

Connectors

TypeNameDescription
FluidPorts_aports_aHeaWat[nPorts_aHeaWat]Fluid connectors for heating water return (from building)
FluidPorts_bports_bHeaWat[nPorts_bHeaWat]Fluid connectors for heating water supply (to building)
FluidPorts_aports_aChiWat[nPorts_aChiWat]Fluid connectors for chilled water return (from building)
FluidPorts_bports_bChiWat[nPorts_bChiWat]Fluid connectors for chilled water supply (to building)
FluidPort_aport_aSerAmbFluid connector for ambient water service supply line
FluidPort_bport_bSerAmbFluid connector for ambient water service return line
FluidPort_aport_aSerHeaFluid connector for heating service supply line
FluidPort_bport_bSerHeaFluid connector for heating service return line
FluidPort_aport_aSerCooFluid connector for cooling service supply line
FluidPort_bport_bSerCooFluid connector for cooling service return line
output RealOutputPHeaPower drawn by heating system [W]
output RealOutputPCooPower drawn by cooling system [W]
output RealOutputPFanPower drawn by fan motors [W]
output RealOutputPPumPower drawn by pump motors [W]
output RealOutputQFue_flow[nFue]Fuel energy input rate [W]
BusweaBusWeather data bus
input BooleanInputuCooCooling enable signal
input BooleanInputuHeaHeating enable signal
input BooleanInputuSHWSHW production enable signal
input RealInputTHeaWatSupSetHeating water supply temperature set point [K]
input RealInputTHotWatSupSetDomestic hot water temperature set point for supply to fixtures [K]
input RealInputTColWatCold water temperature [K]
input RealInputQReqHotWat_flowService hot water load [W]
input RealInputTChiWatSupSetChilled water supply temperature set point [K]
output RealOutputmHea_flowDistrict water mass flow rate used for heating service [kg/s]
output RealOutputmCoo_flowDistrict water mass flow rate used for cooling service [kg/s]

Modelica definition

model HeatPumpHeatExchangerDHWTank "Model of a substation with heat pump for heating, heat pump with storage tank for domestic hot water, and compressor-less cooling" extends Buildings.DHC.ETS.Combined.BaseClasses.PartialHeatPumpHeatExchanger ( volMix_b(nPorts=4), volMix_a(nPorts=4)); Buildings.Fluid.Sources.Boundary_pT souDCW( redeclare final package Medium = MediumBui, use_T_in=true, nPorts=1) if have_hotWat "Source for domestic cold water"; Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank proHotWat( redeclare final package Medium1 = MediumBui, redeclare final package Medium2 = MediumSer, final COP_nominal=COPHotWat_nominal, TCon_nominal=THotWatSup_nominal, TEva_nominal=TDisWatMin - dT_nominal, QHotWat_flow_nominal=QHotWat_flow_nominal, dT_nominal=dT_nominal, final allowFlowReversal1=allowFlowReversalBui, final allowFlowReversal2=allowFlowReversalSer, dp1_nominal=6000, dp2_nominal=6000, datWatHea=datWatHea) if have_hotWat "Subsystem for hot water production"; parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger datWatHea "Performance data"; Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixVal( redeclare package Medium = MediumBui, mMix_flow_nominal=QHotWat_flow_nominal/cpBui_default/(THotWatSup_nominal - TColWat_nominal)) if have_hotWat "Thermostatic mixing valve"; Buildings.DHC.ETS.BaseClasses.Junction dcwSpl( redeclare final package Medium = MediumBui, final m_flow_nominal= datWatHea.mDom_flow_nominal*{1,-1,-1}) "Splitter for domestic cold water"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai( k=1/QHotWat_flow_nominal) if have_hotWat; equation connect(proHotWat.port_b2, volMix_b.ports[4]); connect(proHotWat.PHea, PHeaTot.u[2]); connect(proHotWat.PPum, PPumHeaTot.u[2]); connect(proHotWat.mEva_flow, masFloHeaTot.u[2]); connect(proHotWat.mEva_flow, masFloHea.u2); connect(proHotWat.port_a2, volMix_a.ports[4]); connect(souDCW.ports[1], dcwSpl.port_1); connect(dcwSpl.port_3, proHotWat.port_a1); connect(dcwSpl.port_2, theMixVal.port_col); connect(proHotWat.port_b1, theMixVal.port_hot); connect(souDCW.T_in, TColWat); connect(THotWatSupSet, theMixVal.TMixSet); connect(QReqHotWat_flow, gai.u); connect(gai.y, theMixVal.yMixSet); connect(enaSHW.y, proHotWat.uEna); end HeatPumpHeatExchangerDHWTank;

Buildings.DHC.ETS.Combined.HeatRecoveryHeatPump Buildings.DHC.ETS.Combined.HeatRecoveryHeatPump

An ETS model with a heat recovery heat pump producing CHW, HHW, and DHW

Buildings.DHC.ETS.Combined.HeatRecoveryHeatPump

Information

Model of an Energy Transfer Station with heat recovery heat pump, buffer tanks and optional domestic hot water preparation and optional water-side economizer.

The figure below shows the schematic diagram. The heat recovery heat pump preferentially operates in heat recovery mode, but if heating (or cooling) demand persists while the cold (or hot) water-side buffer tank is fully charged, the evaporator (or condenser) temperature is reset, the corresponding tank is decoupled to avoid flushing the tank, and heat is exchanged with the district energy system.

Schematic diagram of the ETS.

The operation is as follows:

Domestic Hot Water Tank and Buffer Tanks

The chilled water and heating hot water tanks are by default sized for five minutes and used as buffer tanks. The DHW tank is by default sized for 24 hours of storage. Each tank generates a signal to request charging. If the temperature of its supply side (top for the hot tank, bottom for the cold tank) deviates from the set point with hysteresis, charging is enabled until the temperature of its return side (bottom for the hot tank, top for the cold tank) achieves the set point with hysteresis.

When the space heating or cooling tank does not request charging, the diversion valve VAL_DIV_CON or VAL_DIV_EVA to the respective tank is closed, and the isolation valve VAL_ISO_CON or VAL_ISO_EVA is opened to allow energy exchange with the district heat exchanger. The diversion valves are necessary because, for example, when the ETS operates cooling only mode, rejecting heat to the ambient loop, the condenser outputs hot water at the minimum leaving temperature is 15°C. Without the diversion valve, the cool water from the condenser would flush out the energy stored in the space heating tank. This causes energy waste. It also causes short cycling because the tank will request charging repeatedly as its temperature falls below the heating set point, bring the system into a limit cycle.

Two-tank Coordination on the Condenser Side

The integration of the DHW tank is optional, as not all buildings prepare DHW using the ETS. When integrated, the space heating and DHW tank share the same condenser loop. The table below explains how the two loops are coordinated through valve control.

Control signal coordination of the DHW tank and the space heating tank. Depending on the charge signal, the control block computes the position ymix of the mixing valve VAL_MIX (position 1 is to the space heating tank, position 0 is to the DHW tank) and ydiv of the condenser-side diversion valve VAL_DIV_CON.
Charge signal Controller output
DHW HHW ymix ydiv
on on 0.5 1
on off 0 1
off on 1 1
off off 1 0

Heat Recovery Heat Pump

The heat recovery heat pump can produce heating, cooling, or both simultaneously. The condenser pump PUM_CON and the evaporator pump PUM_EVA are enabled when any of the respective tanks requests charging. The heat pump is turned on 30 seconds after PUM_CON and PUM_EVA are running.

When on, the primary pumps are operated at constant speed, and the condenser (resp. evaporator) mixing valve VAL_CON (resp. VAL_EVA) are modulated with a P controller to track the set point for the water that leaves the heat pump, with a small offset to open first the valve and then ramp up the compressor speed.

The compressor speed is controlled based on the same temperature measurement as the mixing valves. Based on a moving average of the compressor speed signal for heating and cooling, the heat pump control is switched into heating or cooling dominated operation, and the respective compressor speed setpoint is sent to the heat pump.

If only heating (or only cooling) is requested from the tank, then the evaporator (or condenser) set point temperature is reset to minimize the temperature lift across the heat pump.

District Heat Exchanger

The district heat exchanger hydraulically decouples the buildings system and the district system. Its primary and secondary circuits are enabled to operate if either any of the tanks request charging, and if an isolation valve VAL_ISO_CON or VAL_ISO_EVA is open. When enabled, the pumps PUM1_DHX and PUM2_DHX operate at a constant speed.

Temperature Set Points

The set points for the supply temperatures are input to this model. For the heating supply water, use THeaWatSupSet, for the cooling supply water, use TChiWatSupSet.

If a domestic hot water supply is present, as declared through the parameter have_hotWat, then use THotWatSupSet for the set point temperature to the end user (such as shower), and use TColWat for the temperature of the cold water supply and QReqHotWat_flow for the heat flow rate associated with the hot water supply, i.e., QReqHotWat_flow = mHotWat_flow cwat (THotWatSupSet-TColWat), where mHotWat_flow is the hot water mass flow rate, and cwat is the specific heat capacity of water.

Domestic Hot Water Preparation

The DHW preparation is optional. If present, a fresh water station is used. The fresh water station allows to store heat in the heating rather than the domestic hot water, therefore avoiding the potential problem of Legionella bacteria getting from the hot water tank to the DHW circuit. This allows to operate the storage at a lower temperature, thereby increasing the heat pump COP.

The integration of the domestic hot water is further described in Buildings.DHC.ETS.Combined.Subsystems.DHWConsumption, which uses the fresh water station that is described and shown with a schematic diagram at Buildings.DHC.ETS.Combined.Subsystems.StorageTankWithExternalHeatExchanger.

Water-side economizer

The water-side economizer is optional. Use of the water-side economizer can improve resilience during heat waves when power consumption of the ETS need to be curtailed by switching of the chiller, for example during a grid outage when the site operates on emergency power.

To use the water-side economizer, if the temperature conditions are favorable, the valves (or pumps) are activated in order to cool the chilled water supply to the building. This model and its operation is described in Buildings.DHC.ETS.Combined.Subsystems.WatersideEconomizer. and in Gautier et al. (2022).

References

Antoine Gautier, Michael Wetter and Matthias Sulzer.
Resilient cooling through geothermal district energy system.
Applied Energy, 325, November, 2022.

Extends from Buildings.DHC.ETS.BaseClasses.PartialETS (Partial class for modeling an energy transfer station).

Parameters

TypeNameDefaultDescription
replaceable package MediumSerWaterService side medium
replaceable package MediumSerHea_aWaterService side medium at heating inlet
replaceable package MediumBuiWaterBuilding side medium
Genericfue[nFue] Fuel type
ConnectionConfigurationconConBuildings.DHC.ETS.Types.Conn...District connection configuration
IntegernSysHea1Number of heating systems
IntegernSysCoonSysHeaNumber of cooling systems
IntegernSouAmb1Number of ambient sources
MassFlowRatem1Hex_flow_nominalabs(QHex_flow_nominal/4200/(...Design mass flow rate for heat exchanger on district side [kg/s]
TemperatureDifferencedTOffSetHea1Temperature to be added to the set point in order to be slightly above what the heating load requires [K]
TemperatureDifferencedTOffSetCoo-1Temperature to be added to the set point in order to be slightly below what the cooling load requires [K]
GenericDomesticHotWaterWithHeatExchangerdatDhw Performance data of the domestic hot water component
Booleanhave_WSEfalseSet to true in case a waterside economizer is used
TemperatureTHeaWatSupSetMindatHeaPum.TConLvgMinMinimum value of heating water supply temperature set point (used for heat pump reset) [K]
Configuration
DistrictSystemTypetypBuildings.DHC.Types.District...Type of district system
Booleanhave_heaWattrueSet to true if the ETS supplies heating water
Booleanhave_hotWatfalseSet to true if the ETS supplies hot water
Booleanhave_chiWattrueSet to true if the ETS supplies chilled water
Booleanhave_fanfalseSet to true if fan power is computed
Booleanhave_pumtrueSet to true if pump power is computed
Booleanhave_eleHeafalseSet to true if the ETS has electric heating system
IntegernFue0Number of fuel types (0 means no combustion system)
Booleanhave_eleCootrueSet to true if the ETS has electric cooling system
Booleanhave_weaBustrueSet to true to use a weather bus
Nominal condition
HeatFlowRateQHeaWat_flow_nominal0Nominal capacity of heating system (>=0) [W]
HeatFlowRateQHotWat_flow_nominal0Nominal capacity of hot water production system (>=0) [W]
HeatFlowRateQChiWat_flow_nominal0Nominal capacity of cooling system (<=0) [W]
PressureDifferencedpValIso_nominal2E3Nominal pressure drop of ambient circuit isolation valves [Pa]
District heat exchanger
PressureDifferencedp1Hex_nominal Nominal pressure drop across heat exchanger on district side [Pa]
PressureDifferencedp2Hex_nominal Nominal pressure drop across heat exchanger on building side [Pa]
HeatFlowRateQHex_flow_nominal Nominal heat flow rate through heat exchanger (from district to building) [W]
TemperatureT_a1Hex_nominal Nominal water inlet temperature on district side [K]
TemperatureT_b1Hex_nominal Nominal water outlet temperature on district side [K]
TemperatureT_a2Hex_nominal Nominal water inlet temperature on building side [K]
TemperatureT_b2Hex_nominal Nominal water outlet temperature on building side [K]
RealspePum1HexMin0.1Heat exchanger primary pump minimum speed (fractional) [1]
RealspePum2HexMin0.1Heat exchanger secondary pump minimum speed (fractional) [1]
Buffer Tank
VolumeVTanHeaWatdatHeaPum.PLRMin*datHeaPum.m...Heating water tank volume [m3]
LengthhTanHeaWat(VTanHeaWat*16/Modelica.Cons...Heating water tank height (without insulation, assuming twice the diameter) [m]
LengthdInsTanHeaWat0.1Heating water tank insulation thickness [m]
VolumeVTanChiWatdatHeaPum.PLRMin*datHeaPum.m...Chilled water tank volume [m3]
LengthhTanChiWat(VTanChiWat*16/Modelica.Cons...Chilled water tank height (without insulation, assuming twice the diameter) [m]
LengthdInsTanChiWat0.1Chilled water tank insulation thickness [m]
IntegernSegTan3Number of volume segments for tanks
Heat recovery heat pump
GenericHeatPumpdatHeaPum Heat pump performance data
PressureDifferencedpCon_nominaldatHeaPum.datHea.dpCon_nominalNominal pressure drop across condenser [Pa]
PressureDifferencedpEva_nominaldatHeaPum.datHea.dpEva_nominalNominal pressure drop across evaporator [Pa]
HeatPumpModularheaPumheaPum(redeclare final packa...Heat pump
Supervisory controller
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
RealkHot0.05Gain of controller on hot side
RealkCol0.1Gain of controller on cold side
TimeTiHot300Time constant of integrator block on hot side [s]
TimeTiCol120Time constant of integrator block on cold side [s]
TemperatureTChiWatSupSetMaxdatHeaPum.TEvaLvgMaxMaximum value of chilled water supply temperature set point for heat pump (used for heat pump reset) [K]
Waterside economizer
PressureDifferencedp1WSE_nominal40E3Nominal pressure drop across heat exchanger on district side [Pa]
PressureDifferencedp2WSE_nominal40E3Nominal pressure drop across heat exchanger on building side [Pa]
HeatFlowRateQWSE_flow_nominal0Nominal heat flow rate through water-side economizer exchanger (<=0) [W]
TemperatureT_a1WSE_nominal279.15Nominal water inlet temperature on district side [K]
TemperatureT_b1WSE_nominal284.15Nominal water outlet temperature on district side [K]
TemperatureT_a2WSE_nominal288.15Nominal water inlet temperature on building side [K]
TemperatureT_b2WSE_nominal281.15Nominal water outlet temperature on building side [K]
Realy1WSEMin0.05Minimum pump flow rate or valve opening for temperature measurement (fractional) [1]
Assumptions
BooleanallowFlowReversalSerfalseSet to true to allow flow reversal on service side
BooleanallowFlowReversalBuifalseSet to true to allow flow reversal on building side
Initialization
TemperatureTCon_startMediumBui.T_defaultTemperature start value on the condenser side [K]
TemperatureTEva_startMediumBui.T_defaultTemperature start value on the evaporator side [K]

Connectors

TypeNameDescription
FluidPorts_aports_aHeaWat[nPorts_aHeaWat]Fluid connectors for heating water return (from building)
FluidPorts_bports_bHeaWat[nPorts_bHeaWat]Fluid connectors for heating water supply (to building)
FluidPorts_aports_aChiWat[nPorts_aChiWat]Fluid connectors for chilled water return (from building)
FluidPorts_bports_bChiWat[nPorts_bChiWat]Fluid connectors for chilled water supply (to building)
FluidPort_aport_aSerAmbFluid connector for ambient water service supply line
FluidPort_bport_bSerAmbFluid connector for ambient water service return line
FluidPort_aport_aSerHeaFluid connector for heating service supply line
FluidPort_bport_bSerHeaFluid connector for heating service return line
FluidPort_aport_aSerCooFluid connector for cooling service supply line
FluidPort_bport_bSerCooFluid connector for cooling service return line
output RealOutputPHeaPower drawn by heating system [W]
output RealOutputPCooPower drawn by cooling system [W]
output RealOutputPFanPower drawn by fan motors [W]
output RealOutputPPumPower drawn by pump motors [W]
output RealOutputQFue_flow[nFue]Fuel energy input rate [W]
BusweaBusWeather data bus
input RealInputTHeaWatSupSetHeating water supply temperature set point [K]
input RealInputTChiWatSupSetChilled water supply temperature set point [K]
output RealOutputdHHeaWat_flowHeating water distributed energy flow rate [W]
output RealOutputdHChiWat_flowChilled water distributed energy flow rate [W]
input RealInputTHotWatSupSetDomestic hot water temperature set point for supply to fixtures [K]
input RealInputTColWatCold water temperature that is fed to domestic hot water preparation [K]
input RealInputQReqHotWat_flowDomestic hot water load [W]
output RealOutputdHHotWat_flowDomestic hot water distributed energy flow rate [W]

Modelica definition

model HeatRecoveryHeatPump "An ETS model with a heat recovery heat pump producing CHW, HHW, and DHW" extends Buildings.DHC.ETS.BaseClasses.PartialETS( final typ=Buildings.DHC.Types.DistrictSystemType.CombinedGeneration5, final have_heaWat=true, final have_chiWat=true, final have_pum=true, final have_eleCoo=true, final have_fan=false, final have_eleHea=false, final have_weaBus=true "Set to true as this determines whether the composite ets and building has a weather bus", nPorts_bHeaWat=1, nPorts_aHeaWat=1, nPorts_bChiWat=1, nPorts_aChiWat=1); parameter Buildings.DHC.ETS.Types.ConnectionConfiguration conCon= Buildings.DHC.ETS.Types.ConnectionConfiguration.Pump "District connection configuration"; parameter Integer nSysHea = 1 "Number of heating systems"; parameter Integer nSysCoo=nSysHea "Number of cooling systems"; parameter Integer nSouAmb=1 "Number of ambient sources"; parameter Modelica.Units.SI.PressureDifference dpValIso_nominal(displayUnit= "Pa") = 2E3 "Nominal pressure drop of ambient circuit isolation valves"; parameter Modelica.Units.SI.PressureDifference dp1Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on district side"; parameter Modelica.Units.SI.PressureDifference dp2Hex_nominal(displayUnit= "Pa") "Nominal pressure drop across heat exchanger on building side"; parameter Modelica.Units.SI.HeatFlowRate QHex_flow_nominal "Nominal heat flow rate through heat exchanger (from district to building)"; parameter Modelica.Units.SI.Temperature T_a1Hex_nominal "Nominal water inlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_b1Hex_nominal "Nominal water outlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_a2Hex_nominal "Nominal water inlet temperature on building side"; parameter Modelica.Units.SI.Temperature T_b2Hex_nominal "Nominal water outlet temperature on building side"; parameter Modelica.Units.SI.MassFlowRate m1Hex_flow_nominal = abs(QHex_flow_nominal/4200/(T_b1Hex_nominal - T_a1Hex_nominal)) "Design mass flow rate for heat exchanger on district side"; parameter Real spePum1HexMin( final unit="1", min=0)=0.1 "Heat exchanger primary pump minimum speed (fractional)"; parameter Real spePum2HexMin( final unit="1", min=0.01)=0.1 "Heat exchanger secondary pump minimum speed (fractional)"; parameter Modelica.Units.SI.Volume VTanHeaWat = datHeaPum.PLRMin*datHeaPum.mCon_flow_nominal*5*60/1000 "Heating water tank volume"; parameter Modelica.Units.SI.Length hTanHeaWat=(VTanHeaWat*16/Modelica.Constants.pi)^(1/3) "Heating water tank height (without insulation, assuming twice the diameter)"; parameter Modelica.Units.SI.Length dInsTanHeaWat=0.1 "Heating water tank insulation thickness"; parameter Modelica.Units.SI.Volume VTanChiWat = datHeaPum.PLRMin*datHeaPum.mEva_flow_nominal*5*60/1000 "Chilled water tank volume"; parameter Modelica.Units.SI.Length hTanChiWat=(VTanChiWat*16/Modelica.Constants.pi)^(1/3) "Chilled water tank height (without insulation, assuming twice the diameter)"; parameter Modelica.Units.SI.Length dInsTanChiWat=0.1 "Chilled water tank insulation thickness"; parameter Integer nSegTan=3 "Number of volume segments for tanks"; parameter Modelica.Units.SI.TemperatureDifference dTOffSetHea( min=0.5, displayUnit="K") = 1 "Temperature to be added to the set point in order to be slightly above what the heating load requires"; parameter Modelica.Units.SI.TemperatureDifference dTOffSetCoo( max=-0.5, displayUnit="K") = -1 "Temperature to be added to the set point in order to be slightly below what the cooling load requires"; parameter Buildings.DHC.ETS.Combined.Data.GenericHeatPump datHeaPum "Heat pump performance data"; parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger datDhw "Performance data of the domestic hot water component"; parameter Boolean have_WSE=false "Set to true in case a waterside economizer is used"; parameter Modelica.Units.SI.PressureDifference dpCon_nominal(displayUnit="Pa") = datHeaPum.datHea.dpCon_nominal "Nominal pressure drop across condenser"; parameter Modelica.Units.SI.PressureDifference dpEva_nominal(displayUnit="Pa") = datHeaPum.datHea.dpEva_nominal "Nominal pressure drop across evaporator"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kHot( min=0)=0.05 "Gain of controller on hot side"; parameter Real kCol( min=0)=0.1 "Gain of controller on cold side"; parameter Modelica.Units.SI.Time TiHot(min=Buildings.Controls.OBC.CDL.Constants.small) = 300 "Time constant of integrator block on hot side"; parameter Modelica.Units.SI.Time TiCol(min=Buildings.Controls.OBC.CDL.Constants.small) = 120 "Time constant of integrator block on cold side"; parameter Modelica.Units.SI.Temperature TChiWatSupSetMax(displayUnit="degC") = datHeaPum.TEvaLvgMax "Maximum value of chilled water supply temperature set point for heat pump (used for heat pump reset)"; parameter Modelica.Units.SI.Temperature THeaWatSupSetMin(displayUnit="degC") = datHeaPum.TConLvgMin "Minimum value of heating water supply temperature set point (used for heat pump reset)"; parameter Modelica.Units.SI.PressureDifference dp1WSE_nominal( displayUnit="Pa") = 40E3 "Nominal pressure drop across heat exchanger on district side"; parameter Modelica.Units.SI.PressureDifference dp2WSE_nominal( displayUnit="Pa") = 40E3 "Nominal pressure drop across heat exchanger on building side"; parameter Modelica.Units.SI.HeatFlowRate QWSE_flow_nominal=0 "Nominal heat flow rate through water-side economizer exchanger (<=0)"; parameter Modelica.Units.SI.Temperature T_a1WSE_nominal=279.15 "Nominal water inlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_b1WSE_nominal=284.15 "Nominal water outlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_a2WSE_nominal=288.15 "Nominal water inlet temperature on building side"; parameter Modelica.Units.SI.Temperature T_b2WSE_nominal=281.15 "Nominal water outlet temperature on building side"; parameter Real y1WSEMin(unit="1")=0.05 "Minimum pump flow rate or valve opening for temperature measurement (fractional)"; final parameter Modelica.Units.SI.MassFlowRate m1WSE_flow_nominal=abs( QWSE_flow_nominal/4200/(T_b1WSE_nominal - T_a1WSE_nominal)) "WSE primary mass flow rate"; parameter MediumBui.Temperature TCon_start = MediumBui.T_default "Temperature start value on the condenser side"; parameter MediumBui.Temperature TEva_start = MediumBui.T_default "Temperature start value on the evaporator side"; // INPUTS and OUTPUTS Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSupSet( final unit="K", displayUnit="degC") "Heating water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSupSet( final unit="K", displayUnit="degC") "Chilled water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dHHeaWat_flow(final unit="W") "Heating water distributed energy flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dHChiWat_flow(final unit="W") "Chilled water distributed energy flow rate"; // COMPONENTS Buildings.DHC.ETS.Combined.Subsystems.HeatPumpModular heaPum( redeclare final package Medium = MediumBui, allowFlowReversal=true, final dpCon_nominal=dpCon_nominal, final dpEva_nominal=dpEva_nominal, final dat=datHeaPum, final THeaWatSupSetMin=THeaWatSupSetMin, final TChiWatSupSetMax=TChiWatSupSetMax, dTOffSetHea=dTOffSetHea, dTOffSetCoo=dTOffSetCoo) "Heat pump"; Buildings.DHC.ETS.Combined.Subsystems.HeatExchanger hex( redeclare final package Medium1=MediumSer, redeclare final package Medium2=MediumBui, final allowFlowReversal1=allowFlowReversalSer, final allowFlowReversal2=allowFlowReversalBui, final conCon=conCon, final dp1Hex_nominal=dp1Hex_nominal, final dp2Hex_nominal=dp2Hex_nominal, final Q_flow_nominal=QHex_flow_nominal, final T_a1_nominal=T_a1Hex_nominal, final T_b1_nominal=T_b1Hex_nominal, final T_a2_nominal=T_a2Hex_nominal, final T_b2_nominal=T_b2Hex_nominal, final spePum1Min=spePum1HexMin, final spePum2Min=spePum2HexMin, pum2(dpMax=Modelica.Constants.inf)) "District heat exchanger"; Buildings.DHC.ETS.Combined.Subsystems.StratifiedTankWithCommand tanChiWat( redeclare final package Medium = MediumBui, final isHotWat=false, final m_flow_nominal=colChiWat.mDis_flow_nominal, final VTan=VTanChiWat, final hTan=hTanChiWat, final dIns=dInsTanChiWat, final nSeg=nSegTan, T_start=TEva_start) "Chilled water tank"; Buildings.DHC.ETS.Combined.Subsystems.StratifiedTankWithCommand tanHeaWat( redeclare final package Medium = MediumBui, final isHotWat=true, final m_flow_nominal=colHeaWat.mDis_flow_nominal, final VTan=VTanHeaWat, final hTan=hTanHeaWat, final dIns=dInsTanHeaWat, final nSeg=nSegTan, T_start=TCon_start) "Heating hot water tank"; Buildings.DHC.ETS.Combined.Subsystems.DHWConsumption tanDhw( redeclare final package Medium = MediumBui, final dat=datDhw, final QHotWat_flow_nominal=datDhw.QHex_flow_nominal, dT_nominal=6, T_start=TCon_start) if have_hotWat "Tank for domestic hot water"; Buildings.Fluid.Actuators.Valves.TwoWayLinear valIsoEva( redeclare final package Medium = MediumBui, final dpValve_nominal=dpValIso_nominal, final m_flow_nominal=colAmbWat.mDis_flow_nominal, linearized=true) "Evaporator to ambient loop isolation valve"; Buildings.Fluid.Actuators.Valves.TwoWayLinear valIsoCon( redeclare final package Medium = MediumBui, final dpValve_nominal=dpValIso_nominal, final m_flow_nominal=colAmbWat.mDis_flow_nominal, linearized=true) "Condenser to ambient loop isolation valve"; Buildings.DHC.ETS.BaseClasses.CollectorDistributor colChiWat( redeclare final package Medium = MediumBui, final nCon=1 + nSysCoo, mCon_flow_nominal={colAmbWat.mDis_flow_nominal, datHeaPum.mEva_flow_nominal}) "Collector/distributor for chilled water"; Buildings.DHC.ETS.BaseClasses.CollectorDistributor colHeaWat( redeclare final package Medium = MediumBui, final nCon=1 + nSysHea, mCon_flow_nominal={colAmbWat.mDis_flow_nominal, datHeaPum.mCon_flow_nominal}) "Collector/distributor for heating water"; Buildings.DHC.ETS.BaseClasses.CollectorDistributor colAmbWat( redeclare final package Medium = MediumBui, final nCon=nSouAmb, mCon_flow_nominal={hex.m2_flow_nominal}) "Collector/distributor for ambient water"; Buildings.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate dHFloHeaWat( redeclare final package Medium1 = MediumBui, final m_flow_nominal=colHeaWat.mDis_flow_nominal) "Variation of enthalpy flow rate"; Buildings.Fluid.Sensors.TemperatureTwoPort senTHexBuiEnt( redeclare final package Medium = MediumBui, final m_flow_nominal=m1Hex_flow_nominal, final allowFlowReversal=true) "Heat exchanger water entering temperature on building side"; Buildings.Fluid.Sensors.TemperatureTwoPort senTHexBuiLvg( redeclare final package Medium = MediumBui, final m_flow_nominal=m1Hex_flow_nominal, final allowFlowReversal=true) "Heat exchanger water leaving temperature on building side"; Buildings.Fluid.Sources.Boundary_pT bou( redeclare final package Medium = MediumBui, nPorts=1) "Pressure boundary condition representing expansion vessel (common to HHW and CHW)"; Buildings.Controls.OBC.CDL.Reals.MultiSum totPPum( nin=if have_hotWat then 3 else 2) "Total pump power"; Buildings.DHC.Networks.BaseClasses.DifferenceEnthalpyFlowRate dHFloChiWat( redeclare final package Medium1 = MediumBui, final m_flow_nominal=colChiWat.mDis_flow_nominal) "Variation of enthalpy flow rate"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zerPHea( final k=0) "Zero power"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear valMixHea( redeclare package Medium = MediumBui, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=datHeaPum.mCon_flow_nominal, dpValve_nominal=dpCon_nominal*0.05, dpFixed_nominal=dpCon_nominal*0.05*{1,1}, linearized={true,true}) if have_hotWat "Three way valve selecting condenser flow from HHW or DHW return"; Buildings.Fluid.FixedResistances.Junction junDomHotWat( redeclare final package Medium = MediumBui, final dp_nominal={0,0,0}, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tau=1, final m_flow_nominal=datHeaPum.mCon_flow_nominal*{1,-1,-1}) if have_hotWat "Junction to domestic hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THotWatSupSet(final unit="K", displayUnit="degC") if have_hotWat "Domestic hot water temperature set point for supply to fixtures"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TColWat(final unit="K", displayUnit="degC") if have_hotWat "Cold water temperature that is fed to domestic hot water preparation"; Buildings.Controls.OBC.CDL.Interfaces.RealInput QReqHotWat_flow(final unit="W") if have_hotWat "Domestic hot water load"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dHHotWat_flow(final unit="W") if have_hotWat "Domestic hot water distributed energy flow rate"; Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination twoTanCoo(final have_hotWat=have_hotWat) "Controller to coordinate heat rejection vs use in space or DHW tank"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal conDivValChi(realTrue=1, realFalse=0) "Control for diversion valve to avoid that tank is flushed when changing to district heat exchanger"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear valDivCon( redeclare package Medium = MediumBui, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=datHeaPum.mCon_flow_nominal, dpValve_nominal=dpCon_nominal*0.05, dpFixed_nominal=dpCon_nominal*0.05*{1,1}, linearized={true,true}) "Diversion valve used to reject heat and not flow through the whole tank"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear valDivEva( redeclare package Medium = MediumBui, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=datHeaPum.mEva_flow_nominal, dpValve_nominal=dpEva_nominal*0.05, dpFixed_nominal=dpEva_nominal*0.05*{1,1}, linearized={true,true}) "Diversion valve used to reject cold and not flow through the whole tank"; Buildings.Fluid.FixedResistances.Junction junChiWat( redeclare final package Medium = MediumBui, final dp_nominal={0,0,0}, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tau=1, final m_flow_nominal=datHeaPum.mCon_flow_nominal*{1,-1,-1}) "Junction at chilled water tank"; Buildings.Fluid.FixedResistances.Junction junHeaWat( redeclare final package Medium = MediumBui, final dp_nominal={0,0,0}, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final tau=1, final m_flow_nominal=datHeaPum.mCon_flow_nominal*{1,-1,-1}) "Junction at heating water tank"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal conAmbEva(realTrue=0, realFalse=1) "Control for valve for ambient loop on evaporator side"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal conDivValHea(realTrue=1, realFalse=0) "Control for diversion valve to avoid that tank is flushed when changing to district heat exchanger"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal conAmbCon(realTrue=0, realFalse=1) "Control for valve for ambient loop on condenser side"; Buildings.Fluid.Sensors.TemperatureTwoPort senTSerEnt( redeclare final package Medium = MediumSer, final m_flow_nominal=colAmbWat.mDis_flow_nominal, final allowFlowReversal=allowFlowReversalSer) "Heat exchanger service line water entering temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTSerLinLvg( redeclare final package Medium = MediumSer, final m_flow_nominal=colAmbWat.mDis_flow_nominal, final allowFlowReversal=allowFlowReversalSer) "Heat exchanger service line water leaving temperature"; Controls.EtsHex opeEtsHex "Output true to operate ETS heat exchanger"; Subsystems.WatersideEconomizer WSE( redeclare final package Medium1 = MediumSer, redeclare final package Medium2 = MediumBui, final allowFlowReversal1=allowFlowReversalSer, final allowFlowReversal2=allowFlowReversalBui, final conCon=conCon, final dp1Hex_nominal=dp1WSE_nominal, final dp2Hex_nominal=dp2WSE_nominal, final Q_flow_nominal=QWSE_flow_nominal, final T_a1_nominal=T_a1WSE_nominal, final T_b1_nominal=T_b1WSE_nominal, final T_a2_nominal=T_a2WSE_nominal, final T_b2_nominal=T_b2WSE_nominal, final y1Min=y1WSEMin) if have_WSE "Waterside economizer"; Buildings.DHC.ETS.BaseClasses.Junction splWSE( redeclare final package Medium = MediumSer, final m_flow_nominal={ hex.m1_flow_nominal + m1WSE_flow_nominal, -hex.m1_flow_nominal, -m1WSE_flow_nominal}) "Flow splitter for WSE"; Buildings.DHC.ETS.BaseClasses.Junction mixWSE( redeclare final package Medium = MediumSer, final m_flow_nominal={ hex.m1_flow_nominal, -hex.m1_flow_nominal-m1WSE_flow_nominal, m1WSE_flow_nominal}) "Flow mixer for WSE"; protected parameter Boolean have_val1Hex= conCon ==Buildings.DHC.ETS.Types.ConnectionConfiguration.TwoWayValve "True in case of control valve on district side, false in case of a pump"; Buildings.DHC.Plants.Cooling.BaseClasses.ParallelPipes parPip( redeclare final package Medium = MediumBui, m_flow_nominal=datHeaPum.mCon_flow_nominal, dp_nominal=0) if not have_hotWat "Parallel pipes for routing purposes"; equation connect(totPPum.y,PPum); connect(valIsoEva.port_b,colAmbWat.port_bDisSup); connect(valIsoCon.port_b,colAmbWat.port_aDisSup); connect(valIsoEva.port_a,colChiWat.ports_aCon[1]); connect(valIsoCon.port_a,colHeaWat.ports_aCon[1]); connect(bou.ports[1], colChiWat.port_aDisSup); connect(colAmbWat.port_bDisRet, colHeaWat.ports_bCon[1]); connect(colAmbWat.port_aDisRet, colChiWat.ports_bCon[1]); connect(THeaWatSupSet, tanHeaWat.TTanSet); connect(senTHexBuiLvg.port_b, colAmbWat.ports_aCon[1]); connect(hex.port_b2, senTHexBuiLvg.port_a); connect(hex.port_a2, senTHexBuiEnt.port_b); connect(senTHexBuiEnt.port_a, colAmbWat.ports_bCon[1]); connect(totPPum.u[1], hex.PPum); connect(dHFloHeaWat.dH_flow, dHHeaWat_flow); connect(dHFloChiWat.dH_flow, dHChiWat_flow); connect(heaPum.port_bChiWat, colChiWat.ports_aCon[2]); connect(colHeaWat.ports_aCon[2], heaPum.port_bHeaWat); connect(heaPum.PPum, totPPum.u[2]); connect(tanDhw.THotWatSupSet, THotWatSupSet); connect(TColWat, tanDhw.TColWat); connect(QReqHotWat_flow, tanDhw.QReqHotWat_flow); connect(dHFloHeaWat.port_a1, tanHeaWat.port_loaTop); connect(tanHeaWat.port_loaBot, dHFloHeaWat.port_b2); connect(tanDhw.PEle, totPPum.u[3]); connect(tanDhw.charge,twoTanCoo.uDhw); connect(tanHeaWat.charge, twoTanCoo.uHea); connect(tanDhw.dHFlo, dHHotWat_flow); connect(tanDhw.port_b, valMixHea.port_3); connect(tanDhw.port_a, junDomHotWat.port_3); connect(tanChiWat.charge, conDivValChi.u); connect(valMixHea.port_2, colHeaWat.port_aDisSup); connect(junDomHotWat.port_1, colHeaWat.port_bDisRet); connect(parPip.port_b2, colHeaWat.port_aDisSup); connect(valDivCon.port_1, tanHeaWat.port_genBot); connect(conDivValChi.y, valDivEva.y); connect(tanChiWat.port_loaTop, dHFloChiWat.port_b2); connect(tanChiWat.port_loaBot, dHFloChiWat.port_a1); connect(colChiWat.port_aDisSup, valDivEva.port_2); connect(valDivEva.port_1, tanChiWat.port_genTop); connect(colChiWat.port_bDisRet, junChiWat.port_1); connect(junChiWat.port_2, tanChiWat.port_genBot); connect(valDivEva.port_3, junChiWat.port_3); connect(junDomHotWat.port_2, junHeaWat.port_1); connect(junHeaWat.port_2, tanHeaWat.port_genTop); connect(valDivCon.port_3, junHeaWat.port_3); connect(parPip.port_b1, junHeaWat.port_1); connect(parPip.port_a1, colHeaWat.port_bDisRet); connect(valDivCon.port_2, parPip.port_a2); connect(valMixHea.port_1, valDivCon.port_2); connect(conAmbEva.u, tanChiWat.charge); connect(valIsoEva.y, conAmbEva.y); connect(conDivValHea.y, valDivCon.y); connect(valIsoCon.y, conAmbCon.y); connect(twoTanCoo.y, conDivValHea.u); connect(conAmbCon.u, twoTanCoo.y); connect(twoTanCoo.yMix, valMixHea.y); connect(port_aSerAmb, senTSerEnt.port_a); connect(senTSerLinLvg.port_b, port_bSerAmb); connect(heaPum.uHeaSpa, tanHeaWat.charge); connect(heaPum.uCoo, tanChiWat.charge); connect(heaPum.THeaWatSupSet, THeaWatSupSet); connect(heaPum.TChiWatSupSet, TChiWatSupSet); connect(opeEtsHex.yVal1, valIsoEva.y_actual); connect(opeEtsHex.yVal2, valIsoCon.y_actual); connect(heaPum.uHeaDhw, twoTanCoo.yDhw); connect(tanChiWat.charge, WSE.uCoo); connect(valIsoEva.y_actual, WSE.yValIsoEva_actual); connect(senTSerEnt.port_b, splWSE.port_1); connect(splWSE.port_2, hex.port_a1); connect(senTSerLinLvg.port_a, mixWSE.port_2); connect(mixWSE.port_1, hex.port_b1); connect(WSE.port_b1, mixWSE.port_3); connect(WSE.port_a1, splWSE.port_3); connect(WSE.port_a2, dHFloChiWat.port_b2); connect(WSE.port_b2, tanChiWat.port_loaTop); connect(heaPum.PChi, PCoo); connect(zerPHea.y, PHea); for i in 1:nPorts_bHeaWat loop connect(dHFloHeaWat.port_b1, ports_bHeaWat[i]); end for; for i in 1:nPorts_aHeaWat loop connect(dHFloHeaWat.port_a2, ports_aHeaWat[i]); end for; for i in 1:nPorts_bChiWat loop connect(dHFloChiWat.port_b1, ports_bChiWat[i]); end for; for i in 1:nPorts_aChiWat loop connect(ports_aChiWat[i], dHFloChiWat.port_a2); end for; connect(opeEtsHex.on, hex.on); connect(heaPum.port_aHeaWat, colHeaWat.ports_bCon[2]); connect(heaPum.port_aChiWat, colChiWat.ports_bCon[2]); connect(TChiWatSupSet, tanChiWat.TTanSet); end HeatRecoveryHeatPump;