Skip to content

Commit

Permalink
Merge pull request #1825 from NREL/fix_advanced_defrost_small_capacity
Browse files Browse the repository at this point in the history
Fix negative defrost power when applying advanced defrost with small cooling capacity
  • Loading branch information
shorowit authored Sep 19, 2024
2 parents 88e256c + 58bb02b commit 623f63c
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 71 deletions.
46 changes: 2 additions & 44 deletions BuildResidentialHPXML/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>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>df8f5a54-0541-4398-83f9-bd00620fc4b2</version_id>
<version_modified>2024-09-17T20:25:01Z</version_modified>
<version_id>2439d1bf-b493-4236-97ab-badc6ee2b0c2</version_id>
<version_modified>2024-09-18T23:10:07Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -7455,48 +7455,6 @@
<usage_type>resource</usage_type>
<checksum>F80359E3</checksum>
</file>
<file>
<filename>extra_files/base-mf.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>06C3D0DD</checksum>
</file>
<file>
<filename>extra_files/base-mf2.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>04582640</checksum>
</file>
<file>
<filename>extra_files/base-sfa.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>16ED9F15</checksum>
</file>
<file>
<filename>extra_files/base-sfa2.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>1B60C132</checksum>
</file>
<file>
<filename>extra_files/base-sfa3.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>DD9CD517</checksum>
</file>
<file>
<filename>extra_files/base-sfd.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>79463062</checksum>
</file>
<file>
<filename>extra_files/base-sfd2.xml</filename>
<filetype>xml</filetype>
<usage_type>test</usage_type>
<checksum>9FC7FBA9</checksum>
</file>
<file>
<filename>test_build_residential_hpxml.rb</filename>
<filetype>rb</filetype>
Expand Down
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>0afd52b5-a309-4dfc-8077-4d9715e178eb</version_id>
<version_modified>2024-09-18T15:09:16Z</version_modified>
<version_id>1650dfa9-50da-4856-b117-58dbffd75ff7</version_id>
<version_modified>2024-09-19T22:24:22Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -387,7 +387,7 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>774978A6</checksum>
<checksum>E26C6DD2</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
Expand Down Expand Up @@ -687,7 +687,7 @@
<filename>test_hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>A3E4F5E8</checksum>
<checksum>3CCD31EC</checksum>
</file>
<file>
<filename>test_hvac_sizing.rb</filename>
Expand Down
51 changes: 28 additions & 23 deletions HPXMLtoOpenStudio/resources/hvac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5085,14 +5085,15 @@ def self.apply_installation_quality(model, heating_system, cooling_system, unita
program_calling_manager.addProgram(fault_program)
end

# TODO
# Calculate delivered cooling load and compressor power during defrost when using
# the advanced defrost model.
#
# @param heat_pump [TODO] TODO
# @param heat_pump [HPXML::HeatPump] HPXML Heat Pump object
# @param unit_multiplier [Integer] Number of similar dwelling units
# @param design_airflow [TODO] TODO
# @param max_heating_airflow [TODO] TODO
# @param fan_watts_per_cfm [TODO] TODO
# @return [TODO] TODO
# @param design_airflow [Float] Heat pump design air flow rate [cfm]
# @param max_heating_airflow [Float] Maximum heat pump heating air flow rate [cfm]
# @param fan_watts_per_cfm [Float] Heat pump watts per cfm [W/cfm]
# @return [Array<Float, Float>] Calculated delivered cooling q_dot and compressor power p_dot [W]
def self.calculate_heat_pump_defrost_load_power_watts(heat_pump, unit_multiplier, design_airflow, max_heating_airflow, fan_watts_per_cfm)
# Calculate q_dot and p_dot
# q_dot is used for EMS program to account for introduced cooling load and supp coil power consumption by actuating other equipment objects
Expand All @@ -5109,32 +5110,36 @@ def self.calculate_heat_pump_defrost_load_power_watts(heat_pump, unit_multiplier
capacity_defrost_multiplier = 0.1
cop_defrost_multiplier = 0.08
end
nominal_cooling_capacity_1x = heat_pump.cooling_capacity / unit_multiplier
max_heating_airflow_1x = max_heating_airflow / unit_multiplier
design_airflow_1x = design_airflow / unit_multiplier
defrost_flow_fraction = max_heating_airflow_1x / design_airflow_1x
defrost_power_fraction = defrost_flow_fraction**3
power_design = fan_watts_per_cfm * design_airflow_1x
# cooling capacity and airflow are already with unit multiplier, calculate the capacity w/o multiplier
nominal_cooling_capacity = heat_pump.cooling_capacity / unit_multiplier
defrost_power_fraction = (max_heating_airflow / design_airflow)**3
power_design = fan_watts_per_cfm * design_airflow / unit_multiplier
p_dot_blower = power_design * defrost_power_fraction
# Based on manufacturer data for ~70 systems ranging from 1.5 to 5 tons with varying efficiency levels
p_dot_odu_fan = 44.348 * UnitConversions.convert(nominal_cooling_capacity_1x, 'Btu/hr', 'ton') + 62.452
rated_clg_cop = heat_pump.additional_properties.cool_rated_cops[-1]
q_dot_defrost = UnitConversions.convert(nominal_cooling_capacity_1x, 'Btu/hr', 'W') * capacity_defrost_multiplier
cop_defrost = rated_clg_cop * cop_defrost_multiplier
if nominal_cooling_capacity > 18000.0 # > 1.5 tons
p_dot_odu_fan = 44.348 * UnitConversions.convert(nominal_cooling_capacity, 'Btu/hr', 'ton') + 62.452
else # < 1.5 tons, scale fan power to avoid negative p_dot_defrost
# Use p_dot_odu_fan at 1.5 ton to scale down
p_dot_odu_fan = 128.974 * (nominal_cooling_capacity / 18000.0)
end
q_dot_defrost = UnitConversions.convert(nominal_cooling_capacity, 'Btu/hr', 'W') * capacity_defrost_multiplier
cop_defrost = heat_pump.additional_properties.cool_rated_cops[-1] * cop_defrost_multiplier
p_dot_defrost = (q_dot_defrost / cop_defrost - p_dot_odu_fan + p_dot_blower) * unit_multiplier # p_dot_defrost is used in coil object, which needs to be scaled up for unit multiplier

return q_dot_defrost, p_dot_defrost
end

# TODO
# Create EMS program and Other equipment objects to account for delivered cooling load and supplemental heating energy during defrost
# when using the advanced defrost model.
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param htg_coil [TODO] TODO
# @param htg_coil [OpenStudio::Model::CoilHeatingDXSingleSpeed or OpenStudio::Model::CoilHeatingDXMultiSpeed] OpenStudio Heating Coil object
# @param air_loop_unitary [OpenStudio::Model::AirLoopHVACUnitarySystem] Air loop for the HVAC system
# @param conditioned_space [TODO] TODO
# @param htg_supp_coil [TODO] TODO
# @param heat_pump [TODO] TODO
# @param q_dot_defrost [TODO] TODO
# @return [TODO] TODO
# @param conditioned_space [OpenStudio::Model::Space] OpenStudio Space object for conditioned zone
# @param htg_supp_coil [OpenStudio::Model::CoilHeatingElectric or CoilHeatingElectricMultiStage] OpenStudio Supplemental Heating Coil object
# @param heat_pump [HPXML::HeatPump] HPXML Heat Pump object
# @param q_dot_defrost [Float] Calculated delivered cooling q_dot [W]
# @return [nil]
def self.apply_advanced_defrost(model, htg_coil, air_loop_unitary, conditioned_space, htg_supp_coil, heat_pump, q_dot_defrost)
if htg_supp_coil.nil?
backup_system = heat_pump.backup_system
Expand Down
19 changes: 19 additions & 0 deletions HPXMLtoOpenStudio/tests/test_hvac.rb
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,25 @@ def test_heat_pump_advanced_defrost
htg_coil = model.getCoilHeatingDXMultiSpeeds[0]
# q_dot smaller than backup capacity
_check_advanced_defrost(model, htg_coil, supp_htg_power, 2373.9, backup_fuel, 0.06667, 569)

# Small capacity test
args_hash = {}
args_hash['hpxml_path'] = @tmp_hpxml_path
hpxml, hpxml_bldg = _create_hpxml('base-hvac-air-to-air-heat-pump-1-speed-research-features.xml')
hpxml_bldg.heat_pumps[0].cooling_capacity = 1000
hpxml_bldg.heat_pumps[0].heating_capacity = 1000
XMLHelper.write_file(hpxml.to_doc, @tmp_hpxml_path)
model, _hpxml, hpxml_bldg = _test_measure(args_hash)

# Get HPXML values
heat_pump = hpxml_bldg.heat_pumps[0]

assert_equal(1, model.getCoilHeatingDXSingleSpeeds.size)
htg_coil = model.getCoilHeatingDXSingleSpeeds[0]
supp_htg_power = 131.88
backup_fuel = EPlus.fuel_type(heat_pump.backup_heating_fuel)
# q_dot smaller than backup capacity
_check_advanced_defrost(model, htg_coil, supp_htg_power, 131.88, backup_fuel, 0.1, 36.85)
end

def test_mini_split_heat_pump
Expand Down

0 comments on commit 623f63c

Please sign in to comment.