This package contains templates for heat pump plants.
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.AirToWaterReversibleHeatRecovery
and selecting "Show Component" from the context menu.
Currently, only identical heat pumps are supported. Although the template
can accommodate any number of identical units, the graphical feedback for
system configuration via the diagram layer is only accurate for up to 6
units.
The supported plant configurations are enumerated in the table below. The
first option displayed in bold characters corresponds to the default
configuration.
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.
model AirToWater
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 yPumHeaWatPriDedHpSet=yPumHeaWatPriDedHpSet,
final yPumHeaWatPriDedPhpSet=yPumHeaWatPriDedPhpSet,
final yPumHeaWatPriHdrSet=yPumHeaWatPriHdrSet,
final yPumChiWatPriDedHpSet=yPumChiWatPriDedHpSet,
final yPumChiWatPriDedPhpSet=yPumChiWatPriDedPhpSet,
final yPumChiWatPriHdrSet=yPumChiWatPriHdrSet)),
final typHp=Buildings.Templates.Components.Types.HeatPump.AirToWater);
parameter Boolean is_dpBalYPumSetCal = false
;
final parameter Boolean is_dpBalCal = is_dpBalYPumSetCal
and (typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Constant
or have_hp
and have_php
and typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Variable1Only)
;
final parameter Boolean is_yPumSetCal = is_dpBalYPumSetCal
and typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Variable2
and typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable
;
final parameter Modelica.Units.SI.PressureDifference dpValCheHeaWatBalHp_nominal =
if have_heaWat
and have_hp
then (
if have_pumPriDedComHp
then dat.dpValCheHeaWat_nominal[1] *
(hp.mHeaWatHp_flow_nominal / dat.pumHeaWatPri.m_flow_nominal[1]) ^ 2
elseif typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheHeaWat_nominal[1]
else dpValCheHeaWatBalHdr_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpValCheChiWatBalHp_nominal =
if have_chiWat
and have_hp
then (
if have_pumPriDedComHp
then dat.dpValCheHeaWat_nominal[1] *
(hp.mChiWatHp_flow_nominal / dat.pumHeaWatPri.m_flow_nominal[1]) ^ 2
elseif typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheChiWat_nominal[1]
else dpValCheChiWatBalHdr_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpValCheHeaWatBalPhp_nominal =
if have_php
then (
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheHeaWat_nominal[nPumHeaWatPri]
else dpValCheHeaWatBalHdr_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpValCheChiWatBalPhp_nominal =
if have_php
then (
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheChiWat_nominal[nPumChiWatPri]
else dpValCheChiWatBalHdr_nominal)
else 0
;
final parameter Modelica.Units.SI.VolumeFlowRate VHeaWatBalHdr_nominal =
(nHp * dat.hp.mHeaWatHp_flow_nominal + nPhp *
dat.hp.mHeaWatPhp_flow_nominal) / rhoHeaWat_default
;
final parameter Modelica.Units.SI.VolumeFlowRate VChiWatBalHdr_nominal =
(nHp * dat.hp.mChiWatHp_flow_nominal + nPhp *
dat.hp.mChiWatPhp_flow_nominal) / rhoChiWat_default
;
final parameter Modelica.Units.SI.VolumeFlowRate VHeaWatBalHp_nominal =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.hp.mHeaWatHp_flow_nominal / rhoHeaWat_default
else VHeaWatBalHdr_nominal
;
final parameter Modelica.Units.SI.VolumeFlowRate VChiWatBalHp_nominal =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.hp.mChiWatHp_flow_nominal / rhoChiWat_default
else VChiWatBalHdr_nominal
;
final parameter Modelica.Units.SI.VolumeFlowRate VHeaWatBalPhp_nominal =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.hp.mHeaWatPhp_flow_nominal / rhoHeaWat_default
else VHeaWatBalHdr_nominal
;
final parameter Modelica.Units.SI.VolumeFlowRate VChiWatBalPhp_nominal =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.hp.mChiWatPhp_flow_nominal / rhoChiWat_default
else VChiWatBalHdr_nominal
;
final parameter Modelica.Units.SI.PressureDifference dpValCheHeaWatBalHdr_nominal =
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then 0
else max(dat.dpValCheHeaWat_nominal) *
(VHeaWatBalHdr_nominal * rhoHeaWat_default /
sum(
dat.pumHeaWatPri.m_flow_nominal)) ^ 2
;
final parameter Modelica.Units.SI.PressureDifference dpValCheChiWatBalHdr_nominal =
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then 0
else max(dat.dpValCheChiWat_nominal) *
(VChiWatBalHdr_nominal * rhoChiWat_default /
sum(
dat.pumChiWatPri.m_flow_nominal)) ^ 2
;
final parameter Integer nPoiPrePumHeaWat =
size(
dat.pumHeaWatPri.per.pressure.V_flow, 2)
;
final parameter Integer nPoiPrePumChiWat =
size(
dat.pumChiWatPri.per.pressure.V_flow, 2)
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumHeaWatBalHdr(
V_flow=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else {
sum(
dat.pumHeaWatPri.per[:].pressure.V_flow[i])
for i
in 1:nPoiPrePumHeaWat},
dp=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else {
max(
dat.pumHeaWatPri.per[:].pressure.dp[i])
for i
in 1:nPoiPrePumHeaWat})
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumChiWatBalHdr(
V_flow=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else {
sum(
dat.pumChiWatPri.per[:].pressure.V_flow[i])
for i
in 1:nPoiPrePumChiWat},
dp=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else {
max(
dat.pumChiWatPri.per[:].pressure.dp[i])
for i
in 1:nPoiPrePumChiWat})
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumHeaWatBalHp =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumHeaWatPri.per[1].pressure.V_flow,
dp=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumHeaWatPri.per[1].pressure.dp)
else prePumHeaWatBalHdr
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumChiWatBalHp =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then (
if have_pumPriDedComHp
then prePumHeaWatBalHp
else Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumChiWatPri.per[1].pressure.V_flow,
dp=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumChiWatPri.per[1].pressure.dp))
else prePumChiWatBalHdr
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumHeaWatBalPhp =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumHeaWatPri.per[nPumHeaWatPri].pressure.V_flow,
dp=
if typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumHeaWatPri.per[nPumHeaWatPri].pressure.dp)
else prePumHeaWatBalHdr
;
final parameter Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters
prePumChiWatBalPhp =
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumChiWatPri.per[nPumChiWatPri].pressure.V_flow,
dp=
if typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
then {0, 0, 0}
else dat.pumChiWatPri.per[nPumChiWatPri].pressure.dp)
else prePumChiWatBalHdr
;
parameter Modelica.Units.SI.PressureDifference dpHeaWatLoo_nominal(start=0)
;
parameter Modelica.Units.SI.PressureDifference dpChiWatLoo_nominal(start=0)
;
final parameter Modelica.Units.SI.PressureDifference dpHeaWatLooBal_nominal =
if typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Variable1Only
then (
if cfg.typCtl ==
Buildings.Templates.Plants.HeatPumps.Types.Controller.AirToWater
and not cfg.have_senDpHeaWatRemWir
then dat.ctl.dpHeaWatLocSet_max
else dpHeaWatLoo_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpChiWatLooBal_nominal =
if typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Variable1Only
then (
if cfg.typCtl ==
Buildings.Templates.Plants.HeatPumps.Types.Controller.AirToWater
and not cfg.have_senDpChiWatRemWir
then dat.ctl.dpChiWatLocSet_max
else dpChiWatLoo_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpBalHeaWatHp_nominal =
if have_hp
then (
if is_dpBalCal
then Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VHeaWatBalHp_nominal,
dp_nominal=hp.dpHeaWatHp_nominal +
max(
valIso.dpValveHeaWat_nominal[1:nHp]) * ((
if have_valHpInlIso
then 1
else 0) + (
if have_valHpOutIso
then 1
else 0)) +
dpValCheHeaWatBalHp_nominal + dpHeaWatLooBal_nominal,
prePum=prePumHeaWatBalHp)
else dat.dpBalHeaWatHp_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpBalChiWatHp_nominal =
if have_hp
and have_chiWat
then (
if is_dpBalCal
then Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VChiWatBalHp_nominal,
dp_nominal=hp.dpChiWatHp_nominal +
max(
valIso.dpValveChiWat_nominal[1:nHp]) * ((
if have_valHpInlIso
then 1
else 0) + (
if have_valHpOutIso
then 1
else 0)) +
dpValCheChiWatBalHp_nominal + dpChiWatLooBal_nominal,
prePum=prePumChiWatBalHp)
else dat.dpBalChiWatHp_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpBalHeaWatPhp_nominal =
if have_php
then (
if is_dpBalCal
then Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VHeaWatBalPhp_nominal,
dp_nominal=dat.hp.dpHeaWatPhp_nominal +
max(
valIso.dpValveHeaWat_nominal[nHp + 1:nHp + nPhp]) *
((
if have_valPhpInlIso
then 1
else 0) + (
if have_valPhpOutIso
then 1
else 0)) + dpValCheHeaWatBalPhp_nominal + dpHeaWatLooBal_nominal,
prePum=prePumHeaWatBalPhp)
else dat.dpBalHeaWatPhp_nominal)
else 0
;
final parameter Modelica.Units.SI.PressureDifference dpBalChiWatPhp_nominal =
if have_php
then (
if is_dpBalCal
then Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VChiWatBalPhp_nominal,
dp_nominal=dat.hp.dpChiWatPhp_nominal +
max(
valIso.dpValveChiWat_nominal[nHp + 1:nHp + nPhp]) *
((
if have_valPhpInlIso
then 1
else 0) + (
if have_valPhpOutIso
then 1
else 0)) + dpValCheChiWatBalPhp_nominal + dpChiWatLooBal_nominal,
prePum=prePumChiWatBalPhp)
else dat.dpBalChiWatPhp_nominal)
else 0
;
final parameter Real yPumHeaWatPriHdrSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
final parameter Real yPumChiWatPriHdrSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
final parameter Real yPumHeaWatPriDedHpSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
final parameter Real yPumChiWatPriDedHpSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
final parameter Real yPumHeaWatPriDedPhpSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
final parameter Real yPumChiWatPriDedPhpSet(
final fixed=false,
final max=2,
final min=0,
start=1,
final unit="1")
;
Buildings.Templates.Plants.HeatPumps.Components.HeatPumpGroups.AirToWater hp(
redeclare final package MediumHeaWat=
MediumHeaWat,
redeclare final package MediumAir=
MediumAir,
final have_hp=have_hp,
final have_php=have_php,
final nHp=nHp,
final nPhp=nPhp,
final is_rev=is_rev,
final energyDynamics=energyDynamics,
final have_dpChiHeaWat=false,
final have_dpSou=false,
final dat=dat.hp,
final allowFlowReversal=allowFlowReversal,
final allowFlowReversalSou=false,
final show_T=show_T)
;
Components.PumpsPrimaryDedicated pumPri(
redeclare final package Medium=
MediumHeaWat,
final have_hp=have_hp,
final have_php=have_php,
final have_pumHeaWatPriVar=typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final have_pumChiWatPriVar=typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final nHp=nHp,
final nPhp=nPhp,
final nPumHeaWat=
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then nPumHeaWatPri
else 0,
final nPumChiWat=
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then nPumChiWatPri
else 0,
final typArrPumPri=typArrPumPri,
final have_pumPriComHp=have_pumPriDedComHp,
final datPumHeaWat=dat.pumHeaWatPri,
final datPumChiWat=dat.pumChiWatPri,
final dpValCheHeaWat_nominal=
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheHeaWat_nominal
else fill(0, 0),
final dpValCheChiWat_nominal=
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then dat.dpValCheChiWat_nominal
else fill(0, 0),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal)
;
Components.ValvesIsolation valIso(
redeclare final package Medium=
MediumHeaWat,
final have_hp=have_hp,
final have_php=have_php,
final nHp=nHp,
final have_chiWat=have_chiWat,
final nPhp=nPhp,
final have_valHpInlIso=have_valHpInlIso,
final have_valHpOutIso=have_valHpOutIso,
final have_valPhpInlIso=have_valPhpInlIso,
final have_valPhpOutIso=have_valPhpOutIso,
final have_pumChiWatDedHp=have_pumChiWatPriDedHp,
final mHeaWatUni_flow_nominal=
cat(
1,
fill(dat.hp.mHeaWatHp_flow_nominal, nHp),
fill(dat.hp.mHeaWatPhp_flow_nominal, nPhp)),
final dpHeaWatUni_nominal=
cat(
1,
fill(dat.hp.dpHeaWatHp_nominal, nHp),
fill(dat.hp.dpHeaWatPhp_nominal, nPhp)),
final dpBalHeaWatUni_nominal=
cat(
1,
fill(dpBalHeaWatHp_nominal, nHp),
fill(dpBalHeaWatPhp_nominal, nPhp)),
final mChiWatUni_flow_nominal=
cat(
1,
fill(dat.hp.mChiWatHp_flow_nominal, nHp),
fill(dat.hp.mChiWatPhp_flow_nominal, nPhp)),
final dpChiWatPhp_nominal=
fill(dat.hp.dpChiWatPhp_nominal, nPhp),
final dpBalChiWatUni_nominal=
cat(
1,
fill(dpBalChiWatHp_nominal, nHp),
fill(dpBalChiWatPhp_nominal, nPhp)),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
linearized=linearized)
;
Buildings.Templates.Components.Pumps.Multiple pumChiWatPri(
final energyDynamics=energyDynamics,
redeclare final package Medium=
MediumChiWat,
final dat=dat.pumChiWatPri,
final dpValChe_nominal=dat.dpValCheChiWat_nominal,
final nPum=nPumChiWatPri,
final have_var=typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final have_varCom=true,
final allowFlowReversal=allowFlowReversal)
if have_chiWat
and typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Headered
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
Buildings.Templates.Components.Sensors.VolumeFlowRate VChiWatLooOrSec_flow(
redeclare final package Medium=
MediumChiWat,
final m_flow_nominal=mChiWat_flow_nominal,
final allowFlowReversal=allowFlowReversal,
final have_sen=ctl.have_senVChiWatSec
or ctl.have_senVChiWatLoo,
final text_flip=false,
final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter,
final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply)
if have_chiWat
;
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
;
Buildings.Templates.Components.Sensors.Temperature TChiWatLooOrSecRet(
redeclare final package Medium=
MediumChiWat,
final have_sen=ctl.have_senTChiWatSecRet
or ctl.have_senTChiWatLooRet,
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
;
Buildings.Templates.Components.Sensors.DifferentialPressure dpChiWatLoc(
redeclare final package Medium=
MediumChiWat,
text_rotation=90)
if have_chiWat
and not ctl.have_senDpChiWatRemWir
;
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
;
Buildings.Templates.Components.Pumps.Multiple pumHeaWatPri(
final energyDynamics=energyDynamics,
redeclare final package Medium=
MediumHeaWat,
final dat=dat.pumHeaWatPri,
final dpValChe_nominal=dat.dpValCheHeaWat_nominal,
final nPum=nPumHeaWatPri,
final have_var=typPumPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final have_varCom=true,
final allowFlowReversal=allowFlowReversal)
if have_heaWat
and typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Headered
;
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
;
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
;
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)
;
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
;
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)
;
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)
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
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
;
Buildings.Templates.Components.Sensors.VolumeFlowRate VHeaWatLooOrSec_flow(
redeclare final package Medium=
MediumHeaWat,
final m_flow_nominal=mHeaWat_flow_nominal,
final allowFlowReversal=allowFlowReversal,
final have_sen=ctl.have_senVHeaWatSec
or ctl.have_senVHeaWatLoo,
final text_flip=false,
final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter,
final icon_pipe=Buildings.Templates.Components.Types.IntegrationPoint.Supply)
;
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)
;
Buildings.Templates.Components.Sensors.Temperature THeaWatLooOrSecRet(
redeclare final package Medium=
MediumHeaWat,
final have_sen=ctl.have_senTHeaWatSecRet
or ctl.have_senTHeaWatLooRet,
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)
;
Buildings.Templates.Components.Sensors.DifferentialPressure dpHeaWatLoc(
redeclare final package Medium=
MediumHeaWat,
text_rotation=90)
if have_heaWat
and not ctl.have_senDpHeaWatRemWir
;
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
;
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
;
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
;
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
;
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
;
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
;
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)
;
Fluid.Sources.Boundary_pT bouHeaWat(
redeclare final package Medium=
MediumHeaWat,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=1)
if have_heaWat
;
Fluid.Sources.Boundary_pT bouChiWat(
redeclare final package Medium=
MediumChiWat,
p=Buildings.Templates.Data.Defaults.pChiWat_rel_nominal + 101325,
nPorts=1)
if typ == Buildings.Templates.Plants.Controls.Types.PlantHeatPump.Polyvalent
;
initial equation
if have_heaWat
then
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then
yPumHeaWatPriHdrSet = 0;
if have_hp
then
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VHeaWatBalHp_nominal,
dp_nominal=
max(valIso.dpHeaWat_nominal[1:nHp]) +
dpValCheHeaWatBalHp_nominal + dpHeaWatLooBal_nominal,
prePum=prePumHeaWatBalHp,
r_N=yPumHeaWatPriDedHpSet);
assert(
yPumHeaWatPriDedHpSet >= 0.1
and yPumHeaWatPriDedHpSet <= 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.");
else
yPumHeaWatPriDedHpSet = dat.ctl.yPumHeaWatPriDedHpSet;
end if;
else
yPumHeaWatPriDedHpSet = 0;
end if;
if have_php
then
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VHeaWatBalPhp_nominal,
dp_nominal=
max(valIso.dpHeaWat_nominal[nHp + 1:nHp + nPhp]) +
dpValCheHeaWatBalPhp_nominal + dpHeaWatLooBal_nominal,
prePum=prePumHeaWatBalPhp,
r_N=yPumHeaWatPriDedPhpSet);
assert(
yPumHeaWatPriDedPhpSet >= 0.1
and yPumHeaWatPriDedPhpSet <= 2,
"In " +
getInstanceName() + ": " +
"The calculated primary pump speed to provide the polyvalent HP design HW flow is out of bounds, " +
"indicating that the primary pump curve needs to be revised.");
else
yPumHeaWatPriDedPhpSet = dat.ctl.yPumHeaWatPriDedPhpSet;
end if;
else
yPumHeaWatPriDedPhpSet = 0;
end if;
else
yPumHeaWatPriDedHpSet = 0;
yPumHeaWatPriDedPhpSet = 0;
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VHeaWatBalHdr_nominal,
dp_nominal=
max(valIso.dpHeaWat_nominal) +
dpValCheHeaWatBalHdr_nominal + dpHeaWatLooBal_nominal,
prePum=prePumHeaWatBalHdr,
r_N=yPumHeaWatPriHdrSet);
assert(
yPumHeaWatPriHdrSet >= 0.1
and yPumHeaWatPriHdrSet <= 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.");
else
yPumHeaWatPriHdrSet = dat.ctl.yPumHeaWatPriHdrSet;
end if;
end if;
else
yPumHeaWatPriHdrSet = 0;
yPumHeaWatPriDedHpSet = 0;
yPumHeaWatPriDedPhpSet = 0;
end if;
if have_chiWat
then
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then
yPumChiWatPriHdrSet = 0;
if have_hp
then
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VChiWatBalHp_nominal,
dp_nominal=
max(valIso.dpChiWat_nominal[1:nHp]) +
dpValCheChiWatBalHp_nominal + dpChiWatLooBal_nominal,
prePum=prePumChiWatBalHp,
r_N=yPumChiWatPriDedHpSet);
assert(
yPumChiWatPriDedHpSet >= 0.1
and yPumChiWatPriDedHpSet <= 2,
"In " +
getInstanceName() + ": " +
"The calculated primary pump speed to provide the HP design CHW flow is out of bounds, " +
"indicating that the primary pump curve needs to be revised.");
else
yPumChiWatPriDedHpSet = dat.ctl.yPumChiWatPriDedHpSet;
end if;
else
yPumChiWatPriDedHpSet = 0;
end if;
if have_php
then
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VChiWatBalPhp_nominal,
dp_nominal=
max(valIso.dpChiWat_nominal[nHp + 1:nHp + nPhp]) +
dpValCheChiWatBalPhp_nominal + dpChiWatLooBal_nominal,
prePum=prePumChiWatBalPhp,
r_N=yPumChiWatPriDedPhpSet);
assert(
yPumChiWatPriDedPhpSet >= 0.1
and yPumChiWatPriDedPhpSet <= 2,
"In " +
getInstanceName() + ": " +
"The calculated primary pump speed to provide the polyvalent HP design HW flow is out of bounds, " +
"indicating that the primary pump curve needs to be revised.");
else
yPumChiWatPriDedPhpSet = dat.ctl.yPumChiWatPriDedPhpSet;
end if;
else
yPumChiWatPriDedPhpSet = 0;
end if;
else
yPumChiWatPriDedHpSet = 0;
yPumChiWatPriDedPhpSet = 0;
if is_yPumSetCal
then
0 =
Buildings.Templates.Utilities.computeBalancingPressureDrop(
V_flow_nominal=VChiWatBalHdr_nominal,
dp_nominal=
max(valIso.dpChiWat_nominal) +
dpValCheChiWatBalHdr_nominal + dpChiWatLooBal_nominal,
prePum=prePumChiWatBalHdr,
r_N=yPumChiWatPriHdrSet);
assert(
yPumChiWatPriHdrSet >= 0.1
and yPumChiWatPriHdrSet <= 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.");
else
yPumChiWatPriHdrSet = dat.ctl.yPumChiWatPriHdrSet;
end if;
end if;
else
yPumChiWatPriHdrSet = 0;
yPumChiWatPriDedHpSet = 0;
yPumChiWatPriDedPhpSet = 0;
end if;
if is_dpBalCal
then
if have_heaWat
then
if have_hp
then
assert(
dpBalHeaWatHp_nominal >= 0,
"In " +
getInstanceName() + ": " +
"The calculated pressure drop for the HP HW balancing valve is negative, " +
"indicating that the primary pump curve needs to be revised.");
end if;
if have_php
then
assert(
dpBalHeaWatPhp_nominal >= 0,
"In " +
getInstanceName() + ": " +
"The calculated pressure drop for the polyvalent HP HW balancing valve is negative, " +
"indicating that the primary pump curve needs to be revised.");
end if;
end if;
if have_chiWat
then
if have_hp
then
assert(
dpBalChiWatHp_nominal >= 0,
"In " +
getInstanceName() + ": " +
"The calculated pressure drop for the HP CHW balancing valve is negative, " +
"indicating that the primary pump curve needs to be revised.");
end if;
if have_php
then
assert(
dpBalChiWatPhp_nominal >= 0,
"In " +
getInstanceName() + ": " +
"The calculated pressure drop for the polyvalent HP CHW balancing valve is negative, " +
"indicating that the primary pump curve needs to be revised.");
end if;
end if;
end if;
equation
if typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Variable2
then
connect(TChiWatLooOrSecRet.y, bus.TChiWatSecRet);
connect(THeaWatLooOrSecRet.y, bus.THeaWatSecRet);
connect(VChiWatLooOrSec_flow.y, bus.VChiWatSec_flow);
connect(VHeaWatLooOrSec_flow.y, bus.VHeaWatSec_flow);
else
connect(TChiWatLooOrSecRet.y, bus.TChiWatLooRet);
connect(THeaWatLooOrSecRet.y, bus.THeaWatLooRet);
connect(VChiWatLooOrSec_flow.y, bus.VChiWatLoo_flow);
connect(VHeaWatLooOrSec_flow.y, bus.VHeaWatLoo_flow);
end if;
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(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(THeaWatRetUpsHrc.y, bus.THeaWatRetUpsHrc);
connect(TChiWatRetUpsHrc.y, bus.TChiWatRetUpsHrc);
connect(dpHeaWatLoc.y, bus.dpHeaWatLoc);
connect(dpChiWatLoc.y, bus.dpChiWatLoc);
connect(pumChiWatPri.ports_b, outPumChiWatPri.ports_a);
connect(inlPumChiWatPri.ports_b, pumChiWatPri.ports_a);
connect(valIso.port_bChiWat, inlPumChiWatPri.port_a);
connect(hp.ports_bChiHeaWatHp, 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_aChiHeaWatHp);
connect(supChiWatSec.port_b, VChiWatLooOrSec_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, VHeaWatLooOrSec_flow.port_a);
connect(outPumHeaWatSec.port_b, VHeaWatLooOrSec_flow.port_a);
connect(valIso.port_bHeaWat, inlPumHeaWatPri.port_a);
connect(VHeaWatLooOrSec_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, TChiWatLooOrSecRet.port_b);
connect(junHeaWatBypSup.port_2, THeaWatSecSup.port_a);
connect(THeaWatSecSup.port_b, inlPumHeaWatSec.port_a);
connect(THeaWatSecSup.port_b, supHeaWatSec.port_a);
connect(bouChiWat.ports[1], TChiWatPriRet.port_b);
connect(TChiWatSecSup.port_b, supChiWatSec.port_a);
connect(junHeaWatBypRet.port_1, THeaWatLooOrSecRet.port_b);
connect(outPumChiWatSec.port_b, VChiWatLooOrSec_flow.port_a);
connect(TChiWatPriRet.port_b, valIso.port_aChiWat);
connect(junHeaWatHrcEnt.port_2, junHeaWatHrcLvg.port_1);
connect(junHeaWatHrcLvg.port_2, THeaWatLooOrSecRet.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, TChiWatLooOrSecRet.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(VChiWatLooOrSec_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);
connect(pumPri.ports_bHeaWatRetShc, hp.ports_aHeaWatPhp);
connect(pumPri.ports_bChiWatRetShc, hp.ports_aChiWatPhp);
connect(hp.ports_bHeaWatPhp, pumPri.ports_aHeaWatPhp);
connect(hp.ports_bChiWatPhp, pumPri.ports_aChiWatPhp);
connect(pumPri.ports_bHeaWatSupShc, valIso.ports_aHeaWatPhp);
connect(pumPri.ports_bChiWatSupShc, valIso.ports_aChiWatPhp);
connect(pumPri.ports_aChiWat, valIso.ports_bChiWatPhp);
connect(pumPri.ports_aHeaWat, valIso.ports_bHeaWatPhp);
end AirToWater;