Skip to content

Commit

Permalink
Revert Window SHGC change; RESNET updated their form.
Browse files Browse the repository at this point in the history
  • Loading branch information
shorowit committed Dec 16, 2024
1 parent 6626007 commit 213f1c8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
6 changes: 4 additions & 2 deletions workflow/tests/resnet_hers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,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

Expand Down
12 changes: 8 additions & 4 deletions workflow/tests/resnet_other_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 9 additions & 5 deletions workflow/tests/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _rm_path(path)
end
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

Expand All @@ -285,7 +285,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)
Expand Down Expand Up @@ -374,7 +374,7 @@ def _test_resnet_hers_method(test_name, dir_name)
return all_results
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]
Expand Down Expand Up @@ -453,8 +453,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)
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)
Expand Down Expand Up @@ -665,8 +670,7 @@ def _check_reference_home_components(results, test_num, version)
end
if version == '2022C'
# Pub 002-2024
assert_equal(0.33, results['Window SHGCo (heating)'])
assert_equal(0.33, results['Window SHGCo (cooling)'])
assert_equal(0.33, results['Window SHGCo'])
else
assert_equal(0.34, results['Window SHGCo (heating)'])
assert_equal(0.28, results['Window SHGCo (cooling)'])
Expand Down

0 comments on commit 213f1c8

Please sign in to comment.