Skip to content

Commit cac7620

Browse files
committed
Add total vs net error checking.
1 parent fabdb1a commit cac7620

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

ReportSimulationOutput/measure.rb

+14
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,20 @@ def check_for_errors(runner)
14331433
return false
14341434
end
14351435

1436+
# Check total vs net energy use
1437+
has_pv = @hpxml_bldgs.count { |hpxml_bldg| !hpxml_bldg.pv_systems.empty? } > 0
1438+
if has_pv
1439+
if @totals[TE::Total].annual_output == @totals[TE::Net].annual_output
1440+
runner.registerError('Building has PV but total/net energy uses are equal.')
1441+
return false
1442+
end
1443+
else
1444+
if @totals[TE::Total].annual_output != @totals[TE::Net].annual_output
1445+
runner.registerError('Building does not have PV but total/net energy uses are different.')
1446+
return false
1447+
end
1448+
end
1449+
14361450
# Check sum of electricity produced end use outputs match total output from meter
14371451
sum_elec_prod_annual = @end_uses.select { |k, eu| k[0] == FT::Elec && eu.is_negative }.map { |_k, eu| eu.annual_output.to_f }.sum(0.0) # Negative value
14381452
if (sum_elec_prod_annual - meter_elec_produced).abs > tol

ReportSimulationOutput/measure.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>report_simulation_output</name>
55
<uid>df9d170c-c21a-4130-866d-0d46b06073fd</uid>
6-
<version_id>7adf009d-a6b7-4501-95f4-318c1c0215b1</version_id>
7-
<version_modified>2025-02-18T15:23:54Z</version_modified>
6+
<version_id>a82d29da-4213-4138-874d-153fecede29b</version_id>
7+
<version_modified>2025-02-18T15:37:37Z</version_modified>
88
<xml_checksum>9BF1E6AC</xml_checksum>
99
<class_name>ReportSimulationOutput</class_name>
1010
<display_name>HPXML Simulation Output Report</display_name>
@@ -1972,7 +1972,7 @@
19721972
<filename>measure.rb</filename>
19731973
<filetype>rb</filetype>
19741974
<usage_type>script</usage_type>
1975-
<checksum>8BAA16E7</checksum>
1975+
<checksum>5184BE90</checksum>
19761976
</file>
19771977
<file>
19781978
<filename>test_report_sim_output.rb</filename>

0 commit comments

Comments
 (0)