Hybrid air-source heat pump plant controls#4369
Hybrid air-source heat pump plant controls#4369AntoineGautier wants to merge 55 commits intomasterfrom
Conversation
…to trigger high stages on both heating and cooling modes.
…rmatting only for changed instances in other components
…rceHeatPumpPlantControls Issue4304 hybrid air source heat pump plant controls
…ssue4304_HybridAirSourceHeatPumpControls
|
@karthikeyad-pnnl Following our discussion, I've
TODO:
|
| block AirToWater | ||
| "Controller for AWHP plant" | ||
|
|
||
| final parameter Boolean has_sort=true |
There was a problem hiding this comment.
- 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"
| annotation (Evaluate=true, | ||
| Dialog(group="Plant configuration")); | ||
|
|
||
| parameter Boolean is_fouPip[nHp]=fill(false,nHp) |
There was a problem hiding this comment.
- change comment:
"Vector of flag for each heat pump: true - the heat pump is a 4-pipe heat pump"
| annotation (Evaluate=true, | ||
| Dialog(group="Plant configuration")); | ||
|
|
||
| final parameter Boolean has_fouPip=Modelica.Math.BooleanVectors.anyTrue(is_fouPip) |
There was a problem hiding this comment.
- change the name to
have_fouPip - avoid use the Modelica function
Modelica.Math.BooleanVectors.anyTrue, could usesum({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"
| each final max=1, | ||
| each final min=0, | ||
| each final unit="1") | ||
| each final unit="1")={fill(0,nHp)} |
There was a problem hiding this comment.
Do we need the default value here?
| annotation (Dialog(group="Equipment staging and rotation")); | ||
| annotation (Dialog(group="Equipment staging and rotation", enable=not has_fouPip)); | ||
|
|
||
| parameter Real staEquCooHea[:, nHp]( |
There was a problem hiding this comment.
staEquDouMod: double mode
| "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]( |
There was a problem hiding this comment.
staEquSinMod: single mode
| annotation (Placement(transformation(extent={{-10,350},{10,370}}))); | ||
| StagingRotation.StageAvailability avaStaHea( | ||
| final staEqu=staEqu) | ||
| StagingRotation.StageAvailability avaStaHea(nSta=nSta, nEqu=nHp) |
There was a problem hiding this comment.
add final: final nSta=nSta, etc.
| extent={{-260,-400},{320,400}})), | ||
| Documentation( | ||
| info="<html> | ||
| <p> |
There was a problem hiding this comment.
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}}), |
There was a problem hiding this comment.
The icon layer graphic should be organized.
| Diagram( | ||
| coordinateSystem( | ||
| extent={{-260,-400},{260,400}})), | ||
| extent={{-260,-400},{300,460}})), |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
missing comment.
Also for the output y1, what if the boolean condition (not is_pri) and (not is_hdr) ?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Cannot use the blocks that is not in the pacakge Buildings.Controls.OBC.CDL.
| 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} |
There was a problem hiding this comment.
It has to be a parameter.
| 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},{ |
There was a problem hiding this comment.
The input swiEna.u[3] will connect to nothing if is_pumApp is true (the block cha1 will be disabled).
There was a problem hiding this comment.
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} |
| 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) |
There was a problem hiding this comment.
Cannot use blocks that are not in the package Buildings.Controls.OBC.CDL.
JayHuLBL
left a comment
There was a problem hiding this comment.
@karthikeyad-pnnl Please see the inline comments.
|
@karthikeyad-pnnl I merged master to the branch. However, the model
|
|
@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 |

This is for #4304.