Skip to content

Commit

Permalink
Require a water heater's HeatingCapacity to be > 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
shorowit committed Oct 16, 2024
1 parent 616154a commit bd4bde1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 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>12483bf7-4ca3-4ba9-876c-77bb831ca387</version_id>
<version_modified>2024-10-15T16:24:50Z</version_modified>
<version_id>5c60d469-73ac-415f-b37f-8b8401c8d5f3</version_id>
<version_modified>2024-10-16T17:32:33Z</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>5AA8A4A1</checksum>
<checksum>BD9733AC</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand Down Expand Up @@ -735,7 +735,7 @@
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>2E4AE571</checksum>
<checksum>7CB39E62</checksum>
</file>
<file>
<filename>test_water_heater.rb</filename>
Expand Down
2 changes: 2 additions & 0 deletions HPXMLtoOpenStudio/resources/hpxml_schematron/EPvalidator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@
<sch:assert role='ERROR' test='count(h:TankVolume) &lt;= 1'>Expected 0 or 1 element(s) for xpath: TankVolume</sch:assert>
<sch:assert role='ERROR' test='count(h:FractionDHWLoadServed) = 1'>Expected 1 element(s) for xpath: FractionDHWLoadServed</sch:assert>
<sch:assert role='ERROR' test='count(h:HeatingCapacity) &lt;= 1'>Expected 0 or 1 element(s) for xpath: HeatingCapacity</sch:assert>
<sch:assert role='ERROR' test='number(h:HeatingCapacity) &gt; 0 or not(h:HeatingCapacity)'>Expected HeatingCapacity to be greater than 0.</sch:assert>
<sch:assert role='ERROR' test='count(h:UniformEnergyFactor) + count(h:EnergyFactor) = 1'>Expected 1 element(s) for xpath: UniformEnergyFactor | EnergyFactor</sch:assert>
<sch:assert role='ERROR' test='number(h:UniformEnergyFactor) &lt; 1 or not(h:UniformEnergyFactor)'>Expected UniformEnergyFactor to be less than 1</sch:assert>
<sch:assert role='ERROR' test='number(h:EnergyFactor) &lt; 1 or not(h:EnergyFactor)'>Expected EnergyFactor to be less than 1</sch:assert>
Expand Down Expand Up @@ -2207,6 +2208,7 @@
<sch:assert role='ERROR' test='count(h:TankVolume) &lt;= 1'>Expected 0 or 1 element(s) for xpath: TankVolume</sch:assert>
<sch:assert role='ERROR' test='count(h:FractionDHWLoadServed) = 1'>Expected 1 element(s) for xpath: FractionDHWLoadServed</sch:assert>
<sch:assert role='ERROR' test='count(h:HeatingCapacity) &lt;= 1'>Expected 0 or 1 element(s) for xpath: HeatingCapacity</sch:assert>
<sch:assert role='ERROR' test='number(h:HeatingCapacity) &gt; 0 or not(h:HeatingCapacity)'>Expected HeatingCapacity to be greater than 0.</sch:assert>
<sch:assert role='ERROR' test='count(h:BackupHeatingCapacity) &lt;= 1'>Expected 0 or 1 element(s) for xpath: BackupHeatingCapacity</sch:assert>
<sch:assert role='ERROR' test='count(h:UniformEnergyFactor) + count(h:EnergyFactor) = 1'>Expected 1 element(s) for xpath: UniformEnergyFactor | EnergyFactor</sch:assert>
<sch:assert role='ERROR' test='number(h:UniformEnergyFactor) &gt; 1 or not(h:UniformEnergyFactor)'>Expected UniformEnergyFactor to be greater than 1</sch:assert>
Expand Down
8 changes: 8 additions & 0 deletions HPXMLtoOpenStudio/tests/test_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ def test_schema_schematron_error_messages
'invalid-ventilation-fan' => ['Expected 1 element(s) for xpath: UsedForWholeBuildingVentilation[text()="true"] | UsedForLocalVentilation[text()="true"] | UsedForSeasonalCoolingLoadReduction[text()="true"] | UsedForGarageVentilation[text()="true"]'],
'invalid-ventilation-recovery' => ['Expected 0 element(s) for xpath: TotalRecoveryEfficiency | AdjustedTotalRecoveryEfficiency',
'Expected 0 element(s) for xpath: SensibleRecoveryEfficiency | AdjustedSensibleRecoveryEfficiency'],
'invalid-water-heater-heating-capacity' => ['Expected HeatingCapacity to be greater than 0.'],
'invalid-water-heater-heating-capacity2' => ['Expected HeatingCapacity to be greater than 0.'],
'invalid-window-height' => ['Expected DistanceToBottomOfWindow to be greater than DistanceToTopOfWindow [context: /HPXML/Building/BuildingDetails/Enclosure/Windows/Window/Overhangs[number(Depth) > 0], id: "Window2"]'],
'leakiness-description-missing-year-built' => ['Expected 1 element(s) for xpath: BuildingSummary/BuildingConstruction/YearBuilt'],
'lighting-fractions' => ['Expected sum(LightingGroup/FractionofUnitsInLocation) for Location="interior" to be less than or equal to 1 [context: /HPXML/Building/BuildingDetails/Lighting, id: "MyBuilding"]'],
Expand Down Expand Up @@ -670,6 +672,12 @@ def test_schema_schematron_error_messages
hpxml, hpxml_bldg = _create_hpxml('base-mechvent-exhaust.xml')
hpxml_bldg.ventilation_fans[0].sensible_recovery_efficiency = 0.72
hpxml_bldg.ventilation_fans[0].total_recovery_efficiency = 0.48
elsif ['invalid-water-heater-heating-capacity'].include? error_case
hpxml, hpxml_bldg = _create_hpxml('base-dhw-tank-gas.xml')
hpxml_bldg.water_heating_systems[0].heating_capacity = 0
elsif ['invalid-water-heater-heating-capacity2'].include? error_case
hpxml, hpxml_bldg = _create_hpxml('base-dhw-tank-heat-pump.xml')
hpxml_bldg.water_heating_systems[0].heating_capacity = 0
elsif ['invalid-window-height'].include? error_case
hpxml, hpxml_bldg = _create_hpxml('base-enclosure-overhangs.xml')
hpxml_bldg.windows[1].overhangs_distance_to_bottom_of_window = 1.0
Expand Down

0 comments on commit bd4bde1

Please sign in to comment.