diff --git a/tasks.rb b/tasks.rb
index c27a065d8..49acd7f14 100644
--- a/tasks.rb
+++ b/tasks.rb
@@ -565,8 +565,8 @@ def set_hpxml_roofs(hpxml_file, hpxml_bldg)
def set_hpxml_rim_joists(hpxml_file, hpxml_bldg)
if ['RESNET_Tests/4.5_DSE/HVAC3a.xml'].include? hpxml_file
- for i in 0..hpxml_bldg.rim_joists.size - 1
- hpxml_bldg.rim_joists[i].interior_adjacent_to = HPXML::LocationBasementUnconditioned
+ hpxml_bldg.rim_joists.each do |rim_joist|
+ rim_joist.interior_adjacent_to = HPXML::LocationBasementUnconditioned
end
elsif hpxml_file.include?('EPA_Tests/SF')
if ['EPA_Tests/SF_National_3.1/SFNHv31_CZ2_FL_elec_slab.xml',
@@ -822,8 +822,8 @@ def set_hpxml_foundation_walls(hpxml_file, hpxml_bldg)
end
end
elsif ['RESNET_Tests/4.5_DSE/HVAC3a.xml'].include? hpxml_file
- for i in 0..hpxml_bldg.foundation_walls.size - 1
- hpxml_bldg.foundation_walls[i].interior_adjacent_to = HPXML::LocationBasementUnconditioned
+ hpxml_bldg.foundation_walls.each do |foundation_wall|
+ foundation_wall.interior_adjacent_to = HPXML::LocationBasementUnconditioned
end
elsif hpxml_file.include?('EPA_Tests')
if hpxml_file.include?('EPA_Tests/SF')
@@ -1677,8 +1677,8 @@ def set_hpxml_hvac_distributions(hpxml_file, hpxml_bldg)
elsif ['RESNET_Tests/4.5_DSE/HVAC3d.xml',
'RESNET_Tests/4.5_DSE/HVAC3h.xml'].include? hpxml_file
# Supply and return duct leakage = 125 cfm each
- for i in 0..hpxml_bldg.hvac_distributions[0].duct_leakage_measurements.size - 1
- hpxml_bldg.hvac_distributions[0].duct_leakage_measurements[i].duct_leakage_value = 125
+ hpxml_bldg.hvac_distributions[0].duct_leakage_measurements.each do |duct_leakage_measurement|
+ duct_leakage_measurement.duct_leakage_value = 125
end
elsif hpxml_file.include?('EPA_Tests')
tot_cfm25 = 4.0 * hpxml_bldg.building_construction.conditioned_floor_area / 100.0
@@ -1718,19 +1718,19 @@ def set_hpxml_hvac_distributions(hpxml_file, hpxml_bldg)
duct_surface_area: 77)
elsif ['RESNET_Tests/4.5_DSE/HVAC3b.xml'].include? hpxml_file
# Change to Duct Location = 100% in basement
- for i in 0..hpxml_bldg.hvac_distributions[0].ducts.size - 1
- hpxml_bldg.hvac_distributions[0].ducts[i].duct_location = HPXML::LocationBasementUnconditioned
+ hpxml_bldg.hvac_distributions[0].ducts.each do |duct|
+ duct.duct_location = HPXML::LocationBasementUnconditioned
end
elsif ['RESNET_Tests/4.5_DSE/HVAC3f.xml'].include? hpxml_file
# Change to Duct Location = 100% in attic
- for i in 0..hpxml_bldg.hvac_distributions[0].ducts.size - 1
- hpxml_bldg.hvac_distributions[0].ducts[i].duct_location = HPXML::LocationAtticVented
+ hpxml_bldg.hvac_distributions[0].ducts.each do |duct|
+ duct.duct_location = HPXML::LocationAtticVented
end
elsif ['RESNET_Tests/4.5_DSE/HVAC3c.xml',
'RESNET_Tests/4.5_DSE/HVAC3g.xml'].include? hpxml_file
# Change to Duct R-val = 6
- for i in 0..hpxml_bldg.hvac_distributions[0].ducts.size - 1
- hpxml_bldg.hvac_distributions[0].ducts[i].duct_insulation_r_value = 6
+ hpxml_bldg.hvac_distributions[0].ducts.each do |duct|
+ duct.duct_insulation_r_value = 6
end
elsif hpxml_file.include?('EPA_Tests')
supply_area = 0.27 * hpxml_bldg.building_construction.conditioned_floor_area
@@ -1796,6 +1796,22 @@ def set_hpxml_hvac_distributions(hpxml_file, hpxml_bldg)
duct_surface_area: (return_area * non_attic_frac).round(2))
end
end
+ # For DSE tests, use effective R-values instead of nominal R-values to match the test specs.
+ if hpxml_file.include? '4.5_DSE'
+ hpxml_bldg.hvac_distributions[0].ducts.each do |duct|
+ next if duct.duct_insulation_r_value.nil?
+
+ if duct.duct_insulation_r_value == 0
+ duct.duct_insulation_r_value = nil
+ duct.duct_effective_r_value = 1.5
+ elsif duct.duct_insulation_r_value == 6
+ duct.duct_insulation_r_value = nil
+ duct.duct_effective_r_value = 7
+ else
+ fail 'Unexpected error.'
+ end
+ end
+ end
# CFA served
if hpxml_bldg.hvac_distributions.size == 1
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3a.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3a.xml
index 8bda37a70..459b61251 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3a.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3a.xml
@@ -592,14 +592,14 @@
supply
- 0.0
+ 1.5
conditioned space
308.0
return
- 0.0
+ 1.5
conditioned space
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3b.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3b.xml
index c020c4502..a58dc4ec7 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3b.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3b.xml
@@ -592,14 +592,14 @@
supply
- 0.0
+ 1.5
basement - unconditioned
308.0
return
- 0.0
+ 1.5
basement - unconditioned
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3c.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3c.xml
index a9a23e3bc..b2727b3ef 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3c.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3c.xml
@@ -592,14 +592,14 @@
supply
- 6.0
+ 7.0
basement - unconditioned
308.0
return
- 6.0
+ 7.0
basement - unconditioned
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3d.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3d.xml
index 22c298caa..2bf4c07cf 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3d.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3d.xml
@@ -592,14 +592,14 @@
supply
- 6.0
+ 7.0
basement - unconditioned
308.0
return
- 6.0
+ 7.0
basement - unconditioned
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3e.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3e.xml
index 46bce808e..90c8c5486 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3e.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3e.xml
@@ -410,14 +410,14 @@
supply
- 0.0
+ 1.5
conditioned space
308.0
return
- 0.0
+ 1.5
conditioned space
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3f.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3f.xml
index 0f43912d9..2a822a0c8 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3f.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3f.xml
@@ -410,14 +410,14 @@
supply
- 0.0
+ 1.5
attic - vented
308.0
return
- 0.0
+ 1.5
attic - vented
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3g.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3g.xml
index e81663562..41058c9a9 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3g.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3g.xml
@@ -410,14 +410,14 @@
supply
- 6.0
+ 7.0
attic - vented
308.0
return
- 6.0
+ 7.0
attic - vented
77.0
diff --git a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3h.xml b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3h.xml
index 6c5390714..4d6694f27 100644
--- a/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3h.xml
+++ b/workflow/tests/RESNET_Tests/4.5_DSE/HVAC3h.xml
@@ -410,14 +410,14 @@
supply
- 6.0
+ 7.0
attic - vented
308.0
return
- 6.0
+ 7.0
attic - vented
77.0
diff --git a/workflow/tests/base_results/RESNET_Test_4.2_HERS_AutoGen_Reference_Home.csv b/workflow/tests/base_results/RESNET_Test_4.2_HERS_AutoGen_Reference_Home.csv
index 1865e2d71..6a48b14a7 100644
--- a/workflow/tests/base_results/RESNET_Test_4.2_HERS_AutoGen_Reference_Home.csv
+++ b/workflow/tests/base_results/RESNET_Test_4.2_HERS_AutoGen_Reference_Home.csv
@@ -20,8 +20,7 @@ South window area (ft2),69.26,69.26,69.26,102.64
East window area (ft2),69.26,69.26,69.26,102.64
West window area (ft2),69.26,69.26,69.26,102.64
Window U-Factor,0.4,0.65,1.2,0.35
-Window SHGCo (heating),0.33,0.33,0.33,0.33
-Window SHGCo (cooling),0.33,0.33,0.33,0.33
+Window SHGCo,0.33,0.33,0.33,0.33
SLAo (ft2/ft2),0.00036,0.00036,0.00036,0.00036
Sensible Internal gains (Btu/day),55142,52470,47839,82721
Latent Internal gains (Btu/day),13635,12565,9150,17734
diff --git a/workflow/tests/base_results/RESNET_Test_4.5_DSE.csv b/workflow/tests/base_results/RESNET_Test_4.5_DSE.csv
index 049986118..74201b8f7 100644
--- a/workflow/tests/base_results/RESNET_Test_4.5_DSE.csv
+++ b/workflow/tests/base_results/RESNET_Test_4.5_DSE.csv
@@ -1,9 +1,9 @@
Test Case,Heat/Cool (kWh or therm),HVAC Fan (kWh)
HVAC3a.xml,570.75,226.25
HVAC3e.xml,6144.82,1199.83
-HVAC3b.xml,682.0,390.66
-HVAC3c.xml,609.97,267.57
-HVAC3d.xml,653.55,443.71
-HVAC3f.xml,7469.21,1450.7
-HVAC3g.xml,6591.75,1284.82
-HVAC3h.xml,7250.58,1384.76
+HVAC3b.xml,696.97,399.16
+HVAC3c.xml,602.01,264.06
+HVAC3d.xml,646.93,439.31
+HVAC3f.xml,7615.16,1483.53
+HVAC3g.xml,6514.97,1267.83
+HVAC3h.xml,7186.98,1370.99
diff --git a/workflow/tests/resnet_hers_test.rb b/workflow/tests/resnet_hers_test.rb
index 04a4869f9..339128bd9 100644
--- a/workflow/tests/resnet_hers_test.rb
+++ b/workflow/tests/resnet_hers_test.rb
@@ -67,13 +67,15 @@ def test_resnet_ashrae_140
end
def test_resnet_hers_reference_home_auto_generation
+ version = '2022C'
all_results = _test_resnet_hers_reference_home_auto_generation('RESNET_Test_4.2_HERS_AutoGen_Reference_Home',
- 'RESNET_Tests/4.2_HERS_AutoGen_Reference_Home')
+ 'RESNET_Tests/4.2_HERS_AutoGen_Reference_Home',
+ version)
# Check results
all_results.each do |xml, results|
test_num = File.basename(xml)[0, 2].to_i
- _check_reference_home_components(results, test_num, '2022C')
+ _check_reference_home_components(results, test_num, version)
end
end
diff --git a/workflow/tests/resnet_other_test.rb b/workflow/tests/resnet_other_test.rb
index a29d7816f..3fd75bc00 100644
--- a/workflow/tests/resnet_other_test.rb
+++ b/workflow/tests/resnet_other_test.rb
@@ -19,25 +19,29 @@ def setup
end
def test_resnet_hers_reference_home_auto_generation_301_2019_pre_addendum_a
+ version = '2019'
all_results = _test_resnet_hers_reference_home_auto_generation('RESNET_Test_Other_HERS_AutoGen_Reference_Home_301_2019_PreAddendumA',
- 'RESNET_Tests/Other_HERS_AutoGen_Reference_Home_301_2019_PreAddendumA')
+ 'RESNET_Tests/Other_HERS_AutoGen_Reference_Home_301_2019_PreAddendumA',
+ version)
# Check results
all_results.each do |xml, results|
test_num = File.basename(xml)[0, 2].to_i
- _check_reference_home_components(results, test_num, '2019')
+ _check_reference_home_components(results, test_num, version)
end
end
def test_resnet_hers_reference_home_auto_generation_301_2014
# Older test w/ 301-2014 mechanical ventilation acceptance criteria
+ version = '2014'
all_results = _test_resnet_hers_reference_home_auto_generation('RESNET_Test_Other_HERS_AutoGen_Reference_Home_301_2014',
- 'RESNET_Tests/Other_HERS_AutoGen_Reference_Home_301_2014')
+ 'RESNET_Tests/Other_HERS_AutoGen_Reference_Home_301_2014',
+ version)
# Check results
all_results.each do |xml, results|
test_num = File.basename(xml)[0, 2].to_i
- _check_reference_home_components(results, test_num, '2014')
+ _check_reference_home_components(results, test_num, version)
end
end
diff --git a/workflow/tests/util.rb b/workflow/tests/util.rb
index d45cfb568..03d84e5c7 100644
--- a/workflow/tests/util.rb
+++ b/workflow/tests/util.rb
@@ -296,7 +296,7 @@ def _test_resnet_hot_water(test_name, dir_name)
return dhw_energy
end
-def _test_resnet_hers_reference_home_auto_generation(test_name, dir_name)
+def _test_resnet_hers_reference_home_auto_generation(test_name, dir_name, version)
test_results_csv = File.absolute_path(File.join(@test_results_dir, "#{test_name}.csv"))
File.delete(test_results_csv) if File.exist? test_results_csv
@@ -307,7 +307,7 @@ def _test_resnet_hers_reference_home_auto_generation(test_name, dir_name)
out_xml = File.join(@test_files_dir, test_name, File.basename(xml), File.basename(xml))
_run_ruleset(Constants.CalcTypeERIReferenceHome, xml, out_xml)
test_num = File.basename(xml)[0, 2].to_i
- all_results[File.basename(xml)] = _get_reference_home_components(out_xml, test_num)
+ all_results[File.basename(xml)] = _get_reference_home_components(out_xml, test_num, version)
# Update HPXML to override mech vent fan power for eRatio test
new_hpxml = HPXML.new(hpxml_path: out_xml)
@@ -417,7 +417,7 @@ def _get_simulation_hvac_energy_results(csv_path, is_heat, is_electric_heat)
end
def _check_ashrae_140_results(htg_loads, clg_loads)
- # Proposed acceptance criteria as of 3/18/2024
+ # Pub 002-2024
htg_min = [48.07, 74.30, 35.98, 39.74, 45.72, 39.13, 42.17, 48.30, 58.15, 121.76, 126.71, 24.59, 27.72, 57.57, 48.33]
htg_max = [61.35, 82.96, 48.09, 49.95, 51.97, 55.54, 58.15, 63.40, 74.24, 137.68, 146.84, 81.73, 70.27, 91.66, 56.47]
htg_dt_min = [17.53, -16.08, -12.92, -12.14, -10.90, -0.56, -1.96, 8.15, 71.16, 3.20, -25.78, -3.14, 7.79, 5.49]
@@ -425,7 +425,7 @@ def _check_ashrae_140_results(htg_loads, clg_loads)
clg_min = [42.50, 47.72, 41.15, 31.54, 21.03, 50.55, 36.63, 52.26, 34.16, 57.07, 50.19]
clg_max = [58.66, 61.33, 51.69, 41.85, 29.35, 73.48, 59.72, 68.60, 47.58, 73.51, 60.72]
clg_dt_min = [0.69, -8.24, -18.53, -30.58, 7.51, -16.52, 6.75, -12.95, 11.62, 5.12]
- clg_dt_max = [6.91, -0.22, -9.74, -20.47, 15.77, -11.15, 12.76, -6.58, 17.59, 14.14]
+ clg_dt_max = [6.91, -0.22, -9.74, -20.48, 15.77, -11.15, 12.76, -6.58, 17.59, 14.14]
# Annual Heating Loads
assert_operator(htg_loads['L100AC'], :<=, htg_max[0])
@@ -536,7 +536,7 @@ def _check_ashrae_140_results(htg_loads, clg_loads)
assert_operator(clg_loads['L200AL'] - clg_loads['L202AL'], :>=, clg_dt_min[9])
end
-def _get_reference_home_components(hpxml, test_num)
+def _get_reference_home_components(hpxml, test_num, version)
results = {}
hpxml = HPXML.new(hpxml_path: hpxml)
hpxml_bldg = hpxml.buildings[0]
@@ -615,8 +615,13 @@ def _get_reference_home_components(hpxml, test_num)
results['East window area (ft2)'] = win_areas[90].round(2)
results['West window area (ft2)'] = win_areas[270].round(2)
results['Window U-Factor'] = win_u.round(2)
- results['Window SHGCo (heating)'] = win_shgc_htg.round(2)
- results['Window SHGCo (cooling)'] = win_shgc_clg.round(2)
+ if version == '2022C'
+ results['Window SHGCo'] = win_shgc_htg.round(2)
+ assert_equal(win_shgc_htg, win_shgc_clg)
+ else
+ results['Window SHGCo (heating)'] = win_shgc_htg.round(2)
+ results['Window SHGCo (cooling)'] = win_shgc_clg.round(2)
+ end
# Infiltration
sla, _ach50 = _get_infiltration(hpxml_bldg)
@@ -826,10 +831,8 @@ def _check_reference_home_components(results, test_num, version)
assert_equal(0.35, results['Window U-Factor'])
end
if version == '2022C'
- # FIXME: Expected values changed due to different internal shading coefficients
- # in 301-2022 Addendum C.
- assert_equal(0.33, results['Window SHGCo (heating)'])
- assert_equal(0.33, results['Window SHGCo (cooling)'])
+ # Pub 002-2024
+ assert_equal(0.33, results['Window SHGCo'])
else
assert_equal(0.34, results['Window SHGCo (heating)'])
assert_equal(0.28, results['Window SHGCo (cooling)'])
@@ -840,6 +843,7 @@ def _check_reference_home_components(results, test_num, version)
# Internal gains
if version == '2022C'
+ # Pub 002-2024
# FIXME: Expected values changed due to rounded F_sensible values in 301-2022
# Addendum C relative to previously prescribed internal gains. Values below
# do not match Pub 002, as it has not yet been updated.
@@ -892,7 +896,7 @@ def _check_reference_home_components(results, test_num, version)
# Mechanical ventilation
mv_kwh_yr = nil
if version == '2022C'
- # FIXME: Updated values per 301-2022 Addendum C
+ # Pub 002-2024
mv_kwh_yr = { 1 => 0.0, 2 => 223.9, 3 => 288.1, 4 => 763.4 }[test_num]
elsif version == '2019'
mv_kwh_yr = { 1 => 0.0, 2 => 222.1, 3 => 288.1, 4 => 763.4 }[test_num]
@@ -1377,8 +1381,8 @@ def _check_method_results(results, test_num, has_tankless_water_heater, version)
end
def _check_hvac_test_results(energy)
- # Proposed acceptance criteria as of 3/18/2024
- min = [-24.59, -13.13, -42.73, 57.35]
+ # Pub 002-2024
+ min = [-24.59, -13.13, -42.73, 59.35]
max = [-18.18, -12.60, -15.88, 110.25]
# Cooling cases
@@ -1397,7 +1401,7 @@ def _check_hvac_test_results(energy)
end
def _check_dse_test_results(energy)
- # Proposed acceptance criteria as of 3/18/2024
+ # Pub 002-2024
htg_min = [9.45, 3.11, 7.40]
htg_max = [25.72, 6.53, 19.77]
clg_min = [18.69, 5.23, 16.32]
@@ -1406,12 +1410,8 @@ def _check_dse_test_results(energy)
# Heating cases
assert_operator((energy['HVAC3b'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :>, htg_min[0])
assert_operator((energy['HVAC3b'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :<, htg_max[0])
- # Note: OS-ERI does not pass this test because of differences in duct insulation
- # R-values; see get_duct_insulation_rvalue() in airflow.rb.
- # See https://github.com/resnet-us/software-consistency-inquiries/issues/21
- # Set Pub 002 effective R-value in test cases?
- # assert_operator((energy['HVAC3c'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :>, htg_min[1])
- # assert_operator((energy['HVAC3c'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :<, htg_max[1])
+ assert_operator((energy['HVAC3c'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :>, htg_min[1])
+ assert_operator((energy['HVAC3c'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :<, htg_max[1])
assert_operator((energy['HVAC3d'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :>, htg_min[2])
assert_operator((energy['HVAC3d'] - energy['HVAC3a']) / energy['HVAC3a'] * 100, :<, htg_max[2])