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

Datapoint extrapolation #1904

Open
wants to merge 19 commits into
base: resnet_heat_pump
Choose a base branch
from
Open

Conversation

shorowit
Copy link
Contributor

@shorowit shorowit commented Dec 26, 2024

Pull Request Description

Addresses #1871. Updates datapoint extrapolation per RESNET MINHERS Addendum 82.

Checklist

Not all may apply:

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (openstudio tasks.rb update_hpxmls)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests/test*.rb and/or workflow/tests/test*.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

…-HPXML into datapoint_extrapolation

# Conflicts:
#	HPXMLtoOpenStudio/measure.xml
#	HPXMLtoOpenStudio/resources/defaults.rb
#	HPXMLtoOpenStudio/tests/test_defaults.rb
#	docs/source/workflow_inputs.rst
@shorowit shorowit added the enhancement New feature or request label Dec 26, 2024
@shorowit shorowit self-assigned this Dec 26, 2024
Comment on lines +11170 to +11177
# Check power at minimum capacity <= power at maximum capacity
if min_capacity / min_cop > max_capacity / max_cop
errors << "Cooling detailed performance data for outdoor temperature = #{outdoor_temp} is invalid; Power (capacity / COP) at minimum capacity must be less than power at maximum capacity."
end
# Check minimum capacity <= maximum capacity
if min_capacity > max_capacity
errors << "Cooling detailed performance data for outdoor temperature = #{outdoor_temp} is invalid; Maximum capacity must be greater than minimum capacity."
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added two checks that RESNET used when filtering the NEEP database for bad data. There could be others that we add, but these are the most important ones.

<sch:assert role='ERROR' test='count(h:PerformanceDataPoint[h:OutdoorTemperature=47 and h:CapacityDescription="minimum"]) = 1'>Expected 1 element(s) for xpath: PerformanceDataPoint[OutdoorTemperature=47 and CapacityDescription="minimum"]</sch:assert> <!-- See [PerformanceDataPoint] -->
<sch:assert role='ERROR' test='count(h:PerformanceDataPoint[h:OutdoorTemperature=47 and h:CapacityDescription="maximum"]) = 1'>Expected 1 element(s) for xpath: PerformanceDataPoint[OutdoorTemperature=47 and CapacityDescription="maximum"]</sch:assert> <!-- See [PerformanceDataPoint] -->
<sch:assert role='ERROR' test='count(h:PerformanceDataPoint[h:OutdoorTemperature!=47 and h:CapacityDescription="minimum"]) &gt;= 1'>Expected 1 or more element(s) for xpath: PerformanceDataPoint[OutdoorTemperature!=47 and CapacityDescription="minimum"]</sch:assert> <!-- See [PerformanceDataPoint] -->
<sch:assert role='ERROR' test='count(h:PerformanceDataPoint[h:OutdoorTemperature!=47 and h:CapacityDescription="maximum"]) &gt;= 1'>Expected 1 or more element(s) for xpath: PerformanceDataPoint[OutdoorTemperature!=47 and CapacityDescription="maximum"]</sch:assert> <!-- See [PerformanceDataPoint] -->
<!-- FIXME: Require 17F once our defaulting code adds this data point -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our current variable speed HP defaulting code only creates 47F and 5F data points, so 17F is temporarily marked as optional. Once we implement the new RESNET defaulting, we'll update the two lines below to require 17F.

is_onoff_thermostat_ddb = hpxml_header.hvac_onoff_thermostat_deadband.to_f > 0.0
has_deadband_control = hpxml_header.hvac_onoff_thermostat_deadband.to_f > 0.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just trying to use consistent variable names throughout the code.

Comment on lines -2855 to +2856
this_cfm = UnitConversions.convert(dp.capacity, 'Btu/hr', 'ton') * cfm_per_ton[speed]
fan_ratio = this_cfm / max_rated_fan_cfm
fan_power = calculate_fan_power_from_curve(hvac_ap.fan_power_rated * max_rated_fan_cfm, fan_ratio, hvac_system)
dp.gross_capacity, dp.gross_efficiency_cop = convert_net_to_gross_capacity_cop(dp.capacity, fan_power, mode, dp.efficiency_cop)
convert_data_point_net_to_gross(dp, mode, hvac_system, cfm_per_ton[speed], max_rated_fan_cfm)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this code into a new method so it can be called for other locations too.

Comment on lines 2901 to 2908
# Calculate ODB temperature at which power or capacity is zero
high_odb_at_zero_power = calculate_odb_at_zero_power_or_capacity(data, user_odbs, :gross_input_power, true)
high_odb_at_zero_capacity = calculate_odb_at_zero_power_or_capacity(data, user_odbs, :gross_capacity, true)
outdoor_dry_bulbs << [high_odb_at_zero_power, high_odb_at_zero_capacity, hp_temp, weather_temp].min # Max cooling ODB

low_odb_at_zero_power = calculate_odb_at_zero_power_or_capacity(data, user_odbs, :gross_input_power, false)
low_odb_at_zero_capacity = calculate_odb_at_zero_power_or_capacity(data, user_odbs, :gross_capacity, false)
outdoor_dry_bulbs << [low_odb_at_zero_power, low_odb_at_zero_capacity, 60.0].max # Min cooling ODB
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This didn't really change other than switching from gross_efficiency_cop to gross_input_power, since we are now extrapolating based on input power instead of COP.

Comment on lines +2932 to +2933
new_dp.capacity = extrapolate_data_point_to_odb(data, mode, capacity_description, target_odb, :capacity)
new_dp.input_power = extrapolate_data_point_to_odb(data, mode, capacity_description, target_odb, :input_power)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now extrapolate based on net capacity and input power (rather than gross capacity and COP).

slope = (right_dp.send(property) - left_dp.send(property)) / (right_odb - left_odb)
val = (target_odb - left_odb) * slope + left_dp.send(property)

if mode == :clg && target_odb < 82
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This handles the extrapolation to 60F for cooling. We can't use target_odb == 60 because we may not extrapolate all the way to 60; if, for example, extrapolation of gross input power becomes negative at a larger ODB temperature, then we only extrapolate to that ODB.

There is an open question to RESNET for the top rule so it may have to change.

# FIXME: Need interpretation from RESNET on how this case should be handled
dp_82F = data.find { |dp| dp.outdoor_temperature == 82.0 }
val = [val, 0.5 * dp_82F.send(property)].max
elsif mode == :htg && target_odb > 47
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar implementation to extrapolate to 60F for heating.

@@ -2201,16 +2201,16 @@
"sample_files/base-hvac-air-to-air-heat-pump-var-speed-detailed-performance-other-temperatures.xml": {
"parent_hpxml": "sample_files/base-hvac-air-to-air-heat-pump-var-speed-detailed-performance.xml",
"hvac_perf_data_capacity_type": "Absolute capacities",
"hvac_perf_data_heating_outdoor_temperatures": "47.0, 55.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

55F is no longer allowed and 17F/5F are now required, so I had to update this test file.

@shorowit
Copy link
Contributor Author

shorowit commented Jan 7, 2025

@yzhou601 This PR is ready, other than the one test failure:
base-hvac-air-to-air-heat-pump-var-speed-max-power-ratio-schedule-two-systems.xml: [Peak Load: Cooling: Delivered (kBtu/hr), Annual] 1x=228.96999999999997, 10x=195.301, abs_delta_tol=0.2, abs_frac_tol=0.05

@shorowit shorowit marked this pull request as ready for review January 7, 2025 20:53
@yzhou601
Copy link
Collaborator

@yzhou601 This PR is ready, other than the one test failure: base-hvac-air-to-air-heat-pump-var-speed-max-power-ratio-schedule-two-systems.xml: [Peak Load: Cooling: Delivered (kBtu/hr), Annual] 1x=228.96999999999997, 10x=195.301, abs_delta_tol=0.2, abs_frac_tol=0.05

Should be fixed in the last commit, let's give it a try and I'll review this PR after CI gets green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants