-
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 Zone Mixing with Spaces and Space Part 4 Followup #10669
Conversation
HeatBalanceAirManager::GetSimpleAirModelInputs(*state, ErrorsFound); | ||
compare_err_stream("", true); | ||
EXPECT_FALSE(ErrorsFound); | ||
SimulationManager::ManageSimulation(*state); |
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.
Extended this unit test to do an actual simulation so that it tests #10670
Running the revised unit test with develop gives a vector error:
Because fromSpaceIndex=0
here:
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.
Great!
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.
Code walkthru. There are still some more space-related ToDo items lurking in the code, but this has enough in it for now. Another followup PR( or two will follow, whether they make it in v24.2 or after.
@@ -458,6 +458,7 @@ namespace DataHeatBalance { | |||
Real64 Volume = Constant::AutoCalculate; // Volume entered by user [m3] or calculated | |||
Real64 ExtGrossWallArea = 0.0; // Exterior Wall Area for Zone (Gross) | |||
Real64 ExteriorTotalSurfArea = 0.0; // Total surface area of all exterior surfaces for Zone | |||
Real64 extPerimeter = 0.0; // Total exposed perimeter (sum of width of exterior walls) |
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 exterior perimeter to use for space equipment sizing.
@@ -472,7 +473,6 @@ namespace DataHeatBalance { | |||
int spaceTypeNum = 0; // Points to spaceType for this space | |||
EPVector<std::string> tags; // Optional tags for reporting | |||
EPVector<int> surfaces; // Pointers to surfaces in this space | |||
Real64 calcFloorArea = 0.0; // Calculated floor area used for this 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.
Remove calcFloorArea
from state
. It's only used in one function, so it's local there now.
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.
Always love to see this type of removal! Makes me want to do a little scripting and sniff out all state variables that are only used in one or two locations and get them outta there.
nomTotOccupants = state.dataHeatBal->space(spaceNum).TotOccupants; | ||
auto &thisSpace = state.dataHeatBal->space(spaceNum); | ||
floorArea = thisSpace.FloorArea; | ||
volume = thisSpace.Volume; |
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 volume is known, so use it directly now.
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.
Excellent. There have been API requests around zone volume, I will try to keep in mind that space volume could go along with it. Anyway, that's for another day.
"ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", // LowTempRadiant | ||
"ZONEHVAC:LOWTEMPERATURERADIANT:CONSTANTFLOW", // LowTempRadiantConstFlow | ||
"ZONEHVAC:LOWTEMPERATURERADIANT:VARIABLEFLOW", // LowTempRadiantVarFlow | ||
"ZONEHVAC:LOWTEMPERATURERADIANT:ELECTRIC", // LowTempRadiantElectric | ||
"FAN:ZONEEXHAUST", // ExhaustFan | ||
"HEATEXCHANGER:AIRTOAIR:FLATPLATE", // HeatExchanger | ||
"WATERHEATER:HEATPUMP:PUMPEDCONDENSER", // HeatPumpWaterHeater | ||
"WATERHEATER:HEATPUMP:PUMPEDCONDENSER", // HeatPumpWaterHeaterPumpedCondenser | ||
"WATERHEATER:HEATPUMP:WRAPPEDCONDENSER", // HeatPumpWaterHeaterWrappedCondenser |
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 string arrays and its enum were missing a few flavors of equipment which led to some awkward input processing elsewhere to squash them into a single enum for later use in simulation case
blocks.
thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:ELECTRIC") { | ||
thisZoneEquipList.EquipType(ZoneEquipTypeNum) = ZoneEquipType::LowTemperatureRadiant; | ||
} else if (thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER") { | ||
thisZoneEquipList.EquipType(ZoneEquipTypeNum) = DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater; |
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 isn't needed anymore.
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.
Nice!
@@ -558,3 +559,3733 @@ TEST_F(EnergyPlusFixture, SizingManager_OverrideAvgWindowInSizing) | |||
EXPECT_EQ(state->dataGlobal->NumOfTimeStepInHour, 1); | |||
EXPECT_EQ(state->dataSize->NumTimeStepsInAvg, 1); | |||
} | |||
TEST_F(EnergyPlusFixture, SizingManager_ZoneSizing_Coincident_1x) |
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.
8 new zone/space sizing unit tests to test coincident vs noncoincident and multipliers. They're very similar, but I couldn't figure out a way to reset everything and use the same idf snippet and make a few small changes then re-rerun sizing.
EXPECT_EQ("N/A", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClDesDay, "ZONE 1")); | ||
EXPECT_EQ("16:00:00", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClPkTime, "ZONE 1")); | ||
} | ||
TEST_F(EnergyPlusFixture, SizingManager_ZoneSizing_Coincident_NonAir_1x_NoLatent) |
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.
Expect the same sizing results for the case of a non-air system (e.g. baseboard with no air terminals). I learned that zone sizing uses the zone inlet node(s) from ZoneHVAC:EquipmentConnections to carry info for sizing, so if there aren't any, it uses other variables to pass the load.
OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClDesDay, "ZONE 1")); | ||
EXPECT_EQ("7/21 16:00:00", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClPkTime, "ZONE 1")); | ||
} | ||
TEST_F(EnergyPlusFixture, SizingManager_ZoneSizing_Coincident_NonAir_10x_NoLatent) |
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 make sure non-air works correctly with a multiplier.
OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClDesDay, "ZONE 1")); | ||
EXPECT_EQ("7/21 16:00:00", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClPkTime, "ZONE 1")); | ||
} | ||
TEST_F(EnergyPlusFixture, SizingManager_ZoneSizing_Coincident_NonAir_10x_NoLatent_NoSpaceHB) |
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 again with space heat balance off.
OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClDesDay, "ZONE 1")); | ||
EXPECT_EQ("7/21 16:00:00", OutputReportPredefined::RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchZnClPkTime, "ZONE 1")); | ||
} | ||
TEST_F(EnergyPlusFixture, SizingManager_ZoneSizing_Coincident_NonAir_10x_Latent_SpaceHB) |
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 finally, add a big latent load to one space to get a different cooling sizing result.
|
|
|
|
@Myoldmopar This is really ready for review now, unit tests are passing on all platforms. |
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 awesome. Some really, really great refactors along with the actual fixes. I'll double check it, but no red flags here.
@@ -472,7 +473,6 @@ namespace DataHeatBalance { | |||
int spaceTypeNum = 0; // Points to spaceType for this space | |||
EPVector<std::string> tags; // Optional tags for reporting | |||
EPVector<int> surfaces; // Pointers to surfaces in this space | |||
Real64 calcFloorArea = 0.0; // Calculated floor area used for this 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.
Always love to see this type of removal! Makes me want to do a little scripting and sniff out all state variables that are only used in one or two locations and get them outta there.
nomTotOccupants = state.dataHeatBal->space(spaceNum).TotOccupants; | ||
auto &thisSpace = state.dataHeatBal->space(spaceNum); | ||
floorArea = thisSpace.FloorArea; | ||
volume = thisSpace.Volume; |
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.
Excellent. There have been API requests around zone volume, I will try to keep in mind that space volume could go along with it. Anyway, that's for another day.
thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "ZONEHVAC:LOWTEMPERATURERADIANT:ELECTRIC") { | ||
thisZoneEquipList.EquipType(ZoneEquipTypeNum) = ZoneEquipType::LowTemperatureRadiant; | ||
} else if (thisZoneEquipList.EquipTypeName(ZoneEquipTypeNum) == "WATERHEATER:HEATPUMP:WRAPPEDCONDENSER") { | ||
thisZoneEquipList.EquipType(ZoneEquipTypeNum) = DataZoneEquipment::ZoneEquipType::HeatPumpWaterHeater; |
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.
Nice!
// Timestep at max | ||
zoneCFS.TimeStepNumAtHeatMax = | ||
1 + std::distance(zoneCFS.HeatLoadSeq.begin(), std::max_element(zoneCFS.HeatLoadSeq.begin(), zoneCFS.HeatLoadSeq.end())); |
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 that is a good use of standard library.
HeatBalanceAirManager::GetSimpleAirModelInputs(*state, ErrorsFound); | ||
compare_err_stream("", true); | ||
EXPECT_FALSE(ErrorsFound); | ||
SimulationManager::ManageSimulation(*state); |
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.
Great!
|
CI still the same, and everything is happy with develop pulled in. Thanks @mjwitte, dropping this in now. |
Pull request overview
CalcFloorArea
from zone and space structs, it's only used locally inGetSurfaceData
.AirflowSpec
enums.calcOAFlowRate
(instead of floor area ratio of zone volume).NonAirSystemResponse
and latent during sizing.Diffs
There are some minor diffs in space sizing results (eio and table) for 5ZoneAirCooledWithSpaceHeatBalance and 5ZoneAirCooledWithSpacesHVAC.
ToDo List
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
If 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
This will not be exhaustively relevant to every PR.