Buildings.Templates.Plants.HeatPumps.Components

Package with component models

Information

This package contains component models that are used in the templates within Buildings.Templates.Plants.HeatPumps.

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

Package Content

Name Description
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated PumpsPrimaryDedicated Dedicated primary pumps
Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation ValvesIsolation Heat pump isolation valves
Buildings.Templates.Plants.HeatPumps.Components.Controls Controls Controllers
Buildings.Templates.Plants.HeatPumps.Components.HeatPumpGroups HeatPumpGroups Models for heat pump groups
Buildings.Templates.Plants.HeatPumps.Components.Data Data Records for design and operating parameters
Buildings.Templates.Plants.HeatPumps.Components.Validation Validation Package with validation models
Buildings.Templates.Plants.HeatPumps.Components.Interfaces Interfaces Interface classes

Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated

Dedicated primary pumps

Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated

Information

This model represents dedicated primary HW pumps and, optionally, separate dedicated primary CHW pumps if the parameter have_pumChiWatPriDed is set to true. The pump components are connected to the heat pump outlet, in a "pump away" configuration. Variable speed or constant speed pumps can be modeled by setting the parameters have_pumHeaWatPriVar and have_pumChiWatPriVar. If headered pumps are modeled (typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Headered), this component resolves to a direct fluid pass-through.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterMedium model
PumpMultipledatPumHeaWatdatPumHeaWat(typ=if typArrPu...HW pump parameters
PumpMultipledatPumChiWatdatPumChiWat(typ=if have_pum...CHW pump parameters
Configuration
IntegernHp Number of heat pumps
PumpArrangementtypArrPumPri Type of primary pump arrangement
Booleanhave_pumChiWatPriDed Set to true for plants with separate dedicated primary CHW pumps
Booleanhave_pumHeaWatPriVar Set to true for variable speed primary HW pumps
Booleanhave_pumChiWatPriVar Set to true for variable speed primary CHW pumps
Nominal condition
PressureDifferencedpValCheHeaWat_nominal[nPum]fill(if typArrPumPri == Buil...HW pump check valve pressure drop at design HW pump flow rate [Pa]
PressureDifferencedpValCheChiWat_nominal[if have_pumChiWatPriDed then nPum else 0]fill(if have_pumChiWatPriDed...CHW pump check valve pressure drop at design CHW pump flow rate [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau1Time constant at nominal flow [s]
Assumptions
BooleanallowFlowReversaltrueSet to false to simplify equations, assuming, but not enforcing, no flow reversal

Connectors

TypeNameDescription
replaceable package MediumMedium model
FluidPorts_bports_bChiHeaWat[nHp]CHW/HW supply (to primary loop)
FluidPorts_aports_aChiHeaWat[nHp]CHW/HW return (from primary loop)
FluidPorts_bports_bChiHeaWatHp[nHp]CHW/HW return (HP entering)
FluidPorts_bports_bHeaWat[nHp]HW supply (to primary loop)
FluidPorts_bports_bChiWat[nHp]CHW supply (to primary loop)
FluidPorts_aports_aChiHeaWatHp[nHp]CHW/HW supply (HP leaving)
BusbusPlant control bus

Modelica definition

model PumpsPrimaryDedicated "Dedicated primary pumps" replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Medium model"; parameter Integer nHp(min=1) "Number of heat pumps"; /* RFE(AntoineGautier): Add support for multiple pumps for each heat pump. Currently, only one dedicated CHW or HW pump for each HP is supported. */ final parameter Integer nPum=if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated then nHp else 0 "Number of primary pumps"; parameter Buildings.Templates.Components.Types.PumpArrangement typArrPumPri "Type of primary pump arrangement"; parameter Boolean have_pumChiWatPriDed(start=false) "Set to true for plants with separate dedicated primary CHW pumps"; parameter Boolean have_pumHeaWatPriVar(start=false) "Set to true for variable speed primary HW pumps"; parameter Boolean have_pumChiWatPriVar(start=false) "Set to true for variable speed primary CHW pumps"; parameter Buildings.Templates.Components.Data.PumpMultiple datPumHeaWat( typ=if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated then Buildings.Templates.Components.Types.Pump.Multiple else Buildings.Templates.Components.Types.Pump.None, nPum=nPum) "HW pump parameters"; parameter Buildings.Templates.Components.Data.PumpMultiple datPumChiWat( typ=if have_pumChiWatPriDed then Buildings.Templates.Components.Types.Pump.Multiple else Buildings.Templates.Components.Types.Pump.None, nPum=if have_pumChiWatPriDed then nPum else 0) "CHW pump parameters"; parameter Modelica.Units.SI.PressureDifference dpValCheHeaWat_nominal[nPum]( each final min=0, start=fill(if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated then Buildings.Templates.Data.Defaults.dpValChe else 0, nPum))=fill( if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated then Buildings.Templates.Data.Defaults.dpValChe else 0, nPum) "HW pump check valve pressure drop at design HW pump flow rate"; parameter Modelica.Units.SI.PressureDifference dpValCheChiWat_nominal[if have_pumChiWatPriDed then nPum else 0]( each final min=0, start=fill(if have_pumChiWatPriDed then Buildings.Templates.Data.Defaults.dpValChe else 0, if have_pumChiWatPriDed then nPum else 0))=fill(if have_pumChiWatPriDed then Buildings.Templates.Data.Defaults.dpValChe else 0, if have_pumChiWatPriDed then nPum else 0) "CHW pump check valve pressure drop at design CHW pump flow rate"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Modelica.Units.SI.Time tau=1 "Time constant at nominal flow"; parameter Boolean allowFlowReversal=true "Set to false to simplify equations, assuming, but not enforcing, no flow reversal"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWat[nHp]( redeclare each final package Medium=Medium, each m_flow( max=if allowFlowReversal then + Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered or typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated and not have_pumChiWatPriDed "CHW/HW supply (to primary loop)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWat[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "CHW/HW return (from primary loop)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( max=if allowFlowReversal then + Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "CHW/HW return (HP entering)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bHeaWat[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated and have_pumChiWatPriDed "HW supply (to primary loop)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiWat[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated and have_pumChiWatPriDed "CHW supply (to primary loop)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "CHW/HW supply (HP leaving)"; Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus "Plant control bus"; Buildings.Templates.Components.Pumps.Multiple pumHeaWat( redeclare final package Medium=Medium, final have_var=have_pumHeaWatPriVar, final have_varCom=false, final nPum=nPum, final dat=datPumHeaWat, final dpValChe_nominal=dpValCheHeaWat_nominal, final allowFlowReversal=allowFlowReversal, final tau=tau, final energyDynamics=energyDynamics) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated "Dedicated primary (HW) Pumps"; Buildings.Templates.Components.Pumps.Multiple pumChiWat( redeclare final package Medium=Medium, final have_var=have_pumChiWatPriVar, final have_varCom=false, final nPum=if have_pumChiWatPriDed then nPum else 0, final dat=datPumChiWat, final dpValChe_nominal=dpValCheChiWat_nominal, final allowFlowReversal=allowFlowReversal, final tau=tau, final energyDynamics=energyDynamics) if have_pumChiWatPriDed "Dedicated primary CHW pumps - Optional"; Buildings.Templates.Components.Routing.PassThroughFluid pasHdr[nHp]( redeclare each final package Medium = Medium) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered "Direct fluid pass-through for headered primary pumps"; Fluid.FixedResistances.Junction junDedSep[nPum]( redeclare each final package Medium =Medium, final m_flow_nominal={{ max(datPumHeaWat.m_flow_nominal[i], datPumChiWat.m_flow_nominal[i]), -datPumHeaWat.m_flow_nominal[i], -datPumChiWat.m_flow_nominal[i]} for i in 1:nPum}, dp_nominal=fill(fill(0, 3), nPum), each final energyDynamics=energyDynamics, each final portFlowDirection_1=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, each final portFlowDirection_2=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, each final portFlowDirection_3=if allowFlowReversal then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated and have_pumChiWatPriDed "Fluid junction for separate dedicated primary pumps"; Buildings.Templates.Components.Routing.PassThroughFluid pasDedCom[nHp]( redeclare each final package Medium = Medium) if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated and not have_pumChiWatPriDed "Direct fluid pass-through for common dedicated primary pumps"; protected Buildings.Templates.Components.Interfaces.Bus busPumHeaWatPri "Primary HW pump control bus"; Buildings.Templates.Components.Interfaces.Bus busPumChiWatPri if have_pumChiWatPriDed "Primary CHW pump control bus"; equation connect(bus.pumHeaWatPri, busPumHeaWatPri); connect(bus.pumChiWatPri, busPumChiWatPri); connect(pumHeaWat.ports_b, ports_bHeaWat); connect(pumHeaWat.ports_b, ports_bChiHeaWat); connect(pumChiWat.ports_b, ports_bChiWat); connect(busPumHeaWatPri, pumHeaWat.bus); connect(busPumChiWatPri, pumChiWat.bus); connect(ports_aChiHeaWat, ports_bChiHeaWatHp); connect(ports_aChiHeaWatHp, pasHdr.port_a); connect(pasHdr.port_b, ports_bChiHeaWat); connect(junDedSep.port_3, pumChiWat.ports_a); connect(ports_aChiHeaWatHp, pasDedCom.port_a); connect(pasDedCom.port_b, pumHeaWat.ports_a); connect(ports_aChiHeaWatHp, junDedSep.port_1); connect(junDedSep.port_2, pumHeaWat.ports_a); end PumpsPrimaryDedicated;

Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation

Heat pump isolation valves

Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation

Information

This model represents the heat pump isolation valves. The isolation valves are modeled as two-way two-position valves, which can be located at the heat pump inlet and/or outlet depending on the settings of the parameters have_valHpInlIso and have_valHpOutIso. It is assumed that the heat pumps always provide heating hot water. Optionally, chilled water return and supply and the associated isolation valves can be modeled by setting the parameter have_chiWat to true.

Implementation details

By default, the isolation valves are modeled considering a linear variation of the pressure drop with the flow rate (linearized=true), as opposed to the quadratic relationship usually considered for a turbulent flow regime. By limiting the size of the system of nonlinear equations, this setting reduces the risk of solver failure and the time to solution.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterMedium model
Configuration
IntegernHp Number of heat pumps
Booleanhave_chiWat Set to true if the plant provides CHW
Booleanhave_valHpInlIso Set to true for isolation valves at HP inlet
Booleanhave_valHpOutIso Set to true for isolation valves at HP outlet
Booleanhave_pumChiWatPriDed Set to true for plants with separate dedicated primary CHW pumps
Nominal condition
MassFlowRatemHeaWatHp_flow_nominal[nHp] HW mass flow rate - Each heat pump [kg/s]
PressureDifferencedpHeaWatHp_nominal[nHp] Pressure drop at design HW mass flow rate - Each heat pump [Pa]
PressureDifferencedpBalHeaWatHp_nominal[nHp]fill(0, nHp)Balancing valve pressure drop at design HW mass flow rate - Each heat pump [Pa]
MassFlowRatemChiWatHp_flow_nominal[nHp] CHW mass flow rate - Each heat pump [kg/s]
PressureDifferencedpBalChiWatHp_nominal[nHp]fill(0, nHp)Balancing valve pressure drop at design CHW mass flow rate - Each heat pump [Pa]
PressureDifferencedpValveHeaWat_nominal[nHp]fill(Buildings.Templates.Dat...HW isolation valve pressure drop: identical for inlet and outlet valves [Pa]
PressureDifferencedpValveChiWat_nominal[nHp]fill(Buildings.Templates.Dat...Isolation valve CHW pressure drop: identical for inlet and outlet valves [Pa]
Dynamics
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Nominal condition
Timetau10Time constant at nominal flow [s]
Filtered opening
Booleanuse_inputFilterenergyDynamics <> Modelica.F...= true, if opening is filtered with a 2nd order CriticalDamping filter
TimeriseTime120Rise time of the filter (time to reach 99.6 % of an opening step) [s]
InitinitModelica.Blocks.Types.Init.I...Type of initialization (no init/steady state/initial state/initial output)
Realy_start1Initial position of actuator
Assumptions
BooleanallowFlowReversaltrueSet to false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
Booleanfrom_dptrue= true, use m_flow = f(dp) else dp = f(m_flow)
Booleanlinearizedtrue= true, use linear relation between m_flow and dp for any flow rate

Connectors

TypeNameDescription
replaceable package MediumMedium model
FluidPort_bport_bChiWatCHW supply (to primary loop)
FluidPort_aport_aChiWatCHW return (from primary loop)
FluidPort_bport_bHeaWatHW supply (to primary loop)
FluidPort_aport_aHeaWatHW return (from primary loop)
FluidPorts_bports_bChiHeaWatHp[nHp]CHW/HW return (HP entering)
FluidPorts_aports_aChiHeaWatHp[nHp]CHW/HW supply (HP leaving)
FluidPorts_aports_aHeaWatHp[nHp]HW supply (HP leaving)
FluidPorts_aports_aChiWatHp[nHp]CHW supply (HP leaving)
BusbusPlant control bus

Modelica definition

model ValvesIsolation "Heat pump isolation valves" replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Medium model"; final parameter Buildings.Templates.Components.Types.Valve typ= Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition "Valve type"; parameter Integer nHp( final min=1) "Number of heat pumps"; parameter Boolean have_chiWat "Set to true if the plant provides CHW"; parameter Boolean have_valHpInlIso "Set to true for isolation valves at HP inlet"; parameter Boolean have_valHpOutIso "Set to true for isolation valves at HP outlet"; parameter Boolean have_pumChiWatPriDed( start=false) "Set to true for plants with separate dedicated primary CHW pumps"; parameter Modelica.Units.SI.MassFlowRate mHeaWatHp_flow_nominal[nHp]( each final min=0, each start=0) "HW mass flow rate - Each heat pump"; parameter Modelica.Units.SI.PressureDifference dpHeaWatHp_nominal[nHp]( each final min=0, each start=Buildings.Templates.Data.Defaults.dpChiWatChi) "Pressure drop at design HW mass flow rate - Each heat pump"; parameter Modelica.Units.SI.PressureDifference dpBalHeaWatHp_nominal[nHp]( each final min=0)=fill(0, nHp) "Balancing valve pressure drop at design HW mass flow rate - Each heat pump"; parameter Modelica.Units.SI.MassFlowRate mChiWatHp_flow_nominal[nHp]( each start=0, each final min=0) "CHW mass flow rate - Each heat pump"; final parameter Modelica.Units.SI.PressureDifference dpChiWatHp_nominal[nHp]= dpHeaWatHp_nominal .*(mChiWatHp_flow_nominal ./ mHeaWatHp_flow_nominal) .^ 2 "Pressure drop at design CHW mass flow rate - Each heat pump"; parameter Modelica.Units.SI.PressureDifference dpBalChiWatHp_nominal[nHp]( each final min=0, each start=0)=fill(0, nHp) "Balancing valve pressure drop at design CHW mass flow rate - Each heat pump"; parameter Modelica.Units.SI.PressureDifference dpValveHeaWat_nominal[nHp]=fill(Buildings.Templates.Data.Defaults.dpValIso, nHp) "HW isolation valve pressure drop: identical for inlet and outlet valves"; final parameter Modelica.Units.SI.PressureDifference dpFixedHeaWat_nominal[nHp]= dpHeaWatHp_nominal + dpBalHeaWatHp_nominal "Fixed HW pressure drop: HP + balancing valve"; final parameter Modelica.Units.SI.PressureDifference dpHeaWat_nominal[nHp]= dpFixedHeaWat_nominal +(if have_valHpOutIso then dpValveHeaWat_nominal else fill(0, nHp)) + (if have_valHpInlIso then dpValveHeaWat_nominal else fill(0, nHp)) "Total HW pressure drop: fixed + valves"; parameter Modelica.Units.SI.PressureDifference dpValveChiWat_nominal[nHp]( each start=0)=fill(Buildings.Templates.Data.Defaults.dpValIso, nHp) "Isolation valve CHW pressure drop: identical for inlet and outlet valves"; final parameter Modelica.Units.SI.PressureDifference dpFixedChiWat_nominal[nHp]= if have_chiWat then dpChiWatHp_nominal + dpBalChiWatHp_nominal else fill(0, nHp) "Total fixed CHW pressure drop"; final parameter Modelica.Units.SI.PressureDifference dpChiWat_nominal[nHp]= dpFixedChiWat_nominal +(if have_chiWat and have_valHpOutIso then dpValveChiWat_nominal else fill(0, nHp)) +(if have_chiWat and have_valHpInlIso then dpValveChiWat_nominal else fill(0, nHp)) "Total CHW pressure drop: fixed + valves"; final parameter Buildings.Templates.Components.Data.Valve datValHeaWatHpOutIso[nHp]( each typ=typ, m_flow_nominal=mHeaWatHp_flow_nominal, dpValve_nominal=dpValveHeaWat_nominal, dpFixed_nominal=dpFixedHeaWat_nominal) "Heat pump outlet HW isolation valve parameters"; // dpFixed_nominal only applied to inlet valves if there is no outlet valve. final parameter Buildings.Templates.Components.Data.Valve datValHeaWatHpInlIso[nHp]( each typ=typ, m_flow_nominal=mHeaWatHp_flow_nominal, dpValve_nominal=dpValveHeaWat_nominal, dpFixed_nominal=if not have_valHpOutIso then dpFixedHeaWat_nominal else fill(0, nHp)) "Heat pump inlet HW isolation valve parameters"; final parameter Buildings.Templates.Components.Data.Valve datValChiWatHpOutIso[nHp]( each typ=typ, m_flow_nominal=mChiWatHp_flow_nominal, dpValve_nominal=dpValveChiWat_nominal, dpFixed_nominal=dpFixedChiWat_nominal) "Heat pump outlet CHW isolation valve parameters"; // dpFixed_nominal only applied to inlet valves if there is no outlet valve. final parameter Buildings.Templates.Components.Data.Valve datValChiWatHpInlIso[nHp]( each typ=typ, m_flow_nominal=mChiWatHp_flow_nominal, dpValve_nominal=dpValveChiWat_nominal, dpFixed_nominal=if not have_valHpOutIso then dpFixedChiWat_nominal else fill(0, nHp)) "Heat pump inlet CHW isolation valve parameters"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Modelica.Units.SI.Time tau=10 "Time constant at nominal flow"; parameter Boolean allowFlowReversal=true "Set to false to simplify equations, assuming, but not enforcing, no flow reversal"; parameter Boolean use_inputFilter=energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState "= true, if opening is filtered with a 2nd order CriticalDamping filter"; parameter Modelica.Units.SI.Time riseTime=120 "Rise time of the filter (time to reach 99.6 % of an opening step)"; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)"; parameter Real y_start=1 "Initial position of actuator"; parameter Boolean from_dp=true "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Boolean linearized=true "= true, use linear relation between m_flow and dp for any flow rate"; Modelica.Fluid.Interfaces.FluidPort_b port_bChiWat( redeclare final package Medium=Medium, m_flow( max=if allowFlowReversal then + Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if have_chiWat "CHW supply (to primary loop)"; Modelica.Fluid.Interfaces.FluidPort_a port_aChiWat( redeclare final package Medium=Medium, m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if have_chiWat "CHW return (from primary loop)"; Modelica.Fluid.Interfaces.FluidPort_b port_bHeaWat( redeclare final package Medium=Medium, m_flow( max=if allowFlowReversal then + Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "HW supply (to primary loop)"; Modelica.Fluid.Interfaces.FluidPort_a port_aHeaWat( redeclare final package Medium=Medium, m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "HW return (from primary loop)"; Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( max=if allowFlowReversal then + Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) "CHW/HW return (HP entering)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if not have_pumChiWatPriDed "CHW/HW supply (HP leaving)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aHeaWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if have_pumChiWatPriDed "HW supply (HP leaving)"; Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiWatHp[nHp]( redeclare each final package Medium=Medium, each m_flow( min=if allowFlowReversal then - Modelica.Constants.inf else 0), each h_outflow( start=Medium.h_default, nominal=Medium.h_default)) if have_pumChiWatPriDed "CHW supply (HP leaving)"; Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus "Plant control bus"; Buildings.Templates.Components.Actuators.Valve valHeaWatHpOutIso[nHp]( redeclare each final package Medium=Medium, final dat=datValHeaWatHpOutIso, each final typ=typ, each final use_inputFilter=use_inputFilter, each final riseTime=riseTime, each final init=init, each final y_start=y_start, each final from_dp=from_dp, each final linearized=linearized) if have_valHpOutIso "HP outlet HW isolation valve"; Buildings.Templates.Components.Actuators.Valve valChiWatHpOutIso[nHp]( redeclare each final package Medium=Medium, final dat=datValChiWatHpOutIso, each final typ=typ, each final use_inputFilter=use_inputFilter, each final riseTime=riseTime, each final init=init, each final y_start=y_start, each final from_dp=from_dp, each final linearized=linearized) if have_valHpOutIso and have_chiWat "HP outlet CHW isolation valve"; Buildings.Templates.Components.Actuators.Valve valHeaWatHpInlIso[nHp]( redeclare each final package Medium=Medium, final dat=datValHeaWatHpInlIso, each final typ=typ, each final use_inputFilter=use_inputFilter, each final riseTime=riseTime, each final init=init, each final y_start=y_start, each final from_dp=from_dp, each final linearized=linearized) if have_valHpInlIso "HP inlet HW isolation valve"; Buildings.Templates.Components.Actuators.Valve valChiWatHpInlIso[nHp]( redeclare each final package Medium=Medium, final dat=datValChiWatHpInlIso, each final typ=typ, each final use_inputFilter=use_inputFilter, each final riseTime=riseTime, each final init=init, each final y_start=y_start, each final from_dp=from_dp, each final linearized=linearized) if have_valHpInlIso and have_chiWat "HP inlet CHW isolation valve"; Buildings.Templates.Components.Routing.PassThroughFluid pasHeaWatHpOut[nHp]( redeclare each final package Medium=Medium) if not have_valHpOutIso "Direct fluid pass-through"; Buildings.Templates.Components.Routing.PassThroughFluid pasChiWatHpOut[nHp]( redeclare each final package Medium=Medium) if not have_valHpOutIso and have_chiWat "Direct fluid pass-through"; Fluid.Delays.DelayFirstOrder junHeaWatSup( redeclare final package Medium=Medium, final tau=tau, final m_flow_nominal=sum(mHeaWatHp_flow_nominal), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nHp + 1) "Fluid volume at junction"; Fluid.Delays.DelayFirstOrder junChiWatSup( redeclare final package Medium=Medium, final tau=tau, final m_flow_nominal=sum(mChiWatHp_flow_nominal), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nHp + 1) if have_chiWat "Fluid volume at junction"; Fluid.Delays.DelayFirstOrder junHeaWatRet( redeclare final package Medium=Medium, final tau=tau, final m_flow_nominal=sum(mHeaWatHp_flow_nominal), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nHp + 1) "Fluid volume at junction"; /* HW pressure drop computed in this component in the absence of isolation valves at both inlet and outlet. */ Fluid.FixedResistances.PressureDrop pasHeaWatHpInl[nHp]( redeclare each final package Medium=Medium, final m_flow_nominal=mHeaWatHp_flow_nominal, final dp_nominal=if not have_valHpInlIso and not have_valHpOutIso then dpFixedHeaWat_nominal else fill(0, nHp)) if not have_valHpInlIso "Direct fluid pass-through with optional fluid resistance"; /* CHW pressure drop computed in this component in the absence of isolation valves at both inlet and outlet. */ Fluid.FixedResistances.PressureDrop pasChiWatHpInl[nHp]( redeclare each final package Medium=Medium, final m_flow_nominal=mChiWatHp_flow_nominal, final dp_nominal=if not have_valHpInlIso and not have_valHpOutIso then dpFixedChiWat_nominal else fill(0, nHp)) if not have_valHpInlIso and have_chiWat "Direct fluid pass-through with optional fluid resistance"; Fluid.Delays.DelayFirstOrder junChiWatRet( redeclare final package Medium=Medium, final tau=tau, final m_flow_nominal=sum(mChiWatHp_flow_nominal), final energyDynamics=energyDynamics, final allowFlowReversal=allowFlowReversal, final prescribedHeatFlowRate=false, final nPorts=nHp + 1) if have_chiWat "Fluid volume at junction"; protected Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpInlIso[nHp] if have_valHpInlIso "Heat pump inlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpOutIso[nHp] if have_valHpOutIso "Heat pump outlet HW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatHpInlIso[nHp] if have_chiWat and have_valHpInlIso "Heat pump inlet CHW isolation valve control bus"; Buildings.Templates.Components.Interfaces.Bus busValChiWatHpOutIso[nHp] if have_chiWat and have_valHpOutIso "Heat pump outlet CHW isolation valve control bus"; equation connect(bus.valHeaWatHpInlIso, busValHeaWatHpInlIso); connect(bus.valHeaWatHpOutIso, busValHeaWatHpOutIso); connect(bus.valChiWatHpInlIso, busValChiWatHpInlIso); connect(bus.valChiWatHpOutIso, busValChiWatHpOutIso); connect(ports_aHeaWatHp, valHeaWatHpOutIso.port_a); connect(ports_aChiHeaWatHp, valHeaWatHpOutIso.port_a); connect(ports_aChiHeaWatHp, valChiWatHpOutIso.port_a); connect(ports_aChiWatHp, valChiWatHpOutIso.port_a); connect(ports_aHeaWatHp, pasHeaWatHpOut.port_a); connect(ports_aChiHeaWatHp, pasHeaWatHpOut.port_a); connect(ports_aChiHeaWatHp, pasChiWatHpOut.port_a); connect(ports_aChiWatHp, pasChiWatHpOut.port_a); connect(valHeaWatHpOutIso.port_b, junHeaWatSup.ports[1:nHp]); connect(pasHeaWatHpOut.port_b, junHeaWatSup.ports[1:nHp]); connect(junHeaWatSup.ports[nHp + 1], port_bHeaWat); connect(valChiWatHpOutIso.port_b, junChiWatSup.ports[1:nHp]); connect(pasChiWatHpOut.port_b, junChiWatSup.ports[1:nHp]); connect(port_bChiWat, junChiWatSup.ports[nHp + 1]); connect(port_aHeaWat, junHeaWatRet.ports[nHp + 1]); connect(junHeaWatRet.ports[1:nHp], valHeaWatHpInlIso.port_a); connect(pasHeaWatHpInl.port_a, junHeaWatRet.ports[1:nHp]); connect(port_aChiWat, junChiWatRet.ports[nHp + 1]); connect(valChiWatHpInlIso.port_a, junChiWatRet.ports[1:nHp]); connect(pasChiWatHpInl.port_a, junChiWatRet.ports[1:nHp]); connect(pasHeaWatHpInl.port_b, ports_bChiHeaWatHp); connect(valHeaWatHpInlIso.port_b, ports_bChiHeaWatHp); connect(pasChiWatHpInl.port_b, ports_bChiHeaWatHp); connect(valChiWatHpInlIso.port_b, ports_bChiHeaWatHp); connect(busValHeaWatHpInlIso, valHeaWatHpInlIso.bus); connect(busValChiWatHpInlIso, valChiWatHpInlIso.bus); connect(busValChiWatHpOutIso, valChiWatHpOutIso.bus); connect(busValHeaWatHpOutIso, valHeaWatHpOutIso.bus); end ValvesIsolation;