This package contains control sequences for heat pump plants.
This block implements the sequence of operation for plants with
air-to-water heat pumps.
Most parts of the sequence of operation are similar to that
described in ASHRAE, 2021 for chiller plants.
The supported plant configurations are enumerated in the table below.
Depending on the plant configuration, the term "primary HW pumps"
(and the corresponding variables containing *pumHeaWatPri*
)
refers either to primary HW pumps for plants with separate primary
HW and CHW pumps (either headered or dedicated)
or to dedicated primary pumps for plants with common primary pumps
serving both the HW and CHW loops.
At its current stage of development, this controller contains no
logic for handling faulted equipment.
It is therefore assumed that any equipment is available at all times.
block AirToWater
parameter Boolean have_heaWat
;
parameter Boolean have_chiWat
;
parameter Boolean have_valHpInlIso
;
parameter Boolean have_valHpOutIso
;
final parameter Boolean have_pumHeaWatPri=have_heaWat
;
parameter Boolean have_pumChiWatPriDed_select(start=false)=false
;
final parameter Boolean have_pumChiWatPriDed=
if have_chiWat
and not have_pumPriHdr
then have_pumChiWatPriDed_select
else false
;
final parameter Boolean have_pumChiWatPri=
have_chiWat
and (have_pumPriHdr
or have_pumChiWatPriDed)
;
parameter Boolean have_pumPriHdr
;
parameter Boolean have_pumHeaWatPriVar(start=true)=true
;
parameter Boolean have_pumChiWatPriVar(start=true)=true
;
final parameter Boolean have_pumPriCtlDp=false
;
parameter Boolean have_pumHeaWatSec_select(start=false)
;
final parameter Boolean have_pumHeaWatSec=
if have_heaWat
then have_pumHeaWatSec_select
else false
;
parameter Boolean have_pumChiWatSec_select(start=false)
;
final parameter Boolean have_pumChiWatSec=
if have_chiWat
then have_pumChiWatSec_select
else false
;
final parameter Boolean have_pumSecHdr=true
;
final parameter Boolean have_pumSecCtlDp=have_pumHeaWatSec
or have_pumChiWatSec
;
final parameter Boolean have_hrc(
start=false)=false
;
parameter Boolean have_senVHeaWatPri_select(start=false)
;
final parameter Boolean have_senVHeaWatPri=have_heaWat
and
(
if have_hrc
or not have_senVHeaWatSec
then true
else have_senVHeaWatPri_select)
;
final parameter Boolean have_senVHeaWatSec=have_pumHeaWatSec
;
parameter Boolean have_senVChiWatPri_select(start=false)
;
final parameter Boolean have_senVChiWatPri=have_chiWat
and
(
if have_hrc
or not have_senVChiWatSec
then true
else have_senVChiWatPri_select)
;
final parameter Boolean have_senVChiWatSec(start=false)=have_pumChiWatSec
;
parameter Boolean have_senTHeaWatPriRet_select(start=false)
;
final parameter Boolean have_senTHeaWatPriRet=have_heaWat
and
(
if have_hrc
or not have_senTHeaWatSecRet
then true
else have_senTHeaWatPriRet_select)
;
parameter Boolean have_senTChiWatPriRet_select(start=false)
;
final parameter Boolean have_senTChiWatPriRet=have_chiWat
and
(
if have_hrc
or not have_senTChiWatSecRet
then true
else have_senTChiWatPriRet_select)
;
final parameter Boolean have_senTHeaWatSecSup=have_pumHeaWatSec
;
final parameter Boolean have_senTChiWatSecSup=have_pumChiWatSec
;
parameter Boolean have_senTHeaWatSecRet(start=false)
;
parameter Boolean have_senTChiWatSecRet(start=false)
;
parameter Integer nHp(
final min=1)
;
parameter Integer nPumHeaWatPri(
final min=
if have_pumHeaWatPri
then 1
else 0,
start=0)=nHp
;
parameter Integer nPumChiWatPri(
final min=
if have_pumChiWatPri
then 1
else 0,
start=
if have_pumChiWatPri
then nHp
else 0)=
if have_pumChiWatPri
then nHp
else 0
;
parameter Integer nPumHeaWatSec(
final min=
if have_pumHeaWatSec
then 1
else 0,
start=0)=nHp
;
parameter Integer nPumChiWatSec(
final min=
if have_pumChiWatSec
then 1
else 0,
start=0)=nHp
;
parameter Boolean have_senDpHeaWatRemWir(start=true)=true
;
parameter Integer nSenDpHeaWatRem(
final min=
if have_heaWat
and have_pumHeaWatSec
then 1
else 0, start=0)
;
parameter Boolean have_senDpChiWatRemWir(start=true)=true
;
parameter Integer nSenDpChiWatRem(
final min=
if have_chiWat
and have_pumChiWatSec
then 1
else 0, start=0)
;
parameter Real THeaWatSup_nominal(
final min=273.15,
start=50 + 273.15,
final unit="K",
displayUnit="degC")
;
parameter Real THeaWatSupSet_min(
final min=273.15,
start=25 + 273.15,
final unit="K",
displayUnit="degC")
;
parameter Real TOutHeaWatLck(
final min=273.15,
start=21 + 273.15,
final unit="K",
displayUnit="degC")=294.15
;
parameter Real capHeaHp_nominal[nHp](
final min=
fill(0, nHp),
start=
fill(1, nHp),
final unit=
fill("W", nHp))
;
parameter Real VHeaWatSec_flow_nominal(
final min=0,
start=1E-6,
final unit="m3/s")
;
parameter Real dpHeaWatRemSet_max[nSenDpHeaWatRem](
final min=
fill(0, nSenDpHeaWatRem),
start=
fill(5E4, nSenDpHeaWatRem),
final unit=
fill("Pa", nSenDpHeaWatRem))
;
parameter Real dpHeaWatRemSet_min(
final min=0,
start=5*6894,
final unit="Pa")=5*6894
;
parameter Real yPumHeaWatPriSet(
final max=1,
final min=0,
start=1,
final unit="1")
;
parameter Real TChiWatSup_nominal(
final min=273.15,
start=7 + 273.15,
final unit="K",
displayUnit="degC")
;
parameter Real TChiWatSupSet_max(
final min=273.15,
start=15 + 273.15,
final unit="K",
displayUnit="degC")
;
parameter Real TOutChiWatLck(
final min=273.15,
start=16 + 273.15,
final unit="K",
displayUnit="degC")=289.15
;
parameter Real capCooHp_nominal[nHp](
final min=
fill(0, nHp),
start=
fill(1, nHp),
final unit=
fill("W", nHp))
;
parameter Real VChiWatSec_flow_nominal(
final min=0,
start=1E-6,
final unit="m3/s")
;
parameter Real dpChiWatRemSet_max[nSenDpChiWatRem](
final min=
fill(0, nSenDpChiWatRem),
start=
fill(5E4, nSenDpChiWatRem),
final unit=
fill("Pa", nSenDpChiWatRem))
;
parameter Real dpChiWatRemSet_min(
final min=0,
start=5*6894,
final unit="Pa")=5*6894
;
parameter Real yPumChiWatPriSet(
final max=1,
final min=0,
start=1,
final unit="1")
;
parameter Real cp_default(
final min=0,
final unit="J/(kg.K)")=4184
;
parameter Real rho_default(
final min=0,
final unit="kg/m3")=996
;
parameter Boolean have_inpSch=false
;
parameter Real schHea[:, 2](start=[0,1; 24*3600,1])=[0,1; 24*3600,1]
;
parameter Real schCoo[:, 2](start=[0,1; 24*3600,1])=[0,1; 24*3600,1]
;
parameter Integer nReqIgnHeaWat(
final min=0)=0
;
parameter Integer nReqIgnChiWat(
final min=0)=0
;
parameter Real dTOutLck(
final min=0,
final unit="K")=0.5
;
parameter Real dtRunEna(
final min=0,
final unit="s")=15*60
;
parameter Real dtReqDis(
final min=0,
final unit="s")=3*60
;
parameter Real staEqu[:, nHp](
each final max=1,
each final min=0,
each final unit="1")
;
final parameter Integer nSta(
final min=1)=
size(staEqu, 1)
;
final parameter Integer nEquAlt(
final min=0)=
max({
sum({(
if staEqu[i, j] > 0
and staEqu[i, j] < 1
then 1
else 0)
for j
in 1:nHp})
for i
in 1:nSta})
;
parameter Integer idxEquAlt[nEquAlt](
each final min=1)
;
parameter Real dtVal(
final min=0,
start=90,
final unit="s")=90
;
parameter Real dtHp(
final min=0,
final unit="s")=180;
parameter Real plrSta(
final max=1,
final min=0,
start=0.9,
final unit="1")=0.9
;
parameter Real dtRunSta(
final min=0,
final unit="s",
displayUnit="min")=900
;
parameter Real dtOff(
final min=0,
final unit="s")=900
;
parameter Real dtRunPumSta(
final min=0,
start=600,
final unit="s")=600
;
parameter Real dVOffUpPumSta(
final max=1,
final min=0,
start=0.03,
final unit="1")=0.03
;
parameter Real dVOffDowPumSta(
final max=1,
final min=0,
start=0.03,
final unit="1")=dVOffUpPumSta
;
parameter Real dtHol(
final min=0,
final unit="s")=900
;
parameter Real resDpHeaWat_max(
final max=1,
final min=0,
final unit="1")=0.5
;
parameter Real resTHeaWatSup_min(
final max=1,
final min=0,
final unit="1")=resDpHeaWat_max
;
parameter Real resDpChiWat_max(
final max=1,
final min=0,
final unit="1")=0.5
;
parameter Real resTChiWatSup_min(
final max=1,
final min=0,
final unit="1")=resDpChiWat_max
;
parameter Real res_init(
final max=1,
final min=0,
final unit="1")=1
;
parameter Real res_min(
final max=1,
final min=0,
final unit="1")=0
;
parameter Real res_max(
final max=1,
final min=0,
final unit="1")=1
;
parameter Real dtDel(
final min=100*1E-15,
final unit="s")=900
;
parameter Real dtResHeaWat(
final min=1E-3,
final unit="s")=300
;
parameter Integer nReqResIgnHeaWat(
final min=0)=2
;
parameter Real triHeaWat(
final max=0,
final unit="1")=-0.02
;
parameter Real rspHeaWat(
final min=0,
final unit="1")=0.03
;
parameter Real rspHeaWat_max(
final min=0,
final unit="1")=0.07
;
parameter Real dtResChiWat(
final min=1E-3,
final unit="s")=300
;
parameter Integer nReqResIgnChiWat(
final min=0)=2
;
parameter Real triChiWat(
final max=0,
final unit="1")=-0.02
;
parameter Real rspChiWat(
final min=0,
final unit="1")=0.03
;
parameter Real rspChiWat_max(
final min=0,
final unit="1")=0.07
;
parameter Real yPumHeaWatSec_min(
final max=1,
final min=0,
start=0.1,
final unit="1")=0.1
;
parameter Real kPumHeaWatSec(
final min=100*Buildings.Controls.OBC.CDL.Constants.eps,
start=1)=1
;
parameter Real TiPumHeaWatSec(
final min=100*Buildings.Controls.OBC.CDL.Constants.eps,
start=60,
final unit="s")=60
;
parameter Real yPumChiWatSec_min(
final max=1,
final min=0,
start=0.1,
final unit="1")=0.1
;
parameter Real kPumChiWatSec(
final min=100*Buildings.Controls.OBC.CDL.Constants.eps,
start=1)=1
;
parameter Real TiPumChiWatSec(
final min=100*Buildings.Controls.OBC.CDL.Constants.eps,
start=60,
final unit="s")=60
;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant u1AvaHp[nHp](
each k=true)
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqPlaHeaWat
if have_heaWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut(
final unit="K",
final quantity="ThermodynamicTemperature",
displayUnit="degC")
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SchHea
if have_heaWat
and have_inpSch
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqPlaChiWat
if have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SchCoo
if have_chiWat
and have_inpSch
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqResHeaWat
if have_heaWat
;
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqResChiWat
if have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPri_actual[nPumHeaWatPri]
if have_heaWat
and have_pumHeaWatPri
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPri_actual[nPumChiWatPri]
if have_chiWat
and have_pumChiWatPri
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatSec_actual[nPumHeaWatSec]
if have_heaWat
and have_pumHeaWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatSec_actual[nPumChiWatSec]
if have_chiWat
and have_pumChiWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriRet(
final unit="K",
displayUnit="degC")
if have_heaWat
and have_senTHeaWatPriRet
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatPri_flow(
final unit="m3/s")
if have_heaWat
and have_senVHeaWatPri
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLoc(
final unit="Pa")
if have_heaWat
and not have_senDpHeaWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLocSet[nSenDpHeaWatRem](
each final unit="Pa")
if have_heaWat
and not have_senDpHeaWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatRem[nSenDpHeaWatRem](
each final unit="Pa")
if have_heaWat
and have_senDpHeaWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLoc(
final unit="Pa")
if have_chiWat
and not have_senDpChiWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLocSet[nSenDpChiWatRem](
each final unit="Pa")
if have_chiWat
and not have_senDpChiWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatRem[nSenDpChiWatRem](
each final unit="Pa")
if have_chiWat
and have_senDpChiWatRemWir
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatHpInlIso[nHp]
if have_heaWat
and have_valHpInlIso
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatHpOutIso[nHp]
if have_heaWat
and have_valHpOutIso
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpInlIso[nHp]
if have_chiWat
and have_valHpInlIso
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpOutIso[nHp]
if have_chiWat
and have_valHpOutIso
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatPri[nPumHeaWatPri]
if have_pumHeaWatPri
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatPri[nPumChiWatPri]
if have_pumChiWatPri
and have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatSec[nPumHeaWatSec]
if have_pumHeaWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatSec[nPumChiWatSec]
if have_pumChiWatSec
and have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Hp[nHp]
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HeaHp[nHp]
if have_heaWat
and have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpHeaWatRemSet[nSenDpHeaWatRem](
each final min=0,
each final unit="Pa")
if have_heaWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpChiWatRemSet[nSenDpChiWatRem](
each final min=0,
each final unit="Pa")
if have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriHdr(
final unit="1")
if have_heaWat
and have_pumHeaWatPriVar
and have_pumPriHdr
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriHdr(
final unit="1")
if have_chiWat
and have_pumChiWatPri
and
have_pumChiWatPriVar
and have_pumPriHdr
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatSec(
final unit="1")
if have_heaWat
and have_pumHeaWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatSec(
final unit="1")
if have_chiWat
and have_pumChiWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupSet(
final unit="K",
displayUnit="degC")
if have_chiWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupSet(
final unit="K",
displayUnit="degC")
if have_heaWat
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriRet(
final unit="K",
displayUnit="degC")
if have_chiWat
and have_senTChiWatPriRet
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatPri_flow(
final unit="m3/s")
if have_chiWat
and have_senVChiWatPri
;
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Hp_actual[nHp]
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDed[nPumHeaWatPri](
each final unit="1")
if have_heaWat
and have_pumHeaWatPriVar
and not have_pumPriHdr
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDed[nPumChiWatPri](
each final unit="1")
if have_chiWat
and have_pumChiWatPriDed
and have_pumChiWatPriVar
;
Enabling.Enable enaHea(
final typ=Buildings.Templates.Plants.Controls.Types.Application.Heating,
final TOutLck=TOutHeaWatLck,
final dTOutLck=dTOutLck,
final dtReq=dtReqDis,
final dtRun=dtRunEna,
final have_inpSch=have_inpSch,
final nReqIgn=nReqIgnHeaWat,
final sch=schHea)
if have_heaWat
;
Utilities.StageIndex idxStaHea(
final nSta=nSta,
final dtRun=dtRunSta)
if have_heaWat
;
StagingRotation.StageAvailability avaStaHea(
final staEqu=staEqu)
if have_heaWat
;
StagingRotation.EquipmentEnable enaEquHea(
final staEqu=staEqu)
if have_heaWat
;
StagingRotation.EventSequencing seqEve[nHp](
each final have_heaWat=have_heaWat,
each final have_chiWat=have_chiWat,
each final have_valInlIso=have_valHpInlIso,
each final have_valOutIso=have_valHpOutIso,
each final have_pumHeaWatPri=have_pumHeaWatPri,
each final have_pumChiWatPri=have_pumChiWatPri,
each final have_pumHeaWatSec=have_pumHeaWatSec,
each final have_pumChiWatSec=have_pumChiWatSec,
each final dtVal=dtVal,
each final dtOff=dtHp) ;
StagingRotation.StageAvailability avaStaCoo(
final staEqu=staEqu)
if have_chiWat
;
StagingRotation.StageChangeCommand chaStaHea(
final have_inpPlrSta=false,
final plrSta=plrSta,
final staEqu=staEqu,
final capEqu=capHeaHp_nominal,
final dtRun=dtRunSta,
final cp_default=cp_default,
final rho_default=rho_default)
if have_heaWat
;
StagingRotation.SortRuntime sorRunTimHea(
idxEquAlt=idxEquAlt,
nin=nHp)
if have_heaWat
;
Enabling.Enable enaCoo(
final typ=Buildings.Templates.Plants.Controls.Types.Application.Cooling,
final TOutLck=TOutChiWatLck,
final dTOutLck=dTOutLck,
final dtReq=dtReqDis,
final dtRun=dtRunEna,
final have_inpSch=have_inpSch,
final nReqIgn=nReqIgnChiWat,
final sch=schCoo)
if have_chiWat
;
StagingRotation.StageChangeCommand chaStaCoo(
final have_inpPlrSta=false,
final plrSta=plrSta,
final staEqu=staEqu,
final capEqu=capCooHp_nominal,
final dtRun=dtRunSta,
final cp_default=cp_default,
final rho_default=rho_default)
if have_chiWat
;
Utilities.StageIndex idxStaCoo(
final nSta=nSta,
final dtRun=dtRunSta)
if have_chiWat
;
StagingRotation.EquipmentEnable enaEquCoo(
final staEqu=staEqu)
if have_chiWat
;
StagingRotation.EquipmentAvailability avaEquHeaCoo[nHp](
each final have_heaWat=have_heaWat,
each final have_chiWat=have_chiWat,
each final dtOff=dtOff)
;
Buildings.Controls.OBC.CDL.Logical.Pre y1HeaPre[nHp]
if have_heaWat
and have_chiWat
;
StagingRotation.SortRuntime sorRunTimCoo(
final idxEquAlt=idxEquAlt,
nin=nHp)
if have_chiWat
;
Pumps.Generic.StagingHeadered staPumHeaWatPri(
final is_pri=true,
final have_valInlIso=have_valHpInlIso,
final have_valOutIso=have_valHpOutIso,
final nEqu=nHp,
final nPum=nPumHeaWatPri,
final is_hdr=have_pumPriHdr,
final is_ctlDp=have_pumPriCtlDp,
final dtRun=dtRunPumSta,
final dVOffUp=dVOffUpPumSta,
final dVOffDow=dVOffDowPumSta)
if have_pumHeaWatPri
;
Pumps.Generic.StagingHeadered staPumChiWatPri(
final is_pri=true,
final have_valInlIso=have_valHpInlIso,
final have_valOutIso=have_valHpOutIso,
final nEqu=nHp,
final nPum=nPumChiWatPri,
final is_hdr=have_pumPriHdr,
final is_ctlDp=have_pumPriCtlDp,
final dtRun=dtRunPumSta,
final dVOffUp=dVOffUpPumSta,
final dVOffDow=dVOffDowPumSta)
if have_pumChiWatPri
and have_chiWat
;
Pumps.Generic.StagingHeadered staPumChiWatSec(
final is_pri=false,
final nEqu=nHp,
final nPum=nPumChiWatSec,
final is_hdr=have_pumSecHdr,
final is_ctlDp=have_pumSecCtlDp,
final V_flow_nominal=VChiWatSec_flow_nominal,
final dtRun=dtRunPumSta,
final dVOffUp=dVOffUpPumSta,
final dVOffDow=dVOffDowPumSta)
if have_pumChiWatSec
and have_chiWat
;
Pumps.Generic.StagingHeadered staPumHeaWatSec(
final is_pri=false,
final nEqu=nHp,
final nPum=nPumHeaWatSec,
final is_hdr=have_pumSecHdr,
final is_ctlDp=have_pumSecCtlDp,
final V_flow_nominal=VHeaWatSec_flow_nominal,
final dtRun=dtRunPumSta,
final dVOffUp=dVOffUpPumSta,
final dVOffDow=dVOffDowPumSta)
if have_pumHeaWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSecRet(
final unit="K",
displayUnit="degC")
if have_heaWat
and have_senTHeaWatSecRet
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatSec_flow(
final unit="m3/s")
if have_heaWat
and have_senVHeaWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSecRet(
final unit="K",
displayUnit="degC")
if have_chiWat
and have_senTChiWatSecRet
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatSec_flow(
final unit="m3/s")
if have_chiWat
and have_senVChiWatSec
;
Utilities.PlaceholderReal THeaWatRet(have_inp=have_heaWat
and
have_senTHeaWatPriRet,
have_inpPh=true)
if have_heaWat ;
Utilities.PlaceholderReal VHeaWat_flow(have_inp=have_heaWat
and
have_senVHeaWatPri,
have_inpPh=true)
if have_heaWat ;
Utilities.PlaceholderReal TChiWatRet(have_inp=have_chiWat
and
have_senTChiWatPriRet,
have_inpPh=true)
if have_chiWat ;
Utilities.PlaceholderReal VChiWat_flow(have_inp=have_chiWat
and
have_senVChiWatPri,
have_inpPh=true)
if have_chiWat ;
Buildings.Controls.OBC.CDL.Logical.Pre y1HpPre[nHp]
;
StagingRotation.StageCompletion comStaCoo(
nin=nHp)
if have_chiWat
;
StagingRotation.StageCompletion comStaHea(
nin=nHp)
if have_heaWat
;
Setpoints.PlantReset resHeaWat(
final TSup_nominal=THeaWatSup_nominal,
final TSupSetLim=THeaWatSupSet_min,
final dpSet_max=dpHeaWatRemSet_max,
final dpSet_min=dpHeaWatRemSet_min,
final dtDel=dtDel,
final dtHol=dtHol,
final dtRes=dtResHeaWat,
final nReqResIgn=nReqResIgnHeaWat,
final nSenDpRem=nSenDpHeaWatRem,
final resDp_max=resDpHeaWat_max,
final resTSup_min=resTHeaWatSup_min,
final res_init=res_init,
final res_max=res_max,
final res_min=res_min,
final rsp=rspHeaWat,
final rsp_max=rspHeaWat_max,
final tri=triHeaWat)
if have_heaWat ;
Setpoints.PlantReset resChiWat(
final TSup_nominal=TChiWatSup_nominal,
final TSupSetLim=TChiWatSupSet_max,
final dpSet_max=dpChiWatRemSet_max,
final dpSet_min=dpChiWatRemSet_min,
final dtDel=dtDel,
final dtHol=dtHol,
final dtRes=dtResChiWat,
final nReqResIgn=nReqResIgnChiWat,
final nSenDpRem=nSenDpChiWatRem,
final resDp_max=resDpChiWat_max,
final resTSup_min=resTChiWatSup_min,
final res_init=res_init,
final res_max=res_max,
final res_min=res_min,
final rsp=rspChiWat,
final rsp_max=rspChiWat_max,
final tri=triChiWat)
if have_chiWat ;
Pumps.Primary.VariableSpeedNoDpControl ctlPumPri(
final have_heaWat=have_heaWat,
final have_chiWat=have_chiWat,
final have_pumChiWatPriDed=have_pumChiWatPriDed,
final have_pumPriHdr=have_pumPriHdr,
final nEqu=nHp,
final nPumHeaWatPri=nPumHeaWatPri,
final nPumChiWatPri=nPumChiWatPri,
final yPumHeaWatPriSet=yPumHeaWatPriSet,
final yPumChiWatPriSet=yPumChiWatPriSet)
;
Pumps.Generic.ControlDifferentialPressure ctlPumHeaWatSec(
final have_senDpRemWir=have_senDpHeaWatRemWir,
nPum=nPumHeaWatSec,
final nSenDpRem=nSenDpHeaWatRem,
final y_min=yPumHeaWatSec_min,
final k=kPumHeaWatSec,
final Ti=TiPumHeaWatSec)
if have_pumHeaWatSec
;
Pumps.Generic.ControlDifferentialPressure ctlPumChiWatSec(
final have_senDpRemWir=have_senDpChiWatRemWir,
final nPum=nPumChiWatSec,
final nSenDpRem=nSenDpChiWatRem,
final y_min=yPumChiWatSec_min,
final k=kPumChiWatSec,
final Ti=TiPumChiWatSec)
if have_chiWat
and have_pumChiWatSec
;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TSupSet[nHp](
each final unit="K",
each final quantity="ThermodynamicTemperature",
each displayUnit="degC")
;
Buildings.Controls.OBC.CDL.Reals.Switch swiTSupSet[nHp]
if have_heaWat
and have_chiWat
;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTChiWatSupSet(
final
nout=nHp)
if have_chiWat ;
Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTHeaWatSupSet(
final
nout=nHp)
if have_heaWat ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriSup(
final unit="K",
displayUnit="degC")
if have_heaWat ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriSup(
final unit="K",
displayUnit="degC")
if have_chiWat ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSecSup(
final unit="K",
displayUnit="degC")
if have_chiWat
and have_senTHeaWatSecSup
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSecSup(
final unit="K",
displayUnit="degC")
if have_chiWat
and have_senTChiWatSecSup
;
Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasTHeaWatSupSet(
final nin
=nHp,
final
nout=nHp)
if have_heaWat
and not have_chiWat
;
Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasTChiWatSupSet(
final nin
=nHp,
final nout=nHp)
if have_chiWat
and not have_heaWat
;
equation
connect(u1SchHea, enaHea.u1Sch);
connect(nReqPlaHeaWat, enaHea.nReqPla);
connect(TOut, enaHea.TOut);
connect(enaHea.y1, idxStaHea.u1Lea);
connect(avaStaHea.y1, idxStaHea.u1AvaSta);
connect(idxStaHea.y, enaEquHea.uSta);
connect(seqEve.y1, y1Hp);
connect(seqEve.y1Hea, y1HeaHp);
connect(seqEve.y1ValHeaWatOutIso, y1ValHeaWatHpOutIso);
connect(seqEve.y1ValHeaWatInlIso, y1ValHeaWatHpInlIso);
connect(seqEve.y1ValChiWatInlIso, y1ValChiWatHpInlIso);
connect(seqEve.y1ValChiWatOutIso, y1ValChiWatHpOutIso);
connect(idxStaHea.y, chaStaHea.uSta);
connect(chaStaHea.y1Dow, idxStaHea.u1Dow);
connect(chaStaHea.y1Up, idxStaHea.u1Up);
connect(avaStaHea.y1, chaStaHea.u1AvaSta);
connect(sorRunTimHea.yIdx, enaEquHea.uIdxAltSor);
connect(nReqPlaChiWat, enaCoo.nReqPla);
connect(TOut, enaCoo.TOut);
connect(u1SchCoo, enaCoo.u1Sch);
connect(avaStaCoo.y1, chaStaCoo.u1AvaSta);
connect(enaCoo.y1, idxStaCoo.u1Lea);
connect(chaStaCoo.y1Up, idxStaCoo.u1Up);
connect(chaStaCoo.y1Dow, idxStaCoo.u1Dow);
connect(idxStaCoo.y, enaEquCoo.uSta);
connect(enaEquHea.y1, seqEve.u1Hea);
connect(enaEquCoo.y1, seqEve.u1Coo);
connect(y1HeaHp, y1HeaPre.u);
connect(y1HeaPre.y, avaEquHeaCoo.u1Hea);
connect(avaEquHeaCoo.y1Hea, avaStaHea.u1Ava);
connect(avaEquHeaCoo.y1Coo, avaStaCoo.u1Ava);
connect(avaStaCoo.y1, idxStaCoo.u1AvaSta);
connect(avaEquHeaCoo.y1Hea, enaEquHea.u1Ava);
connect(avaEquHeaCoo.y1Coo, enaEquCoo.u1Ava);
connect(sorRunTimCoo.yIdx, enaEquCoo.uIdxAltSor);
connect(idxStaCoo.y, chaStaCoo.uSta);
connect(avaEquHeaCoo.y1Hea, sorRunTimHea.u1Ava);
connect(avaEquHeaCoo.y1Coo, sorRunTimCoo.u1Ava);
connect(staPumChiWatPri.y1, y1PumChiWatPri);
connect(staPumChiWatPri.y1_actual, seqEve.u1PumChiWatPri_actual);
connect(seqEve.y1PumChiWatPri, staPumChiWatPri.u1Pum);
connect(u1PumChiWatPri_actual, staPumChiWatPri.u1Pum_actual);
connect(u1PumHeaWatPri_actual, staPumHeaWatPri.u1Pum_actual);
connect(staPumHeaWatPri.y1_actual, seqEve.u1PumHeaWatPri_actual);
connect(staPumHeaWatSec.y1, y1PumHeaWatSec);
connect(staPumChiWatSec.y1, y1PumChiWatSec);
connect(u1PumHeaWatSec_actual, staPumHeaWatSec.u1Pum_actual);
connect(u1PumChiWatSec_actual, staPumChiWatSec.u1Pum_actual);
connect(staPumHeaWatPri.y1, y1PumHeaWatPri);
connect(staPumChiWatSec.y1_actual, seqEve.u1PumChiWatSec_actual);
connect(seqEve.y1PumHeaWatPri, staPumHeaWatPri.u1Pum);
connect(staPumHeaWatSec.y1_actual, seqEve.u1PumHeaWatSec_actual);
connect(VHeaWatSec_flow, staPumHeaWatSec.V_flow);
connect(VChiWatSec_flow, staPumChiWatSec.V_flow);
connect(THeaWatPriRet, THeaWatRet.u);
connect(THeaWatRet.y, chaStaHea.TRet);
connect(THeaWatSecRet, THeaWatRet.uPh);
connect(VHeaWatPri_flow, VHeaWat_flow.u);
connect(VHeaWat_flow.y, chaStaHea.V_flow);
connect(VHeaWatSec_flow, VHeaWat_flow.uPh);
connect(TChiWatPriRet, TChiWatRet.u);
connect(TChiWatRet.y, chaStaCoo.TRet);
connect(TChiWatSecRet, TChiWatRet.uPh);
connect(VChiWatPri_flow, VChiWat_flow.u);
connect(VChiWat_flow.y, chaStaCoo.V_flow);
connect(VChiWatSec_flow, VChiWat_flow.uPh);
connect(enaHea.y1, staPumHeaWatSec.u1Pla);
connect(enaCoo.y1, staPumChiWatSec.u1Pla);
connect(seqEve.y1ValHeaWatInlIso, staPumHeaWatPri.u1ValInlIso);
connect(seqEve.y1ValHeaWatOutIso, staPumHeaWatPri.u1ValOutIso);
connect(seqEve.y1ValChiWatInlIso, staPumChiWatPri.u1ValInlIso);
connect(seqEve.y1ValChiWatOutIso, staPumChiWatPri.u1ValOutIso);
connect(u1Hp_actual, sorRunTimHea.u1Run);
connect(u1Hp_actual, sorRunTimCoo.u1Run);
connect(y1Hp, y1HpPre.u);
connect(y1HpPre.y, avaEquHeaCoo.u1);
connect(idxStaCoo.y, comStaCoo.uSta);
connect(comStaCoo.y1, chaStaCoo.u1StaPro);
connect(u1Hp_actual, comStaCoo.u1_actual);
connect(y1HpPre.y, comStaCoo.u1);
connect(idxStaHea.y, comStaHea.uSta);
connect(u1Hp_actual, comStaHea.u1_actual);
connect(y1HpPre.y, comStaHea.u1);
connect(comStaHea.y1, chaStaHea.u1StaPro);
connect(resHeaWat.dpSet, dpHeaWatRemSet);
connect(resChiWat.dpSet, dpChiWatRemSet);
connect(nReqResHeaWat,resHeaWat.nReqRes);
connect(nReqResChiWat,resChiWat.nReqRes);
connect(enaCoo.y1, resChiWat.u1Ena);
connect(enaHea.y1, resHeaWat.u1Ena);
connect(comStaHea.y1, resHeaWat.u1StaPro);
connect(comStaCoo.y1, resChiWat.u1StaPro);
connect(resChiWat.TSupSet, chaStaCoo.TSupSet);
connect(resHeaWat.TSupSet, chaStaHea.TSupSet);
connect(ctlPumPri.yPumHeaWatPriHdr, yPumHeaWatPriHdr);
connect(ctlPumPri.yPumChiWatPriHdr, yPumChiWatPriHdr);
connect(ctlPumPri.yPumHeaWatPriDed, yPumHeaWatPriDed);
connect(ctlPumPri.yPumChiWatPriDed, yPumChiWatPriDed);
connect(staPumHeaWatPri.y1, ctlPumPri.u1PumHeaWatPri);
connect(staPumChiWatPri.y1, ctlPumPri.u1PumChiWatPri);
connect(seqEve.y1Hea, ctlPumPri.u1Hea);
connect(ctlPumHeaWatSec.y, yPumHeaWatSec);
connect(ctlPumChiWatSec.y, yPumChiWatSec);
connect(u1PumHeaWatSec_actual, ctlPumHeaWatSec.y1_actual);
connect(u1PumChiWatSec_actual, ctlPumChiWatSec.y1_actual);
connect(resChiWat.dpSet, ctlPumChiWatSec.dpRemSet);
connect(dpHeaWatRem, ctlPumHeaWatSec.dpRem);
connect(resHeaWat.dpSet, ctlPumHeaWatSec.dpRemSet);
connect(dpHeaWatLoc, ctlPumHeaWatSec.dpLoc);
connect(dpHeaWatLocSet, ctlPumHeaWatSec.dpLocSet);
connect(dpChiWatRem, ctlPumChiWatSec.dpRem);
connect(dpChiWatLocSet, ctlPumChiWatSec.dpLocSet);
connect(dpChiWatLoc, ctlPumChiWatSec.dpLoc);
connect(u1AvaHp.y, avaEquHeaCoo.u1Ava);
connect(repTChiWatSupSet.y, swiTSupSet.u3);
connect(repTHeaWatSupSet.y, swiTSupSet.u1);
connect(resChiWat.TSupSet, repTChiWatSupSet.u);
connect(resHeaWat.TSupSet, repTHeaWatSupSet.u);
connect(seqEve.y1Hea, swiTSupSet.u2);
connect(swiTSupSet.y, TSupSet);
connect(pasTChiWatSupSet.y, TSupSet);
connect(pasTHeaWatSupSet.y, TSupSet);
connect(repTChiWatSupSet.y, pasTChiWatSupSet.u);
connect(repTHeaWatSupSet.y, pasTHeaWatSupSet.u);
connect(resChiWat.TSupSet, TChiWatSupSet);
connect(resHeaWat.TSupSet, THeaWatSupSet);
end AirToWater;