Skip to content

Commit

Permalink
Fix error in seer_to_cop_cooling and remove all with_fan to be co…
Browse files Browse the repository at this point in the history
…nsistent throughout.
  • Loading branch information
lymereJ committed Mar 1, 2024
1 parent fbc3b54 commit 83b7540
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

This comment has been minimized.

Copy link
@powskier

powskier May 15, 2024

Why does this conversion basically just drop the 0.12 / (1 - 0.12). I thought that was the whole purpose of having the _with_fan was so that I can directly write a value to the COP in a Coil:Cooling:DX object. Thanks again for any clarity.

cop = eer_to_cop(eer)

return cop
end
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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}")
Expand All @@ -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}")
Expand Down Expand Up @@ -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}")
Expand All @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
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
Expand Up @@ -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)
Expand Down

2 comments on commit 83b7540

@powskier
Copy link

@powskier powskier commented on 83b7540 May 15, 2024

Choose a reason for hiding this comment

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

Hello, I was wondering why the conversion changes here? @lymereJ

Specifically the seer_to_cop_cooling_with_fan method. Thank you.

@lymereJ
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @powskier - This is not the latest version of the code. In the latest version we clarified the some of the names and code for these metric conversion methods.

  • Here we have a method that converts from SEER to COP (no fan) using the ASHRAE 90.1 Appendix G/ECB approach.
  • Here we have a method that does the inverse conversion.
  • Here we have method that do the same conversion but do not remove the impact of fan power on the COP

Hope this helps!

Please sign in to comment.