-
Notifications
You must be signed in to change notification settings - Fork 460
Fix space sizing output (spsz) when there is no space HVAC equipment #10947
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
Conversation
| OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClDesDay, "ZONE 1")); | ||
| EXPECT_EQ("7/21 16:00:00", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClPkTime, "ZONE 1")); | ||
| // Expect output to spsz file | ||
| EXPECT_FALSE(state->files.spsz.get_output().empty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work. Tried several different ways to check the contents of this file.
|
Tested with example files: |
|
This probably doesn't need any attention but I noticed that, for 5ZoneAirCooledWithSpaceHeatBalance which has auto generated spaces, the header for epluszsz and eplusspsz look the same. Reported as Zone/Space Name ":" Design Day Name ":" Variable Name, so am just noting it here. Then I checked eplusout.csv and the spaces have their own report names which allows proper reporting (i.e., if they had the same report name they would be duplicates and excel would likely not show the duplicate, they would be in the csv but excel might? get confused). Again, probably nothing to do here. UPDATE: I have noticed this "duplicate" issue before but it happened when the cooling design day and heating design day date were the same (e.g., 1/21 for cooling and heating), so the header should report accurately). It was the rows that did not show up correctly, not the columns. |
|
Also tested 5ZoneAirCooledWithSpaceHeatBalance with Do Space Heat Balance for Sizing set as Yes and No. eplusspsz.csv is blank when set to No so this works as expected. |
| if (forSpaces) { | ||
| zoneNum = state.dataHeatBal->space(i).zoneNum; | ||
| } | ||
| if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if you have any other changes.
int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course. That construct still is not my first thought, or second, or ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add on, the parentheses around forSpaces is not needed unless you need it for order of operations. (Ternary has a very low operation precedence, so most things will be evaluated before it is applied.)
rraustad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes correct the issue.
mjwitte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walkthru
| state.dataGlobal->ZoneSizingCalc = true; | ||
| Available = true; | ||
|
|
||
| if (state.dataSize->SizingFileColSep == CharComma) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to ZoneEquipmentManager to avoid creating an empty spsz output file. Can't make that decision here yet, because the project data (with Do Space Heat Balance flags) has not been read yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| void writeZszSpsz(EnergyPlusData &state, | ||
| EnergyPlus::InputOutputFile &outputFile, | ||
| int const numSpacesOrZones, | ||
| Array1D<DataZoneEquipment::EquipConfiguration> const &zsEquipConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed.
| if (!zsEquipConfig(i).IsControlled) continue; | ||
| int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i; | ||
| if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sizing output, check if the parent zone is controlled instead of checking zsEquipConfig(i).IsControlled (which is only true if there are SpaceHVAC:* objects).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if there are SpaceHVAC objects, that implies that the parent zone IsControlled flag will be set to true, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it should be. SpaceHVAC objects don't work without corresponding ZoneHVAC objects for the parent zone. I see a check for that in some of the SpaceHVAC objects, but not for SpaceHVAC:EquipmentConnections. I'll add that and remove the IDD changes and stash them (somewhere) for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this code in SizeZoneEquipment know the space is controlled? and if this isn't working as expected for spaces then uncontrolled spaces will be held to the Tstat temp and not float?
auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ControlledZoneNum);
if (!zoneEquipConfig.IsControlled) continue;
sizeZoneSpaceEquipmentPart2(
state, zoneEquipConfig, state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, ControlledZoneNum), ControlledZoneNum);
if (state.dataHeatBal->doSpaceHeatBalance) {
for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
sizeZoneSpaceEquipmentPart2(
state, zoneEquipConfig, state.dataSize->CalcSpaceSizing(state.dataSize->CurOverallSimDay, spaceNum), ControlledZoneNum, spaceNum);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked 5ZoneAirCooledWithSpacesHVAC and ZONE 5-REMAINDER has a heating and cooling load showing in eplusspsz.csv. This is a different issue than the original and is scope creeping.
UPDATE: ZONE 5-REMAINDER does have an equipment connections object so it should show loads. I suspect an uncontrolled space would also show loads but that's a different issue than this.
SpaceHVAC:EquipmentConnections,
Zone 5-Remainder, !- Space Name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sizing, the assumption is that all spaces in a zone are controlled to the zone thermostat setpoint. That's intentional, I'll have to check and see if the docs are clear (or cloudy, or dark as night) on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Engineering Ref seems clear:
\subsection{Space Sizing}\label{space-sizing}
When ZoneAirHeatBalanceAlgorithm ``Do Space Heat Balance for Sizing'' is ``Yes'', the same sizing calculations
described above will be performed for each space that is part of a controlled zone, using the same thermostat
setpoints as the parent zone. The space sizing results will be reported the same as zone sizing results (eio, table,
and spsz outputs).
\subsection{NonCoincident Zone Sizing}\label{noncoincident-zone-sizing}
Sizing:Zone has an option for ``Type of Space Sum to Use'', ``Coincident'' or ``NonCoincident''. Coincident zone
sizing (the default) is always calculated first, with all spaces in the zone lumped together. For ``NonCoincident'' zone
sizing, if the zone contains more than one space, the zone sizing results will be overwritten using the sums and
averages of the space sizing results. If all spaces for a given load type (heating or cooling) peak on the same design
day, then that day will be reported as the zone peak day, otherwise the zone design day will be "N/A". The zone
peak time will be determined by scanning the peak zone sequential loads which are calculated by summing the
space peak day sequential loads.
But some I/O Ref changes are needed.
| } else { | ||
| state.files.spsz.filePath = state.files.outputSpszTxtFilePath; | ||
| } | ||
| state.files.spsz.ensure_open(state, "UpdateZoneSizing", state.files.outputControl.spsz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait until here to open zsz and spsz files. At this point we know if doSpaceHeatBalanceSizing is active.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually glad you fixed this. I saw the 0 kB files but wasn't sure how to avoid that. This is a perfect fix.
Myoldmopar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. I've just got to decide what to do about the IDD changes. They are tiny, memo only changes. But they still change the IDD, and we've been pretty strict in the past about that.
idd/Energy+.idd.in
Outdated
| \memo space air node, air inlet nodes, air exhaust nodes, and the air return node. | ||
| \memo If any space in a zone has a SpaceHVAC:EquipmentConnections object, then all spaces in the zone must have one. | ||
| \memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing"is Yes. | ||
| \memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Simulation" is Yes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How strict shall I be regarding IO changes... need to decide...
| state.dataGlobal->ZoneSizingCalc = true; | ||
| Available = true; | ||
|
|
||
| if (state.dataSize->SizingFileColSep == CharComma) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| if (!zsEquipConfig(i).IsControlled) continue; | ||
| int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i; | ||
| if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if there are SpaceHVAC objects, that implies that the parent zone IsControlled flag will be set to true, right?
| if (forSpaces) { | ||
| zoneNum = state.dataHeatBal->space(i).zoneNum; | ||
| } | ||
| if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To add on, the parentheses around forSpaces is not needed unless you need it for order of operations. (Ternary has a very low operation precedence, so most things will be evaluated before it is applied.)
|
Thanks for cleaning up the IDD stuff. I think it's ready to go now. Will let CI confirm and then be ready to merge in a bit. |
| if (!state.dataHeatBal->Zone(zoneNum).IsControlled) { | ||
| ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisSpace.Name)); | ||
| ShowContinueError(state, | ||
| format("..Zone Name={} is not a controlled zone. A ZoneHVAC:EquipmentConnections object is required for this zone.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a modified version of 5ZoneAirCooledWithSpacesHVAC that has only SpaceHVAC:EquipmentConnections objects for the spaces in zone 5 (remove the ZoneHVAC:EquipmentConnections object and the other types of SpaceHVAC:* objects). This file crashes with develop, and fatals with this branch:
* Severe ** GetZoneEquipmentData: SpaceHVAC:EquipmentConnections="SPACE 5 OFFICE"
** ~~~ ** ..Zone Name=ZONE 5 is not a controlled zone. A ZoneHVAC:EquipmentConnections object is required for this zone.
** Severe ** GetZoneEquipmentData: SpaceHVAC:EquipmentConnections="SPACE 5 CONFERENCE"
** ~~~ ** ..Zone Name=ZONE 5 is not a controlled zone. A ZoneHVAC:EquipmentConnections object is required for this zone.
** Severe ** GetZoneEquipmentData: SpaceHVAC:EquipmentConnections="ZONE 5-REMAINDER"
** ~~~ ** ..Zone Name=ZONE 5 is not a controlled zone. A ZoneHVAC:EquipmentConnections object is required for this zone.
** Warning ** GetZoneEquipmentData: SpaceHVAC:EquipmentConnections, duplicate items NOT CHECKED due to previous errors.
** Fatal ** GetZoneEquipmentData: Errors found in getting Zone Equipment input.
5ZoneAirCooledWithSpacesHVAC-TestAZoneNotControlled2.idf.txt
|
Good to go, thanks @mjwitte |






Pull request overview
Description of the purpose of this PR
SpaceHVAC:*objects.Update some related IDD(held for v25.2)\memolines.GetZoneEquipmentData.Pull Request Author
If any diffs are expected, author must demonstrate they are justified using plots and descriptionsIf any defect files are updated to a more recent version, upload new versions here or on DevSupportIf IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange labelIf structural output changes, add to output rules file and add OutputChange labelIf adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependenciesReviewer
`