diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 46d29f18df9..5c839836a0e 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -3723,8 +3723,11 @@ namespace InternalHeatGains { Format_723, "People", "Number of People {},People/Floor Area {person/m2},Floor Area per person {m2/person},Fraction Radiant,Fraction " - "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate,Nominal Minimum " - "Number of People,Nominal Maximum Number of People"); + "Convected,Sensible Fraction Calculation,Activity level,ASHRAE 55 Warnings,Carbon Dioxide Generation Rate," + "Minimum Number of People for All Day Types,Maximum Number of People for All Day Types," + "Minimum Number of People for Weekdays, Maximum Number of People for Weekdays, " + "Minimum Number of People for Weekends/Holidays, Maximum Number of People for Weekends /Holidays," + "Minimum Number of People for Design Days, Maximum Number of People for Design Days"); if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { print(state.files.eio, @@ -3777,11 +3780,27 @@ namespace InternalHeatGains { print(state.files.eio, "No,"); } print(state.files.eio, "{:.4R},", state.dataHeatBal->People(Loop).CO2RateFactor); - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); + print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NomMinNumberPeople); + print(state.files.eio, "{:.1R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); + + auto &thisPeople = state.dataHeatBal->People(Loop); + // weekdays + std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::Weekday); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax); + + // weekends/holidays + std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::WeekEndHoliday); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax); + + //design days + std::tie(SchMin, SchMax) = getScheduleMinMaxByDayType(state, thisPeople.NumberOfPeoplePtr, DayTypeGroup::DesignDay); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMin); + print(state.files.eio, "{:.1R},", thisPeople.NumberOfPeople * SchMax); if (state.dataHeatBal->People(Loop).Fanger || state.dataHeatBal->People(Loop).Pierce || state.dataHeatBal->People(Loop).KSU || state.dataHeatBal->People(Loop).CoolingEffectASH55 || state.dataHeatBal->People(Loop).AnkleDraftASH55) { - print(state.files.eio, "{:.0R},", state.dataHeatBal->People(Loop).NomMaxNumberPeople); if (state.dataHeatBal->People(Loop).MRTCalcType == DataHeatBalance::CalcMRT::EnclosureAveraged) { print(state.files.eio, "Zone Averaged,"); @@ -3830,8 +3849,6 @@ namespace InternalHeatGains { } else { print(state.files.eio, "No\n"); } - } else { - print(state.files.eio, "{:.0R}\n", state.dataHeatBal->People(Loop).NomMaxNumberPeople); } } for (int Loop = 1; Loop <= state.dataHeatBal->TotLights; ++Loop) { diff --git a/src/EnergyPlus/ScheduleManager.cc b/src/EnergyPlus/ScheduleManager.cc index 7cf3efe6b93..4e2b13f695e 100644 --- a/src/EnergyPlus/ScheduleManager.cc +++ b/src/EnergyPlus/ScheduleManager.cc @@ -4491,6 +4491,55 @@ namespace ScheduleManager { return MaximumValue; } + std::pair getScheduleMinMaxByDayType(EnergyPlusData &state, int const ScheduleIndex, DayTypeGroup const days) + { + // J. Glazer - March 2024 + // finds the minimum and maximum for a specific set of day types for a given schedule + Real64 MinValue = Constant::BigNumber; + Real64 MaxValue = -Constant::BigNumber; + if (ScheduleIndex == -1) { + MinValue = 1.0; + MaxValue = 1.0; + } else if (ScheduleIndex == 0) { + MinValue = 0.0; + MaxValue = 0.0; + } else if (ScheduleIndex < 1 || ScheduleIndex > state.dataScheduleMgr->NumSchedules) { + ShowFatalError(state, "getScheduleMinMaxByDayType called with ScheduleIndex out of range"); + } else if (ScheduleIndex > 0) { + std::vector dayTypeFilter(maxDayTypes); + std::fill(dayTypeFilter.begin(), dayTypeFilter.end(), false); + switch (days) { + case DayTypeGroup::Weekday: + dayTypeFilter = {false, true, true, true, true, true, false, false, false, false, false, false}; + break; + case DayTypeGroup::WeekEndHoliday: + dayTypeFilter = {true, false, false, false, false, false, true, true, false, false, false, false}; + break; + case DayTypeGroup::DesignDay: + dayTypeFilter = {false, false, false, false, false, false, false, false, true, true, false, false}; + break; + default: + dayTypeFilter = {false, false, false, false, false, false, false, false, false, false, false, false}; + break; + } + for (int iDayOfYear = 1; iDayOfYear <= 366; ++iDayOfYear) { + int WkSch = state.dataScheduleMgr->Schedule(ScheduleIndex).WeekSchedulePointer(iDayOfYear); + auto &weekSch = state.dataScheduleMgr->WeekSchedule(WkSch); + for (int jType = 1; jType <= maxDayTypes; ++jType) { + if (dayTypeFilter[jType -1]) { + auto &daySch = state.dataScheduleMgr->DaySchedule; + MinValue = min(MinValue, minval(daySch(weekSch.DaySchedulePointer(jType)).TSValue)); + MaxValue = max(MaxValue, maxval(daySch(weekSch.DaySchedulePointer(jType)).TSValue)); + } + } + } + if (MinValue == Constant::BigNumber) MinValue = 0; + if (MaxValue == -Constant::BigNumber) MaxValue = 0; + } + return std::make_pair(MinValue, MaxValue); + } + + std::string GetScheduleName(EnergyPlusData &state, int const ScheduleIndex) { // FUNCTION INFORMATION: diff --git a/src/EnergyPlus/ScheduleManager.hh b/src/EnergyPlus/ScheduleManager.hh index 44b9f2bdc0a..fa5a83c8176 100644 --- a/src/EnergyPlus/ScheduleManager.hh +++ b/src/EnergyPlus/ScheduleManager.hh @@ -93,6 +93,15 @@ namespace ScheduleManager { extern const std::array(DayType::Num)> dayTypeNames; extern const std::array(DayType::Num)> dayTypeNamesUC; + enum class DayTypeGroup + { + Invalid = -1, + Weekday = 1, + WeekEndHoliday, + DesignDay, + Num + }; + enum class SchedType : int { Invalid = -1, @@ -339,6 +348,8 @@ namespace ScheduleManager { Real64 GetScheduleMaxValue(EnergyPlusData &state, int const ScheduleIndex); // Which Schedule being tested + std::pair getScheduleMinMaxByDayType(EnergyPlusData &state, int const ScheduleIndex, DayTypeGroup const days); + std::string GetScheduleName(EnergyPlusData &state, int const ScheduleIndex); void ReportScheduleValues(EnergyPlusData &state);