All control blocks that form the control sequence of a system are instantiated
into one single class, a so-called control section.
This package contains such control sections for heat pump plant models.
The control sequence requires the following external input points in
addition to those already included in the AWHP plant template.
model AirToWater
extends Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController(
final typ=Buildings.Templates.Plants.HeatPumps.Types.Controller.AirToWater,
final have_senVHeaWatPri=ctl.have_senVHeaWatPri,
final have_senVHeaWatLoo=ctl.have_senVHeaWatLoo,
final have_senVHeaWatSec=ctl.have_senVHeaWatSec,
final have_senVChiWatPri=ctl.have_senVChiWatPri,
final have_senVChiWatLoo=ctl.have_senVChiWatLoo,
final have_senVChiWatSec=ctl.have_senVChiWatSec,
final have_senTHeaWatPriRet=ctl.have_senTHeaWatPriRet,
final have_senTChiWatPriRet=ctl.have_senTChiWatPriRet,
final have_senTHeaWatLooRet=ctl.have_senTHeaWatLooRet,
final have_senTChiWatLooRet=ctl.have_senTChiWatLooRet,
final have_senTHeaWatSecSup=ctl.have_senTHeaWatSecSup,
final have_senTChiWatSecSup=ctl.have_senTChiWatSecSup,
final have_senTHeaWatSecRet=ctl.have_senTHeaWatSecRet,
final have_senTChiWatSecRet=ctl.have_senTChiWatSecRet);
Buildings.Templates.Plants.Controls.HeatPumps.AirToWater ctl(
final typ=cfg.typ,
final is_priOnl=cfg.typDis ==
Buildings.Templates.Plants.HeatPumps.Types.Distribution.Variable1Only,
final TChiWatSupSet_max=dat.TChiWatSupSet_max,
final TChiWatSup_nominal=dat.TChiWatSup_nominal,
final THeaWatSupSet_min=dat.THeaWatSupSet_min,
final THeaWatSup_nominal=dat.THeaWatSup_nominal,
final TOutChiWatLck=dat.TOutChiWatLck,
final TOutHeaWatLck=dat.TOutHeaWatLck,
final VChiWatHp_flow_min=
fill(dat.VChiWatHp_flow_min, cfg.nHp),
final VChiWatHp_flow_nominal=
fill(dat.VChiWatHp_flow_nominal, cfg.nHp),
final VChiWatPhp_flow_min=
fill(dat.VChiWatPhp_flow_min, cfg.nPhp),
final VChiWatPhp_flow_nominal=
fill(dat.VChiWatPhp_flow_nominal, cfg.nPhp),
final VChiWatPri_flow_nominal=dat.VChiWatPri_flow_nominal,
final VChiWatSec_flow_nominal=dat.VChiWatSec_flow_nominal,
final VHeaWatHp_flow_min=
fill(dat.VHeaWatHp_flow_min, cfg.nHp),
final VHeaWatHp_flow_nominal=
fill(dat.VHeaWatHp_flow_nominal, cfg.nHp),
final VHeaWatPhp_flow_min=
fill(dat.VHeaWatPhp_flow_min, cfg.nPhp),
final VHeaWatPhp_flow_nominal=
fill(dat.VHeaWatPhp_flow_nominal, cfg.nPhp),
final VHeaWatPri_flow_nominal=dat.VHeaWatPri_flow_nominal,
final VHeaWatSec_flow_nominal=dat.VHeaWatSec_flow_nominal,
final capCooHp_nominal=
fill(dat.capCooHp_nominal, cfg.nHp),
final capCooPhp_nominal=
fill(dat.capCooPhp_nominal, cfg.nPhp),
final capCooShcPhp_nominal=
fill(dat.capCooShcPhp_nominal, cfg.nPhp),
final capHeaHp_nominal=
fill(dat.capHeaHp_nominal, cfg.nHp),
final capHeaPhp_nominal=
fill(dat.capHeaPhp_nominal, cfg.nPhp),
final capHeaShcPhp_nominal=
fill(dat.capHeaShcPhp_nominal, cfg.nPhp),
final cp_default=
if cfg.have_heaWat
then cfg.cpHeaWat_default
else cfg.cpChiWat_default,
final dpChiWatRemSet_max=dat.dpChiWatRemSet_max,
final dpChiWatRemSet_min=dat.dpChiWatRemSet_min,
final dpHeaWatRemSet_max=dat.dpHeaWatRemSet_max,
final dpHeaWatRemSet_min=dat.dpHeaWatRemSet_min,
final capCooHrc_min=dat.capCooHrc_min,
final capHeaHrc_min=dat.capHeaHrc_min,
final COPHeaHrc_nominal=dat.COPHeaHrc_nominal,
final TChiWatSupHrc_min=dat.TChiWatSupHrc_min,
final THeaWatSupHrc_max=dat.THeaWatSupHrc_max,
final have_inpSch=have_inpSch,
final have_pumChiWatPriDedHp_select=cfg.have_pumChiWatPriDedHp,
final have_pumPriHdr=cfg.typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Headered,
final have_pumHeaWatPriVar_select=cfg.typPumHeaWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final have_pumChiWatPriVar_select=cfg.typPumChiWatPri ==
Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
final have_senDpChiWatRemWir=cfg.have_senDpChiWatRemWir,
final have_senDpHeaWatRemWir=cfg.have_senDpHeaWatRemWir,
final have_senTPriRet_select=have_senTPriRet_select,
final have_senTLooRet_select=have_senTLooRet_select,
final have_valHpInlIso=cfg.have_valHpInlIso,
final have_valHpOutIso=cfg.have_valHpOutIso,
final have_valPhpInlIso=cfg.have_valPhpInlIso,
final have_valPhpOutIso=cfg.have_valPhpOutIso,
final nHp_select=cfg.nHp,
final nPhp_select=cfg.nPhp,
final nPumChiWatPri_select=cfg.nPumChiWatPri,
final nPumChiWatSec_select=cfg.nPumChiWatSec,
final nPumHeaWatPri_select=cfg.nPumHeaWatPri,
final nPumHeaWatSec_select=cfg.nPumHeaWatSec,
final nSenDpChiWatRem=nSenDpChiWatRem,
final nSenDpHeaWatRem=nSenDpHeaWatRem,
final plrSta=dat.plrSta,
final rho_default=
if cfg.have_heaWat
then cfg.rhoHeaWat_default
else cfg.rhoChiWat_default,
final schCoo=dat.schCoo,
final schHea=dat.schHea,
final staHp=dat.staHp,
final idxAltHp_select=dat.idxAltHp,
final yPumChiWatPri_min=dat.yPumChiWatPri_min,
yPumChiWatPriDedHpSet=dat.yPumChiWatPriDedHpSet,
yPumChiWatPriDedPhpSet=dat.yPumChiWatPriDedPhpSet,
yPumChiWatPriHdrSet=dat.yPumChiWatPriHdrSet,
final yPumChiWatSec_min=dat.yPumChiWatSec_min,
final yPumHeaWatPri_min=dat.yPumHeaWatPri_min,
yPumHeaWatPriDedHpSet=dat.yPumHeaWatPriDedHpSet,
yPumHeaWatPriDedPhpSet=dat.yPumHeaWatPriDedPhpSet,
yPumHeaWatPriHdrSet=dat.yPumHeaWatPriHdrSet,
final yPumHeaWatSec_min=dat.yPumHeaWatSec_min)
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqPlaHeaWatAirHan(
final nin=nAirHan)
if cfg.have_heaWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqPlaHeaWatEquZon(
final nin=nEquZon)
if cfg.have_heaWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqResHeaWatAirHan(nin=1)
if cfg.have_heaWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqResHeaWatEquZon(
final nin=nEquZon)
if cfg.have_heaWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqResChiWatAirHan(
final nin=nAirHan)
if cfg.have_chiWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqPlaChiWatEquZon(
final nin=nEquZon)
if cfg.have_chiWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqResChiWatEquZon(
final nin=nEquZon)
if cfg.have_chiWat
;
Buildings.Controls.OBC.CDL.Integers.MultiSum reqPlaChiWatAirHan(
final nin=nAirHan)
if cfg.have_chiWat
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqPlaHeaWatAirHan(
final have_inp=cfg.have_heaWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqPlaChiWatAirHan(
final have_inp=cfg.have_chiWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqResHeaWatAirHan(
final have_inp=cfg.have_heaWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqResChiWatAirHan(
final have_inp=cfg.have_chiWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqPlaHeaWatEquZon(
final have_inp=cfg.have_heaWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqPlaChiWatEquZon(
final have_inp=cfg.have_chiWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqResHeaWatEquZon(
final have_inp=cfg.have_heaWat,
final u_internal=0)
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger phReqResChiWatEquZon(
final have_inp=cfg.have_chiWat,
final u_internal=0)
;
Buildings.Controls.OBC.CDL.Integers.Add reqPlaHeaWat
;
Buildings.Controls.OBC.CDL.Integers.Add reqPlaChiWat
;
Buildings.Controls.OBC.CDL.Integers.Add reqResHeaWat
;
Buildings.Controls.OBC.CDL.Integers.Add reqResChiWat
;
Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure
resDpHeaWatLoc[nSenDpHeaWatRem](
dpLocSet_min=
fill(dat.dpHeaWatLocSet_min, nSenDpHeaWatRem),
dpLocSet_max=
fill(dat.dpHeaWatLocSet_max, nSenDpHeaWatRem))
if cfg.have_heaWat
and not have_senDpHeaWatRemWir
;
Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure
resDpChiWatLoc[nSenDpChiWatRem](
dpLocSet_min=
fill(dat.dpChiWatLocSet_min, nSenDpChiWatRem),
dpLocSet_max=
fill(dat.dpChiWatLocSet_max, nSenDpChiWatRem))
if cfg.have_chiWat
and not have_senDpChiWatRemWir
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderReal
THeaWatLooOrSecRet(
final have_inp=have_senTHeaWatLooRet, have_inpPh=true)
if have_senTHeaWatLooRet
or have_senTHeaWatSecRet
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderReal
TChiWatLooOrSecRet(
final have_inp=have_senTChiWatLooRet, have_inpPh=true)
if have_senTChiWatLooRet
or have_senTChiWatSecRet
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderReal VHeaWatLooOrSec(
final have_inp=have_senVHeaWatLoo, have_inpPh=true)
if have_senVHeaWatLoo
or have_senVHeaWatSec
;
Buildings.Templates.Plants.Controls.Utilities.PlaceholderReal VChiWatLooOrSec(
final have_inp=have_senVChiWatLoo, have_inpPh=true)
if have_senVChiWatLoo
or have_senVChiWatSec
;
equation
connect(bus.TChiWatPriRet, ctl.TChiWatPriRet);
connect(bus.TChiWatPriSup, ctl.TChiWatPriSup);
connect(bus.TChiWatSecSup, ctl.TChiWatSecSup);
connect(bus.THeaWatPriRet, ctl.THeaWatPriRet);
connect(bus.THeaWatPriSup, ctl.THeaWatPriSup);
connect(bus.THeaWatSecSup, ctl.THeaWatSecSup);
connect(bus.TOut, ctl.TOut);
connect(bus.VChiWatPri_flow, ctl.VChiWatPri_flow);
connect(bus.VHeaWatPri_flow, ctl.VHeaWatPri_flow);
connect(bus.dpChiWatLoc, ctl.dpChiWatLoc);
connect(bus.dpChiWatLocSet, ctl.dpChiWatLocSet);
connect(bus.dpChiWatRem, ctl.dpChiWatRem);
connect(bus.dpChiWatRem, resDpChiWatLoc.dpRem);
connect(bus.dpHeaWatLoc, ctl.dpHeaWatLoc);
connect(bus.dpHeaWatLocSet, ctl.dpHeaWatLocSet);
connect(bus.dpHeaWatRem, ctl.dpHeaWatRem);
connect(bus.dpHeaWatRem, resDpHeaWatLoc.dpRem);
connect(busHp.y1_actual, ctl.u1Hp_actual);
connect(busPhp.y1_actual, ctl.u1Php_actual);
connect(rouPumChiWatPri.y1Hdr_actual, ctl.u1PumChiWatPriHdr_actual);
connect(rouPumChiWatPri.y1DedHp_actual, ctl.u1PumChiWatPriDedHp_actual);
connect(rouPumChiWatPri.y1DedPhp_actual, ctl.u1PumChiWatPriDedPhp_actual);
connect(busPumChiWatSec.y1_actual, ctl.u1PumChiWatSec_actual);
connect(rouPumHeaWatPri.y1Hdr_actual, ctl.u1PumHeaWatPriHdr_actual);
connect(rouPumHeaWatPri.y1DedHp_actual, ctl.u1PumHeaWatPriDedHp_actual);
connect(rouPumHeaWatPri.y1DedPhp_actual, ctl.u1PumHeaWatPriDedPhp_actual);
connect(busPumHeaWatSec.y1_actual, ctl.u1PumHeaWatSec_actual);
connect(bus.u1SchCoo, ctl.u1SchCoo);
connect(bus.u1SchHea, ctl.u1SchHea);
connect(busHrc.y1_actual, ctl.u1Hrc_actual);
connect(bus.TChiWatRetUpsHrc, ctl.TChiWatRetUpsHrc);
connect(bus.THeaWatRetUpsHrc, ctl.THeaWatRetUpsHrc);
connect(ctl.THeaWatSupHpSet, busHp.THeaWatSet);
connect(ctl.TChiWatSupHpSet, busHp.TChiWatSet);
connect(ctl.THeaWatSupPhpSet, busPhp.THeaWatSet);
connect(ctl.TChiWatSupPhpSet, busPhp.TChiWatSet);
connect(ctl.TChiWatSupSet, bus.TChiWatSupSet);
connect(ctl.THeaWatSupSet, bus.THeaWatSupSet);
connect(ctl.dpChiWatRemSet, bus.dpChiWatRemSet);
connect(ctl.dpHeaWatRemSet, bus.dpHeaWatRemSet);
connect(ctl.y1HeaHp, busHp.y1Hea);
connect(ctl.y1Hp, busHp.y1);
connect(ctl.y1HeaPhp, busPhp.y1Hea);
connect(ctl.y1CooPhp, busPhp.y1Coo);
connect(ctl.y1PumChiWatPriDedHp, rouPumChiWatPri.y1DedHp);
connect(ctl.y1PumChiWatPriDedPhp, rouPumChiWatPri.y1DedPhp);
connect(ctl.y1PumChiWatPriHdr, rouPumChiWatPri.y1Hdr);
connect(ctl.y1PumChiWatSec, busPumChiWatSec.y1);
connect(ctl.y1PumHeaWatPriDedHp, rouPumHeaWatPri.y1DedHp);
connect(ctl.y1PumHeaWatPriDedPhp, rouPumHeaWatPri.y1DedPhp);
connect(ctl.y1PumHeaWatPriHdr, rouPumHeaWatPri.y1Hdr);
connect(ctl.y1PumHeaWatSec, busPumHeaWatSec.y1);
connect(ctl.y1ValChiWatHpInlIso, busValChiWatHpInlIso.y1);
connect(ctl.y1ValChiWatHpOutIso, busValChiWatHpOutIso.y1);
connect(ctl.y1ValHeaWatHpInlIso, busValHeaWatHpInlIso.y1);
connect(ctl.y1ValHeaWatHpOutIso, busValHeaWatHpOutIso.y1);
connect(ctl.y1ValChiWatPhpInlIso, busValChiWatPhpInlIso.y1);
connect(ctl.y1ValChiWatPhpOutIso, busValChiWatPhpOutIso.y1);
connect(ctl.y1ValHeaWatPhpInlIso, busValHeaWatPhpInlIso.y1);
connect(ctl.y1ValHeaWatPhpOutIso, busValHeaWatPhpOutIso.y1);
connect(ctl.yValHeaWatMinByp, busValHeaWatMinByp.y);
connect(ctl.yValChiWatMinByp, busValChiWatMinByp.y);
connect(ctl.yPumChiWatPriDedHp, rouPumChiWatPri.yDedHp);
connect(ctl.yPumChiWatPriDedPhp, rouPumChiWatPri.yDedPhp);
connect(ctl.yPumChiWatPriHdr, rouPumChiWatPri.yHdr);
connect(ctl.yPumChiWatSec, busPumChiWatSec.y);
connect(ctl.yPumHeaWatPriDedHp, rouPumHeaWatPri.yDedHp);
connect(ctl.yPumHeaWatPriDedPhp, rouPumHeaWatPri.yDedPhp);
connect(ctl.yPumHeaWatPriHdr, rouPumHeaWatPri.yHdr);
connect(ctl.yPumHeaWatSec, busPumHeaWatSec.y);
connect(ctl.y1Hrc, busHrc.y1);
connect(ctl.y1CooHrc, busHrc.y1Coo);
connect(ctl.THeaWatSupHrcSet, busHrc.THeaWatSet);
connect(ctl.TChiWatSupHrcSet, busHrc.TChiWatSet);
connect(ctl.y1PumChiWatHrc, busPumChiWatHrc.y1);
connect(ctl.y1PumHeaWatHrc, busPumHeaWatHrc.y1);
connect(busAirHan.reqResChiWat, reqResChiWatAirHan.u);
connect(busEquZon.reqPlaHeaWat, reqPlaHeaWatEquZon.u);
connect(busEquZon.reqResHeaWat, reqResHeaWatEquZon.u);
connect(busEquZon.reqPlaChiWat, reqPlaChiWatEquZon.u);
connect(busEquZon.reqResChiWat, reqResChiWatEquZon.u);
connect(busAirHan.reqPlaChiWat, reqPlaChiWatAirHan.u);
connect(busAirHan.reqPlaHeaWat, reqPlaHeaWatAirHan.u);
connect(busAirHan.reqResHeaWat, reqResHeaWatAirHan.u[1:1]);
connect(reqPlaHeaWatAirHan.y, phReqPlaHeaWatAirHan.u);
connect(reqPlaChiWatAirHan.y, phReqPlaChiWatAirHan.u);
connect(reqResHeaWatAirHan.y, phReqResHeaWatAirHan.u);
connect(reqResChiWatAirHan.y, phReqResChiWatAirHan.u);
connect(reqPlaHeaWatEquZon.y, phReqPlaHeaWatEquZon.u);
connect(reqPlaChiWatEquZon.y, phReqPlaChiWatEquZon.u);
connect(reqResChiWatEquZon.y, phReqResChiWatEquZon.u);
connect(reqResHeaWatEquZon.y, phReqResHeaWatEquZon.u);
connect(phReqPlaHeaWatAirHan.y, reqPlaHeaWat.u1);
connect(phReqPlaHeaWatEquZon.y, reqPlaHeaWat.u2);
connect(phReqPlaChiWatAirHan.y, reqPlaChiWat.u1);
connect(phReqPlaChiWatEquZon.y, reqPlaChiWat.u2);
connect(phReqResHeaWatAirHan.y, reqResHeaWat.u1);
connect(phReqResChiWatAirHan.y, reqResChiWat.u1);
connect(phReqResHeaWatEquZon.y, reqResHeaWat.u2);
connect(phReqResChiWatEquZon.y, reqResChiWat.u2);
connect(reqPlaHeaWat.y, ctl.nReqPlaHeaWat);
connect(reqPlaChiWat.y, ctl.nReqPlaChiWat);
connect(reqResHeaWat.y, ctl.nReqResHeaWat);
connect(reqResChiWat.y, ctl.nReqResChiWat);
connect(resDpHeaWatLoc.dpLocSet, ctl.dpHeaWatLocSet);
connect(resDpChiWatLoc.dpLocSet, ctl.dpChiWatLocSet);
connect(ctl.dpChiWatRemSet, resDpChiWatLoc.dpRemSet);
connect(ctl.dpHeaWatRemSet, resDpHeaWatLoc.dpRemSet);
connect(bus.THeaWatLooRet, THeaWatLooOrSecRet.u);
connect(bus.THeaWatSecRet, THeaWatLooOrSecRet.uPh);
connect(bus.TChiWatLooRet, TChiWatLooOrSecRet.u);
connect(bus.TChiWatSecRet, TChiWatLooOrSecRet.uPh);
connect(bus.VHeaWatLoo_flow, VHeaWatLooOrSec.u);
connect(bus.VHeaWatSec_flow, VHeaWatLooOrSec.uPh);
connect(bus.VChiWatLoo_flow, VChiWatLooOrSec.u);
connect(bus.VChiWatSec_flow, VChiWatLooOrSec.uPh);
connect(VChiWatLooOrSec.y, ctl.VChiWatLooOrSec_flow);
connect(VHeaWatLooOrSec.y, ctl.VHeaWatLooOrSec_flow);
connect(TChiWatLooOrSecRet.y, ctl.TChiWatLooOrSecRet);
connect(THeaWatLooOrSecRet.y, ctl.THeaWatLooOrSecRet);
end AirToWater;
block OpenLoop
extends Buildings.Templates.Plants.HeatPumps.Components.Interfaces.PartialController(
final typ=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop);
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupSet[nHp + nPhp](
y(
each final unit="K",
each displayUnit="degC"),
each k=Buildings.Templates.Data.Defaults.THeaWatSupMed)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet[nHp + nPhp](
y(
each final unit="K",
each displayUnit="degC"),
each k=Buildings.Templates.Data.Defaults.TChiWatSup)
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValHeaWatHpInlIso[nHp](
each table=[0, 0; 1, 1; 3, 0],
each timeScale=1000,
each period=5000)
if cfg.have_hp
and cfg.have_heaWat
and cfg.have_valHpInlIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValHeaWatHpOutIso[nHp](
each table=[0, 0; 1, 1; 3, 0],
each timeScale=1000,
each period=5000)
if cfg.have_hp
and cfg.have_heaWat
and cfg.have_valHpOutIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValChiWatHpInlIso[nHp](
each table=[0, 0; 3.1, 1; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_hp
and cfg.have_chiWat
and cfg.have_valHpInlIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValChiWatHpOutIso[nHp](
each table=[0, 0; 3.1, 1; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_hp
and cfg.have_chiWat
and cfg.have_valHpOutIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1Hp[nHp](
each table=[0, 0; 1, 1],
each timeScale=1000,
each period=5000)
if cfg.have_hp
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1HeaHp[nHp](
each table=[0, 1; 3, 0],
each timeScale=1000,
each period=5000)
if cfg.have_hp
and cfg.is_rev
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1PumHeaWatPri[cfg.nPumHeaWatPri](
each table=
if cfg.typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered
or cfg.have_pumChiWatPriDedHp
or not cfg.have_chiWat
then [0,0; 1,1; 3,
0; 5,0]
else [0,0; 1,1; 3,0; 3.1,1; 5,0],
each timeScale=1000,
each period=5000)
if cfg.have_heaWat ;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1PumChiWatPri[cfg.nPumChiWatPri](
each table=[0, 0; 3.1, 1; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.typPumChiWatPri <> Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1PumHeaWatSec[cfg.nPumHeaWatSec](
each table=[0, 0; 1, 1; 3, 0; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.typPumHeaWatSec <>
Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1PumChiWatSec[cfg.nPumChiWatSec](
each table=[0, 0; 3.1, 1; 5, 1],
each timeScale=1000,
each period=5000)
if cfg.typPumChiWatSec <>
Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumHeaWatSec(k=1)
if cfg.typPumHeaWatSec <>
Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumChiWatSec(k=1)
if cfg.typPumChiWatSec <>
Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumHeaWatPriHdr(
k=dat.yPumHeaWatPriHdrSet)
if cfg.typPumHeaWatPri == Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable
and cfg.typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Headered
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumChiWatPriHdr(
k=dat.yPumChiWatPriHdrSet)
if cfg.typPumChiWatPri == Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable
and cfg.typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumHeaWatPriDed[cfg.nPumHeaWatPri](
k=
cat(1,
fill(dat.yPumHeaWatPriDedHpSet, cfg.nHp),
fill(dat.yPumHeaWatPriDedPhpSet,
cfg.nPhp)))
if cfg.typPumHeaWatPri == Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable
and cfg.typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yPumChiWatPriDed[cfg.nPumChiWatPri](
k=
if cfg.have_pumChiWatPriDedHp
then cat(1,
fill(dat.yPumChiWatPriDedHpSet,
cfg.nHp),
fill(dat.yPumChiWatPriDedPhpSet, cfg.nPhp))
else fill(dat.yPumChiWatPriDedPhpSet,
cfg.nPhp))
if cfg.typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and cfg.typPumChiWatPri == Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValChiWatPhpInlIso[nPhp](
each table=[0, 0; 3.1, 1; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_php
and cfg.have_chiWat
and cfg.have_valPhpInlIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValChiWatPhpOutIso[nPhp](
each table=[0, 0; 3.1, 1; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_php
and cfg.have_chiWat
and cfg.have_valPhpOutIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValHeaWatPhpInlIso[nPhp](
each table=[0, 0; 1, 1; 3, 0; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_php
and cfg.have_heaWat
and cfg.have_valPhpInlIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1ValHeaWatPhpOutIso[nPhp](
each table=[0, 0; 1, 1; 3, 0; 5, 0],
each timeScale=1000,
each period=5000)
if cfg.have_php
and cfg.have_heaWat
and cfg.have_valPhpOutIso
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1HeaPhp[nPhp](
each table=[0, 0; 1, 1; 4, 0],
each timeScale=1000,
each period=5000)
if cfg.have_php
;
Buildings.Controls.OBC.CDL.Logical.Sources.TimeTable y1CooPhp[nPhp](
each table=[0, 0; 2.5, 1],
each timeScale=1000,
each period=5000)
if cfg.have_php
;
equation
connect(TChiWatSupSet[nHp + 1:nHp + nPhp].y, busPhp.TChiWatSet);
connect(THeaWatSupSet[nHp + 1:nHp + nPhp].y, busPhp.THeaWatSet);
connect(y1Hp.y[1], busHp.y1);
connect(y1HeaHp.y[1], busHp.y1Hea);
connect(y1PumChiWatPri.y[1], busPumChiWatPri.y1);
connect(yPumChiWatPriHdr.y, busPumChiWatPri.y);
connect(yPumChiWatPriDed.y, busPumChiWatPri.y);
connect(y1PumChiWatSec.y[1], busPumChiWatSec.y1);
connect(yPumChiWatSec.y, busPumChiWatSec.y);
connect(y1PumHeaWatPri.y[1], busPumHeaWatPri.y1);
connect(yPumHeaWatPriHdr.y, busPumHeaWatPri.y);
connect(yPumHeaWatPriDed.y, busPumHeaWatPri.y);
connect(y1PumHeaWatSec.y[1], busPumHeaWatSec.y1);
connect(yPumHeaWatSec.y, busPumHeaWatSec.y);
connect(TChiWatSupSet[1:nHp].y, busHp.TChiWatSet);
connect(THeaWatSupSet[1:nHp].y, busHp.THeaWatSet);
connect(y1CooPhp.y[1], busPhp.y1Coo);
connect(y1HeaPhp.y[1], busPhp.y1Hea);
connect(y1ValChiWatHpInlIso.y[1], busValChiWatHpInlIso.y1);
connect(y1ValChiWatHpOutIso.y[1], busValChiWatHpOutIso.y1);
connect(y1ValHeaWatHpInlIso.y[1], busValHeaWatHpInlIso.y1);
connect(y1ValHeaWatHpOutIso.y[1], busValHeaWatHpOutIso.y1);
connect(y1ValChiWatPhpInlIso.y[1], busValChiWatPhpInlIso.y1);
connect(y1ValChiWatPhpOutIso.y[1], busValChiWatPhpOutIso.y1);
connect(y1ValHeaWatPhpInlIso.y[1], busValHeaWatPhpInlIso.y1);
connect(y1ValHeaWatPhpOutIso.y[1], busValHeaWatPhpOutIso.y1);
end OpenLoop;
This block routes the primary pump start and stop commands, speed commands
(for variable speed pumps) and status signals between the connectors exposed
to the primary pump controller and the plant bus. Depending on the primary
pump arrangement, the signals are either mapped to the headered pump
connectors or split between the dedicated pump connectors serving the
reversible heat pumps and those serving the polyvalent heat pumps.