-
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
Changes from all commits
654c174
9d3b640
99733f8
43b5c30
d5bc44d
28e753a
c47134d
ad3f000
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2816,6 +2816,18 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con | |
} | ||
} | ||
|
||
// Fill People index lists if needed | ||
if (vent_mech.SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) { | ||
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); | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Check to see if any zones on an air loop are not accounted for by a mechanical ventilation object | ||
for (int AirLoopZoneInfoZoneNum = 1; AirLoopZoneInfoZoneNum <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; | ||
++AirLoopZoneInfoZoneNum) { | ||
|
@@ -3661,19 +3673,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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. That's a great thing. |
||
Real64 ZoneOABZ; // Zone breathing-zone OA flow rate [m3/s] | ||
Real64 ZoneOA; // Zone OA flow rate [m3/s] | ||
Real64 ZoneOAFrac; // Zone OA fraction (as a fraction of actual supply air flow rate) | ||
Real64 SysOAuc; // System uncorrected OA flow rate | ||
Real64 SysOA; // System supply OA volume flow rate [m3/s] | ||
Real64 SysEv; // System ventilation efficiency | ||
Real64 NodeTemp; // node temperature | ||
Real64 NodeHumRat; // node humidity ratio | ||
Real64 ZoneMaxCO2 = 0.0; // Breathing-zone CO2 concentartion | ||
Real64 ZoneMinCO2 = 0.0; // Minimum CO2 concentration in zone | ||
Real64 ZoneOAMin = 0.0; // Minimum Zone OA flow rate when the zone is unoccupied (i.e. ZoneOAPeople = 0) | ||
Real64 ZoneOAMax = 0.0; // Maximum Zone OA flow rate (ZoneOAPeople + ZoneOACalc[static_cast<int>(DataSizing::OAFlowCalcMethod::PerArea)]) | ||
Real64 ZoneOABZ; // Zone breathing-zone OA flow rate [m3/s] | ||
Real64 ZoneOA; // Zone OA flow rate [m3/s] | ||
Real64 ZoneOAFrac; // Zone OA fraction (as a fraction of actual supply air flow rate) | ||
Real64 SysOAuc; // System uncorrected OA flow rate | ||
Real64 SysOA; // System supply OA volume flow rate [m3/s] | ||
Real64 SysEv; // System ventilation efficiency | ||
Real64 NodeTemp; // node temperature | ||
Real64 NodeHumRat; // node humidity ratio | ||
Real64 ZoneMaxCO2 = 0.0; // Breathing-zone CO2 concentartion | ||
Real64 ZoneMinCO2 = 0.0; // Minimum CO2 concentration in zone | ||
Real64 ZoneOAMin = 0.0; // Minimum Zone OA flow rate when the zone is unoccupied (i.e. ZoneOAPeople = 0) | ||
Real64 ZoneOAMax = 0.0; // Maximum Zone OA flow rate (ZoneOAPeople + ZoneOACalc[static_cast<int>(DataSizing::OAFlowCalcMethod::PerArea)]) | ||
Real64 MechVentOAMassFlow = 0.0; | ||
|
||
// Apply mechanical ventilation only when it is available/allowed | ||
|
@@ -3935,8 +3946,8 @@ Real64 VentilationMechanicalProps::CalcMechVentController(EnergyPlusData &state, | |
// Calculate zone maximum target CO2 concentration in PPM | ||
if (this->SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc) { | ||
// Accumulate CO2 generation from people at design occupancy and current activity level | ||
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) { | ||
Comment on lines
-3938
to
+3950
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
||
CO2PeopleGeneration += | ||
state.dataHeatBal->People(PeopleNum).NumberOfPeople * | ||
state.dataHeatBal->People(PeopleNum).CO2RateFactor * | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Yay, a nice little EPVector! |
||
}; | ||
|
||
struct VentilationMechanicalProps // Derived type for Ventilation:Mechanical data | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. |
||
add_simulation_test(IDF_FILE HeatPumpSecondaryCoil.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | ||
add_simulation_test(IDF_FILE HeatPumpSimpleDCV.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | ||
add_simulation_test(IDF_FILE HeatPumpVRP_DCV.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.
Save list of applicable people instances.