Skip to content

Commit

Permalink
Merge branch 'latest-os-hpxml' into ll/test_panel_cap
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Nov 5, 2024
2 parents 6ce60a6 + 2784f72 commit 466c713
Show file tree
Hide file tree
Showing 38 changed files with 70,333 additions and 69,169 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
workflow_dispatch:

env:
OPENSTUDIO_VER: "3.8.0"
OPENSTUDIO_SHA: "f953b6fcaf"
OPENSTUDIO_PLATFORM: "Ubuntu-20.04-x86_64"
OPENSTUDIO_EXT: "deb"
OPENSTUDIO_URL: "https://github.com/NREL/OpenStudio/releases/download/v3.8.0"
OPENSTUDIO_VER: 3.9.0-rc1
OPENSTUDIO_SHA: fb69e5479c
OPENSTUDIO_PLATFORM: Ubuntu-22.04-x86_64
OPENSTUDIO_EXT: deb
OPENSTUDIO_URL: https://github.com/NREL/OpenStudio/releases/download/v3.9.0-rc1

jobs:
format-files:
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [format-files]
container:
image: docker://nrel/openstudio:3.8.0
image: docker://nrel/openstudio:dev-3.9.0-rc1
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [unit-tests]
container:
image: docker://nrel/openstudio:3.8.0
image: docker://nrel/openstudio:dev-3.9.0-rc1
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions project_national/national_baseline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: '0.4'
os_version: 3.8.0
os_sha: f953b6fcaf
os_version: 3.9.0-rc1
os_sha: fb69e5479c
buildstock_directory: ../ # Relative to this file or absolute
project_directory: project_national # Relative to buildstock_directory
output_directory: national_baseline
Expand Down
4 changes: 2 additions & 2 deletions project_national/national_upgrades.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: '0.4'
os_version: 3.8.0
os_sha: f953b6fcaf
os_version: 3.9.0-rc1
os_sha: fb69e5479c
buildstock_directory: ../ # Relative to this file or absolute
project_directory: project_national # Relative to buildstock_directory
output_directory: national_upgrades
Expand Down
4 changes: 2 additions & 2 deletions project_testing/testing_baseline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: '0.4'
os_version: 3.8.0
os_sha: f953b6fcaf
os_version: 3.9.0-rc1
os_sha: fb69e5479c
buildstock_directory: ../ # Relative to this file or absolute
project_directory: project_testing # Relative to buildstock_directory
output_directory: testing_baseline
Expand Down
4 changes: 2 additions & 2 deletions project_testing/testing_upgrades.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: '0.4'
os_version: 3.8.0
os_sha: f953b6fcaf
os_version: 3.9.0-rc1
os_sha: fb69e5479c
buildstock_directory: ../ # Relative to this file or absolute
project_directory: project_testing # Relative to buildstock_directory
output_directory: testing_upgrades
Expand Down
10 changes: 5 additions & 5 deletions resources/hpxml-measures/.github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
run-unit-tests:
runs-on: ubuntu-22.04
container:
image: docker://nrel/openstudio:3.8.0
image: docker://nrel/openstudio:dev-3.9.0-rc1
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
run-workflow1-tests:
runs-on: ubuntu-22.04
container:
image: docker://nrel/openstudio:3.8.0
image: docker://nrel/openstudio:dev-3.9.0-rc1
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -100,7 +100,7 @@ jobs:
run-workflow2-tests:
runs-on: ubuntu-22.04
container:
image: docker://nrel/openstudio:3.8.0
image: docker://nrel/openstudio:dev-3.9.0-rc1
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -129,8 +129,8 @@ jobs:
- name: Install software and run test
shell: pwsh
run: |
$env:OS_VERSION="3.8.0"
$env:OS_SHA="f953b6fcaf"
$env:OS_VERSION="3.9.0-rc1"
$env:OS_SHA="fb69e5479c"
Invoke-WebRequest -OutFile Windows.tar.gz -URI "https://github.com/NREL/OpenStudio/releases/download/v${env:OS_VERSION}/OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows.tar.gz"
tar -xzf Windows.tar.gz
& .\OpenStudio-${env:OS_VERSION}+${env:OS_SHA}-Windows\bin\openstudio.exe workflow\run_simulation.rb -x workflow\sample_files\base.xml --hourly ALL --add-component-loads --add-stochastic-schedules
Expand Down
17 changes: 17 additions & 0 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6417,6 +6417,23 @@ def self.set_ventilation_fans(hpxml_bldg, args)

distribution_system_idref = hvac_distribution.id
end
if distribution_system_idref.nil?
# Allow for PTAC/PTHP by automatically adding a DSE=1 distribution system to attach the CFIS to
hpxml_bldg.hvac_systems.each do |hvac_system|
next unless (hvac_system.is_a?(HPXML::CoolingSystem) && [HPXML::HVACTypePTAC, HPXML::HVACTypeRoomAirConditioner].include?(hvac_system.cooling_system_type)) ||
(hvac_system.is_a?(HPXML::HeatPump) && [HPXML::HVACTypeHeatPumpPTHP, HPXML::HVACTypeHeatPumpRoom].include?(hvac_system.heat_pump_type))

hpxml_bldg.hvac_distributions.add(id: "HVACDistribution#{hpxml_bldg.hvac_distributions.size + 1}",
distribution_system_type: HPXML::HVACDistributionTypeDSE,
annual_cooling_dse: 1.0,
annual_heating_dse: 1.0)
hvac_system.distribution_system_idref = hpxml_bldg.hvac_distributions[-1].id
distribution_system_idref = hpxml_bldg.hvac_distributions[-1].id
end
end

return if distribution_system_idref.nil? # No distribution system to attach the CFIS to

cfis_addtl_runtime_operating_mode = HPXML::CFISModeAirHandler
end

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.1</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>8dfdc271-772e-46a3-a611-71ca703a96c2</version_id>
<version_modified>2024-10-14T23:23:50Z</version_modified>
<version_id>6024806a-1640-4c75-86e4-d00329c89e3a</version_id>
<version_modified>2024-10-31T22:43:54Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -7544,7 +7544,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>F2C64E58</checksum>
<checksum>79912FCC</checksum>
</file>
<file>
<filename>constants.rb</filename>
Expand Down
3 changes: 2 additions & 1 deletion resources/hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## OpenStudio-HPXML v1.9.0

__New Features__
- Updates to HPXML v4.0 final release.
- Updates to OpenStudio 3.9/EnergyPlus 24.2/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.
- Allows optional inputs for modeling skylight curbs and/or shafts.
- Allows modeling exterior horizontal insulation for a slab-on-grade foundation (or basement/crawlspace floor).
Expand All @@ -21,6 +21,7 @@ __New Features__
- Allows CFIS systems with no strategy to meet remainder of ventilation target (`CFISControls/AdditionalRuntimeOperatingMode="none"`).
- Allows CFIS systems with supplemental fans that run simultaneously with the air handler (`CFISControls/extension/SupplementalFanRunsWithAirHandlerFan=true`).
- Allows CFIS systems with timer control, in which ventilation operation occurs at a fixed interval (`CFISControls/extension/ControlType="timer"`).
- Allows CFIS systems to be attached to ductless HVAC systems like PTHPs (requires using a DSE=1 distribution system, see documentation).
- HVAC Manual J design load and sizing calculations:
- Adds optional `DistributionSystemType/AirDistribution/extension/ManualJInputs/BlowerFanHeatBtuh` input.
- Adds optional `DistributionSystemType/HydronicDistribution/extension/ManualJInputs/HotWaterPipingBtuh` input.
Expand Down
18 changes: 9 additions & 9 deletions resources/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>af21de2e-e4ba-4fda-9f29-f4ad94d0475c</version_id>
<version_modified>2024-10-30T04:55:55Z</version_modified>
<version_id>11cc4879-3099-4335-8f6f-2a81177ccf4a</version_id>
<version_modified>2024-11-01T14:33:00Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -375,7 +375,7 @@
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>AC4BF61E</checksum>
<checksum>3E5B0735</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand All @@ -387,7 +387,7 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>5BA0F293</checksum>
<checksum>C389F8A8</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
Expand All @@ -411,7 +411,7 @@
<filename>location.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>5ACAD08F</checksum>
<checksum>E5CD0079</checksum>
</file>
<file>
<filename>materials.rb</filename>
Expand Down Expand Up @@ -453,7 +453,7 @@
<filename>output.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8DBF34EC</checksum>
<checksum>573B31F4</checksum>
</file>
<file>
<filename>psychrometrics.rb</filename>
Expand Down Expand Up @@ -621,7 +621,7 @@
<filename>version.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>C8C5DD23</checksum>
<checksum>084EA5B1</checksum>
</file>
<file>
<filename>waterheater.rb</filename>
Expand Down Expand Up @@ -651,7 +651,7 @@
<filename>test_airflow.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>4366CDCD</checksum>
<checksum>DA1297B3</checksum>
</file>
<file>
<filename>test_battery.rb</filename>
Expand Down Expand Up @@ -735,7 +735,7 @@
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>20E56F9D</checksum>
<checksum>CABF42C5</checksum>
</file>
<file>
<filename>test_water_heater.rb</filename>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@
<sch:pattern>
<sch:title>[CoolingSystemType=PTACorRoomAC]</sch:title>
<sch:rule context='/h:HPXML/h:Building/h:BuildingDetails/h:Systems/h:HVAC/h:HVACPlant/h:CoolingSystem[h:CoolingSystemType="room air conditioner" or h:CoolingSystemType="packaged terminal air conditioner"]'>
<sch:assert role='ERROR' test='count(h:DistributionSystem) = 0'>Expected 0 element(s) for xpath: DistributionSystem</sch:assert>
<sch:assert role='ERROR' test='count(h:DistributionSystem) &lt;= 1'>Expected 0 or 1 element(s) for xpath: DistributionSystem</sch:assert>
<sch:assert role='ERROR' test='count(h:CoolingSystemFuel) = 1'>Expected 1 element(s) for xpath: CoolingSystemFuel</sch:assert>
<sch:assert role='ERROR' test='h:CoolingSystemFuel[text()="electricity"] or not(h:CoolingSystemFuel)'>Expected CoolingSystemFuel to be 'electricity'</sch:assert>
<sch:assert role='ERROR' test='count(h:CoolingCapacity) &lt;= 1'>Expected 0 or 1 element(s) for xpath: CoolingCapacity</sch:assert>
Expand Down Expand Up @@ -1602,7 +1602,7 @@
<sch:pattern>
<sch:title>[HeatPumpType=PTHPorRoomACwithReverseCycle]</sch:title>
<sch:rule context='/h:HPXML/h:Building/h:BuildingDetails/h:Systems/h:HVAC/h:HVACPlant/h:HeatPump[h:HeatPumpType="packaged terminal heat pump" or h:HeatPumpType="room air conditioner with reverse cycle"]'>
<sch:assert role='ERROR' test='count(h:DistributionSystem) = 0'>Expected 0 element(s) for xpath: DistributionSystem</sch:assert>
<sch:assert role='ERROR' test='count(h:DistributionSystem) &lt;= 1'>Expected 0 or 1 element(s) for xpath: DistributionSystem</sch:assert>
<sch:assert role='ERROR' test='count(h:HeatPumpFuel) = 1'>Expected 1 element(s) for xpath: HeatPumpFuel</sch:assert>
<sch:assert role='ERROR' test='h:HeatPumpFuel[text()="electricity"] or not(h:HeatPumpFuel)'>Expected HeatPumpFuel to be 'electricity'</sch:assert>
<sch:assert role='ERROR' test='count(h:HeatingCapacity) &lt;= 1'>Expected 0 or 1 element(s) for xpath: HeatingCapacity</sch:assert>
Expand Down
32 changes: 23 additions & 9 deletions resources/hpxml-measures/HPXMLtoOpenStudio/resources/hvac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5624,18 +5624,32 @@ def self.calc_hspf_from_hspf2(hspf2, is_ducted)
def self.check_distribution_system(hvac_distribution, system_type)
return if hvac_distribution.nil?

hvac_distribution_type_map = { HPXML::HVACTypeFurnace => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeBoiler => [HPXML::HVACDistributionTypeHydronic, HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeCentralAirConditioner => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeEvaporativeCooler => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeMiniSplitAirConditioner => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpAirToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpMiniSplit => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpGroundToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpWaterLoopToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE] }
hvac_distribution_type_map = {
HPXML::HVACTypeFurnace => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeBoiler => [HPXML::HVACDistributionTypeHydronic, HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeCentralAirConditioner => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeEvaporativeCooler => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeMiniSplitAirConditioner => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeRoomAirConditioner => [HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypePTAC => [HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpAirToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpMiniSplit => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpGroundToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpWaterLoopToAir => [HPXML::HVACDistributionTypeAir, HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpPTHP => [HPXML::HVACDistributionTypeDSE],
HPXML::HVACTypeHeatPumpRoom => [HPXML::HVACDistributionTypeDSE],
}

if not hvac_distribution_type_map[system_type].include? hvac_distribution.distribution_system_type
fail "Incorrect HVAC distribution system type for HVAC type: '#{system_type}'. Should be one of: #{hvac_distribution_type_map[system_type]}"
end

# Also check that DSE=1 if PTAC/PTHP/RoomAC/RoomHP, since it is only used to attach a CFIS system
if [HPXML::HVACTypePTAC, HPXML::HVACTypeHeatPumpPTHP, HPXML::HVACTypeRoomAirConditioner, HPXML::HVACTypeHeatPumpRoom].include? system_type
if ((not hvac_distribution.annual_cooling_dse.nil?) && (hvac_distribution.annual_cooling_dse != 1)) ||
((not hvac_distribution.annual_heating_dse.nil?) && (hvac_distribution.annual_heating_dse != 1))
fail "HVAC type '#{system_type}' must have a heating and/or cooling DSE of 1."
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ def self.apply_weather_file(model, epw_path)
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @return [nil]
def self.apply_site(model, hpxml_bldg)
# Note: None of these affect the model; see https://github.com/NREL/EnergyPlus/issues/10579.
site = model.getSite
site.setName("#{hpxml_bldg.city}_#{hpxml_bldg.state_code}")
site.setLatitude(hpxml_bldg.latitude)
site.setLongitude(hpxml_bldg.longitude)
site.setTimeZone(hpxml_bldg.time_zone_utc_offset)
site.setElevation(UnitConversions.convert(hpxml_bldg.elevation, 'ft', 'm').round)

# Tell EnergyPlus to use these values, not what's in the weather station (which
# may be at a very different, e.g., elevation)
site.setKeepSiteLocationInformation(true)
end

# Set calendar year on the OpenStudio YearDescription object.
Expand Down
11 changes: 4 additions & 7 deletions resources/hpxml-measures/HPXMLtoOpenStudio/resources/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,8 @@ def self.apply_component_loads_ems_program(model, hpxml_osm_map, loads_data, sea

key = { 'Window' => :windows_solar,
'Skylight' => :skylights_solar }[surface_type]
vars = { 'Surface Window Transmitted Solar Radiation Energy' => 'ss_trans_in',
vars = { 'Surface Window Transmitted Solar Radiation Rate' => 'ss_trans_in',
'Surface Window Shortwave from Zone Back Out Window Heat Transfer Rate' => 'ss_back_out',
'Surface Window Total Glazing Layers Absorbed Shortwave Radiation Rate' => 'ss_sw_abs',
'Surface Window Total Glazing Layers Absorbed Solar Radiation Energy' => 'ss_sol_abs',
'Surface Inside Face Initial Transmitted Diffuse Transmitted Out Window Solar Radiation Rate' => 'ss_trans_out' }

surfaces_sensors[key] << []
Expand Down Expand Up @@ -682,10 +680,9 @@ def self.apply_component_loads_ems_program(model, hpxml_osm_map, loads_data, sea
surface_sensors.each do |sensors|
s = "Set hr_#{k} = hr_#{k}"
sensors.each do |sensor|
# remove ss_net if switch
if sensor.name.to_s.start_with?('ss_net', 'ss_sol_abs', 'ss_trans_in')
s += " - #{sensor.name}"
elsif sensor.name.to_s.start_with?('ss_sw_abs', 'ss_trans_out', 'ss_back_out')
if sensor.name.to_s.start_with?('ss_trans_in', 'ss_infra', 'ss_glaz')
s += " - #{sensor.name} * ZoneTimestep * 3600"
elsif sensor.name.to_s.start_with?('ss_trans_out', 'ss_back_out')
s += " + #{sensor.name} * ZoneTimestep * 3600"
else
s += " + #{sensor.name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Collection of methods related to software versions.
module Version
OS_HPXML_Version = '1.8.1' # Version of the OS-HPXML workflow
OS_Version = '3.8.0' # Required version of OpenStudio (can be 'X.X' or 'X.X.X')
OS_Version = '3.9.0' # Required version of OpenStudio (can be 'X.X' or 'X.X.X')
HPXML_Version = '4.0' # HPXML schemaVersion

# Checks whether the version of OpenStudio that is running OpenStudio-HPXML
Expand Down
Loading

0 comments on commit 466c713

Please sign in to comment.