Skip to content

Commit

Permalink
Merge pull request #744 from NREL/zipcode_tmy3
Browse files Browse the repository at this point in the history
Latest OS-HPXML, branch
  • Loading branch information
shorowit authored Sep 14, 2024
2 parents 307b1d3 + 6cfee7a commit 4141687
Show file tree
Hide file tree
Showing 35 changed files with 48,610 additions and 2,350 deletions.
6 changes: 3 additions & 3 deletions hpxml-measures/BuildResidentialHPXML/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ State code of the home address. If not provided, the OS-HPXML default (see <a hr

**Site: Zip Code**

Zip code of the home address.
Zip code of the home address. Either this or the Weather Station: EnergyPlus Weather (EPW) Filepath input below must be provided.

- **Name:** ``site_zip_code``
- **Type:** ``String``
Expand Down Expand Up @@ -386,12 +386,12 @@ Longitude of the home address. Must be between -180 and 180. Use negative values

**Weather Station: EnergyPlus Weather (EPW) Filepath**

Path of the EPW file.
Path of the EPW file. Either this or the Site: Zip Code input above must be provided.

- **Name:** ``weather_station_epw_filepath``
- **Type:** ``String``

- **Required:** ``true``
- **Required:** ``false``

<br/>

Expand Down
29 changes: 19 additions & 10 deletions hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument

arg = OpenStudio::Measure::OSArgument.makeStringArgument('site_zip_code', false)
arg.setDisplayName('Site: Zip Code')
arg.setDescription('Zip code of the home address.')
arg.setDescription('Zip code of the home address. Either this or the Weather Station: EnergyPlus Weather (EPW) Filepath input below must be provided.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeDoubleArgument('site_time_zone_utc_offset', false)
Expand All @@ -248,10 +248,9 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setUnits('deg')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('weather_station_epw_filepath', true)
arg = OpenStudio::Measure::OSArgument.makeStringArgument('weather_station_epw_filepath', false)
arg.setDisplayName('Weather Station: EnergyPlus Weather (EPW) Filepath')
arg.setDescription('Path of the EPW file.')
arg.setDefaultValue('USA_CO_Denver.Intl.AP.725650_TMY3.epw')
arg.setDescription('Path of the EPW file. Either this or the Site: Zip Code input above must be provided.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('year_built', false)
Expand Down Expand Up @@ -3521,8 +3520,18 @@ def run(model, runner, user_arguments)
return false
end

# Create EpwFile object
if args[:weather_station_epw_filepath].nil? && args[:site_zip_code].nil?
runner.registerError('Either EPW filepath or site zip code is required.')
return false
end

epw_path = args[:weather_station_epw_filepath]
if epw_path.nil?
# Get EPW path from zip code
epw_path = HPXMLDefaults.lookup_weather_data_from_zipcode(args[:site_zip_code])[:station_filename]
end

# Create EpwFile object
if not File.exist? epw_path
epw_path = File.join(File.expand_path(File.join(File.dirname(__FILE__), '..', 'weather')), epw_path) # a filename was entered for weather_station_epw_filepath
end
Expand Down Expand Up @@ -4707,16 +4716,16 @@ def self.set_building_header(hpxml_bldg, args)
# @param args [Hash] Map of :argument_name => value
# @return [nil]
def self.set_climate_and_risk_zones(hpxml_bldg, args)
hpxml_bldg.climate_and_risk_zones.weather_station_id = 'WeatherStation'

if not args[:site_iecc_zone].nil?
hpxml_bldg.climate_and_risk_zones.climate_zone_ieccs.add(zone: args[:site_iecc_zone],
year: 2006)
end

weather_station_name = File.basename(args[:weather_station_epw_filepath]).gsub('.epw', '')
hpxml_bldg.climate_and_risk_zones.weather_station_name = weather_station_name
hpxml_bldg.climate_and_risk_zones.weather_station_epw_filepath = args[:weather_station_epw_filepath]
if not args[:weather_station_epw_filepath].nil?
hpxml_bldg.climate_and_risk_zones.weather_station_id = 'WeatherStation'
hpxml_bldg.climate_and_risk_zones.weather_station_name = File.basename(args[:weather_station_epw_filepath]).gsub('.epw', '')
hpxml_bldg.climate_and_risk_zones.weather_station_epw_filepath = args[:weather_station_epw_filepath]
end
end

# Set air infiltration measurements properties, including:
Expand Down
15 changes: 7 additions & 8 deletions hpxml-measures/BuildResidentialHPXML/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>bc165d90-d2d3-4f8c-a46f-adcbf6bb03aa</version_id>
<version_modified>2024-08-30T19:32:28Z</version_modified>
<version_id>75f26ae9-db88-4eb8-90c5-10ba2b9e7cd8</version_id>
<version_modified>2024-09-14T01:35:49Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -648,7 +648,7 @@
<argument>
<name>site_zip_code</name>
<display_name>Site: Zip Code</display_name>
<description>Zip code of the home address.</description>
<description>Zip code of the home address. Either this or the Weather Station: EnergyPlus Weather (EPW) Filepath input below must be provided.</description>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
Expand Down Expand Up @@ -692,11 +692,10 @@
<argument>
<name>weather_station_epw_filepath</name>
<display_name>Weather Station: EnergyPlus Weather (EPW) Filepath</display_name>
<description>Path of the EPW file.</description>
<description>Path of the EPW file. Either this or the Site: Zip Code input above must be provided.</description>
<type>String</type>
<required>true</required>
<required>false</required>
<model_dependent>false</model_dependent>
<default_value>USA_CO_Denver.Intl.AP.725650_TMY3.epw</default_value>
</argument>
<argument>
<name>year_built</name>
Expand Down Expand Up @@ -7425,7 +7424,7 @@
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>E25CA49D</checksum>
<checksum>257D934F</checksum>
</file>
<file>
<filename>README.md.erb</filename>
Expand All @@ -7442,7 +7441,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>A908C1C0</checksum>
<checksum>310113A2</checksum>
</file>
<file>
<filename>constants.rb</filename>
Expand Down
6 changes: 3 additions & 3 deletions hpxml-measures/BuildResidentialScheduleFile/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>build_residential_schedule_file</name>
<uid>f770b2db-1a9f-4e99-99a7-7f3161a594b1</uid>
<version_id>c51b1eff-b508-42dd-a77e-671265e526ab</version_id>
<version_modified>2024-08-28T16:06:34Z</version_modified>
<version_id>1872e0df-889e-46ae-8cb9-849eadb97fda</version_id>
<version_modified>2024-09-13T21:54:22Z</version_modified>
<xml_checksum>03F02484</xml_checksum>
<class_name>BuildResidentialScheduleFile</class_name>
<display_name>Schedule File Builder</display_name>
Expand Down Expand Up @@ -931,7 +931,7 @@
<filename>test_build_residential_schedule_file.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>656C80A2</checksum>
<checksum>04AE998D</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ def test_stochastic_location_detailed
assert(info_msgs.any? { |info_msg| info_msg.include?('State=CO') })
assert(!info_msgs.any? { |info_msg| info_msg.include?('RandomSeed') })
assert(info_msgs.any? { |info_msg| info_msg.include?('GeometryNumOccupants=3.0') })
assert(info_msgs.any? { |info_msg| info_msg.include?('TimeZoneUTCOffset=-7.0') })
assert(info_msgs.any? { |info_msg| info_msg.include?('Latitude=40.51') })
assert(info_msgs.any? { |info_msg| info_msg.include?('Longitude=-107.55') })
assert(info_msgs.any? { |info_msg| info_msg.include?('TimeZoneUTCOffset=-6.0') })
assert(info_msgs.any? { |info_msg| info_msg.include?('Latitude=39.77') })
assert(info_msgs.any? { |info_msg| info_msg.include?('Longitude=-104.73') })

sf = SchedulesFile.new(schedules_paths: hpxml.buildings[0].header.schedules_filepaths,
year: @year,
output_path: @tmp_schedule_file_path)

assert_in_epsilon(6689, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:Occupants].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(2062, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:LightingInterior].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(2062, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:LightingGarage].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(1992, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:LightingInterior].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(1992, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:LightingGarage].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(534, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:CookingRange].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(213, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:Dishwasher].name, schedules: sf.tmp_schedules), @tol)
assert_in_epsilon(134, sf.annual_equivalent_full_load_hrs(col_name: SchedulesFile::Columns[:ClothesWasher].name, schedules: sf.tmp_schedules), @tol)
Expand Down
1 change: 1 addition & 0 deletions hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

__New Features__
- Updates to HPXML v4.0 final release.
- Allows `Site/Address/ZipCode` to be provided instead of `ClimateandRiskZones/WeatherStation/extension/EPWFilePath`, in which case the closest TMY3 weather station will be automatically selected.
- Adds inputs for modeling skylight curbs and/or shafts.
- Allows modeling exterior horizontal insulation for a slab-on-grade foundation (or basement/crawlspace floor).
- Allows alternative infiltration input `AirInfiltrationMeasurement/LeakinessDescription`, in which the infiltration level is estimated using age of home, climate zone, foundation type, etc.
Expand Down
44 changes: 19 additions & 25 deletions hpxml-measures/HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>3b678540-7b41-4cda-8eb9-a829bb0c5fe4</version_id>
<version_modified>2024-09-06T17:17:54Z</version_modified>
<version_id>1cc3819d-39ae-4646-a06e-1ab1380d7580</version_id>
<version_modified>2024-09-14T01:35:52Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -221,12 +221,6 @@
<usage_type>resource</usage_type>
<checksum>50B7055C</checksum>
</file>
<file>
<filename>data/ashrae_622_wsf.csv</filename>
<filetype>csv</filetype>
<usage_type>resource</usage_type>
<checksum>308F75BA</checksum>
</file>
<file>
<filename>data/cambium/LRMER_95DecarbBy2035.csv</filename>
<filetype>csv</filetype>
Expand Down Expand Up @@ -263,12 +257,6 @@
<usage_type>resource</usage_type>
<checksum>FC171B98</checksum>
</file>
<file>
<filename>data/climate_zones.csv</filename>
<filetype>csv</filetype>
<usage_type>resource</usage_type>
<checksum>63C6A1E2</checksum>
</file>
<file>
<filename>data/default_schedules.csv</filename>
<filetype>csv</filetype>
Expand Down Expand Up @@ -329,6 +317,12 @@
<usage_type>resource</usage_type>
<checksum>3C44FFBB</checksum>
</file>
<file>
<filename>data/zipcode_weather_stations.csv</filename>
<filetype>csv</filetype>
<usage_type>resource</usage_type>
<checksum>308D9F48</checksum>
</file>
<file>
<filename>energyplus.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -357,13 +351,13 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>C2276348</checksum>
<checksum>8DECE37B</checksum>
</file>
<file>
<filename>hpxml_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>92BB7113</checksum>
<checksum>4FE26115</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand All @@ -381,7 +375,7 @@
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>B4BB56DE</checksum>
<checksum>39C9B433</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand All @@ -399,7 +393,7 @@
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>9B75637E</checksum>
<checksum>BA28B74A</checksum>
</file>
<file>
<filename>lighting.rb</filename>
Expand All @@ -411,7 +405,7 @@
<filename>location.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>6D2C21EE</checksum>
<checksum>2CB41E3C</checksum>
</file>
<file>
<filename>materials.rb</filename>
Expand Down Expand Up @@ -585,7 +579,7 @@
<filename>schedules.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>0B74AC68</checksum>
<checksum>E251B0F9</checksum>
</file>
<file>
<filename>simcontrols.rb</filename>
Expand Down Expand Up @@ -627,7 +621,7 @@
<filename>weather.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>D8B07D1D</checksum>
<checksum>2A6AEFC1</checksum>
</file>
<file>
<filename>xmlhelper.rb</filename>
Expand Down Expand Up @@ -657,7 +651,7 @@
<filename>test_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>736CBC0A</checksum>
<checksum>A8008603</checksum>
</file>
<file>
<filename>test_enclosure.rb</filename>
Expand Down Expand Up @@ -687,7 +681,7 @@
<filename>test_hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>3BA204D7</checksum>
<checksum>3D5F6E4C</checksum>
</file>
<file>
<filename>test_lighting.rb</filename>
Expand Down Expand Up @@ -729,7 +723,7 @@
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>A0D2EEB9</checksum>
<checksum>F6E61B68</checksum>
</file>
<file>
<filename>test_water_heater.rb</filename>
Expand All @@ -741,7 +735,7 @@
<filename>test_weather.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>995FE666</checksum>
<checksum>91B050AB</checksum>
</file>
<file>
<filename>util.rb</filename>
Expand Down
Loading

0 comments on commit 4141687

Please sign in to comment.