Buildings.Templates.Plants.Controls.PolyvalentHeatPumps
Information
This package contains subsequences that are specific to polyvalent heat pump controls.
Package Content
| Name | Description |
|---|---|
| Assert that polyvalent heat pumps are not short cycling | |
| Extract staging matrix at current stage index of opposite operating mode | |
| SHC and single mode alternation | |
Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.AssertMinimumRuntime
Assert that polyvalent heat pumps are not short cycling
Information
This block asserts that each polyvalent heat pump does not short cycle, based on its heating and cooling on/off commands.
If use_runTim=true (default), it asserts that each mode command
remains true for at least dt_min before it turns
false.
If use_runTim=false, it asserts that each mode command remains
false for at least dt_min before it turns
true.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | use_runTim | true | Set to true to assert minimum runtime, false for minimum off time |
| Integer | nUni | Number of units | |
| Real | dt_min | 10*60 | Minimum runtime or off-time [s] |
| String | message | if use_runTim then "Polyvale... | Warning message |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1Hea[nUni] | Polyvalent HP heating on/off command |
| input BooleanInput | u1Coo[nUni] | Polyvalent HP cooling on/off command |
Modelica definition
Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.ExtractStagingMatrix
Extract staging matrix at current stage index of opposite operating mode
Information
Given the pre-computed staging matrix sta (either
staCoo or staHea from
Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.StagingParameters)
and the current stage index u of the opposite operating mode, this
block extracts the corresponding
nSta × nEqu slice of normalized equipment
fractions for all non-zero stages of the primary mode.
The number of stages nSta is recovered from the row count nRow = (nSta + 1) ⋅ nSta by solving the resulting quadratic:
nSta = ⌊(1 + √(1 + 4 ⋅ nRow)) / 2⌋ - 1
nEqu equals the number of columns.
The output matrix corresponds to that specified in the documentation of Buildings.Templates.Plants.Controls.StagingRotation.EquipmentEnable and can therefore be consumed by this block.
If is_transpose = true, the block outputs the transpose of the
staging matrix, with dimensions
nEqu × nSta.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | sta[:, :] | Partially flattened (2D) staging matrix [(nSta+1)*nSta, nEqu], row-major over (iHea, iCoo) | |
| Boolean | is_transpose | false | Set to true to output the transpose of the staging matrix |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Stage index of opposite mode (from 0 to stage number) |
| output RealOutput | y[if is_transpose then nEqu else nSta, if is_transpose then nSta else nEqu] |
Modelica definition
Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.ModeAlternation
SHC and single mode alternation
Information
Heating-only
When a stage transition yields a change in both the number of staged units in heating mode and the number of staged units in SHC mode, i.e., a unit switches from/to heating-only to/from SHC mode: the units previously enabled in cooling mode are removed from the staging order for the heating enable logic. The heating enable logic can thus disable a unit previously enabled in either heating or SHC mode, or enable a unit previously enabled in SHC mode or disabled.
At any other time, the units previously enabled in cooling or SHC mode are removed from the staging order for the heating enable logic. The heating enable logic can thus only disable a unit previously enabled in heating mode, or enable a unit previously disabled.
Cooling-only
When a stage transition yields a change in both the number of staged units in cooling mode and the number of staged units in SHC mode, i.e., a unit switches from/to cooling-only to/from SHC mode: the units previously enabled in heating mode are removed from the staging order for the cooling enable logic. The cooling enable logic can thus disable a unit previously enabled in either cooling or SHC mode, or enable a unit previously enabled in SHC mode or disabled.
At any other time, the units previously enabled in heating or SHC mode are removed from the staging order for the cooling enable logic. The cooling enable logic can thus only disable a unit previously enabled in cooling mode, or enable a unit previously disabled.
SHC
At any time, the units currently enabled in heating or cooling mode are removed from the staging order for the SHC enable logic. The SHC enable logic can thus only disable a unit enabled in SHC mode, or enable a disabled unit. It cannot disable a unit that has been enabled in heating or cooling mode.
Details
Staging logic requirement
The alternation logic in this block assumes that stage transitions are elementary in terms of staged unit counts: either the number of staged units changes by one in exactly one operating mode – a unit is staged on or off – or the number of staged units decreases by one in one operating mode and increases by one in another operating mode – a mode switch at plant level, which the enable logics may realize with two distinct units. The staging logic shall preclude any other transition. Under this assumption, a simultaneous change in the number of staged units in a single mode and in SHC mode identifies without ambiguity a mode switch between that mode and SHC mode.
Resolution order
The heating and cooling enable logics resolve against the unit assignment prior to the stage transition, whereas the SHC enable logic resolves against the resulting heating and cooling enable commands. This establishes the resolution order between the three logics: at a transition where a unit switches between a single mode and SHC mode, the unit claimed by the heating or cooling enable logic is removed from the staging order for the SHC enable logic at the same time instant.
Note that a unit switching from SHC mode to a single mode, or conversely, is not subject to the minimum off-time required by Buildings.Templates.Plants.Controls.HeatPumps.Subsequences.EquipmentAvailability for the alternation between heating-only and cooling-only mode.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nPhp | Number of polyvalent HP |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | uIdxSor[nPhp] | Indices of units sorted by increasing runtime |
| input IntegerInput | nHea | Number of units to be staged in heating mode |
| input IntegerInput | nCoo | Number of units to be staged in cooling mode |
| input IntegerInput | nShc | Number of units to be staged in SHC mode |
| input BooleanInput | u1Hea[nPhp] | Enable command of each unit in heating mode, indexed by unit |
| input BooleanInput | u1Coo[nPhp] | Enable command of each unit in cooling mode, indexed by unit |
| input BooleanInput | u1Shc[nPhp] | Enable command of each unit in SHC mode, indexed by unit |
| output IntegerOutput | yIdxSorHea[nPhp] | Staging order for the heating enable logic |
| output IntegerOutput | yIdxSorCoo[nPhp] | Staging order for the cooling enable logic |
| output IntegerOutput | yIdxSorShc[nPhp] | Staging order for the SHC enable logic |
Modelica definition
Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.StagingParameters
Information
This block pre-computes all staging parameters for a plant with nHP standard reversible heat pumps and nPHP polyvalent heat pumps (capable of simultaneous heating and cooling, SHC).
Fundamental assumptions
Within each equipment set (reversible HPs and polyvalent HPs), all units are assumed to be equally sized and are treated as lead/lag alternates. Adding one unit of either type therefore contributes one additional stage of capacity, so the maximum number of plant stages is nSta = nHP + nPHP. Heating and cooling stages are tracked independently, each ranging over {0, …, nSta}, since the same pool of units can serve either load.
For each combination of active heating and cooling stages (iHea, iCoo) with iHea, iCoo ∈ {0, …, nSta}, the block resolves how many units operate in each mode by applying the following assignment rules in order.
1. SHC assignment
Polyvalent HPs are assigned to simultaneous heating and cooling first, saturating at the available count and at the smaller of the two stage indices (since each SHC unit satisfies one heating stage and one cooling stage simultaneously):
nSHCPHP = min(min(iHea, iCoo), nPHP)
The residual heating and cooling stages after SHC assignment are:
iresHea = iHea - nSHCPHP, iresCoo = iCoo - nSHCPHP
2. Heating assignment
Standard HPs cover the residual heating stage first:
nHeaHP = min(iresHea, nHP)
Any remaining residual heating stage is covered by polyvalent HPs operating in heating-only mode (drawn from those not already in SHC):
nHeaPHP = min(iresHea - nHeaHP, nPHP - nSHCPHP)
3. Cooling assignment
Standard HPs not used for heating are assigned to the residual cooling stage:
nCooHP = min(iresCoo, nHP - nHeaHP)
Remaining polyvalent HPs (neither in SHC nor heating-only) cover any unmet cooling stage:
nCooPHP = min(iresCoo - nCooHP, nPHP - nSHCPHP - nHeaPHP)
Feasibility
A stage combination is feasible if and only if both residual stages are fully covered by the assigned units:
iresHea = nHeaHP + nHeaPHP and iresCoo = nCooHP + nCooPHP
Combinations that cannot be satisfied with the available equipment (e.g.,
requiring more simultaneous heating and cooling stages than there are
polyvalent HPs) are flagged in is_feasible and receive zero
weights in the staging matrices.
Staging matrices
The parameters staCoo and staHea pack feasible
stage combinations into matrices consumed by the equipment enable logic.
Each has (nSta + 1) × nSta rows (one per
non-zero stage transition) and
nHP + 2 nPHP columns, ordered as: standard
HPs | polyvalent HPs (cooling- or heating-only) | polyvalent HPs (SHC).
For staCoo, row r corresponds to
iHea = ⌊(r - 1) / nSta⌋
(outer index, 0 ≤ iHea ≤ nSta) and
iCoo = (r - 1) mod nSta + 1
(inner index, 1 ≤ iCoo ≤ nSta). Column values are normalized fractions, as specified in the
documentation of
Buildings.Templates.Plants.Controls.StagingRotation.EquipmentEnable.:
- Columns 1 … nHP: nCooHP / max(nHP, 1)
- Columns nHP + 1 … nHP + nPHP: nCooPHP / max(nPHP, 1)
- Columns nHP + nPHP + 1 … nHP + 2 nPHP: nSHCPHP / max(nPHP, 1)
A row of zeros indicates an infeasible stage combination.
staHea follows the same column layout but with
iCoo as the outer index and iHea
as the inner index, and the heating counts substituted for the cooling
counts.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nHp | Number of HP (excluding polyvalent HP) | |
| Integer | nPhp | Number of polyvalent HP |