Skip to content

Commit

Permalink
Merge pull request #1059 from NREL/latest-os-hpxml
Browse files Browse the repository at this point in the history
Latest OS-HPXML
  • Loading branch information
joseph-robertson committed Mar 22, 2023
2 parents 746eea1 + a4e9722 commit ae4e65a
Show file tree
Hide file tree
Showing 432 changed files with 4,863 additions and 13,911 deletions.
4 changes: 2 additions & 2 deletions measures/ServerDirectoryCleanup/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>server_directory_cleanup</name>
<uid>ec7d04ad-0b7b-495b-825a-e1b6d28d1d3f</uid>
<version_id>0d932187-f72e-444b-a2d2-783fd0c85634</version_id>
<version_modified>20230321T150352Z</version_modified>
<version_id>3ca380b1-1c29-43e6-8a77-2243d9f75726</version_id>
<version_modified>20230322T174029Z</version_modified>
<xml_checksum>5F1EDF75</xml_checksum>
<class_name>ServerDirectoryCleanup</class_name>
<display_name>Server Directory Cleanup</display_name>
Expand Down
111 changes: 60 additions & 51 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5638,61 +5638,70 @@ def self.set_battery(hpxml, args)
end

def self.set_lighting(hpxml, args)
return unless args[:lighting_present] || args[:ceiling_fan_present] # If ceiling fans present but not lighting present, need to continue and use lighting multipliers = 0 instead

hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_led],
lighting_type: HPXML::LightingTypeLED)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_led],
lighting_type: HPXML::LightingTypeLED)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_led],
lighting_type: HPXML::LightingTypeLED)

if args[:lighting_present]
if args[:lighting_interior_usage_multiplier].is_initialized
hpxml.lighting.interior_usage_multiplier = args[:lighting_interior_usage_multiplier].get
end
has_garage = (args[:geometry_garage_width] * args[:geometry_garage_depth] > 0)

# Interior
if args[:lighting_interior_usage_multiplier].is_initialized
interior_usage_multiplier = args[:lighting_interior_usage_multiplier].get
end
if interior_usage_multiplier.nil? || interior_usage_multiplier.to_f > 0
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationInterior,
fraction_of_units_in_location: args[:lighting_interior_fraction_led],
lighting_type: HPXML::LightingTypeLED)
hpxml.lighting.interior_usage_multiplier = interior_usage_multiplier
end

# Exterior
if args[:lighting_exterior_usage_multiplier].is_initialized
hpxml.lighting.exterior_usage_multiplier = args[:lighting_exterior_usage_multiplier].get
end

if args[:lighting_garage_usage_multiplier].is_initialized
hpxml.lighting.garage_usage_multiplier = args[:lighting_garage_usage_multiplier].get
exterior_usage_multiplier = args[:lighting_exterior_usage_multiplier].get
end
if exterior_usage_multiplier.nil? || exterior_usage_multiplier.to_f > 0
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationExterior,
fraction_of_units_in_location: args[:lighting_exterior_fraction_led],
lighting_type: HPXML::LightingTypeLED)
hpxml.lighting.exterior_usage_multiplier = exterior_usage_multiplier
end

# Garage
if has_garage
if args[:lighting_garage_usage_multiplier].is_initialized
garage_usage_multiplier = args[:lighting_garage_usage_multiplier].get
end
if garage_usage_multiplier.nil? || garage_usage_multiplier.to_f > 0
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_cfl],
lighting_type: HPXML::LightingTypeCFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_lfl],
lighting_type: HPXML::LightingTypeLFL)
hpxml.lighting_groups.add(id: "LightingGroup#{hpxml.lighting_groups.size + 1}",
location: HPXML::LocationGarage,
fraction_of_units_in_location: args[:lighting_garage_fraction_led],
lighting_type: HPXML::LightingTypeLED)
hpxml.lighting.garage_usage_multiplier = garage_usage_multiplier
end
end
elsif args[:ceiling_fan_present]
hpxml.lighting.interior_usage_multiplier = 0.0
hpxml.lighting.exterior_usage_multiplier = 0.0
hpxml.lighting.garage_usage_multiplier = 0.0
end

return unless args[:holiday_lighting_present]
Expand Down
6 changes: 3 additions & 3 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>a052c3d8-5816-4da4-9e8e-c49239c7f6f8</version_id>
<version_modified>20230310T230924Z</version_modified>
<version_id>7dcd8f86-2794-4c3c-b3bc-c037c5b30241</version_id>
<version_modified>20230316T143229Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -6577,7 +6577,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>3DC9D959</checksum>
<checksum>D3AB2AEA</checksum>
</file>
</files>
</measure>
1 change: 1 addition & 0 deletions resources/hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __New Features__
- Updates defaults for `CompressorLockoutTemperature` and `BackupHeatingLockoutTemperature`.
- Provides a warning if `BackupHeatingSwitchoverTemperature` or `BackupHeatingLockoutTemperature` are low and may cause unmet hours.
- LightingGroups can now be specified using kWh/year annual consumption values as an alternative to fractions of different lighting types.
- LightingGroups for interior, exterior, and garage are no longer required; if not provided, these lighting uses will not be modeled.
- Allows building air leakage to be specified using CFMnatural or EffectiveLeakageArea.
- Allows modeling a pilot light for non-electric heating systems (furnaces, stoves, boilers, and fireplaces).
- Window shading seasons now based on calendar dates (e.g., summer: May 1-Sep 30 in northern hemisphere) instead of monthly outdoor temperatures.
Expand Down
34 changes: 18 additions & 16 deletions resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def self.create(hpxml, runner, model, hpxml_path, epw_path, cache_path, output_d
Location.apply(model, weather, epw_file, @hpxml)
add_simulation_params(model)
@availability_sensor = create_availability_sensor(model)
@hvac_off_periods = Schedule.get_off_periods(SchedulesFile::ColumnHVAC, vacancy_periods: @hpxml.header.vacancy_periods, power_outage_periods: @hpxml.header.power_outage_periods)

# Conditioned space/zone

Expand Down Expand Up @@ -1373,6 +1374,7 @@ def self.add_hot_water_and_appliances(runner, model, weather, spaces)
end

# Water Heater
off_periods = Schedule.get_off_periods(SchedulesFile::ColumnWaterHeater, vacancy_periods: @hpxml.header.vacancy_periods, power_outage_periods: @hpxml.header.power_outage_periods)
has_uncond_bsmnt = @hpxml.has_location(HPXML::LocationBasementUnconditioned)
plantloop_map = {}
@hpxml.water_heating_systems.each do |water_heating_system|
Expand All @@ -1382,14 +1384,14 @@ def self.add_hot_water_and_appliances(runner, model, weather, spaces)

sys_id = water_heating_system.id
if water_heating_system.water_heater_type == HPXML::WaterHeaterTypeStorage
plantloop_map[sys_id] = Waterheater.apply_tank(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, @hpxml.header.power_outage_periods)
plantloop_map[sys_id] = Waterheater.apply_tank(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, off_periods)
elsif water_heating_system.water_heater_type == HPXML::WaterHeaterTypeTankless
plantloop_map[sys_id] = Waterheater.apply_tankless(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, @hpxml.header.power_outage_periods)
plantloop_map[sys_id] = Waterheater.apply_tankless(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, off_periods)
elsif water_heating_system.water_heater_type == HPXML::WaterHeaterTypeHeatPump
living_zone = spaces[HPXML::LocationLivingSpace].thermalZone.get
plantloop_map[sys_id] = Waterheater.apply_heatpump(model, runner, loc_space, loc_schedule, weather, water_heating_system, ec_adj, solar_thermal_system, living_zone, @eri_version, @schedules_file, @hpxml.header.power_outage_periods)
plantloop_map[sys_id] = Waterheater.apply_heatpump(model, runner, loc_space, loc_schedule, weather, water_heating_system, ec_adj, solar_thermal_system, living_zone, @eri_version, @schedules_file, off_periods)
elsif [HPXML::WaterHeaterTypeCombiStorage, HPXML::WaterHeaterTypeCombiTankless].include? water_heating_system.water_heater_type
plantloop_map[sys_id] = Waterheater.apply_combi(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, @hpxml.header.power_outage_periods)
plantloop_map[sys_id] = Waterheater.apply_combi(model, runner, loc_space, loc_schedule, water_heating_system, ec_adj, solar_thermal_system, @eri_version, @schedules_file, off_periods)
else
fail "Unhandled water heater (#{water_heating_system.water_heater_type})."
end
Expand Down Expand Up @@ -1444,12 +1446,12 @@ def self.add_cooling_system(model, spaces, airloop_map)

airloop_map[sys_id] = HVAC.apply_air_source_hvac_systems(model, cooling_system, heating_system,
sequential_cool_load_fracs, sequential_heat_load_fracs,
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)

elsif [HPXML::HVACTypeEvaporativeCooler].include? cooling_system.cooling_system_type

airloop_map[sys_id] = HVAC.apply_evaporative_cooler(model, cooling_system,
sequential_cool_load_fracs, living_zone, @hpxml.header.power_outage_periods)
sequential_cool_load_fracs, living_zone, @hvac_off_periods)
end
end
end
Expand Down Expand Up @@ -1488,17 +1490,17 @@ def self.add_heating_system(runner, model, spaces, airloop_map)

airloop_map[sys_id] = HVAC.apply_air_source_hvac_systems(model, nil, heating_system,
[0], sequential_heat_load_fracs,
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)

elsif [HPXML::HVACTypeBoiler].include? heating_system.heating_system_type

airloop_map[sys_id] = HVAC.apply_boiler(model, runner, heating_system,
sequential_heat_load_fracs, living_zone, @hpxml.header.power_outage_periods)
sequential_heat_load_fracs, living_zone, @hvac_off_periods)

elsif [HPXML::HVACTypeElectricResistance].include? heating_system.heating_system_type

HVAC.apply_electric_baseboard(model, heating_system,
sequential_heat_load_fracs, living_zone, @hpxml.header.power_outage_periods)
sequential_heat_load_fracs, living_zone, @hvac_off_periods)

elsif [HPXML::HVACTypeStove,
HPXML::HVACTypePortableHeater,
Expand All @@ -1508,7 +1510,7 @@ def self.add_heating_system(runner, model, spaces, airloop_map)
HPXML::HVACTypeFireplace].include? heating_system.heating_system_type

HVAC.apply_unit_heater(model, heating_system,
sequential_heat_load_fracs, living_zone, @hpxml.header.power_outage_periods)
sequential_heat_load_fracs, living_zone, @hvac_off_periods)
end

next unless heating_system.is_heat_pump_backup_system
Expand Down Expand Up @@ -1543,20 +1545,20 @@ def self.add_heat_pump(runner, model, weather, spaces, airloop_map)

airloop_map[sys_id] = HVAC.apply_water_loop_to_air_heat_pump(model, heat_pump,
sequential_heat_load_fracs, sequential_cool_load_fracs,
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)

elsif [HPXML::HVACTypeHeatPumpAirToAir,
HPXML::HVACTypeHeatPumpMiniSplit,
HPXML::HVACTypeHeatPumpPTHP,
HPXML::HVACTypeHeatPumpRoom].include? heat_pump.heat_pump_type
airloop_map[sys_id] = HVAC.apply_air_source_hvac_systems(model, heat_pump, heat_pump,
sequential_cool_load_fracs, sequential_heat_load_fracs,
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)
elsif [HPXML::HVACTypeHeatPumpGroundToAir].include? heat_pump.heat_pump_type

airloop_map[sys_id] = HVAC.apply_ground_to_air_heat_pump(model, runner, weather, heat_pump,
sequential_heat_load_fracs, sequential_cool_load_fracs,
living_zone, @hpxml.site.ground_conductivity, @hpxml.header.power_outage_periods)
living_zone, @hpxml.site.ground_conductivity, @hvac_off_periods)

end

Expand Down Expand Up @@ -1590,7 +1592,7 @@ def self.add_ideal_system(model, spaces, epw_path)
end
end
HVAC.apply_ideal_air_loads(model, obj_name, [cooling_load_frac], [heating_load_frac],
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)
return
end

Expand All @@ -1610,7 +1612,7 @@ def self.add_ideal_system(model, spaces, epw_path)

if (sequential_heat_load_fracs.sum > 0.0) || (sequential_cool_load_fracs.sum > 0.0)
HVAC.apply_ideal_air_loads(model, obj_name, sequential_cool_load_fracs, sequential_heat_load_fracs,
living_zone, @hpxml.header.power_outage_periods)
living_zone, @hvac_off_periods)
end
end

Expand All @@ -1635,7 +1637,7 @@ def self.add_ceiling_fans(runner, model, weather, spaces)
def self.add_dehumidifiers(model, spaces)
return if @hpxml.dehumidifiers.size == 0

HVAC.apply_dehumidifiers(model, @hpxml.dehumidifiers, spaces[HPXML::LocationLivingSpace], @hpxml.header.power_outage_periods)
HVAC.apply_dehumidifiers(model, @hpxml.dehumidifiers, spaces[HPXML::LocationLivingSpace], @hpxml.header.vacancy_periods, @hpxml.header.power_outage_periods)
end

def self.check_distribution_system(hvac_distribution, system_type)
Expand Down

0 comments on commit ae4e65a

Please sign in to comment.