Package with validation models
Information
This package contains validation models for the classes within
Buildings.Templates.Plants.HeatPumps.Components.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
HeatPumpGroupAirToWater
|
Validation model for heat pump group |
PumpsPrimaryDedicated
|
Validation model for dedicated primary pump component |
ValvesIsolation
|
Validation model for isolation valve component |
Validation model for heat pump group
Information
This model validates the model
Buildings.Templates.Plants.HeatPumps.Components.HeatPumpGroups.AirToWater
in a configuration in which the heat pump components are exposed
to a constant differential pressure and a varying
return temperature.
The model is configured to represent either a non-reversible heat pump
(component hpAwNrv
) or a reversible heat pump
(component hpAw
) that switches between cooling and heating
mode.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | CHW/HW medium |
Controller | datCtlPlaAwNrv | datCtlPlaAwNrv(cfg(have_hrc=... | Controller parameters |
Controller | datCtlPlaAw | datCtlPlaAw(cfg(have_hrc=fal... | Controller parameters |
HeatPumpGroup | datHpAwNrv | datHpAwNrv(final cpHeaWat_de... | Non-reversible AWHP parameters |
HeatPumpGroup | datHpAw | datHpAw(final cpHeaWat_defau... | Reversible AWHP parameters |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package Medium | CHW/HW medium |
Bus | busPla | Plant controller |
Bus | busHp[hpAw.nHp] | HP control bus |
Modelica definition
model HeatPumpGroupAirToWater
extends Modelica.Icons.Example;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial
;
parameter Data.Controller datCtlPlaAwNrv(
cfg(
have_hrc = false,
have_inpSch = false,
have_chiWat=false,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
have_pumChiWatPriDed=false,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=hpAwNrv.is_rev,
typ=hpAwNrv.typ,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=hpAwNrv.cpChiWat_default,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
have_valHpInlIso=false,
have_valHpOutIso=false,
typMod=hpAwNrv.typMod,
cpHeaWat_default=hpAwNrv.cpHeaWat_default,
cpSou_default=hpAwNrv.cpSou_default,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=hpAwNrv.nHp,
nPumHeaWatPri=hpAwNrv.nHp,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=hpAwNrv.nHp,
nSenDpHeaWatRem=1,
nSenDpChiWatRem=1,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=datHpAwNrv.THeaWatSupHp_nominal,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlPlaAwNrv.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlPlaAwNrv.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, hpAwNrv.nHp)})
;
parameter Data.Controller datCtlPlaAw(
cfg(
have_hrc = false,
have_inpSch = false,
have_chiWat=true,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=true,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
have_pumChiWatPriDed=false,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=hpAw.is_rev,
typ=hpAw.typ,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=hpAw.cpChiWat_default,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
have_valHpInlIso=true,
have_valHpOutIso=true,
typMod=hpAw.typMod,
cpHeaWat_default=hpAw.cpHeaWat_default,
cpSou_default=hpAw.cpSou_default,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=hpAw.nHp,
nPumHeaWatPri=hpAw.nHp,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=hpAw.nHp,
nSenDpHeaWatRem=1,
nSenDpChiWatRem=1,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=datHpAw.THeaWatSupHp_nominal,
TChiWatSup_nominal=datHpAw.TChiWatSupHp_nominal,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlPlaAw.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlPlaAw.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, hpAw.nHp)})
;
parameter Buildings.Templates.Plants.HeatPumps.Components.Data.HeatPumpGroup datHpAwNrv(
final cpHeaWat_default=hpAwNrv.cpHeaWat_default,
final cpSou_default=hpAwNrv.cpSou_default,
final nHp=hpAwNrv.nHp,
final typ=hpAwNrv.typ,
final is_rev=hpAwNrv.is_rev,
final typMod=hpAwNrv.typMod,
mHeaWatHp_flow_nominal=datHpAwNrv.capHeaHp_nominal /
abs(datHpAwNrv.THeaWatSupHp_nominal -
Buildings.Templates.Data.Defaults.THeaWatRetMed) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
dpHeaWatHp_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp,
capHeaHp_nominal=500E3,
THeaWatSupHp_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TSouHeaHp_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow,
perFitHp(
hea(
P=datHpAwNrv.capHeaHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwHea,
coeQ={- 4.2670305442, - 0.7381077035, 6.0049480456, 0, 0},
coeP={- 4.9107455513, 5.3665308366, 0.5447612754, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow)))
;
parameter Buildings.Templates.Plants.HeatPumps.Components.Data.HeatPumpGroup datHpAw(
final cpHeaWat_default=hpAw.cpHeaWat_default,
final cpSou_default=hpAw.cpSou_default,
final nHp=hpAw.nHp,
final typ=hpAw.typ,
final is_rev=hpAw.is_rev,
final typMod=hpAw.typMod,
mHeaWatHp_flow_nominal=datHpAw.capHeaHp_nominal /
abs(datHpAw.THeaWatSupHp_nominal -
Buildings.Templates.Data.Defaults.THeaWatRetMed) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
dpHeaWatHp_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp,
capHeaHp_nominal=500E3,
THeaWatSupHp_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TSouHeaHp_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow,
mChiWatHp_flow_nominal=datHpAw.capCooHp_nominal /
abs(datHpAw.TChiWatSupHp_nominal -
Buildings.Templates.Data.Defaults.TChiWatRet) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
capCooHp_nominal=500E3,
TChiWatSupHp_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
TSouCooHp_nominal=Buildings.Templates.Data.Defaults.TOutHpCoo,
perFitHp(
hea(
P=datHpAw.capHeaHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwHea,
coeQ={- 4.2670305442, - 0.7381077035, 6.0049480456, 0, 0},
coeP={- 4.9107455513, 5.3665308366, 0.5447612754, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow),
coo(
P=datHpAw.capCooHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwCoo,
coeQ={- 2.2545246871, 6.9089257665, - 3.6548225094, 0, 0},
coeP={- 5.8086010402, 1.6894933858, 5.1167787436, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.TChiWatRet,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpCoo)))
;
Fluid.Sources.Boundary_pT sup(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=hpAwNrv.nHp)
;
Fluid.Sources.Boundary_pT inlHp1(
redeclare final package Medium=
Medium,
use_p_in=true,
use_T_in=true,
nPorts=hpAwNrv.nHp)
;
BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"));
Fluid.Sensors.TemperatureTwoPort TRet1[hpAwNrv.nHp](
redeclare each final package Medium=
Medium,
each final m_flow_nominal=datHpAwNrv.mHeaWatHp_flow_nominal)
;
Fluid.Sensors.TemperatureTwoPort TSup1[hpAwNrv.nHp](
redeclare each final package Medium=
Medium,
each final m_flow_nominal=datHpAwNrv.mHeaWatHp_flow_nominal)
;
Controls.OpenLoop ctlPlaAwNrv(
final cfg=datCtlPlaAwNrv.cfg,
final dat=datCtlPlaAwNrv)
;
HeatPumpGroups.AirToWater hpAwNrv(
redeclare final package MediumHeaWat=
Medium,
nHp=3,
is_rev=false,
final dat=datHpAwNrv,
final energyDynamics=energyDynamics)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Sin THeaWatRet(
amplitude=datHpAwNrv.THeaWatSupHp_nominal - datHpAwNrv.THeaWatRetHp_nominal,
freqHz=3 / 3000,
y(
final unit="K",
displayUnit="degC"),
offset=datHpAwNrv.THeaWatRetHp_nominal,
startTime=0)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant pHeaWatInl(
k=sup.p + datHpAwNrv.dpHeaWatHp_nominal)
;
HeatPumpGroups.AirToWater hpAw(
redeclare final package MediumHeaWat=
Medium,
nHp=3,
is_rev=true,
final dat=datHpAw,
final energyDynamics=energyDynamics)
;
Controls.OpenLoop ctlPlaAw(
final cfg=datCtlPlaAw.cfg,
final dat=datCtlPlaAw)
;
Fluid.Sources.Boundary_pT inlHp(
redeclare final package Medium=
Medium,
use_p_in=true,
use_T_in=true,
nPorts=hpAwNrv.nHp)
;
Fluid.Sensors.TemperatureTwoPort TRet[hpAw.nHp](
redeclare each final package Medium=
Medium,
each final m_flow_nominal=datHpAw.mHeaWatHp_flow_nominal)
;
Fluid.Sources.Boundary_pT sup1(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=hpAwNrv.nHp)
;
Fluid.Sensors.TemperatureTwoPort TSup[hpAw.nHp](
redeclare each final package Medium=
Medium,
each final m_flow_nominal=datHpAw.mHeaWatHp_flow_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Sin THeaWatRet1(
amplitude=datHpAw.THeaWatSupHp_nominal - datHpAw.THeaWatRetHp_nominal,
freqHz=3 / 3000,
y(
final unit="K",
displayUnit="degC"),
offset=datHpAw.THeaWatRetHp_nominal,
startTime=0)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Sin TChiWatRet(
amplitude=datHpAw.TChiWatRetHp_nominal - datHpAw.TChiWatSupHp_nominal,
freqHz=3 / 3000,
y(
final unit="K",
displayUnit="degC"),
offset=datHpAw.TChiWatRetHp_nominal,
startTime=0)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant pHeaWatInl1(
k=sup.p + hpAw.dpHeaWatHp_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant pChiWatInl(
k=sup.p + hpAw.dpChiWatHp_nominal)
;
Buildings.Controls.OBC.CDL.Reals.Switch TRetAct
;
Buildings.Controls.OBC.CDL.Reals.Switch pInl_rel
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus busPla
;
Buildings.Templates.Components.Interfaces.Bus busHp[hpAw.nHp]
;
equation
connect(ctlPlaAwNrv.bus, hpAwNrv.bus);
connect(inlHp1.ports, TRet1.port_a);
connect(TRet1.port_b, hpAwNrv.ports_aChiHeaWat);
connect(hpAwNrv.ports_bChiHeaWat, TSup1.port_a);
connect(TSup1.port_b, sup.ports);
connect(weaDat.weaBus, hpAwNrv.busWea);
connect(THeaWatRet.y, inlHp1.T_in);
connect(pHeaWatInl.y, inlHp1.p_in);
connect(weaDat.weaBus, hpAw.busWea);
connect(ctlPlaAw.bus, hpAw.bus);
connect(inlHp.ports, TRet.port_a);
connect(TRet.port_b, hpAw.ports_aChiHeaWat);
connect(TSup.port_b, sup1.ports);
connect(hpAw.ports_bChiHeaWat, TSup.port_a);
connect(THeaWatRet1.y, TRetAct.u1);
connect(TChiWatRet.y, TRetAct.u3);
connect(pHeaWatInl1.y, pInl_rel.u1);
connect(pChiWatInl.y, pInl_rel.u3);
connect(pInl_rel.y, inlHp.p_in);
connect(TRetAct.y, inlHp.T_in);
connect(busPla, ctlPlaAw.bus);
connect(busPla.hp, busHp);
connect(busHp[1].y1Hea, pInl_rel.u2);
connect(pInl_rel.u2, TRetAct.u2);
end HeatPumpGroupAirToWater;
Validation model for dedicated primary pump component
Information
This model validates the model
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated
for the following configurations.
-
Heating and cooling system with common constant speed dedicated primary pumps:
component
pumPriCom
.
-
Heating and cooling system with headered constant speed primary pumps:
component
pumPriHdr
.
-
Heating and cooling system with separate constant speed dedicated HW and CHW pumps:
component
pumPriSep
.
-
Heating-only system with variable speed dedicated primary pumps:
component
pumPriHea
.
In each configuration, two identical heat pumps are represented by fixed flow resistances
(components hp*
).
The model uses open loop controls and the simulation allows verifying that design flow
is obtained in each loop and each heat pump when the pumps are enabled.
In the configurations with common constant speed dedicated primary pumps or
headered constant speed primary pumps, this requires adjusting the
design pressure drop of the balancing valves which are modeled by fixed flow
resistances in the isolation valve components
valHeaWatIso*
and valChiWatIso*
.
This adjustment is done programmatically using the function
Buildings.Templates.Utilities.computeBalancingPressureDrop.
Similarly, in the configuration with variable speed pumps pumPriHea
,
the design head of the pumps is voluntarily chosen higher than necessary
and the required pump speed needed to provide the design HP flow is computed
at initialization by solving for a balancing valve pressure drop of zero.
Note that this requires solving a numerical Jacobian at initialization.
Although this is handled well by various Modelica tools, the parameter
use_spePumIni
allows switching to a default value in
this validation model for better integration into the continuous integration
test workflow.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | CHW/HW medium |
Boolean | use_spePumIni | false | Set to true to compute pump speed at initialization, false to use default value |
Real | r_N[pumPriHea.nPum] | | Relative revolution, r_N=N/N_nominal [1] |
Real | r_NDef[pumPriHea.nPum] | fill(0.85, pumPriHea.nPum) | Default value for relative revolution, r_N=N/N_nominal [1] |
Controller | datCtl | datCtl(cfg(have_pumHeaWatPri... | Controller parameters |
Controller | datCtlNoDed | datCtlNoDed(cfg(have_pumHeaW... | Controller parameters |
Controller | datCtlSep | datCtlSep(cfg(have_pumHeaWat... | Controller parameters |
Controller | datCtlHea | datCtlHea(cfg(have_pumHeaWat... | Controller parameters |
HeatPumpGroup | datHp | datHp(final nHp=2, final typ... | HP parameters |
PumpMultiple | datPumPriCom | datPumPriCom(typ=Buildings.T... | Primary pump parameters |
PumpMultiple | datPumHeaWat | datPumHeaWat(typ=Buildings.T... | Dedicated primary HW pump parameters |
PumpMultiple | datPumChiWat | datPumChiWat(typ=Buildings.T... | Dedicated primary CHW pump parameters |
PumpMultiple | datPumHeaWatHea | datPumHeaWatHea(typ=Building... | Dedicated primary HW pump parameters – Heating-only system |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package Medium | CHW/HW medium |
Bus | busPla | Plant control bus |
Bus | busPla1 | Plant control bus |
Bus | busPla2 | Plant control bus |
Modelica definition
model PumpsPrimaryDedicated
extends Modelica.Icons.Example;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Boolean use_spePumIni = false
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial
;
parameter Real r_N[pumPriHea.nPum](
each final fixed=false,
each start=1,
each final unit="1")
;
parameter Real r_NDef[pumPriHea.nPum](
each start=1,
each final unit="1")=
fill(0.85, pumPriHea.nPum)
;
parameter Data.Controller datCtl(
cfg(
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=false,
have_valHpInlIso=true,
have_chiWat=true,
have_pumChiWatPriDed=false,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=true,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=0,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtl.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtl.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtl.cfg.nHp)})
;
parameter Data.Controller datCtlNoDed(
cfg(
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=false,
have_valHpInlIso=true,
have_chiWat=true,
have_pumChiWatPriDed=false,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=true,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Headered,
nHp=2,
nPumHeaWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=0,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlNoDed.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlNoDed.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtlNoDed.cfg.nHp)})
;
parameter Data.Controller datCtlSep(
cfg(
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=false,
have_valHpInlIso=true,
have_chiWat=true,
have_pumChiWatPriDed=true,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=true,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
nPumChiWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlSep.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlSep.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtlSep.cfg.nHp)})
;
parameter Data.Controller datCtlHea(
cfg(
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=false,
have_valHpInlIso=false,
have_chiWat=false,
have_pumChiWatPriDed=false,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=false,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
nPumChiWatPri=0,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlHea.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlHea.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtlHea.cfg.nHp)})
;
parameter Data.HeatPumpGroup datHp(
final nHp=2,
final typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
final is_rev=true,
final typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
mHeaWatHp_flow_nominal=datHp.capHeaHp_nominal /
abs(datHp.THeaWatSupHp_nominal -
Buildings.Templates.Data.Defaults.THeaWatRetMed) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
dpHeaWatHp_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp,
capHeaHp_nominal=500E3,
THeaWatSupHp_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TSouHeaHp_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow,
mChiWatHp_flow_nominal=datHp.capCooHp_nominal /
abs(datHp.TChiWatSupHp_nominal -
Buildings.Templates.Data.Defaults.TChiWatRet) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
capCooHp_nominal=500E3,
TChiWatSupHp_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
TSouCooHp_nominal=Buildings.Templates.Data.Defaults.TOutHpCoo,
perFitHp(
hea(
P=datHp.capHeaHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwHea,
coeQ={- 4.2670305442, - 0.7381077035, 6.0049480456, 0, 0},
coeP={- 4.9107455513, 5.3665308366, 0.5447612754, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow),
coo(
P=datHp.capCooHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwCoo,
coeQ={- 2.2545246871, 6.9089257665, - 3.6548225094, 0, 0},
coeP={- 5.8086010402, 1.6894933858, 5.1167787436, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.TChiWatRet,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpCoo)))
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumPriCom(
typ=Buildings.Templates.Components.Types.Pump.Multiple,
nPum=datHp.nHp,
m_flow_nominal=
fill(
max(datHp.mHeaWatHp_flow_nominal, datHp.mChiWatHp_flow_nominal),
datHp.nHp),
dp_nominal=
fill(
max(datHp.dpHeaWatHp_nominal, datHp.dpChiWatHp_nominal) +
Buildings.Templates.Data.Defaults.dpValChe +
max(
max(valChiWatIsoCom.dpValve_nominal),
max(valHeaWatIsoCom.dpValve_nominal)), datHp.nHp))
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumHeaWat(
typ=Buildings.Templates.Components.Types.Pump.Multiple,
nPum=datHp.nHp,
m_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, datHp.nHp),
dp_nominal=
fill(datHp.dpHeaWatHp_nominal + Buildings.Templates.Data.Defaults.dpValChe
+
max(valHeaWatIsoCom.dpValve_nominal), datHp.nHp))
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumChiWat(
typ=Buildings.Templates.Components.Types.Pump.Multiple,
nPum=datHp.nHp,
m_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, datHp.nHp),
dp_nominal=
fill(datHp.dpChiWatHp_nominal + Buildings.Templates.Data.Defaults.dpValChe
+
max(valHeaWatIsoCom.dpValve_nominal), datHp.nHp))
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumHeaWatHea(
typ=Buildings.Templates.Components.Types.Pump.Multiple,
nPum=datHp.nHp,
m_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, datHp.nHp),
dp_nominal=1.5 *
fill(datHp.dpHeaWatHp_nominal + Buildings.Templates.Data.Defaults.dpValChe
+
max(valHeaWatIsoCom.dpValve_nominal), datHp.nHp))
;
final parameter Buildings.Templates.Components.Data.PumpSingle datPumSin[
pumPriCom.nHp](
each typ=datPumPriCom.typ,
m_flow_nominal=datPumPriCom.m_flow_nominal,
dp_nominal=datPumPriCom.dp_nominal,
per=datPumPriCom.per,
each rho_default=datPumPriCom.rho_default)
;
final parameter Buildings.Templates.Components.Data.PumpSingle datPumHeaWatHeaSin[pumPriHea.nHp](
each typ=datPumHeaWatHea.typ,
m_flow_nominal=datPumHeaWatHea.m_flow_nominal,
dp_nominal=datPumHeaWatHea.dp_nominal,
per=datPumHeaWatHea.per,
each rho_default=datPumHeaWatHea.rho_default)
;
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated
pumPriCom(
redeclare final package Medium =
Medium,
nHp=2,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
have_pumChiWatPriDed=false,
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
datPumHeaWat=datPumPriCom,
final energyDynamics=energyDynamics)
;
Fluid.FixedResistances.PressureDrop hpCom[pumPriCom.nHp](
redeclare each final package Medium =
Medium,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dp_nominal=datHp.dpHeaWatHp_nominal) ;
Fluid.Sources.Boundary_pT ret(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=datHp.nHp)
;
Controls.OpenLoop ctl(
final cfg=datCtl.cfg,
final dat=datCtl)
;
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated
pumPriNoDed(
redeclare final package Medium =
Medium,
nHp=2,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Headered,
have_pumChiWatPriDed=false,
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
datPumHeaWat=datPumPriCom,
final energyDynamics=energyDynamics)
;
Fluid.FixedResistances.PressureDrop hpHdr[pumPriCom.nHp](
redeclare each final package Medium =
Medium,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dp_nominal=datHp.dpHeaWatHp_nominal)
;
Fluid.Sources.Boundary_pT ret1(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=datHp.nHp)
;
Controls.OpenLoop ctlNoDed(
final cfg=datCtlNoDed.cfg,
final dat=datCtlNoDed)
;
Buildings.Templates.Components.Pumps.Multiple pumPriHdr(
have_var=false,
final energyDynamics=energyDynamics,
nPum=2,
dat=datPumPriCom) ;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus busPla
;
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated pumPriSep(
redeclare final package Medium=
Medium,
nHp=2,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
have_pumChiWatPriDed=true,
have_pumHeaWatPriVar=false,
have_pumChiWatPriVar=false,
datPumHeaWat=datPumHeaWat,
final datPumChiWat=datPumChiWat,
final energyDynamics=energyDynamics)
;
Fluid.Sources.Boundary_pT ret2(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=datHp.nHp)
;
Controls.OpenLoop ctlSep(
final cfg=datCtlSep.cfg,
final dat=datCtlSep)
;
Fluid.FixedResistances.PressureDrop hpSep[pumPriCom.nHp](
redeclare each final package Medium =
Medium,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dp_nominal=datHp.dpHeaWatHp_nominal) ;
Buildings.Templates.Components.Actuators.Valve valHeaWatIsoCom[datHp.nHp](
redeclare each final package Medium =
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso,
dpFixed_nominal=
Buildings.Templates.Utilities.computeBalancingPressureDrop(
m_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, datHp.nHp),
dp_nominal=pumPriCom.dpValCheHeaWat_nominal*(datHp.mHeaWatHp_flow_nominal
/
max(datHp.mHeaWatHp_flow_nominal, datHp.mChiWatHp_flow_nominal))^2 .+
fill(datHp.dpHeaWatHp_nominal, datHp.nHp) .+ valHeaWatIsoCom.dpValve_nominal,
datPum=datPumSin)),
each from_dp=true) ;
Buildings.Templates.Components.Actuators.Valve valChiWatIsoCom[datHp.nHp](
redeclare each final package Medium =
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mChiWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso,
dpFixed_nominal=
Buildings.Templates.Utilities.computeBalancingPressureDrop(
m_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, datHp.nHp),
dp_nominal=pumPriCom.dpValCheHeaWat_nominal*(datHp.mChiWatHp_flow_nominal
/
max(datHp.mHeaWatHp_flow_nominal, datHp.mChiWatHp_flow_nominal))^2 .+
fill(datHp.dpChiWatHp_nominal, datHp.nHp) .+ valChiWatIsoCom.dpValve_nominal,
datPum=datPumSin)),
each from_dp=true) ;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus busPla1
;
Buildings.Templates.Components.Actuators.Valve valChiWatIsoHdr[datHp.nHp](
redeclare each final package Medium =
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mChiWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso,
dpFixed_nominal=
Buildings.Templates.Utilities.computeBalancingPressureDrop(
m_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, datHp.nHp),
dp_nominal=pumPriHdr.dpValChe_nominal*(datHp.mChiWatHp_flow_nominal/
max(datHp.mHeaWatHp_flow_nominal, datHp.mChiWatHp_flow_nominal))^2 .+
fill(datHp.dpChiWatHp_nominal, datHp.nHp) .+ valChiWatIsoCom.dpValve_nominal,
datPum=datPumSin)),
each from_dp=true) ;
Buildings.Templates.Components.Actuators.Valve valHeaWatIsoHdr[datHp.nHp](
redeclare each final package Medium =
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso,
dpFixed_nominal=
Buildings.Templates.Utilities.computeBalancingPressureDrop(
m_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, datHp.nHp),
dp_nominal=pumPriHdr.dpValChe_nominal*(datHp.mHeaWatHp_flow_nominal/
max(datHp.mHeaWatHp_flow_nominal, datHp.mChiWatHp_flow_nominal))^2 .+
fill(datHp.dpHeaWatHp_nominal, datHp.nHp) .+ valHeaWatIsoCom.dpValve_nominal,
datPum=datPumSin)),
each from_dp=true) ;
Buildings.Templates.Components.Actuators.Valve valHeaWatIsoSep[datHp.nHp](
redeclare each final package Medium=
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso),
each from_dp=true,
each linearized=true)
;
Buildings.Templates.Components.Actuators.Valve valChiWatIsoSep[datHp.nHp](
redeclare each final package Medium=
Medium,
each typ=Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition,
dat(
each m_flow_nominal=datHp.mChiWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValIso),
each from_dp=true,
each linearized=true)
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus busPla2
;
Buildings.Templates.Plants.HeatPumps.Components.PumpsPrimaryDedicated pumPriHea(
redeclare final package Medium=
Medium,
nHp=2,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
have_pumChiWatPriDed=false,
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
datPumHeaWat=datPumHeaWatHea,
final energyDynamics=energyDynamics)
;
Fluid.Sources.Boundary_pT ret3(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=1)
;
Controls.OpenLoop ctlHea(
final cfg=datCtlHea.cfg,
final dat=datCtlHea,
yPumHeaWatPriDed(k=r_N))
;
Fluid.FixedResistances.PressureDrop hpHea[pumPriCom.nHp](
redeclare each final package Medium =
Medium,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dp_nominal=datHp.dpHeaWatHp_nominal) ;
Fluid.FixedResistances.PressureDrop priHeaWat(
redeclare final package Medium=
Medium,
final m_flow_nominal=
sum(datPumHeaWat.m_flow_nominal),
final dp_nominal=0)
;
initial equation
if use_spePumIni
then
fill(0, pumPriHea.nHp)=
Buildings.Templates.Utilities.computeBalancingPressureDrop(
m_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, pumPriHea.nHp),
dp_nominal=pumPriHea.dpValCheHeaWat_nominal .+
fill(datHp.dpHeaWatHp_nominal, pumPriHea.nHp) .+
fill(Buildings.Templates.Data.Defaults.dpValIso, pumPriHea.nHp),
datPum=datPumHeaWatHeaSin,
r_N=r_N);
else
r_N=r_NDef;
end if;
equation
for i
in 1:(pumPriHea.nHp)
loop
connect(pumPriHea.ports_bChiHeaWat[i], priHeaWat.port_a);
connect(priHeaWat.port_b, pumPriHea.ports_aChiHeaWat[i]);
end for;
connect(pumPriCom.ports_bChiHeaWatHp, hpCom.port_a);
connect(hpCom.port_b, pumPriCom.ports_aChiHeaWatHp);
connect(pumPriNoDed.ports_bChiHeaWatHp, hpHdr.port_a);
connect(hpHdr.port_b, pumPriNoDed.ports_aChiHeaWatHp);
connect(pumPriNoDed.ports_bChiHeaWat, pumPriHdr.ports_a);
connect(ctlNoDed.bus, busPla);
connect(busPla.pumHeaWatPri, pumPriHdr.bus);
connect(pumPriSep.ports_bChiHeaWatHp, hpSep.port_a);
connect(hpSep.port_b, pumPriSep.ports_aChiHeaWatHp);
connect(pumPriCom.ports_bChiHeaWat, valHeaWatIsoCom.port_a);
connect(valHeaWatIsoCom.port_b, pumPriCom.ports_aChiHeaWat);
connect(pumPriCom.ports_bChiHeaWat, valChiWatIsoCom.port_a);
connect(valChiWatIsoCom.port_b, pumPriCom.ports_aChiHeaWat);
connect(ctl.bus, busPla1);
connect(busPla1.valHeaWatHpInlIso, valHeaWatIsoCom.bus);
connect(busPla1.valChiWatHpInlIso, valChiWatIsoCom.bus);
connect(ret.ports, valHeaWatIsoCom.port_b);
connect(pumPriHdr.ports_b, valChiWatIsoHdr.port_a);
connect(pumPriHdr.ports_b, valHeaWatIsoHdr.port_a);
connect(valHeaWatIsoHdr.port_b, pumPriNoDed.ports_aChiHeaWat);
connect(valChiWatIsoHdr.port_b, pumPriNoDed.ports_aChiHeaWat);
connect(ret1.ports, valHeaWatIsoHdr.port_b);
connect(busPla.valHeaWatHpInlIso, valHeaWatIsoHdr.bus);
connect(busPla.valChiWatHpInlIso, valChiWatIsoHdr.bus);
connect(busPla1, pumPriCom.bus);
connect(busPla2.valHeaWatHpInlIso, valHeaWatIsoSep.bus);
connect(busPla2.valChiWatHpInlIso, valChiWatIsoSep.bus);
connect(ctlSep.bus, busPla2);
connect(pumPriSep.ports_bHeaWat, valHeaWatIsoSep.port_a);
connect(pumPriSep.ports_bChiWat, valChiWatIsoSep.port_a);
connect(valHeaWatIsoSep.port_b, pumPriSep.ports_aChiHeaWat);
connect(valChiWatIsoSep.port_b, pumPriSep.ports_aChiHeaWat);
connect(busPla2, pumPriSep.bus);
connect(pumPriHea.ports_bChiHeaWatHp, hpHea.port_a);
connect(hpHea.port_b, pumPriHea.ports_aChiHeaWatHp);
connect(ctlHea.bus, pumPriHea.bus);
connect(ret2.ports, valHeaWatIsoSep.port_b);
connect(ret3.ports[1], priHeaWat.port_b);
end PumpsPrimaryDedicated;
Validation model for isolation valve component
Information
This model validates the model
Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation
for the following configurations.
-
Heating and cooling system with common dedicated primary HW and CHW pumps
and isolation valves at both heat pump inlet and outlet:
component
valIsoCom
.
-
Heating-only system with isolation valves at heat pump inlet:
component
valIsoHeaInl
.
-
Heating and cooling system with separate dedicated primary HW and CHW pumps
and isolation valves at heat pump inlet:
component
valIsoSep
.
In each configuration, two identical heat pumps are represented by fixed
flow resistances (components hp*
).
The model uses open loop controls and the simulation allows verifying that design
flow is obtained in each loop and each heat pump when the valves are open.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Controller | typCtl | Buildings.Templates.Plants.H... | |
replaceable package Medium | Buildings.Media.Water | CHW/HW medium |
Controller | datCtl | datCtl(cfg(have_pumHeaWatPri... | Controller parameters |
Controller | datCtlHeaInl | datCtlHeaInl(cfg(have_pumHea... | Controller parameters |
Controller | datCtlSep | datCtlSep(cfg(have_pumHeaWat... | Controller parameters |
HeatPumpGroup | datHp | datHp(final nHp=2, final typ... | HP parameters |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Connectors
Type | Name | Description |
replaceable package Medium | CHW/HW medium |
Bus | busPla | Plant controller |
Bus | busPumHeaWatPri | Primary HW pump control bus |
Bus | busPumChiWatPri | Primary CHW pump control bus |
Modelica definition
model ValvesIsolation
extends Modelica.Icons.Example;
parameter Buildings.Templates.Plants.HeatPumps.Types.Controller typCtl=
Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop;
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial
;
parameter Data.Controller datCtl(
cfg(
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=valIsoCom.have_valHpOutIso,
have_valHpInlIso=valIsoCom.have_valHpInlIso,
have_chiWat=valIsoCom.have_chiWat,
have_pumChiWatPriDed=valIsoCom.have_pumChiWatPriDed,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=true,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=0,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max,
datCtl.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max,
datCtl.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtl.cfg.nHp)}) ;
parameter Data.Controller datCtlHeaInl(
cfg(
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=valIsoHeaInl.have_valHpOutIso,
have_valHpInlIso=valIsoHeaInl.have_valHpInlIso,
have_chiWat=valIsoHeaInl.have_chiWat,
have_pumChiWatPriDed=valIsoHeaInl.have_pumChiWatPriDed,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.None,
is_rev=false,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=0,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlHeaInl.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlHeaInl.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtlHeaInl.cfg.nHp)})
;
parameter Data.Controller datCtlSep(
cfg(
have_pumHeaWatPriVar=true,
have_pumChiWatPriVar=false,
have_inpSch=false,
have_hrc=false,
have_valHpOutIso=valIsoSep.have_valHpOutIso,
have_valHpInlIso=valIsoSep.have_valHpInlIso,
have_chiWat=valIsoSep.have_chiWat,
have_pumChiWatPriDed=valIsoSep.have_pumChiWatPriDed,
typPumHeaWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumChiWatPri=Buildings.Templates.Plants.HeatPumps.Types.PumpsPrimary.Variable,
typPumHeaWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
typDis=Buildings.Templates.Plants.HeatPumps.Types.Distribution.Constant1Only,
nPumChiWatSec=0,
rhoHeaWat_default=Buildings.Media.Water.d_const,
typCtl=Buildings.Templates.Plants.HeatPumps.Types.Controller.OpenLoop,
is_rev=true,
typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
rhoChiWat_default=Buildings.Media.Water.d_const,
cpChiWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_hotWat=false,
have_valChiWatMinByp=false,
have_valHeaWatMinByp=false,
typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
cpHeaWat_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
cpSou_default=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
have_senDpChiWatRemWir=true,
typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Dedicated,
nHp=2,
nPumHeaWatPri=2,
have_heaWat=true,
nPumHeaWatSec=0,
rhoSou_default=Buildings.Media.Air.dStp,
have_senDpHeaWatRemWir=true,
typPumChiWatSec=Buildings.Templates.Plants.HeatPumps.Types.PumpsSecondary.None,
nPumChiWatPri=2,
nSenDpHeaWatRem=0,
nSenDpChiWatRem=0,
nAirHan=0,
nEquZon=0),
THeaWatSup_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TChiWatSup_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
dpChiWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpChiWatRemSet_max, datCtlSep.cfg.nSenDpChiWatRem),
dpHeaWatRemSet_max=
fill(Buildings.Templates.Data.Defaults.dpHeaWatRemSet_max, datCtlSep.cfg.nSenDpHeaWatRem),
staEqu={
fill(1, datCtlSep.cfg.nHp)})
;
parameter Data.HeatPumpGroup datHp(
final nHp=2,
final typ=Buildings.Templates.Components.Types.HeatPump.AirToWater,
final is_rev=true,
final typMod=Buildings.Templates.Components.Types.HeatPumpModel.EquationFit,
mHeaWatHp_flow_nominal=datHp.capHeaHp_nominal /
abs(datHp.THeaWatSupHp_nominal -
Buildings.Templates.Data.Defaults.THeaWatRetMed) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
dpHeaWatHp_nominal=Buildings.Templates.Data.Defaults.dpHeaWatHp,
capHeaHp_nominal=500E3,
THeaWatSupHp_nominal=Buildings.Templates.Data.Defaults.THeaWatSupMed,
TSouHeaHp_nominal=Buildings.Templates.Data.Defaults.TOutHpHeaLow,
mChiWatHp_flow_nominal=datHp.capCooHp_nominal /
abs(datHp.TChiWatSupHp_nominal -
Buildings.Templates.Data.Defaults.TChiWatRet) / Buildings.Utilities.Psychrometrics.Constants.cpWatLiq,
capCooHp_nominal=500E3,
TChiWatSupHp_nominal=Buildings.Templates.Data.Defaults.TChiWatSup,
TSouCooHp_nominal=Buildings.Templates.Data.Defaults.TOutHpCoo,
perFitHp(
hea(
P=datHp.capHeaHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwHea,
coeQ={- 4.2670305442, - 0.7381077035, 6.0049480456, 0, 0},
coeP={- 4.9107455513, 5.3665308366, 0.5447612754, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.THeaWatRetMed,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpHeaLow),
coo(
P=datHp.capCooHp_nominal / Buildings.Templates.Data.Defaults.COPHpAwCoo,
coeQ={- 2.2545246871, 6.9089257665, - 3.6548225094, 0, 0},
coeP={- 5.8086010402, 1.6894933858, 5.1167787436, 0, 0},
TRefLoa=Buildings.Templates.Data.Defaults.TChiWatRet,
TRefSou=Buildings.Templates.Data.Defaults.TOutHpCoo)))
;
Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation valIsoCom(
redeclare final package Medium =
Medium,
nHp=2,
have_chiWat=true,
have_valHpInlIso=true,
have_valHpOutIso=true,
have_pumChiWatPriDed=false,
final mHeaWatHp_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, valIsoCom.nHp),
dpHeaWatHp_nominal=
fill(datHp.dpHeaWatHp_nominal, valIsoCom.nHp),
mChiWatHp_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, valIsoCom.nHp),
final energyDynamics=energyDynamics,
y_start=0)
;
Fluid.FixedResistances.PressureDrop hpCom[valIsoCom.nHp](
redeclare each final package Medium =
Medium,
m_flow_nominal=valIsoCom.mHeaWatHp_flow_nominal,
dp_nominal=
fill(0, valIsoCom.nHp))
;
Fluid.Sources.Boundary_pT retChiWat(
redeclare final package Medium =
Medium,
p=supChiWat.p +
max(valIsoCom.dpChiWat_nominal),
T=Buildings.Templates.Data.Defaults.TChiWatRet,
nPorts=1) ;
Fluid.Sources.Boundary_pT retHeaWat(
redeclare final package Medium =
Medium,
p=supHeaWat.p +
max(valIsoCom.dpHeaWat_nominal),
T=Buildings.Templates.Data.Defaults.THeaWatRetMed,
nPorts=1) ;
Fluid.Sources.Boundary_pT supChiWat(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pChiWat_rel_nominal + 101325,
nPorts=1)
;
Fluid.Sources.Boundary_pT supHeaWat(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=1)
;
Controls.OpenLoop ctl(
final cfg=datCtl.cfg,
final dat=datCtl)
;
Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation valIsoHeaInl(
redeclare final package Medium =
Medium,
nHp=2,
have_chiWat=false,
have_pumChiWatPriDed=false,
have_valHpInlIso=true,
have_valHpOutIso=false,
final mHeaWatHp_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, valIsoCom.nHp),
dpHeaWatHp_nominal=
fill(datHp.dpHeaWatHp_nominal, valIsoCom.nHp),
mChiWatHp_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, valIsoCom.nHp),
final energyDynamics=energyDynamics,
y_start=0)
;
Fluid.FixedResistances.PressureDrop hpHea[valIsoHeaInl.nHp](
redeclare each final package Medium=
Medium,
m_flow_nominal=valIsoHeaInl.mHeaWatHp_flow_nominal,
dp_nominal=
fill(0, valIsoHeaInl.nHp))
;
Fluid.Sources.Boundary_pT retHeaWat1(
redeclare final package Medium=
Medium,
p=supHeaWat1.p +
max(valIsoHeaInl.dpHeaWat_nominal),
T=Buildings.Templates.Data.Defaults.THeaWatRetMed,
nPorts=1)
;
Fluid.Sources.Boundary_pT supHeaWat1(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=1)
;
Controls.OpenLoop ctlHeaInl(
final cfg=datCtlHeaInl.cfg,
final dat=datCtlHeaInl)
;
Buildings.Templates.Plants.HeatPumps.Components.ValvesIsolation valIsoSep(
redeclare final package Medium =
Medium,
nHp=2,
have_chiWat=true,
have_valHpInlIso=true,
have_valHpOutIso=false,
have_pumChiWatPriDed=true,
final mHeaWatHp_flow_nominal=
fill(datHp.mHeaWatHp_flow_nominal, valIsoCom.nHp),
dpHeaWatHp_nominal=
fill(datHp.dpHeaWatHp_nominal, valIsoCom.nHp),
mChiWatHp_flow_nominal=
fill(datHp.mChiWatHp_flow_nominal, valIsoCom.nHp),
final energyDynamics=energyDynamics,
y_start=0,
from_dp=false)
;
Fluid.FixedResistances.PressureDrop hpSep[valIsoSep.nHp](
redeclare each final package Medium=
Medium,
m_flow_nominal=valIsoSep.mHeaWatHp_flow_nominal,
dp_nominal=
fill(0, valIsoSep.nHp))
;
Fluid.Sources.Boundary_pT supHeaWat2(
redeclare final package Medium=
Medium,
p=Buildings.Templates.Data.Defaults.pHeaWat_rel_nominal + 101325,
nPorts=2)
;
Controls.OpenLoop ctlSep(
final cfg=datCtlSep.cfg,
final dat=datCtlSep)
;
Fluid.Movers.Preconfigured.SpeedControlled_y pumChiWatPri[2](
redeclare each final package Medium=
Medium,
each addPowerToMedium=false,
each m_flow_nominal=datHp.mChiWatHp_flow_nominal,
each final energyDynamics=energyDynamics,
dp_nominal=valIsoSep.dpChiWat_nominal + cheValChiWat.dpValve_nominal)
;
Fluid.Movers.Preconfigured.SpeedControlled_y pumHeaWatPri[2](
redeclare each final package Medium=
Medium,
each addPowerToMedium=false,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each final energyDynamics=energyDynamics,
dp_nominal=valIsoSep.dpHeaWat_nominal + cheValHeaWat.dpValve_nominal)
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus busPla
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal yPumHeaWatPri[2]
;
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal yPumChiWatPri[2]
;
Buildings.Templates.Components.Interfaces.Bus busPumHeaWatPri
;
Buildings.Templates.Components.Interfaces.Bus busPumChiWatPri
;
Fluid.FixedResistances.CheckValve cheValHeaWat[2](
redeclare each final package Medium=
Medium,
each m_flow_nominal=datHp.mHeaWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValChe)
;
Fluid.FixedResistances.CheckValve cheValChiWat[2](
redeclare each final package Medium=
Medium,
each m_flow_nominal=datHp.mChiWatHp_flow_nominal,
each dpValve_nominal=Buildings.Templates.Data.Defaults.dpValChe)
;
equation
connect(retHeaWat.ports[1], valIsoCom.port_aHeaWat);
connect(retChiWat.ports[1], valIsoCom.port_aChiWat);
connect(valIsoCom.port_bChiWat, supChiWat.ports[1]);
connect(valIsoCom.port_bHeaWat, supHeaWat.ports[1]);
connect(ctl.bus, valIsoCom.bus);
connect(retHeaWat1.ports[1], valIsoHeaInl.port_aHeaWat);
connect(valIsoHeaInl.port_bHeaWat, supHeaWat1.ports[1]);
connect(ctlHeaInl.bus, valIsoHeaInl.bus);
connect(valIsoCom.ports_bChiHeaWatHp, hpCom.port_a);
connect(hpCom.port_b, valIsoCom.ports_aChiHeaWatHp);
connect(valIsoHeaInl.ports_bChiHeaWatHp, hpHea.port_a);
connect(hpHea.port_b, valIsoHeaInl.ports_aChiHeaWatHp);
connect(valIsoSep.port_bHeaWat, supHeaWat2.ports[1]);
connect(ctlSep.bus, valIsoSep.bus);
connect(valIsoSep.ports_bChiHeaWatHp, hpSep.port_a);
connect(supHeaWat2.ports[2], valIsoSep.port_aHeaWat);
connect(ctlSep.bus, busPla);
connect(busPla.pumHeaWatPri, busPumHeaWatPri);
connect(busPumHeaWatPri.y1, yPumHeaWatPri.u);
connect(yPumHeaWatPri.y, pumHeaWatPri.y);
connect(busPla.pumChiWatPri, busPumChiWatPri);
connect(busPumChiWatPri.y1, yPumChiWatPri.u);
connect(yPumChiWatPri.y, pumChiWatPri.y);
connect(pumHeaWatPri.port_b, cheValHeaWat.port_a);
connect(cheValHeaWat.port_b, valIsoSep.ports_aHeaWatHp);
connect(cheValChiWat.port_b, valIsoSep.ports_aChiWatHp);
connect(pumChiWatPri.port_b, cheValChiWat.port_a);
connect(hpSep.port_b, pumChiWatPri.port_a);
connect(hpSep.port_b, pumHeaWatPri.port_a);
connect(valIsoSep.port_bChiWat, valIsoSep.port_aChiWat);
end ValvesIsolation;