Package with component models
Information
This package contains component models that are used in the templates
within
Buildings.Templates.Plants.HeatPumps.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name |
Description |
HeatRecoveryChiller
|
Heat recovery chiller for sidestream integration |
PumpsPrimaryDedicated
|
Dedicated primary pumps |
ValvesIsolation
|
Heat pump isolation valves |
Controls
|
Controllers |
HeatPumpGroups
|
Models for heat pump groups |
Data
|
Records for design and operating parameters |
Validation
|
Package with validation models |
Interfaces
|
Interface classes |
Heat recovery chiller for sidestream integration
Information
Model of a heat recovery chiller with constant speed CHW and HW pumps.
The model is intended to represent the sidestream integration of a HRC
into a heating and cooling plant.
In such a configuration, the condenser is connected to the HW
return and the evaporator is connected to the CHW return.
Control points
The following input and output points are available.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | PartialMedium | Medium 1 in the component |
replaceable package Medium2 | PartialMedium | Medium 2 in the component |
replaceable package MediumChiWat | Buildings.Media.Water | CHW medium |
replaceable package MediumHeaWat | Buildings.Media.Water | HW medium |
PumpSingle | datPumChiWat | | HRC CHW pump parameters |
PumpSingle | datPumHeaWat | | HRC HW pump parameters |
Chiller | datHrc | | HRC parameters |
Nominal condition |
MassFlowRate | m1_flow_nominal | datHrc.mCon_flow_nominal | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | datHrc.mChiWat_flow_nominal | Nominal mass flow rate [kg/s] |
Assumptions |
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
Advanced |
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Dynamics |
Nominal condition |
Time | tauHrc | 30 | HRC – Time constant at nominal flow, used if energy or mass balance is dynamic [s] |
Time | tauPum | 1 | Pump – Time constant of fluid volume for nominal flow, used if energy or mass balance is dynamic [s] |
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 Medium1 | Medium 1 in the component |
replaceable package Medium2 | Medium 2 in the component |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
replaceable package MediumChiWat | CHW medium |
replaceable package MediumHeaWat | HW medium |
Bus | bus | Plant control bus |
Modelica definition
model HeatRecoveryChiller
extends Buildings.Fluid.Interfaces.PartialFourPortInterface(
redeclare final package Medium1=
MediumHeaWat,
redeclare final package Medium2=
MediumChiWat,
final m1_flow_nominal=datHrc.mCon_flow_nominal,
final m2_flow_nominal=datHrc.mChiWat_flow_nominal);
replaceable package MediumChiWat=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
replaceable package MediumHeaWat=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Buildings.Templates.Components.Data.PumpSingle datPumChiWat
;
parameter Buildings.Templates.Components.Data.PumpSingle datPumHeaWat
;
parameter Buildings.Templates.Components.Data.Chiller datHrc
;
parameter Modelica.Units.SI.Time tauHrc=30
;
parameter Modelica.Units.SI.Time tauPum=1
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus
;
Buildings.Templates.Components.Chillers.Compression hrc(
redeclare final package MediumChiWat=
MediumChiWat,
redeclare final package MediumCon=
MediumHeaWat,
final dat=datHrc,
final typ=Buildings.Templates.Components.Types.Chiller.WaterCooled,
final have_switchover=true,
final energyDynamics=energyDynamics,
final tau=tauHrc,
final allowFlowReversal1=allowFlowReversal1,
final allowFlowReversal2=allowFlowReversal2,
final show_T=show_T)
;
Buildings.Templates.Components.Pumps.Single pumChiWat(
have_var=false,
have_valChe=false,
redeclare final package Medium=
MediumChiWat,
final dat=datPumChiWat,
final energyDynamics=energyDynamics,
final tau=tauPum,
final allowFlowReversal=allowFlowReversal2,
final show_T=show_T)
;
Buildings.Templates.Components.Pumps.Single pumHeaWat(
have_var=false,
have_valChe=false,
redeclare final package Medium=
MediumHeaWat,
final dat=datPumHeaWat,
final energyDynamics=energyDynamics,
final tau=tauPum,
final allowFlowReversal=allowFlowReversal1,
final show_T=show_T)
;
equation
connect(port_a1, pumHeaWat.port_a);
connect(port_a2, pumChiWat.port_a);
connect(pumChiWat.port_b, hrc.port_a2);
connect(hrc.port_b2, port_b2);
connect(pumHeaWat.port_b, hrc.port_a1);
connect(hrc.port_b1, port_b1);
connect(bus.hrc, hrc.bus);
connect(bus.pumHeaWatHrc, pumHeaWat.bus);
connect(bus.pumChiWatHrc, pumChiWat.bus);
end HeatRecoveryChiller;
Dedicated primary pumps
Information
This model represents dedicated primary HW pumps and, optionally,
separate dedicated primary CHW pumps if the parameter
have_pumChiWatPriDed
is set to true.
The pump components are connected to the heat pump outlet,
in a "pump away" configuration.
Variable speed or constant speed pumps can be modeled by
setting the parameters have_pumHeaWatPriVar
and have_pumChiWatPriVar
.
If headered pumps are modeled
(typArrPumPri=Buildings.Templates.Components.Types.PumpArrangement.Headered
),
this component resolves to a direct fluid pass-through.
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium model |
PumpMultiple | datPumHeaWat | datPumHeaWat(typ=if typArrPu... | HW pump parameters |
PumpMultiple | datPumChiWat | datPumChiWat(typ=if have_pum... | CHW pump parameters |
Configuration |
Integer | nHp | | Number of heat pumps |
PumpArrangement | typArrPumPri | | Type of primary pump arrangement |
Boolean | have_pumChiWatPriDed | | Set to true for plants with separate dedicated primary CHW pumps |
Boolean | have_pumHeaWatPriVar | | Set to true for variable speed primary HW pumps |
Boolean | have_pumChiWatPriVar | | Set to true for variable speed primary CHW pumps |
Nominal condition |
PressureDifference | dpValCheHeaWat_nominal[nPum] | fill(if typArrPumPri == Buil... | HW pump check valve pressure drop at design pump flow rate (selection conditions) [Pa] |
PressureDifference | dpValCheChiWat_nominal[if have_pumChiWatPriDed then nPum else 0] | fill(if have_pumChiWatPriDed... | CHW pump check valve pressure drop at design pump flow rate (selection conditions) [Pa] |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Nominal condition |
Time | tau | 1 | Time constant at nominal flow [s] |
Assumptions |
Boolean | allowFlowReversal | true | Set to false to simplify equations, assuming, but not enforcing, no flow reversal |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
FluidPorts_b | ports_bChiHeaWat[nHp] | CHW/HW supply (to primary loop) |
FluidPorts_a | ports_aChiHeaWat[nHp] | CHW/HW return (from primary loop) |
FluidPorts_b | ports_bChiHeaWatHp[nHp] | CHW/HW return (HP entering) |
FluidPorts_b | ports_bHeaWat[nHp] | HW supply (to primary loop) |
FluidPorts_b | ports_bChiWat[nHp] | CHW supply (to primary loop) |
FluidPorts_a | ports_aChiHeaWatHp[nHp] | CHW/HW supply (HP leaving) |
Bus | bus | Plant control bus |
Modelica definition
model PumpsPrimaryDedicated
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
parameter Integer nHp(min=1)
;
final parameter Integer nPum=
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then nHp
else 0
;
parameter Buildings.Templates.Components.Types.PumpArrangement typArrPumPri
;
parameter Boolean have_pumChiWatPriDed(start=false)
;
parameter Boolean have_pumHeaWatPriVar(start=false)
;
parameter Boolean have_pumChiWatPriVar(start=false)
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumHeaWat(
typ=
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Templates.Components.Types.Pump.Multiple
else Buildings.Templates.Components.Types.Pump.None,
nPum=nPum)
;
parameter Buildings.Templates.Components.Data.PumpMultiple datPumChiWat(
typ=
if have_pumChiWatPriDed
then Buildings.Templates.Components.Types.Pump.Multiple
else Buildings.Templates.Components.Types.Pump.None,
nPum=
if have_pumChiWatPriDed
then nPum
else 0)
;
parameter Modelica.Units.SI.PressureDifference dpValCheHeaWat_nominal[nPum](
each final min=0,
start=
fill(
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Templates.Data.Defaults.dpValChe
else 0, nPum))=
fill(
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
then Buildings.Templates.Data.Defaults.dpValChe
else 0, nPum)
;
parameter Modelica.Units.SI.PressureDifference dpValCheChiWat_nominal[
if have_pumChiWatPriDed
then nPum
else 0](
each final min=0,
start=
fill(
if have_pumChiWatPriDed
then Buildings.Templates.Data.Defaults.dpValChe
else 0,
if have_pumChiWatPriDed
then nPum
else 0))=
fill(
if
have_pumChiWatPriDed
then Buildings.Templates.Data.Defaults.dpValChe
else 0,
if have_pumChiWatPriDed
then nPum
else 0)
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
;
parameter Modelica.Units.SI.Time tau=1
;
parameter Boolean allowFlowReversal=true
;
Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWat[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
max=
if allowFlowReversal
then + Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Headered
or typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and not have_pumChiWatPriDed
;
Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWat[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
max=
if allowFlowReversal
then + Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Modelica.Fluid.Interfaces.FluidPorts_b ports_bHeaWat[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and have_pumChiWatPriDed
;
Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiWat[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and have_pumChiWatPriDed
;
Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus
;
Buildings.Templates.Components.Pumps.Multiple pumHeaWat(
redeclare final package Medium=
Medium,
final have_var=have_pumHeaWatPriVar,
final have_varCom=false,
final nPum=nPum,
final dat=datPumHeaWat,
final dpValChe_nominal=dpValCheHeaWat_nominal,
final allowFlowReversal=allowFlowReversal,
final tau=tau,
final energyDynamics=energyDynamics)
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
;
Buildings.Templates.Components.Pumps.Multiple pumChiWat(
redeclare final package Medium=
Medium,
final have_var=have_pumChiWatPriVar,
final have_varCom=false,
final nPum=
if have_pumChiWatPriDed
then nPum
else 0,
final dat=datPumChiWat,
final dpValChe_nominal=dpValCheChiWat_nominal,
final allowFlowReversal=allowFlowReversal,
final tau=tau,
final energyDynamics=energyDynamics)
if have_pumChiWatPriDed
;
Buildings.Templates.Components.Routing.PassThroughFluid pasHdr[nHp](
redeclare each final package Medium =
Medium)
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Headered
;
Fluid.FixedResistances.Junction junDedSep[nPum](
redeclare each final package Medium =
Medium,
final m_flow_nominal={{
max(datPumHeaWat.m_flow_nominal[i], datPumChiWat.m_flow_nominal[i]),
-datPumHeaWat.m_flow_nominal[i],
-datPumChiWat.m_flow_nominal[i]}
for i
in 1:nPum},
dp_nominal=
fill(
fill(0, 3), nPum),
each final energyDynamics=energyDynamics,
each final portFlowDirection_1=
if allowFlowReversal
then
Modelica.Fluid.Types.PortFlowDirection.Bidirectional
else
Modelica.Fluid.Types.PortFlowDirection.Entering,
each final portFlowDirection_2=
if allowFlowReversal
then
Modelica.Fluid.Types.PortFlowDirection.Bidirectional
else
Modelica.Fluid.Types.PortFlowDirection.Leaving,
each final portFlowDirection_3=
if allowFlowReversal
then
Modelica.Fluid.Types.PortFlowDirection.Bidirectional
else
Modelica.Fluid.Types.PortFlowDirection.Leaving)
if typArrPumPri == Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and have_pumChiWatPriDed
;
Buildings.Templates.Components.Routing.PassThroughFluid pasDedCom[nHp](
redeclare each final package Medium =
Medium)
if typArrPumPri ==
Buildings.Templates.Components.Types.PumpArrangement.Dedicated
and not
have_pumChiWatPriDed
;
protected
Buildings.Templates.Components.Interfaces.Bus busPumHeaWatPri
;
Buildings.Templates.Components.Interfaces.Bus busPumChiWatPri
if have_pumChiWatPriDed
;
equation
connect(bus.pumHeaWatPri, busPumHeaWatPri);
connect(bus.pumChiWatPri, busPumChiWatPri);
connect(pumHeaWat.ports_b, ports_bHeaWat);
connect(pumHeaWat.ports_b, ports_bChiHeaWat);
connect(pumChiWat.ports_b, ports_bChiWat);
connect(busPumHeaWatPri, pumHeaWat.bus);
connect(busPumChiWatPri, pumChiWat.bus);
connect(ports_aChiHeaWat, ports_bChiHeaWatHp);
connect(ports_aChiHeaWatHp, pasHdr.port_a);
connect(pasHdr.port_b, ports_bChiHeaWat);
connect(junDedSep.port_3, pumChiWat.ports_a);
connect(ports_aChiHeaWatHp, pasDedCom.port_a);
connect(pasDedCom.port_b, pumHeaWat.ports_a);
connect(ports_aChiHeaWatHp, junDedSep.port_1);
connect(junDedSep.port_2, pumHeaWat.ports_a);
end PumpsPrimaryDedicated;
Heat pump isolation valves
Information
This model represents the heat pump isolation valves.
The isolation valves are modeled as two-way two-position
valves, which can be located at the heat pump inlet and/or
outlet depending on the settings of the parameters have_valHpInlIso
and have_valHpOutIso
.
It is assumed that the heat pumps always provide heating hot water.
Optionally, chilled water return and supply and the associated isolation valves
can be modeled by setting the parameter have_chiWat
to true.
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium model |
Configuration |
Integer | nHp | | Number of heat pumps |
Boolean | have_chiWat | | Set to true if the plant provides CHW |
Boolean | have_valHpInlIso | | Set to true for isolation valves at HP inlet |
Boolean | have_valHpOutIso | | Set to true for isolation valves at HP outlet |
Boolean | have_pumChiWatPriDed | | Set to true for plants with separate dedicated primary CHW pumps |
Nominal condition |
MassFlowRate | mHeaWatHp_flow_nominal[nHp] | | HW mass flow rate - Each heat pump [kg/s] |
PressureDifference | dpHeaWatHp_nominal[nHp] | | Pressure drop at design HW mass flow rate - Each heat pump [Pa] |
PressureDifference | dpBalHeaWatHp_nominal[nHp] | fill(0, nHp) | Balancing valve pressure drop at design HW mass flow rate - Each heat pump [Pa] |
MassFlowRate | mChiWatHp_flow_nominal[nHp] | | CHW mass flow rate - Each heat pump [kg/s] |
PressureDifference | dpBalChiWatHp_nominal[nHp] | fill(0, nHp) | Balancing valve pressure drop at design CHW mass flow rate - Each heat pump [Pa] |
PressureDifference | dpValveHeaWat_nominal[nHp] | fill(Buildings.Templates.Dat... | HW isolation valve pressure drop (identical for inlet and outlet valves) [Pa] |
PressureDifference | dpValveChiWat_nominal[nHp] | fill(Buildings.Templates.Dat... | Isolation valve CHW pressure drop (identical for inlet and outlet valves) [Pa] |
Dynamics |
Conservation equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Nominal condition |
Time | tau | 10 | Time constant at nominal flow [s] |
Time needed to open or close valve |
Boolean | use_strokeTime | energyDynamics <> Modelica.F... | Set to true to continuously open and close valve |
Time | strokeTime | 120 | Time needed to open or close valve [s] |
Init | init | Modelica.Blocks.Types.Init.I... | Type of initialization (no init/steady state/initial state/initial output) |
Real | y_start | 1 | Initial position of actuator |
Assumptions |
Boolean | allowFlowReversal | true | Set to false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
Boolean | from_dp | true | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearized | false | = true, use linear relation between m_flow and dp for any flow rate |
Connectors
Type | Name | Description |
replaceable package Medium | Medium model |
FluidPort_b | port_bChiWat | CHW supply (to primary loop) |
FluidPort_a | port_aChiWat | CHW return (from primary loop) |
FluidPort_b | port_bHeaWat | HW supply (to primary loop) |
FluidPort_a | port_aHeaWat | HW return (from primary loop) |
FluidPorts_b | ports_bChiHeaWatHp[nHp] | CHW/HW return (HP entering) |
FluidPorts_a | ports_aChiHeaWatHp[nHp] | CHW/HW supply (HP leaving) |
FluidPorts_a | ports_aHeaWatHp[nHp] | HW supply (HP leaving) |
FluidPorts_a | ports_aChiWatHp[nHp] | CHW supply (HP leaving) |
Bus | bus | Plant control bus |
Modelica definition
model ValvesIsolation
replaceable package Medium=
Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
;
final parameter Buildings.Templates.Components.Types.Valve typ=
Buildings.Templates.Components.Types.Valve.TwoWayTwoPosition
;
parameter Integer nHp(
final min=1)
;
parameter Boolean have_chiWat
;
parameter Boolean have_valHpInlIso
;
parameter Boolean have_valHpOutIso
;
parameter Boolean have_pumChiWatPriDed(
start=false)
;
parameter Modelica.Units.SI.MassFlowRate mHeaWatHp_flow_nominal[nHp](
each final min=0,
each start=0)
;
parameter Modelica.Units.SI.PressureDifference dpHeaWatHp_nominal[nHp](
each final min=0,
each start=Buildings.Templates.Data.Defaults.dpChiWatChi)
;
parameter Modelica.Units.SI.PressureDifference dpBalHeaWatHp_nominal[nHp](
each final min=0)=
fill(0, nHp)
;
parameter Modelica.Units.SI.MassFlowRate mChiWatHp_flow_nominal[nHp](
each start=0,
each final min=0)
;
final parameter Modelica.Units.SI.PressureDifference dpChiWatHp_nominal[nHp]=
dpHeaWatHp_nominal .*(mChiWatHp_flow_nominal ./ mHeaWatHp_flow_nominal) .^ 2
;
parameter Modelica.Units.SI.PressureDifference dpBalChiWatHp_nominal[nHp](
each final min=0,
each start=0)=
fill(0, nHp)
;
parameter Modelica.Units.SI.PressureDifference dpValveHeaWat_nominal[nHp]=
fill(Buildings.Templates.Data.Defaults.dpValIso, nHp)
;
final parameter Modelica.Units.SI.PressureDifference dpFixedHeaWat_nominal[nHp]=
dpHeaWatHp_nominal + dpBalHeaWatHp_nominal
;
final parameter Modelica.Units.SI.PressureDifference dpHeaWat_nominal[nHp]=
dpFixedHeaWat_nominal +
(
if have_valHpOutIso
then dpValveHeaWat_nominal
else fill(0, nHp)) +
(
if have_valHpInlIso
then dpValveHeaWat_nominal
else fill(0, nHp))
;
parameter Modelica.Units.SI.PressureDifference dpValveChiWat_nominal[nHp](
each start=0)=
fill(Buildings.Templates.Data.Defaults.dpValIso, nHp)
;
final parameter Modelica.Units.SI.PressureDifference dpFixedChiWat_nominal[nHp]=
if have_chiWat
then dpBalChiWatHp_nominal + dpChiWatHp_nominal
else fill(0, nHp)
;
final parameter Modelica.Units.SI.PressureDifference dpChiWat_nominal[nHp]=
if have_chiWat
then dpFixedChiWat_nominal +
(
if have_valHpOutIso
then dpValveChiWat_nominal
else fill(0, nHp)) +
(
if have_valHpInlIso
then dpValveChiWat_nominal
else fill(0, nHp))
else fill(0, nHp)
;
final parameter Buildings.Templates.Components.Data.Valve datValHeaWatHpOutIso[nHp](
each typ=typ,
m_flow_nominal=mHeaWatHp_flow_nominal,
dpValve_nominal=dpValveHeaWat_nominal,
dpFixed_nominal=dpFixedHeaWat_nominal)
;
final parameter Buildings.Templates.Components.Data.Valve datValHeaWatHpInlIso[nHp](
each typ=typ,
m_flow_nominal=mHeaWatHp_flow_nominal,
dpValve_nominal=dpValveHeaWat_nominal,
dpFixed_nominal=
if not have_valHpOutIso
then dpFixedHeaWat_nominal
else fill(0, nHp))
;
final parameter Buildings.Templates.Components.Data.Valve datValChiWatHpOutIso[nHp](
each typ=typ,
m_flow_nominal=mChiWatHp_flow_nominal,
dpValve_nominal=dpValveChiWat_nominal,
dpFixed_nominal=dpFixedChiWat_nominal)
;
final parameter Buildings.Templates.Components.Data.Valve datValChiWatHpInlIso[nHp](
each typ=typ,
m_flow_nominal=mChiWatHp_flow_nominal,
dpValve_nominal=dpValveChiWat_nominal,
dpFixed_nominal=
if not have_valHpOutIso
then dpFixedChiWat_nominal
else fill(0, nHp))
;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
;
parameter Modelica.Units.SI.Time tau=10
;
parameter Boolean allowFlowReversal=true
;
parameter Boolean use_strokeTime=energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState
;
parameter Modelica.Units.SI.Time strokeTime=120
;
parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput
;
parameter Real y_start=1
;
parameter Boolean from_dp=true
;
parameter Boolean linearized=false
;
Modelica.Fluid.Interfaces.FluidPort_b port_bChiWat(
redeclare final package Medium=
Medium,
m_flow(
max=
if allowFlowReversal
then + Modelica.Constants.inf
else 0),
h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if have_chiWat
;
Modelica.Fluid.Interfaces.FluidPort_a port_aChiWat(
redeclare final package Medium=
Medium,
m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if have_chiWat
;
Modelica.Fluid.Interfaces.FluidPort_b port_bHeaWat(
redeclare final package Medium=
Medium,
m_flow(
max=
if allowFlowReversal
then + Modelica.Constants.inf
else 0),
h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Modelica.Fluid.Interfaces.FluidPort_a port_aHeaWat(
redeclare final package Medium=
Medium,
m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Modelica.Fluid.Interfaces.FluidPorts_b ports_bChiHeaWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
max=
if allowFlowReversal
then + Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
;
Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiHeaWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if not have_pumChiWatPriDed
;
Modelica.Fluid.Interfaces.FluidPorts_a ports_aHeaWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if have_pumChiWatPriDed
;
Modelica.Fluid.Interfaces.FluidPorts_a ports_aChiWatHp[nHp](
redeclare each final package Medium=
Medium,
each m_flow(
min=
if allowFlowReversal
then - Modelica.Constants.inf
else 0),
each h_outflow(
start=Medium.h_default,
nominal=Medium.h_default))
if have_pumChiWatPriDed
;
Buildings.Templates.Plants.HeatPumps.Interfaces.Bus bus
;
Buildings.Templates.Components.Actuators.Valve valHeaWatHpOutIso[nHp](
redeclare each final package Medium=
Medium,
final dat=datValHeaWatHpOutIso,
each final typ=typ,
each final use_strokeTime=use_strokeTime,
each final strokeTime=strokeTime,
each final init=init,
each final y_start=y_start,
each final from_dp=from_dp,
each final linearized=linearized)
if have_valHpOutIso
;
Buildings.Templates.Components.Actuators.Valve valChiWatHpOutIso[nHp](
redeclare each final package Medium=
Medium,
final dat=datValChiWatHpOutIso,
each final typ=typ,
each final use_strokeTime=use_strokeTime,
each final strokeTime=strokeTime,
each final init=init,
each final y_start=y_start,
each final from_dp=from_dp,
each final linearized=linearized)
if have_valHpOutIso
and have_chiWat
;
Buildings.Templates.Components.Actuators.Valve valHeaWatHpInlIso[nHp](
redeclare each final package Medium=
Medium,
final dat=datValHeaWatHpInlIso,
each final typ=typ,
each final use_strokeTime=use_strokeTime,
each final strokeTime=strokeTime,
each final init=init,
each final y_start=y_start,
each final from_dp=from_dp,
each final linearized=linearized)
if have_valHpInlIso
;
Buildings.Templates.Components.Actuators.Valve valChiWatHpInlIso[nHp](
redeclare each final package Medium=
Medium,
final dat=datValChiWatHpInlIso,
each final typ=typ,
each final use_strokeTime=use_strokeTime,
each final strokeTime=strokeTime,
each final init=init,
each final y_start=y_start,
each final from_dp=from_dp,
each final linearized=linearized)
if have_valHpInlIso
and have_chiWat
;
Buildings.Templates.Components.Routing.PassThroughFluid pasHeaWatHpOut[nHp](
redeclare each final package Medium=
Medium)
if not have_valHpOutIso
;
Buildings.Templates.Components.Routing.PassThroughFluid pasChiWatHpOut[nHp](
redeclare each final package Medium=
Medium)
if not have_valHpOutIso
and have_chiWat
;
Fluid.Delays.DelayFirstOrder junHeaWatSup(
redeclare final package Medium=
Medium,
final tau=tau,
final m_flow_nominal=
sum(mHeaWatHp_flow_nominal),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final prescribedHeatFlowRate=false,
final nPorts=nHp + 1)
;
Fluid.Delays.DelayFirstOrder junChiWatSup(
redeclare final package Medium=
Medium,
final tau=tau,
final m_flow_nominal=
sum(mChiWatHp_flow_nominal),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final prescribedHeatFlowRate=false,
final nPorts=nHp + 1)
if have_chiWat
;
Fluid.Delays.DelayFirstOrder junHeaWatRet(
redeclare final package Medium=
Medium,
final tau=tau,
final m_flow_nominal=
sum(mHeaWatHp_flow_nominal),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final prescribedHeatFlowRate=false,
final nPorts=nHp + 1)
;
Fluid.FixedResistances.PressureDrop pasHeaWatHpInl[nHp](
redeclare each final package Medium=
Medium,
final m_flow_nominal=mHeaWatHp_flow_nominal,
final dp_nominal=
if not have_valHpInlIso
and not have_valHpOutIso
then dpFixedHeaWat_nominal
else fill(0, nHp))
if not have_valHpInlIso
;
Fluid.FixedResistances.PressureDrop pasChiWatHpInl[nHp](
redeclare each final package Medium=
Medium,
final m_flow_nominal=mChiWatHp_flow_nominal,
final dp_nominal=
if not have_valHpInlIso
and not have_valHpOutIso
then dpFixedChiWat_nominal
else fill(0, nHp))
if not have_valHpInlIso
and have_chiWat
;
Fluid.Delays.DelayFirstOrder junChiWatRet(
redeclare final package Medium=
Medium,
final tau=tau,
final m_flow_nominal=
sum(mChiWatHp_flow_nominal),
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final prescribedHeatFlowRate=false,
final nPorts=nHp + 1)
if have_chiWat
;
protected
Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpInlIso[nHp]
if have_valHpInlIso
;
Buildings.Templates.Components.Interfaces.Bus busValHeaWatHpOutIso[nHp]
if have_valHpOutIso
;
Buildings.Templates.Components.Interfaces.Bus busValChiWatHpInlIso[nHp]
if have_chiWat
and have_valHpInlIso
;
Buildings.Templates.Components.Interfaces.Bus busValChiWatHpOutIso[nHp]
if have_chiWat
and have_valHpOutIso
;
equation
connect(bus.valHeaWatHpInlIso, busValHeaWatHpInlIso);
connect(bus.valHeaWatHpOutIso, busValHeaWatHpOutIso);
connect(bus.valChiWatHpInlIso, busValChiWatHpInlIso);
connect(bus.valChiWatHpOutIso, busValChiWatHpOutIso);
connect(ports_aHeaWatHp, valHeaWatHpOutIso.port_a);
connect(ports_aChiHeaWatHp, valHeaWatHpOutIso.port_a);
connect(ports_aChiHeaWatHp, valChiWatHpOutIso.port_a);
connect(ports_aChiWatHp, valChiWatHpOutIso.port_a);
connect(ports_aHeaWatHp, pasHeaWatHpOut.port_a);
connect(ports_aChiHeaWatHp, pasHeaWatHpOut.port_a);
connect(ports_aChiHeaWatHp, pasChiWatHpOut.port_a);
connect(ports_aChiWatHp, pasChiWatHpOut.port_a);
connect(valHeaWatHpOutIso.port_b, junHeaWatSup.ports[1:nHp]);
connect(pasHeaWatHpOut.port_b, junHeaWatSup.ports[1:nHp]);
connect(junHeaWatSup.ports[nHp + 1], port_bHeaWat);
connect(valChiWatHpOutIso.port_b, junChiWatSup.ports[1:nHp]);
connect(pasChiWatHpOut.port_b, junChiWatSup.ports[1:nHp]);
connect(port_bChiWat, junChiWatSup.ports[nHp + 1]);
connect(port_aHeaWat, junHeaWatRet.ports[nHp + 1]);
connect(junHeaWatRet.ports[1:nHp], valHeaWatHpInlIso.port_a);
connect(pasHeaWatHpInl.port_a, junHeaWatRet.ports[1:nHp]);
connect(port_aChiWat, junChiWatRet.ports[nHp + 1]);
connect(valChiWatHpInlIso.port_a, junChiWatRet.ports[1:nHp]);
connect(pasChiWatHpInl.port_a, junChiWatRet.ports[1:nHp]);
connect(pasHeaWatHpInl.port_b, ports_bChiHeaWatHp);
connect(pasChiWatHpInl.port_b, ports_bChiHeaWatHp);
connect(busValHeaWatHpInlIso, valHeaWatHpInlIso.bus);
connect(busValChiWatHpInlIso, valChiWatHpInlIso.bus);
connect(busValChiWatHpOutIso, valChiWatHpOutIso.bus);
connect(busValHeaWatHpOutIso, valHeaWatHpOutIso.bus);
connect(valHeaWatHpInlIso.port_b, ports_bChiHeaWatHp);
connect(valChiWatHpInlIso.port_b, ports_bChiHeaWatHp);
end ValvesIsolation;