-
Notifications
You must be signed in to change notification settings - Fork 392
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
Fix User-input Floor Area for Zone and Space #9308
Conversation
New unit test fails in multiple places, as expected. Changing the Space1-1 Zone Floor Area by 10% only results in small diffs for 5ZoneEndUses.
eio diffs show that floor areas changed in Space1-1 and Space2-2, but the number of occupants did not.
Next step is to add the floor area fixes. |
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. This is ready for review.
@@ -2389,10 +2388,9 @@ namespace SurfaceGeometry { | |||
for (int SurfNum = state.dataHeatBal->Zone(ZoneNum).HTSurfaceFirst; SurfNum <= state.dataHeatBal->Zone(ZoneNum).HTSurfaceLast; | |||
++SurfNum) { | |||
if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Floor) { | |||
state.dataHeatBal->Zone(ZoneNum).FloorArea += state.dataSurface->Surface(SurfNum).Area; |
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.
Zone floor area is now the sum of space floor areas, done later.
state.dataHeatBal->Zone(ZoneNum).HasFloor = true; | ||
int spaceNum = state.dataSurface->Surface(SurfNum).spaceNum; | ||
state.dataHeatBal->space(spaceNum).floorArea += state.dataSurface->Surface(SurfNum).Area; | ||
state.dataHeatBal->space(spaceNum).calcFloorArea += state.dataSurface->Surface(SurfNum).Area; |
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.
Set the space calculated floor area as the sum of the floor surfaces in the space.
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.
Off topic but I wonder what would happen if user entered calcFloorArea != user entered CeilingArea
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 pulled this branch and reviewed there since this view is hard to follow. I don't see anything that stands out as a problem. Why are the space.calcFloorAreas summed (above) and the ZONE.CeilingArea summed (below). What if the ceiling is split by space? I would have thought the floor and ceiling calculations would be similar wrt space and 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.
I guess a ceiling split by space would just be 2 ceiling surfaces in the zone so they would get summed correctly. But then that would hold true for the floor as well. Since the issue was with respect to floor area this is probably a moot point (space floor area vs zone ceiling area).
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.
@rraustad Good questions. The main focus here was getting the internal gain levels correct, since they can be specified per floor area. At the moment, state.dataHeatBal->space
only has fields related to floor area, nothing yet for ceiling height, ceiling area, or volume. That's future work.
for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) { | ||
state.dataHeatBal->space(spaceNum).calcFloorArea = state.dataHeatBal->space(spaceNum).floorArea; |
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.
space(spaceNum).calcFloorArea
has been set earlier now. The rest of this section doesn't change. User input for space floor area is used if >zero.
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { | ||
// Calculate zone floor area as sum of space floor areas |
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.
Now, after the space floor areas have been set (either as the sum of floor areas or the user-input space floor area), the zone calcFloorArea
is the sum of the space floor areas (this is new and fixes part of the problem).
} | ||
if (state.dataHeatBal->Zone(ZoneNum).UserEnteredFloorArea != DataGlobalConstants::AutoCalculate) { | ||
// Check entered vs calculated | ||
if (state.dataHeatBal->Zone(ZoneNum).UserEnteredFloorArea > 0.0) { // User entered zone floor area, |
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 starts the block if the user entered a zone floor area > 0
state.dataHeatBal->Zone(ZoneNum).FloorArea = state.dataHeatBal->Zone(ZoneNum).UserEnteredFloorArea; | ||
state.dataHeatBal->Zone(ZoneNum).HasFloor = true; | ||
|
||
// Adjust space floor areas to match zone floor area |
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 there is a user-input for zone floor area, always adjust the space floor areas proportionately to match.
As I read this, maybe this should be skipped if the zone floor area value already matches the sum of the space floor areas or within some threshold?
@@ -856,7 +856,8 @@ | |||
1, !- Type | |||
1, !- Multiplier | |||
2.438400269, !- Ceiling Height {m} | |||
239.247360229; !- Volume {m3} | |||
239.247360229, !- Volume {m3} | |||
90.0; !- Floor Area {m2} |
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.
Add a couple of zone floor area overrides to a test suite file (since there weren't any before).
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 a warning now shows up in 5ZoneEndUses since calculated floor area is 98.1.
@@ -8554,3 +8554,192 @@ TEST_F(EnergyPlusFixture, Use_Gross_Roof_Area_for_Averge_Height_with_Window) | |||
EXPECT_NEAR(state->dataHeatBal->Zone(1).CeilingHeight, ceilingHeight_expected, 1e-6); | |||
EXPECT_NE(state->dataHeatBal->Zone(1).CeilingHeight, ceilingHeight_old); | |||
} | |||
TEST_F(EnergyPlusFixture, SurfaceGeometry_ZoneAndSpaceAreas) |
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.
New unit test to cover some combinations of space and/or zone floor area inputs.
@mjwitte I'm reviewing this now. It looks like there's now one file with a merge conflict that needs to be resolved, and it's probably good to get another CI run anyway. I think it can likely go in shortly after that if nothing else pops up. I'm happy to fix that conflict if needed, just let me know. |
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.
Thanks for the nice detailed explanation of the issue at the top of this PR. That was super helpful.
I have one minor comment about the docs, but I've run the unit tests, and they all pass. I also ran regressions 5ZoneEndUses and I see the updated areas and new warning in the err file.
This is ready from my perspective unless you decide to do something with the docs. But regardless, this can go in right away.
@@ -27,7 +27,9 @@ \subsubsection{Inputs}\label{space-inputs-048} | |||
|
|||
\paragraph{Field: Floor Area}\label{space-field-floor-area} | |||
|
|||
Space floor area is used in many places within EnergyPlus. EnergyPlus automatically calculates the space floor area (\SI{}{\area}) from the space geometry given by the surfaces that belong to the space. If this field is 0.0, negative or \textbf{autocalculate} (the default), then the calculated space floor area will be used in subsequent calculations. If this field is positive, then it will be used as the space floor area. If this number differs significantly from the calculated space floor area a warning message will be issued. | |||
Space floor area is used in many places within EnergyPlus. EnergyPlus automatically calculates the space floor area (\SI{}{\area}) as the total area of surfaces with Surface Type = Floor. If this field is 0.0, negative or \textbf{autocalculate} (the default), then the calculated space floor area will be used in subsequent calculations. If this field is positive, then it will be used as the space floor area. If this number differs significantly from the calculated space floor area a warning message will be issued. |
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.
What does "significantly" mean in this context? Should there be a percent value or some other quantifiable metric listed here, or maybe note that DisplayExtraWarnings
can be used to show the issues?
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 modified this and then got carried away changing the warning messages. They now read:
** Warning ** GetSurfaceData: Entered Zone Floor Area(s) differ more than 5% from the sum of the Space Floor Area(s).
** ~~~ ** ...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual zones.
** Warning ** GetSurfaceData: Entered Floor Area for Zone="SPACE1-1" is 10.2% different from the sum of the Space Floor Area(s).
** ~~~ ** Entered Zone Floor Area=90.00, Sum of Space Floor Area(s)=99.16
** ~~~ ** Entered Zone Floor Area will be used and Space Floor Area(s) will be adjusted proportionately.
** Warning ** GetSurfaceData: Entered Space Floor Area(s) differ more than 5% from calculated Space Floor Area(s).
** ~~~ ** ...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual Spaces.
** Warning ** GetSurfaceData: Entered Floor Area for Space="SPACE 1" is 24.0% different from the calculated Floor Area.
** ~~~ ** Entered Space Floor Area=80.00, Calculated Space Floor Area=99.16, entered Floor Area will be used.
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.
Thanks, @mjwitte. Those are perfect. I think this is ready once CI settles down.
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.
Grrr. The doc change needs attention. I didn't escape the percent signs. Didn't know I needed to.
EXPECT_EQ(state->dataHeatBal->space(2).Name, "SPACE 1B"); | ||
EXPECT_NEAR(state->dataHeatBal->space(2).userEnteredFloorArea, DataGlobalConstants::AutoCalculate, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(2).calcFloorArea, 2.0, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(2).floorArea, 20.0, 0.001); |
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 space areas are proportional to the user entered zone floor area of 30.
EXPECT_NEAR(state->dataHeatBal->Zone(1).CalcFloorArea, 3.0, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->Zone(1).FloorArea, 30.0, 0.001); | ||
Real64 zone1Area = state->dataHeatBal->space(1).floorArea + state->dataHeatBal->space(2).floorArea; | ||
EXPECT_NEAR(state->dataHeatBal->Zone(1).FloorArea, zone1Area, 0.001); |
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.
space and zone areas match
EXPECT_EQ(state->dataHeatBal->space(3).Name, "SPACE 3"); | ||
EXPECT_NEAR(state->dataHeatBal->space(3).userEnteredFloorArea, 5.0, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(3).calcFloorArea, 1.0, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(3).floorArea, 5.0, 0.001); |
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.
Zone 3 reversed which floor area was blank compared to zone 1 and areas still match
EXPECT_EQ(state->dataHeatBal->space(4).Name, "ZONE 2"); | ||
EXPECT_NEAR(state->dataHeatBal->space(4).userEnteredFloorArea, DataGlobalConstants::AutoCalculate, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(4).calcFloorArea, 1.0, 0.001); | ||
EXPECT_NEAR(state->dataHeatBal->space(4).floorArea, 20.0, 0.001); |
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 space is not entered for a zone, areas still match.
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.
Looks ready to merge.
Github is partially down, which is likely causing our NREL CI machines to be down. I merged develop into this branch locally and reran tests. Everything looks consistent with previous CI results. I'll take a chance and merge this now before CI has caught up. We can address any uncaught issues later if something pops up. |
Pull request overview
Fixes Zone entered Floor Area not used in calculations #9302
Before this fix:
After this fix:
Diffs
5ZoneEndUses is modified in this branch, Space1-1 floor area reduced from 99 to 90, Space2-2 floor area changed slightly (to match input volume/ceiling height).
Prior to this fix, the nominal levels for People and Lighting. Space1-1 has people/area, 2 lights and 2 electric equipment objects (one/area and one fixed level). With the change in floor area, the nominal level for the 3 gains that are entered per area should change, and the others should not. Without this fix, none of them changed. Now they do which then results in big diffs in eso and mtr. These table screenshots have the original 5ZoneEndUses on the left (run with develop), and the new one with this branch on the right.
Defect file fixed
The defect file has Zone objects with user-input floor areas and no Space objects, so Spaces are all default one-to-one with zones. Before this fix, the zone and space floor areas did not agree. Now they do. Develop is on the left, this branch on the right.
ToDo
new issue posted Space Summary Totals for People area per person do not match the Zone Summary #9317 fix separately to avoid excess diffs here
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.