Skip to content

Commit

Permalink
Merge commit '2681c4e6594061de7038d9d1a9302938aed03949' into latest-o…
Browse files Browse the repository at this point in the history
…s-hpxml
  • Loading branch information
joseph-robertson committed Apr 15, 2024
2 parents b22e1d3 + 2681c4e commit 211b6ea
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 54 deletions.
1 change: 1 addition & 0 deletions resources/hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ __Bugfixes__
- Fixes possible EnergyPlus error when a `Slab` representing a crawlspace dirt floor has perimeter or under slab insulation.
- Prevents errors due to incorrect `Floor/FloorOrCeiling` input; issues a warning when detected.
- Apportion shared water heater tank losses for HPWHs and combi systems.
- Fixes buried duct effective R-values.

## OpenStudio-HPXML v1.7.0

Expand Down
2 changes: 1 addition & 1 deletion resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,7 @@ def add_airflow(runner, model, weather, spaces, airloop_map)
hvac_availability_sensor.additionalProperties.setFeature('ObjectType', Constants.ObjectNameHVACAvailabilitySensor)
end

Airflow.apply(model, runner, weather, spaces, @hpxml_header, @hpxml_bldg, @cfa, @nbeds,
Airflow.apply(model, runner, weather, spaces, @hpxml_header, @hpxml_bldg, @cfa,
@ncfl_ag, duct_systems, airloop_map, @clg_ssn_sensor, @eri_version,
@frac_windows_operable, @apply_ashrae140_assumptions, @schedules_file,
@hpxml_header.unavailable_periods, hvac_availability_sensor)
Expand Down
12 changes: 6 additions & 6 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>a29c684e-60c6-4228-8d59-8f6c311f1172</version_id>
<version_modified>2024-04-09T20:34:32Z</version_modified>
<version_id>9e66c831-4f8f-4792-b4b1-4a0f23f1b1a7</version_id>
<version_modified>2024-04-12T19:22:19Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -142,13 +142,13 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>CA17B170</checksum>
<checksum>50FE267E</checksum>
</file>
<file>
<filename>airflow.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>BDC264D1</checksum>
<checksum>4BEFAE6F</checksum>
</file>
<file>
<filename>battery.rb</filename>
Expand Down Expand Up @@ -346,7 +346,7 @@
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>94F8A8E9</checksum>
<checksum>462AE65B</checksum>
</file>
<file>
<filename>lighting.rb</filename>
Expand Down Expand Up @@ -586,7 +586,7 @@
<filename>test_airflow.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>DFBB744E</checksum>
<checksum>DDF3C1A8</checksum>
</file>
<file>
<filename>test_battery.rb</filename>
Expand Down
15 changes: 7 additions & 8 deletions resources/hpxml-measures/HPXMLtoOpenStudio/resources/airflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Airflow
# Constants
InfilPressureExponent = 0.65

def self.apply(model, runner, weather, spaces, hpxml_header, hpxml_bldg, cfa, nbeds,
def self.apply(model, runner, weather, spaces, hpxml_header, hpxml_bldg, cfa,
ncfl_ag, duct_systems, airloop_map, clg_ssn_sensor, eri_version,
frac_windows_operable, apply_ashrae140_assumptions, schedules_file,
unavailable_periods, hvac_availability_sensor)
Expand All @@ -16,7 +16,6 @@ def self.apply(model, runner, weather, spaces, hpxml_header, hpxml_bldg, cfa, nb
@year = hpxml_header.sim_calendar_year
@conditioned_space = spaces[HPXML::LocationConditionedSpace]
@conditioned_zone = @conditioned_space.thermalZone.get
@nbeds = nbeds
@ncfl_ag = ncfl_ag
@eri_version = eri_version
@apply_ashrae140_assumptions = apply_ashrae140_assumptions
Expand Down Expand Up @@ -2175,11 +2174,11 @@ def self.get_duct_effective_r_value(nominal_rvalue, side, buried_level)
# Deeply buried | 18.1 | 19.6 | 21.0

if buried_level == HPXML::DuctBuriedInsulationPartial
return 5.83 + 2.0 * nominal_rvalue
return 3.46 + 1.05 * nominal_rvalue
elsif buried_level == HPXML::DuctBuriedInsulationFull
return 9.4 + 1.9 * nominal_rvalue
return 7.14 + 1.0 * nominal_rvalue
elsif buried_level == HPXML::DuctBuriedInsulationDeep
return 16.67 + 1.45 * nominal_rvalue
return 14.94 + 0.76 * nominal_rvalue
end
elsif side == HPXML::DuctTypeReturn
# Equations derived from Table 13 in https://www.nrel.gov/docs/fy13osti/55876.pdf
Expand All @@ -2192,11 +2191,11 @@ def self.get_duct_effective_r_value(nominal_rvalue, side, buried_level)
# Deeply buried | 22.8 | 24.7 | 26.6

if buried_level == HPXML::DuctBuriedInsulationPartial
return 7.6 + 2.5 * nominal_rvalue
return 4.62 + 1.31 * nominal_rvalue
elsif buried_level == HPXML::DuctBuriedInsulationFull
return 11.83 + 2.45 * nominal_rvalue
return 8.91 + 1.29 * nominal_rvalue
elsif buried_level == HPXML::DuctBuriedInsulationDeep
return 20.9 + 1.9 * nominal_rvalue
return 18.64 + 1.0 * nominal_rvalue
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,10 @@ def self.assign_to_hpxml_system(htg_sys, clg_sys, hvac_sizing_values)
# Heating backup capacity
if htg_sys.is_a? HPXML::HeatPump
if htg_sys.backup_type.nil?
htg_sys.backup_heating_capacity = 0.0
if htg_sys.backup_heating_capacity.nil?
htg_sys.backup_heating_capacity = 0.0
htg_sys.backup_heating_capacity_isdefaulted = true
end
elsif htg_sys.backup_type == HPXML::HeatPumpBackupTypeIntegrated
if htg_sys.backup_heating_capacity.nil? || ((htg_sys.backup_heating_capacity - hvac_sizing_values.Heat_Capacity_Supp).abs >= 1.0)
htg_sys.backup_heating_capacity = Float(hvac_sizing_values.Heat_Capacity_Supp.round)
Expand Down
70 changes: 68 additions & 2 deletions resources/hpxml-measures/HPXMLtoOpenStudio/tests/test_airflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ def test_ducts_ua_buried

# Check ducts program
program_values = get_ems_values(model.getEnergyManagementSystemSubroutines, 'duct subroutine')
assert_in_delta(6.67, UnitConversions.convert(program_values['supply_ua'].sum, 'W/K', 'Btu/(hr*F)'), 0.1)
assert_in_delta(1.75, UnitConversions.convert(program_values['return_ua'].sum, 'W/K', 'Btu/(hr*F)'), 0.1)
assert_in_delta(8.34, UnitConversions.convert(program_values['supply_ua'].sum, 'W/K', 'Btu/(hr*F)'), 0.1)
assert_in_delta(2.21, UnitConversions.convert(program_values['return_ua'].sum, 'W/K', 'Btu/(hr*F)'), 0.1)
end

def test_infiltration_compartmentalization_area
Expand Down Expand Up @@ -789,6 +789,72 @@ def test_infiltration_imbalance_induced_infiltration_fractions
assert_equal(0.5, program_values['FracCondToDZ'].sum)
end

def test_duct_effective_r_values
# Supply, not buried
{ 4.2 => 4.51,
6.0 => 5.66,
8.0 => 6.81 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeSupply, HPXML::DuctBuriedInsulationNone)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Return, not buried
{ 4.2 => 4.93,
6.0 => 6.33,
8.0 => 7.76 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeReturn, HPXML::DuctBuriedInsulationNone)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Supply, partially buried
{ 4.2 => 7.8,
6.0 => 9.9,
8.0 => 11.8 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeSupply, HPXML::DuctBuriedInsulationPartial)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Return, partially buried
{ 4.2 => 10.1,
6.0 => 12.6,
8.0 => 15.1 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeReturn, HPXML::DuctBuriedInsulationPartial)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Supply, fully buried
{ 4.2 => 11.3,
6.0 => 13.2,
8.0 => 15.1 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeSupply, HPXML::DuctBuriedInsulationFull)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Return, fully buried
{ 4.2 => 14.3,
6.0 => 16.7,
8.0 => 19.2 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeReturn, HPXML::DuctBuriedInsulationFull)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Supply, deeply buried
{ 4.2 => 18.1,
6.0 => 19.6,
8.0 => 21.0 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeSupply, HPXML::DuctBuriedInsulationDeep)
assert_in_delta(expected_r, effective_r, 0.2)
end

# Return, deeply buried
{ 4.2 => 22.8,
6.0 => 24.7,
8.0 => 26.6 }.each do |nominal_r, expected_r|
effective_r = Airflow.get_duct_effective_r_value(nominal_r, HPXML::DuctTypeReturn, HPXML::DuctBuriedInsulationDeep)
assert_in_delta(expected_r, effective_r, 0.2)
end
end

def _test_measure(args_hash)
# create an instance of the measure
measure = HPXMLtoOpenStudio.new
Expand Down
Loading

0 comments on commit 211b6ea

Please sign in to comment.