Buildings.Templates.Plants.Controls.Utilities
Package with utility blocks
Information
This package contains utility blocks that are used to implement the control sequences within Buildings.Templates.Plants.Controls.
Package Content
| Name | Description |
|---|---|
| Merge both Boolean arrays when present, otherwise return the available one | |
| Output the number of true elements in a Boolean array | |
| Hold value of real signal based on timer and Boolean signal | |
| Output the maximum element of the input vector | |
| Output the minimum element of the input vector | |
| Output a placeholder signal | |
| Output a placeholder signal | |
| Output a placeholder signal | |
| Evaluation of stage index from staging signals | |
| Output a Boolean array with a given number of true elements and a priority order | |
| Collection of validation models |
Buildings.Templates.Plants.Controls.Utilities.ConcatenateLogical
Information
This block concatenates two Boolean arrays.
When is_app = true (default), the values of u2 are
appended after the values of u1.
When is_app = false, the values of u2 are
prepended before the values of u1.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | is_app | true | Set to true to append to the input array, false to prepend |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin1] | Array of Boolean signals |
| input BooleanInput | u2[nin2] | Array of Boolean signals |
| output BooleanOutput | y[nout] | Concatenated array |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.ConcatenateParameterLogical
Information
This block concatenates two Boolean arrays, one provided as an input, the other one provided as a parameter.
When is_app = true (default), the values of the parameter array
are appended after the values of the input array.
When is_app = false, the values of the parameter array are
prepended before the values of the input array.
A zero-sized array can be provided as a parameter. The block then is a no-op, returning the input array unchanged.
Extends from Buildings.Templates.Plants.Controls.Utilities.ConcatenateLogical.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | is_app | true | Set to true to append to the input array, false to prepend |
| Boolean | new[:] | New array to be concatenated with the input array |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin1] | Array of Boolean signals |
| input BooleanInput | u2[nin2] | Array of Boolean signals |
| output BooleanOutput | y[nout] | Concatenated array |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.ConcatenateSelectLogical
Merge both Boolean arrays when present, otherwise return the available one
Information
This block concatenates two Boolean arrays if both the parameters
have_u1 and have_u2 are true.
Otherwise, it returns the sole available input array unchanged.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_u1 | Set to true if u1 array available | |
| Boolean | have_u2 | Set to true if u2 array available |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin1] | Array of Boolean signals |
| input BooleanInput | u2[nin2] | Array of Boolean signals |
| output BooleanOutput | y[nout] | Concatenated array |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.CountTrue
Output the number of true elements in a Boolean array
Information
Counts the number of true elements in the Boolean
input vector.
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin] | Array of Boolean signals |
| output IntegerOutput | y | Index of first element being true |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.FirstTrueIndex
Information
Returns the index of the first true element of the Boolean
input vector.
If no element is true, the block returns 0.
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin] | Array of Boolean signals |
| output IntegerOutput | y | Index of first element being true |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.HoldReal
Hold value of real signal based on timer and Boolean signal
Information
Holds input value fixed at its last value while the Boolean signal
u1 is true, and for at least the hold time dtHol.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | dtHol | 0 | Hold time [s] |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1 | Boolean signal that triggers fixed output value |
| input RealInput | u | Input signal |
| output RealOutput | y | Output signal |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.LastTrueIndex
Information
Returns the index of the last true element of the Boolean
input vector.
If no element is true, the block returns 0.
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1[nin] | Array of Boolean signals |
| output IntegerOutput | y | Index of first element being true |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.MultiMaxInteger
Output the maximum element of the input vector
Information
Outputs the maximum element of the input vector.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u[nin] | Integer input signal |
| output IntegerOutput | y | Integer output signal |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.MultiMinInteger
Output the minimum element of the input vector
Information
Outputs the minimum element of the input vector.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u[nin] | Integer input signal |
| output IntegerOutput | y | Integer output signal |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.PlaceholderInteger
Output a placeholder signal
Information
This block enables replacing a variable that is conditionally removed with either a parameter or another input variable.
-
If the parameter
have_inpis true, the output variableyis equal to the input variableu. -
If the parameter
have_inpis false and the parameterhave_inpPhis true, the output variableyis equal to the input variableuPh. -
If the parameter
have_inpis false and the parameterhave_inpPhis false, the output variableyis equal to the parameteru_internal.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_inp | true | Set to true if input signal is available |
| Boolean | have_inpPh | false | Set to true if placeholder value is provided with input signal |
| Integer | u_internal | Placeholder value if input signal is not available |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input |
| input IntegerInput | uPh | Input |
| output IntegerOutput | y | Output |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.PlaceholderLogical
Output a placeholder signal
Information
This block enables replacing a variable that is conditionally removed with either a parameter or another input variable.
-
If the parameter
have_inpis true, the output variableyis equal to the input variableu. -
If the parameter
have_inpis false and the parameterhave_inpPhis true, the output variableyis equal to the input variableuPh. -
If the parameter
have_inpis false and the parameterhave_inpPhis false, the output variableyis equal to the parameteru_internal.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_inp | true | Set to true if input signal is available |
| Boolean | have_inpPh | false | Set to true if placeholder value is provided with input signal |
| Boolean | u_internal | Placeholder value if input signal is not available |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u | Input |
| input BooleanInput | uPh | Input |
| output BooleanOutput | y | Output |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.PlaceholderReal
Output a placeholder signal
Information
This block enables replacing a variable that is conditionally removed with either a parameter or another input variable.
-
If the parameter
have_inpis true, the output variableyis equal to the input variableu. -
If the parameter
have_inpis false and the parameterhave_inpPhis true, the output variableyis equal to the input variableuPh. -
If the parameter
have_inpis false and the parameterhave_inpPhis false, the output variableyis equal to the parameteru_internal.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_inp | true | Set to true if input signal is available |
| Boolean | have_inpPh | false | Set to true if placeholder value is provided with input signal |
| Real | u_internal | Placeholder value if input signal is not available |
Connectors
| Type | Name | Description |
|---|---|---|
| input RealInput | u | Input |
| input RealInput | uPh | Input |
| output RealOutput | y | Output |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.StageIndex
Evaluation of stage index from staging signals
Information
This block is used to compute the stage index for a group of multiple equipment such as CHW pumps or chillers.
-
At initial time, stage
0is active – all units are disabled. -
From stage
0, the transition to the next higher available stage is triggered when the lead unit is enabled (u1Lea = true) and if at least one stage is available. -
From any stage
i(1 ≤ i ≤ nSta), the transition to the next higher or lower available stagej(1 ≤ j ≤ nSta,j ≠ i) is triggered when stageihas been active for the minimum runtime and there is a stage up commandu1Upor stage down commandu1Dow, respectively. -
From any stage
i(1 ≤ i ≤ nSta), the transition to stage0is triggered when stageihas been active for the minimum runtime and the lead unit is disabled (u1Lea = false).
Unavailable stages are handled by the following requirements.
-
Any unavailable stage (
u1Ava[i] = false) is skipped during staging events. - If all higher (resp. lower) stages are unavailable, then the transition to a higher (resp. lower) stage is blocked.
- If the current stage is unavailable, the transition to the next higher available stage is triggered.
- Stage transitions due to availability conditions are not subject to the minimum stage runtime requirement.
Caveats
The only way to transition to stage 0 is by disabling the lead unit
(u1Lea = false).
The stage down command u1Dow cannot be used to transition
below stage 1.
When the current stage becomes unavailable, the transition to the next higher available stage is triggered. However, it can happen that equipment that is enabled at the current stage is no longer available while the current stage is not deemed unavailable – for example if a lead/lag alternate equipment remains available. In this case, the equipment rotation logic must stage on the lead/lag alternate equipment to replace the faulty equipment.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_inpAva | true | Set to true if stage availability is provided with input signal, false for stages always available |
| Boolean | use_twoMod | false | Set to true to apply the runtime requirement to combinations of cooling and heating stages |
| Integer | nSta | Number of stages | |
| Real | dtRun | 0 | Minimum runtime of each stage [s] |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | u1Lea | Lead unit enable signal |
| input BooleanInput | u1Up | Stage up command |
| input BooleanInput | u1Dow | Stage down command |
| input BooleanInput | u1AvaSta[nSta] | Stage available signal |
| output IntegerOutput | y | Stage index |
| input IntegerInput | uStaOpp | Opposite mode stage index |
Modelica definition
Buildings.Templates.Plants.Controls.Utilities.TrueArrayConditional
Output a Boolean array with a given number of true elements and a priority order
Information
This block outputs a Boolean array with true at the output positions given
by the first u entries of the priority-ordered index array
uIdx. The number of true elements equals u when at
least u valid and distinct entries are present in
uIdx, and is less otherwise.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nout | nin | Size of output array |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Number of true elements |
| input IntegerInput | uIdx[nin] | Array of indices by order of priority to be true |
| output BooleanOutput | y1[nout] | Array with true at the first u priority-ordered indices |