-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: resnet_heat_pump
Are you sure you want to change the base?
Datapoint extrapolation #1904
Conversation
…-HPXML into datapoint_extrapolation # Conflicts: # HPXMLtoOpenStudio/measure.xml # HPXMLtoOpenStudio/resources/defaults.rb # HPXMLtoOpenStudio/tests/test_defaults.rb # docs/source/workflow_inputs.rst
…-HPXML into datapoint_extrapolation # Conflicts: # HPXMLtoOpenStudio/measure.xml
…-HPXML into datapoint_extrapolation # Conflicts: # HPXMLtoOpenStudio/measure.xml
… the RESNET MINHERS Addendum 82 extrapolation rules. [ci skip]
…-HPXML into datapoint_extrapolation # Conflicts: # HPXMLtoOpenStudio/measure.xml
# 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 |
There was a problem hiding this comment.
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"]) >= 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"]) >= 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 --> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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.
HPXMLtoOpenStudio/resources/hvac.rb
Outdated
# 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 |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
@yzhou601 This PR is ready, other than the one test failure: |
Should be fixed in the last commit, let's give it a try and I'll review this PR after CI gets green. |
Pull Request Description
Addresses #1871. Updates datapoint extrapolation per RESNET MINHERS Addendum 82.
Checklist
Not all may apply:
EPvalidator.xml
) has been updatedopenstudio tasks.rb update_hpxmls
)HPXMLtoOpenStudio/tests/test*.rb
and/orworkflow/tests/test*.rb
)openstudio tasks.rb update_measures
has been run