Skip to content

Hybrid air-source heat pump plant controls#4369

Open
AntoineGautier wants to merge 55 commits intomasterfrom
issue4304_HybridAirSourceHeatPumpControls
Open

Hybrid air-source heat pump plant controls#4369
AntoineGautier wants to merge 55 commits intomasterfrom
issue4304_HybridAirSourceHeatPumpControls

Conversation

@AntoineGautier
Copy link
Copy Markdown
Contributor

This is for #4304.

karthikeyad-pnnl and others added 30 commits January 20, 2025 06:40
…to trigger high stages on both heating and cooling modes.
@AntoineGautier
Copy link
Copy Markdown
Contributor Author

@karthikeyad-pnnl Following our discussion, I've

TODO:

  • Solve failing CI tests
  • Develop a closed loop test using Buildings.Fluid.HeatPumps.ModularReversible.TableData2DLoadDepSHC
  • Check the status of the SOO from the G36 working group

block AirToWater
"Controller for AWHP plant"

final parameter Boolean has_sort=true
Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL Sep 30, 2025

Choose a reason for hiding this comment

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

  • change the name, to have_sorRunTim
  • change the comment: "Set to true if the staging order algorithm includes the sequence of sorting runtime for equipment rotation"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

annotation (Evaluate=true,
Dialog(group="Plant configuration"));

parameter Boolean is_fouPip[nHp]=fill(false,nHp)
Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL Sep 30, 2025

Choose a reason for hiding this comment

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

  • change comment: "Vector of flag for each heat pump: true - the heat pump is a 4-pipe heat pump"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

annotation (Evaluate=true,
Dialog(group="Plant configuration"));

final parameter Boolean has_fouPip=Modelica.Math.BooleanVectors.anyTrue(is_fouPip)
Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL Sep 30, 2025

Choose a reason for hiding this comment

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

  • change the name to have_fouPip
  • avoid use the Modelica function Modelica.Math.BooleanVectors.anyTrue, could use sum({if is_fouPip[i] then 1 else 0 for i in 1:nHp})>0
  • comment: "True: if the plant has any 4-pipe heat pump"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Modified in #4490

each final max=1,
each final min=0,
each final unit="1")
each final unit="1")={fill(0,nHp)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need the default value here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removed in #4490

annotation (Dialog(group="Equipment staging and rotation"));
annotation (Dialog(group="Equipment staging and rotation", enable=not has_fouPip));

parameter Real staEquCooHea[:, nHp](
Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL Sep 30, 2025

Choose a reason for hiding this comment

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

staEquDouMod: double mode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

"Staging matrix for heating-cooling mode – Equipment required for each stage"
annotation (Dialog(group="Equipment staging and rotation", enable=has_fouPip));

parameter Real staEquOneMod[:, nHp](
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

staEquSinMod: single mode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

annotation (Placement(transformation(extent={{-10,350},{10,370}})));
StagingRotation.StageAvailability avaStaHea(
final staEqu=staEqu)
StagingRotation.StageAvailability avaStaHea(nSta=nSta, nEqu=nHp)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add final: final nSta=nSta, etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

extent={{-260,-400},{320,400}})),
Documentation(
info="<html>
<p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to add a more detailed specification of how the control is implemented?

coordinateSystem(
preserveAspectRatio=true,
extent={{-200,-360},{200,360}}),
extent={{-260,-400},{300,460}}),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The icon layer graphic should be organized.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

Diagram(
coordinateSystem(
extent={{-260,-400},{260,400}})),
extent={{-260,-400},{300,460}})),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The diagram layer graphic should be organized to minimize the crosslines and avoid lines above instances.

I could do a more detailed review after the graphic has been improved.

="Pa") if is_hdr and is_ctlDp "Loop differential pressure setpoint"
annotation (Placement(transformation(extent={{-200,-40},{-160,0}}),
iconTransformation(extent={{-140,-60},{-100,-20}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con[nPum,nPum](k=staPum)
Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL Sep 30, 2025

Choose a reason for hiding this comment

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

missing comment.

Also for the output y1, what if the boolean condition (not is_pri) and (not is_hdr) ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Boolean conditions indicate whether the pumps are primary/secondary and whether they are headered/dedicated. The combination you indicate (dedicated+secondary) is not a valid condition present in actual applications. Additionally, users are not anticipated to use this block separately, so I think the current structure should be fine without any assert conditions to enforce correct configurations.

annotation (Placement(transformation(extent={{-240,40},{-200,80}}),
iconTransformation(extent={{-140,20},{-100,60}})));

Modelica.Blocks.Sources.RealExpression traMatStaEqu[nEqu, nSta](y=traStaEqu)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cannot use the blocks that is not in the pacakge Buildings.Controls.OBC.CDL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

annotation (Evaluate=true);
final parameter Real traStaEqu[nEqu, nSta]={{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}

final Real traStaEqu[nEqu, nSta]= {{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It has to be a parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

62,-60},{78,-60}}, color={255,0,255}));
connect(u1HeaCoo, cha1.u) annotation (Line(points={{-220,-120},{-180,-120},{
-180,-100},{-142,-100}}, color={255,0,255}));
connect(cha1.y, swiEna.u[3]) annotation (Line(points={{-118,-100},{-40,-100},{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The input swiEna.u[3] will connect to nothing if is_pumApp is true (the block cha1 will be disabled).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation is intentional. I want the signal swiEna.u[3] to be used only if the plant is a hybrid plant.

"Staging part load ratio"
annotation (Dialog(enable=not have_inpPlrSta));
final parameter Real traStaEqu[nEqu, nSta]={{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}
final Real traStaEqu[nEqu, nSta]={{staEqu[i, j] for i in 1:nSta} for j in 1:nEqu}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It has to be parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

iconTransformation(extent={{100,-60},{140,-20}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant traMatStaEqu[nEqu, nSta](
final k=traStaEqu)
Modelica.Blocks.Sources.RealExpression traMatStaEqu[nEqu, nSta](y=traStaEqu)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cannot use blocks that are not in the package Buildings.Controls.OBC.CDL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in #4490

Copy link
Copy Markdown
Contributor

@JayHuLBL JayHuLBL left a comment

Choose a reason for hiding this comment

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

@karthikeyad-pnnl Please see the inline comments.

@JayHuLBL
Copy link
Copy Markdown
Contributor

@karthikeyad-pnnl I merged master to the branch. However, the model Buildings.Templates.Plants.Controls.HeatPumps.AirToWater has checking error as below:

Screenshot 2026-02-18 at 1 23 09 PM

@karthikeyad-pnnl
Copy link
Copy Markdown
Contributor

@JayHuLBL Thanks for the heads-up! I will be submitting a PR this afternoon with some code updates to address comments. I will address the compilation errors then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants