-
Notifications
You must be signed in to change notification settings - Fork 394
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 Controller:MechanicalVentilation ProportionalControlBasedOnDesignOccupancy #10268
Conversation
Single-zone unit test passes in develop, but 3-zone unit test fails in develop.
|
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.
for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) { | ||
for (auto &thisMechVentZone : vent_mech.VentMechZone) { | ||
if (state.dataHeatBal->People(peopleNum).ZonePtr == thisMechVentZone.zoneNum) { | ||
thisMechVentZone.peopleIndexes.push_back(peopleNum); |
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.
Save list of applicable people instances.
@@ -3672,19 +3684,18 @@ Real64 VentilationMechanicalProps::CalcMechVentController(EnergyPlusData &state, | |||
// new local variables for DCV | |||
// Zone OA flow rate based on each calculation method [m3/s] | |||
std::array<Real64, static_cast<int>(DataSizing::OAFlowCalcMethod::Num)> ZoneOACalc{0.0}; | |||
Real64 CO2PeopleGeneration = 0; // CO2 generation from people at design level |
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.
Narrow scope for this.
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.
That's a great thing.
for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) { | ||
if (state.dataHeatBal->People(PeopleNum).ZonePtr != ZoneNum) continue; | ||
Real64 CO2PeopleGeneration = 0.0; | ||
for (int const PeopleNum : thisMechVentZone.peopleIndexes) { |
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.
Loop through only the applicable people instances, not all of them. Also reset sum to zero for each zone (previously this kept accumulating across zones).
@@ -355,6 +355,7 @@ add_simulation_test(IDF_FILE HeatPumpIAQP_DCV.idf EPW_FILE USA_IL_Chicago-OHare. | |||
add_simulation_test(IDF_FILE HeatPumpIAQP_GenericContamControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignRate.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignOccAllZones.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) |
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 test file that uses this control type.
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.
Sounds good to me.
Real64 zoneCO2Max = 431.08678; | ||
Real64 zoneCO2Min = 400.0; | ||
|
||
// Case 1 - Zone CO2 greater than CO2 Max, so OA flow is flow/area+flow/person |
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.
Single-zone test, three cases.
EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); | ||
} | ||
|
||
TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) |
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.
3-zone test, identical to single-zone test but with 3 zones, expect 3x OA flow rates.
The Windows build failure is unrelated, as is the one small diff that pops up occasionally. I'll pull develop in and build while looking this over. |
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 like fine little fix and cleanup with sufficient tests to me.
@@ -3672,19 +3684,18 @@ Real64 VentilationMechanicalProps::CalcMechVentController(EnergyPlusData &state, | |||
// new local variables for DCV | |||
// Zone OA flow rate based on each calculation method [m3/s] | |||
std::array<Real64, static_cast<int>(DataSizing::OAFlowCalcMethod::Num)> ZoneOACalc{0.0}; | |||
Real64 CO2PeopleGeneration = 0; // CO2 generation from people at design level |
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.
That's a great thing.
@@ -286,6 +286,7 @@ namespace MixedAir { | |||
DataSizing::OAFlowCalcMethod ZoneOAFlowMethod = DataSizing::OAFlowCalcMethod::PerPerson; // OA flow method for each zone | |||
int ZoneOASchPtr = 0; // Index to the outdoor air schedule for each zone (from DesignSpecification:OutdoorAir or default) | |||
Real64 OAPropCtlMinRateSchPtr = 0; // Outdoor design OA flow rate schedule from DesignSpecification:OutdoorAir | |||
EPVector<int> peopleIndexes; // List of People objects in this zone (for SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) |
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.
Yay, a nice little EPVector!
@@ -355,6 +355,7 @@ add_simulation_test(IDF_FILE HeatPumpIAQP_DCV.idf EPW_FILE USA_IL_Chicago-OHare. | |||
add_simulation_test(IDF_FILE HeatPumpIAQP_GenericContamControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignRate.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | |||
add_simulation_test(IDF_FILE HeatPumpProportionalControl_DCVDesignOccAllZones.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) |
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.
Sounds good to me.
Everything tests out perfectly fine, and the changes look good. Merging this. Thanks @mjwitte |
Pull request overview
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.