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

Output:Table:Monthly: SumOrAverageDuringHoursShown doesn't follow previous variable #10899

Open
lymereJ opened this issue Jan 18, 2025 · 0 comments · May be fixed by #10901
Open

Output:Table:Monthly: SumOrAverageDuringHoursShown doesn't follow previous variable #10899

lymereJ opened this issue Jan 18, 2025 · 0 comments · May be fixed by #10901
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus

Comments

@lymereJ
Copy link
Collaborator

lymereJ commented Jan 18, 2025

The attached files includes the following object:

Output:Table:Monthly,
    FanSplit,                !- Name
    3,                       !- Digits After Decimal
    Air System Cooling Coil Total Cooling Energy,  !- Variable or Meter 1 Name
    HoursNonZero,            !- Aggregation Type for Variable or Meter 1
    Air System Fan Electricity Energy,  !- Variable or Meter 2 Name
    SumOrAverageDuringHoursShown,  !- Aggregation Type for Variable or Meter 2
    Air System Heating Coil Total Heating Energy,  !- Variable or Meter 3 Name
    HoursNonZero,            !- Aggregation Type for Variable or Meter 3
    Air System Fan Electricity Energy,  !- Variable or Meter 4 Name
    SumOrAverageDuringHoursShown,  !- Aggregation Type for Variable or Meter 4
    Air System Fan Electricity Energy,  !- Variable or Meter 5 Name
    SumOrAverage;            !- Aggregation Type for Variable or Meter 5

In EnergyPlus 9.6 the object gives the expected output, meaning that the sum of AIR SYSTEM FAN ELECTRICITY ENERGY {FOR HOURS SHOWN} [kWh] and AIR SYSTEM FAN ELECTRICITY ENERGY {FOR HOURS SHOWN} [kWh] in the FANSPLIT report are equal to AIR SYSTEM FAN ELECTRICITY ENERGY [kWh]. When updated to a more recent version of EnergyPlus (tried in 23.2, 24.2 and in the latest develop branch), the values for AIR SYSTEM FAN ELECTRICITY ENERGY {FOR HOURS SHOWN} [kWh] are the same as AIR SYSTEM FAN ELECTRICITY ENERGY [kWh] and does not seem to follow the aggregation per the previous variable AIR SYSTEM HEATING COIL TOTAL HEATING ENERGY {HOURS NON-ZERO} [HOURS].

Defect file(s):

defect_files.zip

@lymereJ lymereJ added the Defect Includes code to repair a defect in EnergyPlus label Jan 18, 2025
@jmarrec jmarrec self-assigned this Jan 20, 2025
jmarrec added a commit that referenced this issue Jan 20, 2025
```
[ RUN      ] EnergyPlusFixture.OutputReportTabularMonthly_HandleMultipleDuringHoursShown
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13785: Failure
Expected equality of these values:
  0.0
    Which is: 0
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13795: Failure
Expected equality of these values:
  0.0
    Which is: 0
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 2
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13805: Failure
Expected equality of these values:
  1.0
    Which is: 1
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 3
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13815: Failure
Expected equality of these values:
  2.0
    Which is: 2
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 4
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13824: Failure
Expected equality of these values:
  2.0
    Which is: 2
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 5
[  FAILED  ] EnergyPlusFixture.OutputReportTabularMonthly_HandleMultipleDuringHoursShown (2280 ms)
```
jmarrec added a commit that referenced this issue Jan 20, 2025
The issue was that an if else ladder inside a loop was incorrectly refactored to a switch case:

This was the original thing
```c++
for (int i = ....) {
  SELECT_CASE_var = XXXX
  if (SELECT_CASE_var == blabla) {
    break; // THIS BREAKS THE FOR LOOP
   } else ...
}
```

The refactor:

```c++
for (int i = ....) {
  switch (XXX) {
  case blabla:
    break; // THIS DO NOT BREAK THE FOR LOOP, it just prevents other `case`s to be processed (fallthrough)
  }
  ...
 }
```

255e7e939fc?w=1#diff-79e778e07bedf79acf027aa76c1235badd89a6f3014b6f0cdadc4ada74402ae3R3817-R3827
jmarrec added a commit that referenced this issue Jan 21, 2025
```
[ RUN      ] EnergyPlusFixture.OutputReportTabularMonthly_HandleMultipleDuringHoursShown
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13785: Failure
Expected equality of these values:
  0.0
    Which is: 0
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 1
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13795: Failure
Expected equality of these values:
  0.0
    Which is: 0
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 2
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13805: Failure
Expected equality of these values:
  1.0
    Which is: 1
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 3
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13815: Failure
Expected equality of these values:
  2.0
    Which is: 2
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 4
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/OutputReportTabular.unit.cc:13824: Failure
Expected equality of these values:
  2.0
    Which is: 2
  ort->MonthlyColumns(colValueWhenConditionNotA).reslt(12)
    Which is: 5
[  FAILED  ] EnergyPlusFixture.OutputReportTabularMonthly_HandleMultipleDuringHoursShown (2280 ms)
```
jmarrec added a commit that referenced this issue Jan 21, 2025
The issue was that an if else ladder inside a loop was incorrectly refactored to a switch case:

This was the original thing
```c++
for (int i = ....) {
  SELECT_CASE_var = XXXX
  if (SELECT_CASE_var == blabla) {
    break; // THIS BREAKS THE FOR LOOP
   } else ...
}
```

The refactor:

```c++
for (int i = ....) {
  switch (XXX) {
  case blabla:
    break; // THIS DO NOT BREAK THE FOR LOOP, it just prevents other `case`s to be processed (fallthrough)
  }
  ...
 }
```

255e7e939fc?w=1#diff-79e778e07bedf79acf027aa76c1235badd89a6f3014b6f0cdadc4ada74402ae3R3817-R3827
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
2 participants