Skip to content

Commit

Permalink
Update to latest HPXML schema for standby losses. Code backported from
Browse files Browse the repository at this point in the history
  • Loading branch information
shorowit committed Sep 29, 2022
1 parent f62df2c commit 02f3cf4
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 76 deletions.
6 changes: 4 additions & 2 deletions BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5228,7 +5228,8 @@ def self.set_water_heating_systems(hpxml, args)
if [HPXML::WaterHeaterTypeCombiTankless, HPXML::WaterHeaterTypeCombiStorage].include? water_heater_type
if args[:water_heater_standby_loss].is_initialized
if args[:water_heater_standby_loss].get > 0
standby_loss = args[:water_heater_standby_loss].get
standby_loss_units = HPXML::UnitsDegFPerHour
standby_loss_value = args[:water_heater_standby_loss].get
end
end
end
Expand Down Expand Up @@ -5291,7 +5292,8 @@ def self.set_water_heating_systems(hpxml, args)
recovery_efficiency: recovery_efficiency,
uses_desuperheater: uses_desuperheater,
related_hvac_idref: related_hvac_idref,
standby_loss: standby_loss,
standby_loss_units: standby_loss_units,
standby_loss_value: standby_loss_value,
jacket_r_value: jacket_r_value,
temperature: temperature,
heating_capacity: heating_capacity,
Expand Down
6 changes: 3 additions & 3 deletions BuildResidentialHPXML/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>1d0058f9-2963-443a-a959-78e5f088e7d2</version_id>
<version_modified>20220926T172603Z</version_modified>
<version_id>9a3394b8-30aa-4f07-a4c7-dfa6bbf1ba4b</version_id>
<version_modified>20220929T155118Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -6413,7 +6413,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>470336B9</checksum>
<checksum>C00BFDD4</checksum>
</file>
</files>
</measure>
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__New Features__
- **Breaking Change**: Replaces `FrameFloors/FrameFloor` with `Floors/Floor`.
- **Breaking change**: Replaces `SoftwareInfo/extension/SimulationControl/DaylightSaving/Enabled` with `Building/Site/TimeZone/DSTObserved`.
- **Breaking Change**: Replaces `StandbyLoss` with `StandbyLoss[Units="F/hr"]/Value` for an indirect water heater.
- Allows SEER2/HSPF2 efficiency types for central air conditioners and heat pumps.
- Allows heating/cooling seasons that don't span the entire year.
- Allows calculating one or more utility bill scenarios (e.g., net metering vs feed-in tariff compensation types for a simulation with PV).
Expand Down
100 changes: 50 additions & 50 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>0be40881-8b15-4dd9-a51f-432b4fec76cd</version_id>
<version_modified>20220927T180626Z</version_modified>
<version_id>65d82b9f-532d-400b-8f27-183b6b08f5f9</version_id>
<version_modified>20220929T155120Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -325,12 +325,6 @@
<usage_type>resource</usage_type>
<checksum>0F94C201</checksum>
</file>
<file>
<filename>waterheater.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>500A5756</checksum>
</file>
<file>
<filename>meta_measure.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -361,30 +355,12 @@
<usage_type>resource</usage_type>
<checksum>2FD98C89</checksum>
</file>
<file>
<filename>hpxml_schema/HPXMLBaseElements.xsd</filename>
<filetype>xsd</filetype>
<usage_type>resource</usage_type>
<checksum>17563F8C</checksum>
</file>
<file>
<filename>hpxml_schema/HPXMLDataTypes.xsd</filename>
<filetype>xsd</filetype>
<usage_type>resource</usage_type>
<checksum>2B0922EC</checksum>
</file>
<file>
<filename>utility_bills.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>35B866E9</checksum>
</file>
<file>
<filename>hpxml_schematron/HPXMLvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>5DD85F0D</checksum>
</file>
<file>
<filename>misc_loads.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -535,36 +511,12 @@
<usage_type>resource</usage_type>
<checksum>6F6B5865</checksum>
</file>
<file>
<filename>test_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>069B537F</checksum>
</file>
<file>
<filename>hpxml_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>F954FBA8</checksum>
</file>
<file>
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>A482C431</checksum>
</file>
<file>
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>675AC983</checksum>
</file>
<file>
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>CD5019F4</checksum>
</file>
<file>
<filename>hvac.rb</filename>
<filetype>rb</filetype>
Expand Down Expand Up @@ -594,5 +546,53 @@
<usage_type>resource</usage_type>
<checksum>42C2E302</checksum>
</file>
<file>
<filename>waterheater.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>65181200</checksum>
</file>
<file>
<filename>hpxml_schema/HPXMLBaseElements.xsd</filename>
<filetype>xsd</filetype>
<usage_type>resource</usage_type>
<checksum>32481882</checksum>
</file>
<file>
<filename>hpxml_schema/HPXMLDataTypes.xsd</filename>
<filetype>xsd</filetype>
<usage_type>resource</usage_type>
<checksum>5559DDD1</checksum>
</file>
<file>
<filename>hpxml_schematron/HPXMLvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>6FFC25E9</checksum>
</file>
<file>
<filename>test_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>48381849</checksum>
</file>
<file>
<filename>hpxml_defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>23576669</checksum>
</file>
<file>
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>6499B5B3</checksum>
</file>
<file>
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>3450451E</checksum>
</file>
</files>
</measure>
16 changes: 12 additions & 4 deletions HPXMLtoOpenStudio/resources/hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ class HPXML < Object
UnitsACHNatural = 'ACHnatural'
UnitsAFUE = 'AFUE'
UnitsAh = 'Ah'
UnitsBtuPerHour = 'Btu/hr'
UnitsCFM = 'CFM'
UnitsCFM25 = 'CFM25'
UnitsCFM50 = 'CFM50'
UnitsCOP = 'COP'
UnitsDegFPerHour = 'F/hr'
UnitsDollars = '$'
UnitsDollarsPerkW = '$/kW'
UnitsEER = 'EER'
Expand All @@ -316,6 +318,7 @@ class HPXML < Object
UnitsKwhPerDay = 'kWh/day'
UnitsKwPerTon = 'kW/ton'
UnitsPercent = 'Percent'
UnitsPercentPerHour = '%/hr'
UnitsSEER = 'SEER'
UnitsSEER2 = 'SEER2'
UnitsSLA = 'SLA'
Expand Down Expand Up @@ -4642,8 +4645,8 @@ class WaterHeatingSystem < BaseElement
ATTRS = [:id, :year_installed, :fuel_type, :water_heater_type, :location, :performance_adjustment,
:tank_volume, :fraction_dhw_load_served, :heating_capacity, :energy_factor, :usage_bin,
:uniform_energy_factor, :first_hour_rating, :recovery_efficiency, :uses_desuperheater, :jacket_r_value,
:related_hvac_idref, :third_party_certification, :standby_loss, :temperature, :is_shared_system,
:number_of_units_served, :tank_model_type, :operating_mode]
:related_hvac_idref, :third_party_certification, :standby_loss_units, :standby_loss_value,
:temperature, :is_shared_system, :number_of_units_served, :tank_model_type, :operating_mode]
attr_accessor(*ATTRS)

def related_hvac_system
Expand Down Expand Up @@ -4700,7 +4703,11 @@ def to_oga(doc)
jacket = XMLHelper.add_element(water_heater_insulation, 'Jacket')
XMLHelper.add_element(jacket, 'JacketRValue', @jacket_r_value, :float)
end
XMLHelper.add_element(water_heating_system, 'StandbyLoss', @standby_loss, :float, @standby_loss_isdefaulted) unless @standby_loss.nil?
if (not @standby_loss_units.nil?) && (not @standby_loss_value.nil?)
standby_loss = XMLHelper.add_element(water_heating_system, 'StandbyLoss')
XMLHelper.add_element(standby_loss, 'Units', @standby_loss_units, :string, @standby_loss_units_isdefaulted)
XMLHelper.add_element(standby_loss, 'Value', @standby_loss_value, :float, @standby_loss_value_isdefaulted)
end
XMLHelper.add_element(water_heating_system, 'HotWaterTemperature', @temperature, :float, @temperature_isdefaulted) unless @temperature.nil?
XMLHelper.add_element(water_heating_system, 'UsesDesuperheater', @uses_desuperheater, :boolean) unless @uses_desuperheater.nil?
if not @related_hvac_idref.nil?
Expand Down Expand Up @@ -4735,7 +4742,8 @@ def from_oga(water_heating_system)
@usage_bin = XMLHelper.get_value(water_heating_system, 'UsageBin', :string)
@recovery_efficiency = XMLHelper.get_value(water_heating_system, 'RecoveryEfficiency', :float)
@jacket_r_value = XMLHelper.get_value(water_heating_system, 'WaterHeaterInsulation/Jacket/JacketRValue', :float)
@standby_loss = XMLHelper.get_value(water_heating_system, 'StandbyLoss', :float)
@standby_loss_units = XMLHelper.get_value(water_heating_system, 'StandbyLoss/Units', :string)
@standby_loss_value = XMLHelper.get_value(water_heating_system, 'StandbyLoss/Value', :float)
@temperature = XMLHelper.get_value(water_heating_system, 'HotWaterTemperature', :float)
@uses_desuperheater = XMLHelper.get_value(water_heating_system, 'UsesDesuperheater', :boolean)
@related_hvac_idref = HPXML::get_idref(XMLHelper.get_element(water_heating_system, 'RelatedHVACSystem'))
Expand Down
8 changes: 5 additions & 3 deletions HPXMLtoOpenStudio/resources/hpxml_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1663,14 +1663,16 @@ def self.apply_water_heaters(hpxml, nbeds, eri_version, schedules_file)
water_heating_system.performance_adjustment = Waterheater.get_default_performance_adjustment(water_heating_system)
water_heating_system.performance_adjustment_isdefaulted = true
end
if (water_heating_system.water_heater_type == HPXML::WaterHeaterTypeCombiStorage) && water_heating_system.standby_loss.nil?
if (water_heating_system.water_heater_type == HPXML::WaterHeaterTypeCombiStorage) && water_heating_system.standby_loss_value.nil?
# Use equation fit from AHRI database
# calculate independent variable SurfaceArea/vol(physically linear to standby_loss/skin_u under test condition) to fit the linear equation from AHRI database
act_vol = Waterheater.calc_storage_tank_actual_vol(water_heating_system.tank_volume, nil)
surface_area = Waterheater.calc_tank_areas(act_vol)[0]
sqft_by_gal = surface_area / act_vol # sqft/gal
water_heating_system.standby_loss = (2.9721 * sqft_by_gal - 0.4732).round(3) # linear equation assuming a constant u, F/hr
water_heating_system.standby_loss_isdefaulted = true
water_heating_system.standby_loss_value = (2.9721 * sqft_by_gal - 0.4732).round(3) # linear equation assuming a constant u, F/hr
water_heating_system.standby_loss_value_isdefaulted = true
water_heating_system.standby_loss_units = HPXML::UnitsDegFPerHour
water_heating_system.standby_loss_units_isdefaulted = true
end
if (water_heating_system.water_heater_type == HPXML::WaterHeaterTypeStorage)
if water_heating_system.heating_capacity.nil?
Expand Down
33 changes: 26 additions & 7 deletions HPXMLtoOpenStudio/resources/hpxml_schema/HPXMLBaseElements.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="InteriorStuds" type="StudProperties"/>
<xs:element minOccurs="0" name="InteriorFinish" type="InteriorFinishInfo"> </xs:element>
<xs:element minOccurs="0" name="InteriorFinish" type="InteriorFinishInfo"/>
<xs:element maxOccurs="1" minOccurs="0" name="Insulation" type="FoundationWallInsulationInfo"/>
<xs:element minOccurs="0" ref="extension"/>
</xs:sequence>
Expand All @@ -1168,7 +1168,7 @@
</xs:element>
<xs:element minOccurs="0" name="Ceilings">
<xs:annotation>
<xs:documentation>Use Ceilings for horizontal surfaces above living space (e.g., sufaces between living space and attic).</xs:documentation>
<xs:documentation>Use Ceilings for horizontal surfaces above living space (e.g., surfaces between living space and attic).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -1199,13 +1199,13 @@
</xs:element>
<xs:element minOccurs="0" name="Floors">
<xs:annotation>
<xs:documentation>Use Floors for horizontal surfaces below living space (e.g., sufaces between living space and crawlspace/basement/ambient foundations).</xs:documentation>
<xs:documentation>Use Floors for horizontal surfaces below living space (e.g., surfaces between living space and crawlspace/basement/ambient foundations).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Floor" maxOccurs="unbounded" minOccurs="1">
<xs:annotation>
<xs:documentation>Interior partition surfaces should not be described using the Floor element.</xs:documentation>
<xs:documentation>Interior partition surfaces should not be described using the FrameFloor element.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
Expand Down Expand Up @@ -1709,6 +1709,11 @@
430, Subpart B, Appendix E.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="HeatPumpCOP" type="Efficiency">
<xs:annotation>
<xs:documentation>The dimensionless coefficient of performance, used to measure the efficiency of a commercial heat pump water heater.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="FirstHourRating" type="Volume">
<xs:annotation>
<xs:documentation>[gal per hour] An estimate of the maximum volume of hot water in gallons that a storage water heater can supply within an hour that begins
Expand Down Expand Up @@ -1774,9 +1779,9 @@
<xs:attribute name="dataSource" type="DataSource"/>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="StandbyLoss" type="HPXMLDouble">
<xs:element minOccurs="0" name="StandbyLoss" type="StandbyLossType">
<xs:annotation>
<xs:documentation>[degF/hr] The standby heat loss rate for, e.g., indirect water heaters in degrees per hour. Published in the AHRI Consumer’s Directory of Certified Efficiency Ratings.</xs:documentation>
<xs:documentation>The standby heat loss rate for, e.g., indirect or commercial water heaters. Published in the AHRI Consumer’s Directory of Certified Efficiency Ratings.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="MeetsACCA5QIHVACSpecification" type="HPXMLBoolean" minOccurs="0"/>
Expand Down Expand Up @@ -3948,6 +3953,17 @@
<xs:documentation>Ah is computed by multiplying the discharge current (Amps) by the discharge time (hours). kWh is computed by multiplying the power output (kW) by the discharge time (hours).</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="dataSource" type="DataSource"/>
</xs:complexType>
<xs:complexType name="StandbyLossType">
<xs:sequence>
<xs:element name="Units" type="StandbyLossUnits">
<xs:annotation>
<xs:documentation>For %/hr enter values as a fraction, i.e. 1.20%/hr = 0.0120 and 0.68%/hr = 0.0068.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Value" type="HPXMLDouble"/>
</xs:sequence>
<xs:attribute name="dataSource" type="DataSource"/>
</xs:complexType>
Expand Down Expand Up @@ -5582,7 +5598,7 @@
</xs:complexType>
<xs:complexType name="FloorType">
<xs:choice>
<xs:element name="WoodStud">
<xs:element name="WoodFrame">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="extension"/>
Expand All @@ -5591,6 +5607,9 @@
</xs:complexType>
</xs:element>
<xs:element name="StructurallyInsulatedPanel">
<xs:annotation>
<xs:documentation>Structurally Insulated Panel</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="extension"/>
Expand Down
14 changes: 14 additions & 0 deletions HPXMLtoOpenStudio/resources/hpxml_schema/HPXMLDataTypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,20 @@
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="StandbyLossUnits_simple">
<xs:restriction base="xs:string">
<xs:enumeration value="F/hr"/>
<xs:enumeration value="%/hr"/>
<xs:enumeration value="Btu/hr"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="StandbyLossUnits">
<xs:simpleContent>
<xs:extension base="StandbyLossUnits_simple">
<xs:attribute name="dataSource" type="DataSource"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="DistrictSteamType_simple">
<xs:restriction base="xs:string">
<xs:enumeration value="1-pipe"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@
<sch:assert role='ERROR' test='count(h:RelatedHVACSystem) = 1'>Expected 1 element(s) for xpath: RelatedHVACSystem</sch:assert> <!-- HeatingSystem (boiler) -->
<sch:assert role='ERROR' test='count(h:TankVolume) = 1'>Expected 1 element(s) for xpath: TankVolume</sch:assert>
<sch:assert role='ERROR' test='count(h:WaterHeaterInsulation/h:Jacket/h:JacketRValue) &lt;= 1'>Expected 0 or 1 element(s) for xpath: WaterHeaterInsulation/Jacket/JacketRValue</sch:assert>
<sch:assert role='ERROR' test='count(h:StandbyLoss) &lt;= 1'>Expected 0 or 1 element(s) for xpath: StandbyLoss</sch:assert>
<sch:assert role='ERROR' test='count(h:StandbyLoss[h:Units="F/hr"]/h:Value) &lt;= 1'>Expected 0 or 1 element(s) for xpath: StandbyLoss[Units="F/hr"]/Value</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down

0 comments on commit 02f3cf4

Please sign in to comment.