Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address test failures on master #1700

Merged
merged 10 commits into from
Mar 15, 2024
Prev Previous commit
Next Next commit
Fix error in seer_to_cop_cooling and remove all with_fan to be co…
…nsistent throughout.
lymereJ committed Mar 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 83b75401700e4cdbf50a137677535587628c358d
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ def seer_to_cop_cooling_no_fan(seer)
#
# @param cop [Double] COP
# @return [Double] Seasonal Energy Efficiency Ratio
def cop_to_seer_cooling_no_fan(cop)
def cop_no_fan_to_seer_cooling(cop)
delta = 0.3796**2 - 4.0 * 0.0076 * cop
seer = (-delta**0.5 + 0.3796) / (2.0 * 0.0076)

@@ -279,9 +279,9 @@ def cop_to_seer_cooling_no_fan(cop)
#
# @param seer [Double] seasonal energy efficiency ratio (SEER)
# @return [Double] Coefficient of Performance (COP)
def seer_to_cop_cooling_with_fan(seer)
def seer_to_cop_cooling(seer)
eer = -0.0182 * seer * seer + 1.1088 * seer
cop = (eer / OpenStudio.convert(1.0, 'W', 'Btu/h').get + 0.12) / (1 - 0.12)
cop = eer_to_cop(eer)
Copy link
Collaborator Author

@lymereJ lymereJ Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing to straight EER to COP conversion, don't remove fan impact from metric since we don't to calculate a "cop no fan".


return cop
end
@@ -291,7 +291,7 @@ def seer_to_cop_cooling_with_fan(seer)
#
# @param cop [Double] Coefficient of Performance (COP)
# @return [Double] seasonal energy efficiency ratio (SEER)
def cop_to_seer_cooling_with_fan(cop)
def cop_to_seer_cooling(cop)
eer = cop_to_eer(cop)
delta = 1.1088**2 - 4.0 * 0.0182 * eer
seer = (1.1088 - delta**0.5) / (2.0 * 0.0182)
@@ -326,11 +326,11 @@ def hspf_to_cop_heating_no_fan(hspf)
end

# Convert from HSPF to COP (with fan) for heat pump heating coils
# @ref [References::ASHRAE9012013] Appendix G
# @ref ASHRAE RP-1197
#
# @param hspf [Double] heating seasonal performance factor (HSPF)
# @return [Double] Coefficient of Performance (COP)
def hspf_to_cop_heating_with_fan(hspf)
def hspf_to_cop_heating(hspf)
cop = -0.0255 * hspf * hspf + 0.6239 * hspf

return cop
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ def coil_cooling_dx_multi_speed_apply_efficiency_and_curves(coil_cooling_dx_mult
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the _with_fan suffix throughout to be consistent with other methods.

new_comp_name = "#{coil_cooling_dx_multi_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
# self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXMultiSpeed', "For #{template}: #{coil_cooling_dx_multi_speed.name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
@@ -189,7 +189,7 @@ def coil_cooling_dx_multi_speed_apply_efficiency_and_curves(coil_cooling_dx_mult
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_multi_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
# self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXMultiSpeed', "For #{template}: #{coil_cooling_dx_multi_speed.name}: #{cooling_type} #{heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
@@ -272,7 +272,7 @@ def coil_cooling_dx_multi_speed_standard_minimum_cop(coil_cooling_dx_multi_speed
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_multi_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
# self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXMultiSpeed', "For #{template}: #{coil_cooling_dx_multi_speed.name}: #{cooling_type} #{heating_type} #{coil_dx_subcategory(coil_cooling_dx_multi_speed)} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
@@ -289,7 +289,7 @@ def coil_cooling_dx_multi_speed_standard_minimum_cop(coil_cooling_dx_multi_speed
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_multi_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
# self.setName("#{self.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXMultiSpeed', "For #{template}: #{coil_cooling_dx_multi_speed.name}: #{cooling_type} #{heating_type} #{coil_dx_subcategory(coil_cooling_dx_multi_speed)} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ def coil_cooling_dx_single_speed_standard_minimum_cop(coil_cooling_dx_single_spe
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -148,7 +148,7 @@ def coil_cooling_dx_single_speed_standard_minimum_cop(coil_cooling_dx_single_spe
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ def coil_cooling_dx_two_speed_standard_minimum_cop(coil_cooling_dx_two_speed, re
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_two_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{coil_cooling_dx_two_speed.name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -78,7 +78,7 @@ def coil_cooling_dx_two_speed_standard_minimum_cop(coil_cooling_dx_two_speed, re
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_two_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXTwoSpeed', "For #{template}: #{coil_cooling_dx_two_speed.name}: #{cooling_type} #{heating_type} #{sub_category} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ def coil_heating_dx_multi_speed_apply_efficiency_and_curves(coil_heating_dx_mult
# If specified as SEER
unless hp_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = hp_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
coil_heating_dx_multi_speed.setName("#{coil_heating_dx_multi_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER")
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXMultiSpeed', "For #{template}: #{coil_heating_dx_multi_speed.name}: #{suppl_heating_type} #{subcategory} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ def coil_heating_dx_single_speed_standard_minimum_cop(coil_heating_dx_single_spe
# If specified as HSPF
unless ac_props['minimum_heating_seasonal_performance_factor'].nil?
min_hspf = ac_props['minimum_heating_seasonal_performance_factor']
cop = hspf_to_cop_heating_with_fan(min_hspf)
cop = hspf_to_cop_heating(min_hspf)
new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round} Clg kBtu/hr #{min_hspf.round(1)}HSPF"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: #{suppl_heating_type} #{sub_category} Cooling Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; HSPF = #{min_hspf}")
end
18 changes: 9 additions & 9 deletions lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb
Original file line number Diff line number Diff line change
@@ -2662,7 +2662,7 @@ def coil_cooling_dx_single_speed_apply_cop(coil_cooling_dx_single_speed,
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2678,7 +2678,7 @@ def coil_cooling_dx_single_speed_apply_cop(coil_cooling_dx_single_speed,
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXSingleSpeed', "For #{template}: #{coil_cooling_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2742,7 +2742,7 @@ def coil_heating_dx_single_speed_apply_cop(coil_heating_dx_single_speed,
# if specified as HSPF (heat pump)
unless props['minimum_heating_seasonal_performance_factor'].nil?
min_hspf = props['minimum_heating_seasonal_performance_factor']
cop = hspf_to_cop_heating_with_fan(min_hspf)
cop = hspf_to_cop_heating(min_hspf)
new_comp_name = "#{coil_heating_dx_single_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXSingleSpeed', "For #{template}: #{coil_heating_dx_single_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2798,7 +2798,7 @@ def coil_cooling_dx_variable_speed_apply_cop(coil_cooling_dx_variable_speed,
# If specified as SEER
unless ac_props['minimum_seasonal_energy_efficiency_ratio'].nil?
min_seer = ac_props['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2814,7 +2814,7 @@ def coil_cooling_dx_variable_speed_apply_cop(coil_cooling_dx_variable_speed,
# if specified as SEER (heat pump)
unless ac_props['minimum_seasonal_efficiency'].nil?
min_seer = ac_props['minimum_seasonal_efficiency']
cop = seer_to_cop_cooling_with_fan(min_seer)
cop = seer_to_cop_cooling(min_seer)
new_comp_name = "#{coil_cooling_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}SEER"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilCoolingDXVariableSpeed', "For #{template}: #{coil_cooling_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2878,7 +2878,7 @@ def coil_heating_dx_variable_speed_apply_cop(coil_heating_dx_variable_speed,
# if specified as HSPF (heat pump)
unless props['minimum_heating_seasonal_performance_factor'].nil?
min_hspf = props['minimum_heating_seasonal_performance_factor']
cop = hspf_to_cop_heating_with_fan(min_hspf)
cop = hspf_to_cop_heating(min_hspf)
new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.CoilHeatingDXVariableSpeed', "For #{template}: #{coil_heating_dx_variable_speed.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -2942,7 +2942,7 @@ def airconditioner_variablerefrigerantflow_cooling_apply_cop(airconditioner_vari
# if specified as HSPF (heat pump)
unless props['minimum_heating_seasonal_performance_factor'].nil?
min_hspf = props['minimum_heating_seasonal_performance_factor']
cop = hspf_to_cop_heating_with_fan(min_hspf)
cop = hspf_to_cop_heating(min_hspf)
new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -3006,7 +3006,7 @@ def airconditioner_variablerefrigerantflow_heating_apply_cop(airconditioner_vari
# if specified as HSPF (heat pump)
unless props['minimum_heating_seasonal_performance_factor'].nil?
min_hspf = props['minimum_heating_seasonal_performance_factor']
cop = hspf_to_cop_heating_with_fan(min_hspf)
cop = hspf_to_cop_heating(min_hspf)
new_comp_name = "#{coil_heating_dx_variable_speed.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_seer}HSPF"
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirConditionerVariableRefrigerantFlow', "For #{template}: #{airconditioner_variablerefrigerantflow.name}: Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; SEER = #{min_seer}")
end
@@ -3456,7 +3456,7 @@ def modify_unitary_cop(model:, unitary_cop:, sizing_done:, sql_db_vars_map:)
if unitary_cop['minimum_energy_efficiency_ratio']
cop = eer_to_cop(unitary_cop['minimum_energy_efficiency_ratio'].to_f)
elsif unitary_cop['minimum_seasonal_energy_efficiency_ratio']
cop = seer_to_cop_cooling_with_fan(unitary_cop['minimum_seasonal_energy_efficiency_ratio'].to_f)
cop = seer_to_cop_cooling(unitary_cop['minimum_seasonal_energy_efficiency_ratio'].to_f)
elsif unitary_cop['minimum_coefficient_of_performance_cooling']
cop = unitary_cop['minimum_coefficient_of_performance_cooling'].to_f
end
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ def test_modify_unitary_efficiency
for int in 0..heating_type_cap[heating_type].size - 1
output_line_text += "#{heating_type},#{heating_type_min_cap[heating_type][int]},#{heating_type_max_cap[heating_type][int]},"
if efficiency_type[heating_type][int] == 'Seasonal Energy Efficiency Ratio (SEER)'
actual_unitary_eff[heating_type][int] = (standard.cop_to_seer_cooling_with_fan(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)
actual_unitary_eff[heating_type][int] = (standard.cop_to_seer_cooling(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)
output_line_text += "#{actual_unitary_eff[heating_type][int]},,\n"
elsif efficiency_type[heating_type][int] == 'Energy Efficiency Ratio (EER)'
actual_unitary_eff[heating_type][int] = (standard.cop_to_eer(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)
2 changes: 1 addition & 1 deletion test/necb/unit_tests/tests/test_necb_unitary_rules.rb
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ def test_unitary_efficiency
for int in 0..heating_type_cap[heating_type].size - 1
output_line_text += "#{heating_type},#{heating_type_min_cap[heating_type][int]},#{heating_type_max_cap[heating_type][int]},"
if efficiency_type[heating_type][int] == 'Seasonal Energy Efficiency Ratio (SEER)'
actual_unitary_eff[heating_type][int] = (standard.cop_to_seer_cooling_with_fan(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)
actual_unitary_eff[heating_type][int] = (standard.cop_to_seer_cooling(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)
output_line_text += "#{actual_unitary_eff[heating_type][int]},\n"
elsif efficiency_type[heating_type][int] == 'Energy Efficiency Ratio (EER)'
actual_unitary_eff[heating_type][int] = (standard.cop_to_eer(actual_unitary_cop[heating_type][int].to_f) + 0.001).round(2)