Repository: NREL/OpenStudio (language: python)

Issue:
DistrictHeating meter is renamed to DistrictHeatingWater
Issue overview
--------------
Translation of OSM to IDF is using old DistrictHeating meter name rather than the new DistrictHeatingWater meter name.  I'm not sure if DistrictCooling was also renamed as well.

## Current Behavior
Translation of OSM to IDF is generating:

```
Output:Table:Monthly,
  Building Energy Performance - District Heating, !- Name
  2,                                      !- Digits After Decimal
  InteriorLights:DistrictHeating,         !- Variable or Meter Name 1
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
  ExteriorLights:DistrictHeating,         !- Variable or Meter Name 2
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
  InteriorEquipment:DistrictHeating,      !- Variable or Meter Name 3
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
  ExteriorEquipment:DistrictHeating,      !- Variable or Meter Name 4
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
  Fans:DistrictHeating,                   !- Variable or Meter Name 5
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
  Pumps:DistrictHeating,                  !- Variable or Meter Name 6
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
  Heating:DistrictHeating,                !- Variable or Meter Name 7
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
  Cooling:DistrictHeating,                !- Variable or Meter Name 8
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
  HeatRejection:DistrictHeating,          !- Variable or Meter Name 9
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
  Humidifier:DistrictHeating,             !- Variable or Meter Name 10
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
  HeatRecovery:DistrictHeating,           !- Variable or Meter Name 11
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
  WaterSystems:DistrictHeating,           !- Variable or Meter Name 12
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
  Cogeneration:DistrictHeating,           !- Variable or Meter Name 13
  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13

Output:Meter,
  DistrictHeating:Facility,               !- Key Name
  Timestep;  
```

## Expected Behavior
Translation of OSM to IDF should generate:

```
Output:Table:Monthly,
  Building Energy Performance - District Heating, !- Name
  2,                                      !- Digits After Decimal
  InteriorLights:DistrictHeatingWater,         !- Variable or Meter Name 1
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
  ExteriorLights:DistrictHeatingWater,         !- Variable or Meter Name 2
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
  InteriorEquipment:DistrictHeatingWater,      !- Variable or Meter Name 3
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
  ExteriorEquipment:DistrictHeatingWater,      !- Variable or Meter Name 4
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
  Fans:DistrictHeatingWater,                   !- Variable or Meter Name 5
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
  Pumps:DistrictHeatingWater,                  !- Variable or Meter Name 6
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
  Heating:DistrictHeatingWater,                !- Variable or Meter Name 7
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
  Cooling:DistrictHeatingWater,                !- Variable or Meter Name 8
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
  HeatRejection:DistrictHeatingWater,          !- Variable or Meter Name 9
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
  Humidifier:DistrictHeatingWater,             !- Variable or Meter Name 10
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
  HeatRecovery:DistrictHeatingWater,           !- Variable or Meter Name 11
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
  WaterSystems:DistrictHeatingWater,           !- Variable or Meter Name 12
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
  Cogeneration:DistrictHeatingWater,           !- Variable or Meter Name 13
  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13

Output:Meter,
  DistrictHeatingWater:Facility,               !- Key Name
  Timestep;  
```

## Possible Solution
I'm not sure all the places the old name might be referenced, this might be one: https://github.com/NREL/OpenStudio/blob/develop/src/workflow/RunPreProcessMonthlyReports.hpp

### Environment

Some additional details about your environment for this issue (if relevant):
 - Platform (Operating system, version): Windows 11
 - Version of OpenStudio (if using an intermediate build, include SHA): 3.7.0

### Context
Cannot view DistrictHeating monthly end uses

May also need to update the OpenStudio Results measure to match

DistrictHeating meter is renamed to DistrictHeatingWater
Issue overview
--------------
Translation of OSM to IDF is using old DistrictHeating meter name rather than the new DistrictHeatingWater meter name.  I'm not sure if DistrictCooling was also renamed as well.

## Current Behavior
Translation of OSM to IDF is generating:

```
Output:Table:Monthly,
  Building Energy Performance - District Heating, !- Name
  2,                                      !- Digits After Decimal
  InteriorLights:DistrictHeating,         !- Variable or Meter Name 1
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
  ExteriorLights:DistrictHeating,         !- Variable or Meter Name 2
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
  InteriorEquipment:DistrictHeating,      !- Variable or Meter Name 3
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
  ExteriorEquipment:DistrictHeating,      !- Variable or Meter Name 4
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
  Fans:DistrictHeating,                   !- Variable or Meter Name 5
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
  Pumps:DistrictHeating,                  !- Variable or Meter Name 6
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
  Heating:DistrictHeating,                !- Variable or Meter Name 7
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
  Cooling:DistrictHeating,                !- Variable or Meter Name 8
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
  HeatRejection:DistrictHeating,          !- Variable or Meter Name 9
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
  Humidifier:DistrictHeating,             !- Variable or Meter Name 10
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
  HeatRecovery:DistrictHeating,           !- Variable or Meter Name 11
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
  WaterSystems:DistrictHeating,           !- Variable or Meter Name 12
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
  Cogeneration:DistrictHeating,           !- Variable or Meter Name 13
  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13

Output:Meter,
  DistrictHeating:Facility,               !- Key Name
  Timestep;  
```

## Expected Behavior
Translation of OSM to IDF should generate:

```
Output:Table:Monthly,
  Building Energy Performance - District Heating, !- Name
  2,                                      !- Digits After Decimal
  InteriorLights:DistrictHeatingWater,         !- Variable or Meter Name 1
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
  ExteriorLights:DistrictHeatingWater,         !- Variable or Meter Name 2
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
  InteriorEquipment:DistrictHeatingWater,      !- Variable or Meter Name 3
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
  ExteriorEquipment:DistrictHeatingWater,      !- Variable or Meter Name 4
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
  Fans:DistrictHeatingWater,                   !- Variable or Meter Name 5
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
  Pumps:DistrictHeatingWater,                  !- Variable or Meter Name 6
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
  Heating:DistrictHeatingWater,                !- Variable or Meter Name 7
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
  Cooling:DistrictHeatingWater,                !- Variable or Meter Name 8
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
  HeatRejection:DistrictHeatingWater,          !- Variable or Meter Name 9
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
  Humidifier:DistrictHeatingWater,             !- Variable or Meter Name 10
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
  HeatRecovery:DistrictHeatingWater,           !- Variable or Meter Name 11
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
  WaterSystems:DistrictHeatingWater,           !- Variable or Meter Name 12
  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
  Cogeneration:DistrictHeatingWater,           !- Variable or Meter Name 13
  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13

Output:Meter,
  DistrictHeatingWater:Facility,               !- Key Name
  Timestep;  
```

## Possible Solution
I'm not sure all the places the old name might be referenced, this might be one: https://github.com/NREL/OpenStudio/blob/develop/src/workflow/RunPreProcessMonthlyReports.hpp

### Environment

Some additional details about your environment for this issue (if relevant):
 - Platform (Operating system, version): Windows 11
 - Version of OpenStudio (if using an intermediate build, include SHA): 3.7.0

### Context
Cannot view DistrictHeating monthly end uses

May also need to update the OpenStudio Results measure to match



Discussion / hints:
Example model to reproduce
[example.osm.txt](https://github.com/NREL/OpenStudio/files/14471792/example.osm.txt)

Example model to reproduce
[example.osm.txt](https://github.com/NREL/OpenStudio/files/14471792/example.osm.txt)


Fix patch:
diff --git a/developer/ruby/GeneratePreProcessMonthlyReports.rb b/developer/ruby/GeneratePreProcessMonthlyReports.rb
new file mode 100644
index 00000000000..11d6142553b
--- /dev/null
+++ b/developer/ruby/GeneratePreProcessMonthlyReports.rb
@@ -0,0 +1,123 @@
+# To regenerate OpenSutdio/src/workflow/RunPreProcessMonthlyReports.hpp
+require 'openstudio'
+
+include OpenStudio::Model
+
+excluded_EUTs = ["HeatingCoils", "CoolingCoils", "Boilers", "Baseboard", "HeatRecoveryForCooling", "HeatRecoveryForHeating"].map{|s| OpenStudio::EndUseType.new(s)}
+included_EUTs = OpenStudio::EndUseType.getValues.map{|i| OpenStudio::EndUseType.new(i)}.reject{|x| excluded_EUTs.include?(x)}
+included_EUTs.map(&:valueDescription)
+
+# excluded_FTs= ["Solar", "Geothermal"].map{|s| OpenStudio::FuelType.new(s)} # These are rejected by OutputMeter
+# included_FTs = OpenStudio::FuelType.getValues.map{|i| OpenStudio::FuelType.new(i)}.reject{|x| excluded_FTs.include?(x)}.map(&:valueDescription)
+included_FTs = ["Electricity", "NaturalGas", "DistrictHeatingWater", "DistrictCooling"].map{|s| OpenStudio::FuelType.new(s)}
+
+c_monthlyReports = ""
+
+specificEndUseType = OpenStudio::OptionalString.new()
+installLocationType = OpenStudio::OptionalInstallLocationType.new()
+specificInstallLocation = OpenStudio::OptionalString.new()
+ft_excludes_euts = {
+  OpenStudio::FuelType.new("NaturalGas").value => ["InteriorLights", "ExteriorLights", "Fans", "Pumps", "HeatRejection", "Humidifier", "HeatRecovery", "Refrigeration"].map{|s| OpenStudio::EndUseType.new(s)},
+  OpenStudio::FuelType.new("DistrictHeatingWater").value => ["Refrigeration"].map{|s| OpenStudio::EndUseType.new(s)},
+  OpenStudio::FuelType.new("DistrictCooling").value => ["Refrigeration"].map{|s| OpenStudio::EndUseType.new(s)},
+}
+
+w = OpenStudio::Workspace.new("None".to_StrictnessLevel, "EnergyPlus".to_IddFileType)
+included_FTs.each do |ft|
+  i = w.addObject(OpenStudio::IdfObject.new("Output:Table:Monthly".to_IddObjectType)).get
+
+  table_name = OpenStudio::EndUseFuelType.new(ft.valueName).valueDescription
+  i.setName("Building Energy Performance - #{table_name}")
+  i.setInt(1, 2) # Digits after decimal
+  this_included_EUTs = included_EUTs
+  if ft_excludes_euts.include?(ft.value)
+    this_included_EUTs = this_included_EUTs.reject{|x| ft_excludes_euts[ft.value].include?(x)}
+  end
+  this_included_EUTs.each do |eut|
+    ig = i.pushExtensibleGroup
+    name = OutputMeter::getName(specificEndUseType, OpenStudio::OptionalEndUseType.new(eut), OpenStudio::OptionalFuelType.new(ft), installLocationType, specificInstallLocation)
+    ig.setString(0, name)
+    ig.setString(1, "SumOrAverage")
+  end
+
+  c_monthlyReports << "\n" << '  R"idf(' << "\n" << i.to_s.chomp << ')idf",'
+end
+
+facilityLoc = OpenStudio::OptionalInstallLocationType.new(OpenStudio::InstallLocationType.new("Facility"))
+included_FTs.each do |ft|
+  i = w.addObject(OpenStudio::IdfObject.new("Output:Table:Monthly".to_IddObjectType)).get
+
+  table_name = OpenStudio::EndUseFuelType.new(ft.valueName).valueDescription
+  i.setName("Building Energy Performance - #{table_name} Peak Demand")
+  i.setInt(1, 2) # Digits after decimal
+  ig = i.pushExtensibleGroup
+  facility_meter_name = OutputMeter::getName(specificEndUseType, OpenStudio::OptionalEndUseType.new(), OpenStudio::OptionalFuelType.new(ft), facilityLoc, specificInstallLocation)
+
+  ig.setString(0, facility_meter_name)
+  ig.setString(1, "Maximum")
+
+  this_included_EUTs = included_EUTs
+  if ft_excludes_euts.include?(ft.value)
+    this_included_EUTs = this_included_EUTs.reject{|x| ft_excludes_euts[ft.value].include?(x)}
+  end
+  this_included_EUTs.each do |eut|
+    ig = i.pushExtensibleGroup
+    name = OutputMeter::getName(specificEndUseType, OpenStudio::OptionalEndUseType.new(eut), OpenStudio::OptionalFuelType.new(ft), installLocationType, specificInstallLocation)
+    ig.setString(0, name)
+    ig.setString(1, "ValueWhenMaximumOrMinimum")
+  end
+
+  c_monthlyReports << "\n" << '  R"idf(' << "\n" << i.to_s.chomp << ')idf",'
+end
+
+n_tables = included_FTs.size * 2
+cpp_code = """/***********************************************************************************************************************
+*  OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
+*  See also https://openstudio.net/license
+***********************************************************************************************************************/
+
+#ifndef WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP
+#define WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP
+
+#include <array>
+#include <string_view>
+
+// NOTE: see OpenStudio/developer/ruby/GeneratePreProcessMonthlyReports.rb
+
+"""
+cpp_code << "static constexpr std::array<std::string_view, #{n_tables}> c_monthlyReports = {"
+cpp_code << c_monthlyReports.chop << "};"
+
+calib_meterfileonlys = [
+  ["NaturalGas", "Daily"],
+  ["Electricity", "Timestep"],
+  ["Electricity", "Daily"],
+]
+
+n_metersForced = calib_meterfileonlys.size + included_FTs.size
+cpp_code << "\n\nstatic constexpr std::array<std::string_view, #{n_metersForced}> c_metersForced{\n"
+cpp_code << "  // These are needed for the calibration report\n"
+
+calib_meterfileonlys.each do |ft_name, freq|
+  ft = OpenStudio::FuelType.new(ft_name)
+  facility_meter_name = OutputMeter::getName(specificEndUseType, OpenStudio::OptionalEndUseType.new(), OpenStudio::OptionalFuelType.new(ft), facilityLoc, specificInstallLocation)
+  cpp_code << '  "Output:Meter:MeterFileOnly,' << facility_meter_name << "," << freq << ';",' << "\n"
+end
+
+cpp_code << "\n  // Always add in the timestep facility meters\n"
+
+included_FTs.each do |ft|
+  facility_meter_name = OutputMeter::getName(specificEndUseType, OpenStudio::OptionalEndUseType.new(), OpenStudio::OptionalFuelType.new(ft), facilityLoc, specificInstallLocation)
+  cpp_code << '  "Output:Meter,' << facility_meter_name << ',Timestep;",' << "\n"
+end
+cpp_code << "};\n\n"
+cpp_code << "#endif  // WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP\n"
+
+ROOT_DIR = File.absolute_path(File.join(File.dirname(__FILE__), "../../"))
+PREPROCESS_FILE = File.join(ROOT_DIR, "src/workflow/RunPreProcessMonthlyReports.hpp")
+raise "File #{PREPROCESS_FILE} does not exist" unless File.exist?(PREPROCESS_FILE)
+# puts cpp_code
+File.write(PREPROCESS_FILE, cpp_code)
+
+# Save to workflow-gem and also paste the text into workflow/util/energyplus.rb
+# w.save('/path/to/OpenStudio-workflow-gem/lib/openstudio/workflow/jobs/resources/monthly_report.idf', true)
diff --git a/src/workflow/CMakeLists.txt b/src/workflow/CMakeLists.txt
index 23e406f23ec..b5c2ab99edb 100644
--- a/src/workflow/CMakeLists.txt
+++ b/src/workflow/CMakeLists.txt
@@ -36,6 +36,7 @@ if(BUILD_TESTING)
 
   set(openstudio_workflow_test_src
     test/Util_GTest.cpp
+    test/RunPreProcessMonthlyReports_GTest.cpp
   )
 
   CREATE_TEST_TARGETS(openstudio_workflow "${openstudio_workflow_test_src}" "${openstudio_workflow_test_depends}")
diff --git a/src/workflow/RunPreProcessMonthlyReports.hpp b/src/workflow/RunPreProcessMonthlyReports.hpp
index 422a52172d4..8c79cfe4532 100644
--- a/src/workflow/RunPreProcessMonthlyReports.hpp
+++ b/src/workflow/RunPreProcessMonthlyReports.hpp
@@ -3,236 +3,250 @@
 *  See also https://openstudio.net/license
 ***********************************************************************************************************************/
 
+#ifndef WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP
+#define WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP
+
 #include <array>
 #include <string_view>
 
+// NOTE: see OpenStudio/developer/ruby/GeneratePreProcessMonthlyReports.rb
+
 static constexpr std::array<std::string_view, 8> c_monthlyReports = {
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - Electricity,  !- Name
-      2,                       !- Digits After Decimal
-      InteriorLights:Electricity,  !- Variable or Meter 1 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:Electricity,  !- Variable or Meter 2 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:Electricity,  !- Variable or Meter 3 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:Electricity,  !- Variable or Meter 4 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 4
-      Fans:Electricity,        !- Variable or Meter 5 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 5
-      Pumps:Electricity,       !- Variable or Meter 6 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 6
-      Heating:Electricity,     !- Variable or Meter 7 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 7
-      Cooling:Electricity,     !- Variable or Meter 8 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:Electricity,  !- Variable or Meter 9 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:Electricity,  !- Variable or Meter 10 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:Electricity,!- Variable or Meter 11 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:Electricity,!- Variable or Meter 12 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:Electricity,!- Variable or Meter 13 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 13
-      Refrigeration:Electricity,!- Variable or Meter 14 Name
-      SumOrAverage;            !- Aggregation Type for Variable or Meter 14)idf",
+Output:Table:Monthly,
+  Building Energy Performance - Electricity, !- Name
+  2,                                      !- Digits After Decimal
+  InteriorLights:Electricity,             !- Variable or Meter Name 1
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
+  ExteriorLights:Electricity,             !- Variable or Meter Name 2
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
+  InteriorEquipment:Electricity,          !- Variable or Meter Name 3
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
+  ExteriorEquipment:Electricity,          !- Variable or Meter Name 4
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
+  Fans:Electricity,                       !- Variable or Meter Name 5
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
+  Pumps:Electricity,                      !- Variable or Meter Name 6
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
+  Heating:Electricity,                    !- Variable or Meter Name 7
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
+  Cooling:Electricity,                    !- Variable or Meter Name 8
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
+  HeatRejection:Electricity,              !- Variable or Meter Name 9
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
+  Humidifier:Electricity,                 !- Variable or Meter Name 10
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
+  HeatRecovery:Electricity,               !- Variable or Meter Name 11
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
+  WaterSystems:Electricity,               !- Variable or Meter Name 12
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
+  Cogeneration:Electricity,               !- Variable or Meter Name 13
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 13
+  Refrigeration:Electricity,              !- Variable or Meter Name 14
+  SumOrAverage;                           !- Aggregation Type for Variable or Meter 14
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - Natural Gas,  !- Name
-      2,                       !- Digits After Decimal
-      InteriorEquipment:NaturalGas,   !- Variable or Meter 1 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 1
-      ExteriorEquipment:NaturalGas,   !- Variable or Meter 2 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 2
-      Heating:NaturalGas,             !- Variable or Meter 3 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 3
-      Cooling:NaturalGas,             !- Variable or Meter 4 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 4
-      WaterSystems:NaturalGas,        !- Variable or Meter 5 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 5
-      Cogeneration:NaturalGas,        !- Variable or Meter 6 Name
-      SumOrAverage;            !- Aggregation Type for Variable or Meter 6)idf",
+Output:Table:Monthly,
+  Building Energy Performance - Natural Gas, !- Name
+  2,                                      !- Digits After Decimal
+  InteriorEquipment:NaturalGas,           !- Variable or Meter Name 1
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
+  ExteriorEquipment:NaturalGas,           !- Variable or Meter Name 2
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
+  Heating:NaturalGas,                     !- Variable or Meter Name 3
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
+  Cooling:NaturalGas,                     !- Variable or Meter Name 4
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
+  WaterSystems:NaturalGas,                !- Variable or Meter Name 5
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
+  Cogeneration:NaturalGas,                !- Variable or Meter Name 6
+  SumOrAverage;                           !- Aggregation Type for Variable or Meter 6
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - District Heating,  !- Name
-      2,                       !- Digits After Decimal
-      InteriorLights:DistrictHeating,  !- Variable or Meter 1 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:DistrictHeating,  !- Variable or Meter 2 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:DistrictHeating,  !- Variable or Meter 3 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:DistrictHeating,  !- Variable or Meter 4 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 4
-      Fans:DistrictHeating,        !- Variable or Meter 5 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 5
-      Pumps:DistrictHeating,       !- Variable or Meter 6 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 6
-      Heating:DistrictHeating,     !- Variable or Meter 7 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 7
-      Cooling:DistrictHeating,     !- Variable or Meter 8 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:DistrictHeating,  !- Variable or Meter 9 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:DistrictHeating,  !- Variable or Meter 10 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:DistrictHeating,!- Variable or Meter 11 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:DistrictHeating,!- Variable or Meter 12 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:DistrictHeating,!- Variable or Meter 13 Name
-      SumOrAverage;            !- Aggregation Type for Variable or Meter 13)idf",
+Output:Table:Monthly,
+  Building Energy Performance - District Heating Water, !- Name
+  2,                                      !- Digits After Decimal
+  InteriorLights:DistrictHeatingWater,    !- Variable or Meter Name 1
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
+  ExteriorLights:DistrictHeatingWater,    !- Variable or Meter Name 2
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
+  InteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 3
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
+  ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 4
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
+  Fans:DistrictHeatingWater,              !- Variable or Meter Name 5
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
+  Pumps:DistrictHeatingWater,             !- Variable or Meter Name 6
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
+  Heating:DistrictHeatingWater,           !- Variable or Meter Name 7
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
+  Cooling:DistrictHeatingWater,           !- Variable or Meter Name 8
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
+  HeatRejection:DistrictHeatingWater,     !- Variable or Meter Name 9
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
+  Humidifier:DistrictHeatingWater,        !- Variable or Meter Name 10
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
+  HeatRecovery:DistrictHeatingWater,      !- Variable or Meter Name 11
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
+  WaterSystems:DistrictHeatingWater,      !- Variable or Meter Name 12
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
+  Cogeneration:DistrictHeatingWater,      !- Variable or Meter Name 13
+  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - District Cooling,  !- Name
-      2,                       !- Digits After Decimal
-      InteriorLights:DistrictCooling,  !- Variable or Meter 1 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:DistrictCooling,  !- Variable or Meter 2 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:DistrictCooling,  !- Variable or Meter 3 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:DistrictCooling,  !- Variable or Meter 4 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 4
-      Fans:DistrictCooling,        !- Variable or Meter 5 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 5
-      Pumps:DistrictCooling,       !- Variable or Meter 6 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 6
-      Heating:DistrictCooling,     !- Variable or Meter 7 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 7
-      Cooling:DistrictCooling,     !- Variable or Meter 8 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:DistrictCooling,  !- Variable or Meter 9 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:DistrictCooling,  !- Variable or Meter 10 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:DistrictCooling,!- Variable or Meter 11 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:DistrictCooling,!- Variable or Meter 12 Name
-      SumOrAverage,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:DistrictCooling,!- Variable or Meter 13 Name
-      SumOrAverage;            !- Aggregation Type for Variable or Meter 13)idf",
+Output:Table:Monthly,
+  Building Energy Performance - District Cooling, !- Name
+  2,                                      !- Digits After Decimal
+  InteriorLights:DistrictCooling,         !- Variable or Meter Name 1
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 1
+  ExteriorLights:DistrictCooling,         !- Variable or Meter Name 2
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 2
+  InteriorEquipment:DistrictCooling,      !- Variable or Meter Name 3
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 3
+  ExteriorEquipment:DistrictCooling,      !- Variable or Meter Name 4
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 4
+  Fans:DistrictCooling,                   !- Variable or Meter Name 5
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 5
+  Pumps:DistrictCooling,                  !- Variable or Meter Name 6
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 6
+  Heating:DistrictCooling,                !- Variable or Meter Name 7
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 7
+  Cooling:DistrictCooling,                !- Variable or Meter Name 8
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 8
+  HeatRejection:DistrictCooling,          !- Variable or Meter Name 9
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 9
+  Humidifier:DistrictCooling,             !- Variable or Meter Name 10
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 10
+  HeatRecovery:DistrictCooling,           !- Variable or Meter Name 11
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 11
+  WaterSystems:DistrictCooling,           !- Variable or Meter Name 12
+  SumOrAverage,                           !- Aggregation Type for Variable or Meter 12
+  Cogeneration:DistrictCooling,           !- Variable or Meter Name 13
+  SumOrAverage;                           !- Aggregation Type for Variable or Meter 13
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - Electricity Peak Demand,  !- Name
-      2,                       !- Digits After Decimal
-      Electricity:Facility,  !- Variable or Meter 1 Name
-      Maximum,            !- Aggregation Type for Variable or Meter 1
-      InteriorLights:Electricity,  !- Variable or Meter 1 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:Electricity,  !- Variable or Meter 2 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:Electricity,  !- Variable or Meter 3 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:Electricity,  !- Variable or Meter 4 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 4
-      Fans:Electricity,        !- Variable or Meter 5 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 5
-      Pumps:Electricity,       !- Variable or Meter 6 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 6
-      Heating:Electricity,     !- Variable or Meter 7 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 7
-      Cooling:Electricity,     !- Variable or Meter 8 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:Electricity,  !- Variable or Meter 9 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:Electricity,  !- Variable or Meter 10 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:Electricity,!- Variable or Meter 11 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:Electricity,!- Variable or Meter 12 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:Electricity,!- Variable or Meter 13 Name
-      ValueWhenMaximumOrMinimum;            !- Aggregation Type for Variable or Meter 13)idf",
+Output:Table:Monthly,
+  Building Energy Performance - Electricity Peak Demand, !- Name
+  2,                                      !- Digits After Decimal
+  Electricity:Facility,                   !- Variable or Meter Name 1
+  Maximum,                                !- Aggregation Type for Variable or Meter 1
+  InteriorLights:Electricity,             !- Variable or Meter Name 2
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 2
+  ExteriorLights:Electricity,             !- Variable or Meter Name 3
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 3
+  InteriorEquipment:Electricity,          !- Variable or Meter Name 4
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 4
+  ExteriorEquipment:Electricity,          !- Variable or Meter Name 5
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 5
+  Fans:Electricity,                       !- Variable or Meter Name 6
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 6
+  Pumps:Electricity,                      !- Variable or Meter Name 7
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 7
+  Heating:Electricity,                    !- Variable or Meter Name 8
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 8
+  Cooling:Electricity,                    !- Variable or Meter Name 9
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 9
+  HeatRejection:Electricity,              !- Variable or Meter Name 10
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 10
+  Humidifier:Electricity,                 !- Variable or Meter Name 11
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 11
+  HeatRecovery:Electricity,               !- Variable or Meter Name 12
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 12
+  WaterSystems:Electricity,               !- Variable or Meter Name 13
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 13
+  Cogeneration:Electricity,               !- Variable or Meter Name 14
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 14
+  Refrigeration:Electricity,              !- Variable or Meter Name 15
+  ValueWhenMaximumOrMinimum;              !- Aggregation Type for Variable or Meter 15
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - Natural Gas Peak Demand,  !- Name
-      2,                       !- Digits After Decimal
-      NaturalGas:Facility,  !- Variable or Meter 1 Name
-      Maximum,            !- Aggregation Type for Variable or Meter 1
-      InteriorEquipment:NaturalGas,   !- Variable or Meter 1 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 1
-      ExteriorEquipment:NaturalGas,   !- Variable or Meter 2 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 2
-      Heating:NaturalGas,             !- Variable or Meter 3 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 3
-      Cooling:NaturalGas,             !- Variable or Meter 4 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 4
-      WaterSystems:NaturalGas,        !- Variable or Meter 5 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 5
-      Cogeneration:NaturalGas,        !- Variable or Meter 6 Name
-      ValueWhenMaximumOrMinimum;            !- Aggregation Type for Variable or Meter 6)idf",
+Output:Table:Monthly,
+  Building Energy Performance - Natural Gas Peak Demand, !- Name
+  2,                                      !- Digits After Decimal
+  NaturalGas:Facility,                    !- Variable or Meter Name 1
+  Maximum,                                !- Aggregation Type for Variable or Meter 1
+  InteriorEquipment:NaturalGas,           !- Variable or Meter Name 2
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 2
+  ExteriorEquipment:NaturalGas,           !- Variable or Meter Name 3
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 3
+  Heating:NaturalGas,                     !- Variable or Meter Name 4
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 4
+  Cooling:NaturalGas,                     !- Variable or Meter Name 5
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 5
+  WaterSystems:NaturalGas,                !- Variable or Meter Name 6
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 6
+  Cogeneration:NaturalGas,                !- Variable or Meter Name 7
+  ValueWhenMaximumOrMinimum;              !- Aggregation Type for Variable or Meter 7
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - District Heating Peak Demand,  !- Name
-      2,                       !- Digits After Decimal
-      DistrictHeating:Facility,  !- Variable or Meter 1 Name
-      Maximum,            !- Aggregation Type for Variable or Meter 1
-      InteriorLights:DistrictHeating,  !- Variable or Meter 1 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:DistrictHeating,  !- Variable or Meter 2 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:DistrictHeating,  !- Variable or Meter 3 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:DistrictHeating,  !- Variable or Meter 4 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 4
-      Fans:DistrictHeating,        !- Variable or Meter 5 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 5
-      Pumps:DistrictHeating,       !- Variable or Meter 6 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 6
-      Heating:DistrictHeating,     !- Variable or Meter 7 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 7
-      Cooling:DistrictHeating,     !- Variable or Meter 8 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:DistrictHeating,  !- Variable or Meter 9 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:DistrictHeating,  !- Variable or Meter 10 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:DistrictHeating,!- Variable or Meter 11 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:DistrictHeating,!- Variable or Meter 12 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:DistrictHeating,!- Variable or Meter 13 Name
-      ValueWhenMaximumOrMinimum;            !- Aggregation Type for Variable or Meter 13)idf",
+Output:Table:Monthly,
+  Building Energy Performance - District Heating Water Peak Demand, !- Name
+  2,                                      !- Digits After Decimal
+  DistrictHeatingWater:Facility,          !- Variable or Meter Name 1
+  Maximum,                                !- Aggregation Type for Variable or Meter 1
+  InteriorLights:DistrictHeatingWater,    !- Variable or Meter Name 2
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 2
+  ExteriorLights:DistrictHeatingWater,    !- Variable or Meter Name 3
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 3
+  InteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 4
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 4
+  ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 5
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 5
+  Fans:DistrictHeatingWater,              !- Variable or Meter Name 6
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 6
+  Pumps:DistrictHeatingWater,             !- Variable or Meter Name 7
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 7
+  Heating:DistrictHeatingWater,           !- Variable or Meter Name 8
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 8
+  Cooling:DistrictHeatingWater,           !- Variable or Meter Name 9
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 9
+  HeatRejection:DistrictHeatingWater,     !- Variable or Meter Name 10
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 10
+  Humidifier:DistrictHeatingWater,        !- Variable or Meter Name 11
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 11
+  HeatRecovery:DistrictHeatingWater,      !- Variable or Meter Name 12
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 12
+  WaterSystems:DistrictHeatingWater,      !- Variable or Meter Name 13
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 13
+  Cogeneration:DistrictHeatingWater,      !- Variable or Meter Name 14
+  ValueWhenMaximumOrMinimum;              !- Aggregation Type for Variable or Meter 14
+)idf",
   R"idf(
-  Output:Table:Monthly,
-    Building Energy Performance - District Cooling Peak Demand,  !- Name
-      2,                       !- Digits After Decimal
-      DistrictCooling:Facility,  !- Variable or Meter 1 Name
-      Maximum,            !- Aggregation Type for Variable or Meter 1
-      InteriorLights:DistrictCooling,  !- Variable or Meter 1 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 1
-      ExteriorLights:DistrictCooling,  !- Variable or Meter 2 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 2
-      InteriorEquipment:DistrictCooling,  !- Variable or Meter 3 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 3
-      ExteriorEquipment:DistrictCooling,  !- Variable or Meter 4 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 4
-      Fans:DistrictCooling,        !- Variable or Meter 5 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 5
-      Pumps:DistrictCooling,       !- Variable or Meter 6 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 6
-      Heating:DistrictCooling,     !- Variable or Meter 7 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 7
-      Cooling:DistrictCooling,     !- Variable or Meter 8 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 8
-      HeatRejection:DistrictCooling,  !- Variable or Meter 9 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 9
-      Humidifier:DistrictCooling,  !- Variable or Meter 10 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 10
-      HeatRecovery:DistrictCooling,!- Variable or Meter 11 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 11
-      WaterSystems:DistrictCooling,!- Variable or Meter 12 Name
-      ValueWhenMaximumOrMinimum,            !- Aggregation Type for Variable or Meter 12
-      Cogeneration:DistrictCooling,!- Variable or Meter 13 Name
-      ValueWhenMaximumOrMinimum;            !- Aggregation Type for Variable or Meter 13
+Output:Table:Monthly,
+  Building Energy Performance - District Cooling Peak Demand, !- Name
+  2,                                      !- Digits After Decimal
+  DistrictCooling:Facility,               !- Variable or Meter Name 1
+  Maximum,                                !- Aggregation Type for Variable or Meter 1
+  InteriorLights:DistrictCooling,         !- Variable or Meter Name 2
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 2
+  ExteriorLights:DistrictCooling,         !- Variable or Meter Name 3
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 3
+  InteriorEquipment:DistrictCooling,      !- Variable or Meter Name 4
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 4
+  ExteriorEquipment:DistrictCooling,      !- Variable or Meter Name 5
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 5
+  Fans:DistrictCooling,                   !- Variable or Meter Name 6
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 6
+  Pumps:DistrictCooling,                  !- Variable or Meter Name 7
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 7
+  Heating:DistrictCooling,                !- Variable or Meter Name 8
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 8
+  Cooling:DistrictCooling,                !- Variable or Meter Name 9
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 9
+  HeatRejection:DistrictCooling,          !- Variable or Meter Name 10
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 10
+  Humidifier:DistrictCooling,             !- Variable or Meter Name 11
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 11
+  HeatRecovery:DistrictCooling,           !- Variable or Meter Name 12
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 12
+  WaterSystems:DistrictCooling,           !- Variable or Meter Name 13
+  ValueWhenMaximumOrMinimum,              !- Aggregation Type for Variable or Meter 13
+  Cogeneration:DistrictCooling,           !- Variable or Meter Name 14
+  ValueWhenMaximumOrMinimum;              !- Aggregation Type for Variable or Meter 14
 )idf"};
 
 static constexpr std::array<std::string_view, 7> c_metersForced{
-  //These are needed for the calibration report
+  // These are needed for the calibration report
   "Output:Meter:MeterFileOnly,NaturalGas:Facility,Daily;",
   "Output:Meter:MeterFileOnly,Electricity:Facility,Timestep;",
   "Output:Meter:MeterFileOnly,Electricity:Facility,Daily;",
@@ -240,6 +254,8 @@ static constexpr std::array<std::string_view, 7> c_metersForced{
   // Always add in the timestep facility meters
   "Output:Meter,Electricity:Facility,Timestep;",
   "Output:Meter,NaturalGas:Facility,Timestep;",
+  "Output:Meter,DistrictHeatingWater:Facility,Timestep;",
   "Output:Meter,DistrictCooling:Facility,Timestep;",
-  "Output:Meter,DistrictHeating:Facility,Timestep;",
 };
+
+#endif  // WORKFLOW_RUNPREPROCESSMONTHLY_REPORTS_HPP


Test patch:
diff --git a/src/workflow/test/RunPreProcessMonthlyReports_GTest.cpp b/src/workflow/test/RunPreProcessMonthlyReports_GTest.cpp
new file mode 100644
index 00000000000..fdcfcab582b
--- /dev/null
+++ b/src/workflow/test/RunPreProcessMonthlyReports_GTest.cpp
@@ -0,0 +1,138 @@
+/***********************************************************************************************************************
+*  OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
+*  See also https://openstudio.net/license
+***********************************************************************************************************************/
+
+#include <gtest/gtest.h>
+
+#include "../RunPreProcessMonthlyReports.hpp"
+#include "../../model/OutputMeter.hpp"
+
+#include "../../utilities/data/DataEnums.hpp"
+#include "../../utilities/idf/IdfObject.hpp"
+#include "../../utilities/idf/IdfExtensibleGroup.hpp"
+
+#include <boost/regex.hpp>
+
+#include <string>
+
+class WorkflowFixture : public testing::Test
+{
+};
+
+TEST_F(WorkflowFixture, RunPreProcessMonthlyReports) {
+
+  const std::string peakDemandSuffix = " Peak Demand";
+  const std::string expectedPrefix = "Building Energy Performance";
+
+  size_t n_regular = 0;
+  size_t n_demand = 0;
+
+  const auto meterRegex = openstudio::model::OutputMeter::meterRegex();
+
+  auto endUseType = [&meterRegex](const std::string& name) -> boost::optional<openstudio::EndUseType> {
+    boost::optional<openstudio::EndUseType> result;
+    boost::smatch matches;
+    if (boost::regex_search(name, matches, meterRegex)) {
+      if (matches[2].matched) {
+        result = openstudio::EndUseType(std::string(matches[2].first, matches[2].second));
+      }
+    }
+
+    return result;
+  };
+
+  auto fuelType = [&meterRegex](const std::string& name) -> boost::optional<openstudio::FuelType> {
+    boost::optional<openstudio::FuelType> result;
+    boost::smatch matches;
+    if (boost::regex_search(name, matches, meterRegex)) {
+      if (matches[3].matched) {
+        result = openstudio::FuelType(std::string(matches[3].first, matches[3].second));
+      }
+    }
+
+    return result;
+  };
+
+  auto installLocationType = [&meterRegex](const std::string& name) -> boost::optional<openstudio::InstallLocationType> {
+    boost::optional<openstudio::InstallLocationType> result;
+    boost::smatch matches;
+    if (boost::regex_search(name, matches, meterRegex)) {
+      if (matches[4].matched) {
+        result = openstudio::InstallLocationType(std::string(matches[4].first, matches[4].second));
+      }
+    }
+
+    return result;
+  };
+
+  for (auto meter : c_monthlyReports) {
+    auto idfObject_ = openstudio::IdfObject::load(std::string{meter});
+
+    ASSERT_TRUE(idfObject_);
+    auto idfObject = std::move(*idfObject_);
+    auto name = idfObject.nameString();
+    SCOPED_TRACE("Processing " + name + "\n========================================");
+    const auto n = name.find(" - ");
+    auto tableFuelType = name.substr(n + 3);
+
+    EXPECT_NE(n, std::string::npos);
+    auto prefix = name.substr(0, n);
+    EXPECT_EQ(expectedPrefix, prefix);
+
+    auto demandN = tableFuelType.find(peakDemandSuffix);
+    bool isDemand = false;
+    if (demandN != std::string::npos) {
+      isDemand = true;
+      ++n_demand;
+      tableFuelType = tableFuelType.substr(0, tableFuelType.size() - peakDemandSuffix.size());
+    } else {
+      ++n_regular;
+    }
+    try {
+      auto tableEUFT = openstudio::EndUseFuelType(tableFuelType);
+      EXPECT_EQ(tableFuelType, tableEUFT.valueDescription());
+    } catch (...) {
+      EXPECT_TRUE(false) << tableFuelType << " is not a valid EndUseFuelType";
+    }
+
+    EXPECT_EQ(2, idfObject.getInt(1).get());
+    const std::string aggregrationType = isDemand ? "ValueWhenMaximumOrMinimum" : "SumOrAverage";
+    bool is_first = true;
+    for (const auto& eg : idfObject.extensibleGroups()) {
+      const auto meterName = eg.getString(0).get();
+      SCOPED_TRACE("Processing extensible group " + meterName);
+
+      const auto eut = endUseType(meterName);
+      const auto ft = fuelType(meterName);
+      const auto loc = installLocationType(meterName);
+
+      const auto reconstructedMeterName = openstudio::model::OutputMeter::getName(boost::none, eut, ft, loc, boost::none);
+
+      // This is the definitive test
+      EXPECT_EQ(reconstructedMeterName, meterName);
+
+      if (isDemand && is_first) {
+        // Electricity:Facility : Maximum
+        EXPECT_FALSE(eut) << "EndUseType should not be present";
+        EXPECT_TRUE(ft) << "FuelType should be present";
+        ASSERT_TRUE(loc) << "InstallLocationType should be present";
+        EXPECT_EQ("Facility", loc->valueName());
+
+        EXPECT_EQ("Maximum", eg.getString(1).get());
+
+        is_first = false;
+        continue;
+      }
+
+      EXPECT_TRUE(eut) << "EndUseType should be present";
+      EXPECT_TRUE(ft) << "FuelType should be present";
+      EXPECT_FALSE(loc) << "InstallLocationType should not be present";
+
+      EXPECT_EQ(aggregrationType, eg.getString(1).get());
+    }
+  }
+
+  EXPECT_EQ(n_regular, n_demand);
+  EXPECT_EQ(4, n_regular);
+}