Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chiller plant sequences #2299

Open
wants to merge 1,177 commits into
base: master
Choose a base branch
from
Open

Chiller plant sequences #2299

wants to merge 1,177 commits into from

Conversation

milicag
Copy link
Contributor

@milicag milicag commented Dec 8, 2020

@milicag milicag marked this pull request as ready for review December 10, 2020 06:01
@milicag
Copy link
Contributor Author

milicag commented Dec 10, 2020

Local diff for commit 2c13e9e:

(py36) milicag@ubuntu:~/repos/modelica-buildings$ git diff
diff --git a/.travis.yml b/.travis.yml
index d8b9c4008a..34babba3b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -175,4 +175,4 @@ after_failure:
       echo "*** Content of $ff"
       cat $ff
       echo "*** End of $ff"
-    done
+    done

@JayHuLBL
Copy link
Contributor

JayHuLBL commented Sep 3, 2021

@milicag Would you please review the changes?

Copy link
Contributor

@AntoineGautier AntoineGautier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JayHuLBL This is not an in-depth review but rather some comments that I have after trying to integrate the top-level controller into the CHW plant template for Linkage.

Also, when simulating Buildings.Controls.OBC.ASHRAE.PrimarySystem.ChillerPlant.Validation.Controller with OCT (r26747) I get the following error.

Error in flattened model:
  A when-guard is involved in an algebraic loop, consider breaking it using pre() expressions.

The model simulates with Dymola. However, when simulating the closed loop model with the controller integrated in the system model, I get a similar error with Dymola (2022x).

Failed to generate code for an algebraic loop involving when equations or algorithms with when parts.
...
You may be able to cut the loop by putting 'pre' around some of the references to unknown continuous time variables in when parts or when conditions.

Other than the translation issue, this seems to conflict with https://obc.lbl.gov/specification/cdl.html#model-of-computation.

In addition, the dependency graph from inputs to outputs that directly depend on inputs shall be directed and acyclic. I.e., connections that form an algebraic loop are not allowed.

OCT also issues warnings that should be corrected.

Warning at line 36, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "W"'

Warning at line 40, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "W"'

Warning at line 45, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "K"'

Warning at line 46, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'displayUnit = "degC"'

Warning at line 251, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "m3/s"'

Warning at line 255, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "m3/s"'

Warning at line 377, column 48, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "Pa"'

Warning at line 377, column 59, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'displayUnit = "Pa"'

Warning at line 558, column 33, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "K"'

Warning at line 563, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "K"'

Warning at line 564, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'displayUnit = "degC"'

Warning at line 569, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'unit = "K"'

Warning at line 570, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'displayUnit = "degC"'

Warning at line 906, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'final min = 0'

Warning at line 907, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'final max = 1'

Warning at line 908, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Controller.mo':
  Assuming 'each' for the modification 'final unit = "1"'

Warning at line 69, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'final unit = "m3/s"'

Warning at line 70, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'final quantity = "VolumeFlowRate"'

Warning at line 71, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'displayUnit = "m3/s"'

Warning at line 75, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'final unit = "m3/s"'

Warning at line 76, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'final quantity = "VolumeFlowRate"'

Warning at line 77, column 5, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo':
  Assuming 'each' for the modification 'displayUnit = "m3/s"'

Warning at line 29, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/SetpointController.mo':
  Assuming 'each' for the modification 'unit = "W"'

Warning at line 29, column 44, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/SetpointController.mo':
  Assuming 'each' for the modification 'displayUnit = "W"'

Warning at line 33, column 34, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/SetpointController.mo':
  Assuming 'each' for the modification 'unit = "W"'

Warning at line 33, column 44, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/SetpointController.mo':
  Assuming 'each' for the modification 'displayUnit = "W"'

Warning at line 229, column 3, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Economizers/Subsequences/Tuning.mo':
  Ignored connection from connector to itself

Warning at line 87, column 3, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Generic/EquipmentRotation/Subsequences/LeastRuntime.mo':
  Ignored connection from connector to itself

Warning at line 135, column 3, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/Subsequences/Capacities.mo':
  Ignored connection from connector to itself

Warning at line 181, column 3, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/Subsequences/Capacities.mo':
  Ignored connection from connector to itself

Warning at line 261, column 3, in file '/home/agautier/gitrepo/modelica-buildings/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/SetPoints/Subsequences/Status.mo':
  Ignored connection from connector to itself

Comment on lines +700 to +701
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChiConIsoVal[nChi]
"Chiller condenser water isolation valve status"
Copy link
Contributor

@AntoineGautier AntoineGautier Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Instance should be conditioned by have_heaConWatPum and even then it is optional, so another configuration parameter is required.

  • If present and two-position valves, there should rather be 2 input points (DI) for open and closed end switch status.

  • Missing option for modulating valve (AI).

  • "Valve status" is not clear: valve open or closed end switch status (or position feedback if modulating) is clearer.

  • That signal is used for fault detection and alarm only in RP1711. Here it is used by Buildings.Controls.OBC.ASHRAE.PrimarySystem.ChillerPlant.Pumps.CondenserWater.Controller. This seems incorrect based on:

    5.2.9.2. Enable lead CW pump when any chiller or WSE CW isolation valve is commanded open. Disable the lead CW pump when all chiller and WSE CW isolation valves are commanded closed.

    The signal that should be used is the command (yielded by subcontroller), not the feedback signal.

  • Lacking consistency in variable name between that input and the output yHeaPreConVal.

Comment on lines +720 to +721
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChiIsoVal[nChi] if have_heaChiWatPum
"Chilled water isolation valve status"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Should be optional (even if have_heaChiWatPum), so another configuration parameter is required.

  • If present in case of two-position valves, there should rather be 2 input points for open and closed end switch status.

  • Missing option for modulating valve.

  • "Valve status" is not clear: valve open or closed end switch status (or position feedback if modulating) is clearer.

  • That signal is used for fault detection and alarm only in RP1711. Here it is used by Buildings.Controls.OBC.ASHRAE.PrimarySystem.ChillerPlant.Pumps.ChilledWater.Controller. This seems incorrect based on:

    5.2.6.2. Enable lead primary CHW pump when any chiller CHW isolation valve is commanded open. Disable the lead primary CHW pump when all chiller CHW isolation valves are commanded closed.

    The signal that should be used is the command (yielded by subcontroller), not the feedback signal

Comment on lines 813 to 818
Buildings.Controls.OBC.CDL.Interfaces.RealInput uChiWatIsoVal[nChi](
final min=fill(0, nChi),
final max=fill(1, nChi),
final unit=fill("1", nChi))
"Chilled water isolation valve position"
annotation(Placement(transformation(extent={{-840,-248},{-800,-208}}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • uChiWatIsoVal should be optional and exclusive from uChiIsoVal.
  • Lacking consistency in variable names between those two inputs.

Comment on lines +924 to +925
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHeaPreConValSta[nChi]
"Chiller head pressure control status setpoint"
Copy link
Contributor

@AntoineGautier AntoineGautier Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This is not an output per §4. LIST OF POINTS.
  • The variable name is confusing as it includes Val which makes one think that this signal is for a two-position valve control, whereas the description string indicates that this is actually to enable/disable head pressure control.
  • This is only to be used internally to disable/enable the BAS head pressure control loop (case where chillers do not have built-in head pressure control).
  • If chillers have built-in head pressure control and head pressure control is disabled, a neutral signal shall be used instead of the AI from the the chiller controller.

Comment on lines +929 to +933
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yHeaPreConVal[nChi](
final min=fill(0, nChi),
final max=fill(1, nChi),
final unit=fill("1", nChi))
"Head pressure control valve position"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The constraints below are not taken into account.

    Required for plants with headered condenser water pumps. Delete otherwise. CW isolation valves may be two-position for chillers that do not require head pressure control or for plants with variable speed condenser pumps but no waterside economizer.

Comment on lines +945 to +948
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiWatMinFloSet(
final quantity="VolumeFlowRate",
final unit="m3/s",
final min=0) "Chilled water minimum flow setpoint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an output per §4. LIST OF POINTS. Should be deleted.

Comment on lines +952 to +953
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yConWatPum[nConWatPum]
"Status setpoint of condenser water pump"
Copy link
Contributor

@AntoineGautier AntoineGautier Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Should be conditional to water-cooled plant.
  • "Status setpoint" is not clear: "on/off command" or "start signal" is clearer.
  • "Setpoint" should be reserved for the desired value of a controlled variable.

Comment on lines +957 to +961
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiWatIsoVal[nChi](
final unit=fill("1", nChi),
final min=fill(0, nChi),
final max=fill(1, nChi))
"Chiller isolation valve position setpoints"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options below not taken into account.

A modulating valve is recommended on primary-only variable flow systems to allow for slow changes in flow during chiller staging. Sometimes electric valve timing may be sufficiently slow that 2-position valves can provide stable performance. Two-position valves are acceptable on primary-secondary systems.

Comment on lines 978 to 979
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yNumCel
"Total number of enabled cooling tower cells"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an output per §4. LIST OF POINTS. Should be deleted.

Comment on lines +983 to +987
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTowCelIsoVal[nTowCel](
final min=fill(0, nTowCel),
final max=fill(1, nTowCel),
final unit=fill("1", nTowCel))
"Cooling tower cells isolation valve position"
Copy link
Contributor

@AntoineGautier AntoineGautier Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

  • Boolean, and
  • conditional to a configuration parameter (as CT may not have isolation valves), and
  • duplicated in case CT have both inlet and outlet isolation valves: one signal for each kind of valve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: In progress
Development

Successfully merging this pull request may close these issues.

Chiller plant sequences
4 participants