Skip to content
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

Merged
merged 8 commits into from
Nov 2, 2023
41 changes: 26 additions & 15 deletions src/EnergyPlus/MixedAir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor Author

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.

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) {
Expand Down Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrow scope for this.

Copy link
Member

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.

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
Expand Down Expand Up @@ -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
Copy link
Contributor Author

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).

CO2PeopleGeneration +=
state.dataHeatBal->People(PeopleNum).NumberOfPeople *
state.dataHeatBal->People(PeopleNum).CO2RateFactor *
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/MixedAir.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

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!

};

struct VentilationMechanicalProps // Derived type for Ventilation:Mechanical data
Expand Down
1 change: 1 addition & 0 deletions testfiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The 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)
Expand Down
Loading