From ed4d02bd794912f75a28bff3ba9321a09519e102 Mon Sep 17 00:00:00 2001 From: "Xu, Weili" Date: Thu, 16 Jan 2025 16:06:14 -0800 Subject: [PATCH 1/3] UPDATE 23-1 based on modification in #1434 --- .../ashrae9012019/section23/section23rule1.py | 92 ++++++------------- 1 file changed, 26 insertions(+), 66 deletions(-) diff --git a/rct229/rulesets/ashrae9012019/section23/section23rule1.py b/rct229/rulesets/ashrae9012019/section23/section23rule1.py index 5835d04e3a..330a44a404 100644 --- a/rct229/rulesets/ashrae9012019/section23/section23rule1.py +++ b/rct229/rulesets/ashrae9012019/section23/section23rule1.py @@ -12,6 +12,7 @@ get_baseline_system_types, ) from rct229.schema.config import ureg +from rct229.schema.schema_enums import SchemaEnums from rct229.utils.assertions import getattr_ from rct229.utils.pint_utils import CalcQ @@ -20,9 +21,10 @@ HVAC_SYS.SYS_4, ] -HEATPUMP_LOW_SHUTOFF_LOWER = 17 * ureg("F") -HEATPUMP_LOW_SHUTOFF_HIGH = 25 * ureg("F") -HEATPUMP_LOW_SHUTOFF_LOWER_SYS4 = 10 * ureg("F") +HEATPUMP_AUX_HEAT_HIGH_SHUTOFF_THRESHOLD = 40 * ureg("F") +HeatpumpAuxilliaryHeatOptions = SchemaEnums.schema_enums[ + "HeatpumpAuxilliaryHeatOptions" +] class Section23Rule1(RuleDefinitionListIndexedBase): @@ -36,7 +38,7 @@ def __init__(self): each_rule=Section23Rule1.HVACRule(), index_rmd=BASELINE_0, id="23-1", - description="System 2 and 4 - Electric air-source heat pumps shall be modeled with electric auxiliary heat and an outdoor air thermostat. The systems shall be controlled to energize auxiliary heat only when the outdoor air temperature is less than 40°F. The air-source heat pump shall be modeled to continue to operate while auxiliary heat is energized.", + description="System 2 and 4 - Electric air-source heat pumps shall be modeled with electric auxiliary heat and an outdoor air thermostat. The systems shall be controlled to energize auxiliary heat only when the outdoor air temperature is less than 40°F.", ruleset_section_title="HVAC - Airside", standard_section="G3.1.3.1 Heat Pumps (Systems 2 and 4)", is_primary_rule=True, @@ -91,7 +93,7 @@ def __init__(self): "$": ["heating_system"], }, precision={ - "heatpump_low_shutoff_b": { + "heatpump_auxilliary_heat_high_shutoff_temperature": { "precision": 0.1, "unit": "K", }, @@ -103,74 +105,32 @@ def get_calc_vals(self, context, data=None): baseline_system_types_dict = data["baseline_system_types_dict"] heating_system_b = hvac_b["heating_system"] - heatpump_low_shutoff_b = getattr_( - heating_system_b, "HeatingSystem", "heatpump_low_shutoff_temperature" + heatpump_aux_high_temp_shutoff = getattr_( + heating_system_b, + "HeatingSystem", + "heatpump_auxilliary_heat_high_shutoff_temperature", ) - - hvac_type_b = next( - ( - key - for key, values in baseline_system_types_dict.items() - if hvac_b["id"] in values - ), - None, + heatpump_aux_heat_energy_source = getattr_( + heating_system_b, "HeatingSystem", "heatpump_auxilliary_heat_type" ) return { - "heatpump_low_shutoff_temperature": CalcQ( - "temperature", heatpump_low_shutoff_b + "heatpump_aux_high_temp_shutoff": CalcQ( + "temperature", heatpump_aux_high_temp_shutoff ), - "hvac_type": hvac_type_b, + "heatpump_aux_heat_energy_source": heatpump_aux_heat_energy_source, } - def manual_check_required(self, context, calc_vals=None, data=None): - heatpump_low_shutoff_b = calc_vals["heatpump_low_shutoff_temperature"] - hvac_type_b = calc_vals["hvac_type"] - - return ( - hvac_type_b == HVAC_SYS.SYS_2 - and HEATPUMP_LOW_SHUTOFF_LOWER - < heatpump_low_shutoff_b - <= HEATPUMP_LOW_SHUTOFF_HIGH - ) - - def get_manual_check_required_msg(self, context, calc_vals=None, data=None): - heatpump_low_shutoff_b = calc_vals["heatpump_low_shutoff_temperature"] - - return ( - f"Undetermined because the low temperature shutoff is between 17F and 25F for System Type 2. " - f"Check with the rating authority to ensure correct shutoff temperature. Low shutoff temperature " - f"is currently modeled at: {heatpump_low_shutoff_b}." - ) - def rule_check(self, context, calc_vals=None, data=None): - heatpump_low_shutoff_b = calc_vals["heatpump_low_shutoff_temperature"].to( - ureg.kelvin - ) - hvac_type_b = calc_vals["hvac_type"] - - return ( - hvac_type_b == HVAC_SYS.SYS_2 - and ( - heatpump_low_shutoff_b < HEATPUMP_LOW_SHUTOFF_LOWER - or self.precision_comparison["heatpump_low_shutoff_b"]( - heatpump_low_shutoff_b, - HEATPUMP_LOW_SHUTOFF_LOWER.to(ureg.kelvin), - ) - ) - ) or ( - hvac_type_b == HVAC_SYS.SYS_4 - and ( - heatpump_low_shutoff_b < HEATPUMP_LOW_SHUTOFF_LOWER_SYS4 - or self.precision_comparison["heatpump_low_shutoff_b"]( - heatpump_low_shutoff_b, - HEATPUMP_LOW_SHUTOFF_LOWER_SYS4.to(ureg.kelvin), - ) - ) - ) + heatpump_aux_high_temp_shutoff = calc_vals[ + "heatpump_aux_high_temp_shutoff" + ].to(ureg.kelvin) + heatpump_aux_heat_energy_source = calc_vals[ + "heatpump_aux_heat_energy_source" + ] - def get_fail_msg(self, context, calc_vals=None, data=None): - heatpump_low_shutoff_b = calc_vals["heatpump_low_shutoff_temperature"] return ( - f"Fail because low temperature heat pump shutoff is above 25F for system 2. The modeled low " - f"temperature heat pump shutoff value is {heatpump_low_shutoff_b}. " + heatpump_aux_high_temp_shutoff + <= HEATPUMP_AUX_HEAT_HIGH_SHUTOFF_THRESHOLD + and heatpump_aux_heat_energy_source + == HeatpumpAuxilliaryHeatOptions.ELECTRIC_RESISTANCE ) From 2e67878cdcc2881bc9cbbcc3c59afd465b7c4596 Mon Sep 17 00:00:00 2001 From: gonz102 Date: Fri, 24 Jan 2025 19:59:03 -0500 Subject: [PATCH 2/3] Updated ruletest 23-1 to correspond with latest RDS. Much simpler approach. --- .../ashrae9012019/section23/rule_23_1.json | 196 +----------------- 1 file changed, 11 insertions(+), 185 deletions(-) diff --git a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section23/rule_23_1.json b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section23/rule_23_1.json index be742da950..f7758b7801 100644 --- a/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section23/rule_23_1.json +++ b/rct229/ruletest_engine/ruletest_jsons/ashrae9012019/section23/rule_23_1.json @@ -3,8 +3,8 @@ "Section": 23, "Rule": 1, "Test": "a", - "test_description": "The project has one building segment with one zone served by baseline system 2. with a heat pump low shut off of less than 17 F.", - "expected_rule_outcome": "pass", + "test_description": "The project has one building segment with one zone served by baseline system 2. The auxiliary heat high temperature shutoff is greater than 40 F.", + "expected_rule_outcome": "fail", "standard": { "rule_id": "23-1", "ruleset_reference": "G3.1.3.1", @@ -26,15 +26,12 @@ "buildings": [ { "id": "Building 1", - "building_open_schedule": "Required Building Schedule 1", "building_segments": [ { "id": "Building Segment 1", "zones": [ { "id": "Thermal Zone 1", - "thermostat_cooling_setpoint_schedule": "Required Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Required Heating Schedule 1", "terminals": [ { "id": "PTHP Terminal 1", @@ -55,7 +52,8 @@ "heating_system": { "id": "HP Heating Coil 1", "type": "HEAT_PUMP", - "heatpump_low_shutoff_temperature": -8.888888888888857 + "heatpump_auxilliary_heat_type": "ELECTRIC_RESISTANCE", + "heatpump_low_shutoff_temperature": 7.222222222222285 }, "fan_system": { "id": "CAV Fan System 1", @@ -82,7 +80,7 @@ "Section": 23, "Rule": 1, "Test": "b", - "test_description": "The project has one building segment with one zone served by baseline system 2 with a heat pump low shut off greater than 25 F. The expected result is: fail", + "test_description": "The project has one building segment with one zone served by baseline system 2. The auxiliary heat fuel type is not electric resistance.", "expected_rule_outcome": "fail", "standard": { "rule_id": "23-1", @@ -105,15 +103,12 @@ "buildings": [ { "id": "Building 1", - "building_open_schedule": "Required Building Schedule 1", "building_segments": [ { "id": "Building Segment 1", "zones": [ { "id": "Thermal Zone 1", - "thermostat_cooling_setpoint_schedule": "Required Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Required Heating Schedule 1", "terminals": [ { "id": "PTHP Terminal 1", @@ -134,7 +129,8 @@ "heating_system": { "id": "HP Heating Coil 1", "type": "HEAT_PUMP", - "heatpump_low_shutoff_temperature": -3.3333333333333144 + "heatpump_auxilliary_heat_type": "OTHER", + "heatpump_low_shutoff_temperature": 1.6666666666666856 }, "fan_system": { "id": "CAV Fan System 1", @@ -161,8 +157,8 @@ "Section": 23, "Rule": 1, "Test": "c", - "test_description": "The project has one building segment with one zone served by baseline system 2 with a heat pump low shut off between 17 F and 25 F. The expected result is: undetermined", - "expected_rule_outcome": "undetermined", + "test_description": "The project has one building segment with one zone served by baseline system 2. The auxiliary heat fuel type is electric resistance and the high temperature shutoff for the auxiliary heat is less than 40 F.", + "expected_rule_outcome": "pass", "standard": { "rule_id": "23-1", "ruleset_reference": "G3.1.3.1", @@ -184,15 +180,12 @@ "buildings": [ { "id": "Building 1", - "building_open_schedule": "Required Building Schedule 1", "building_segments": [ { "id": "Building Segment 1", "zones": [ { "id": "Thermal Zone 1", - "thermostat_cooling_setpoint_schedule": "Required Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Required Heating Schedule 1", "terminals": [ { "id": "PTHP Terminal 1", @@ -213,86 +206,8 @@ "heating_system": { "id": "HP Heating Coil 1", "type": "HEAT_PUMP", - "heatpump_low_shutoff_temperature": -6.666666666666629 - }, - "fan_system": { - "id": "CAV Fan System 1", - "fan_control": "CONSTANT", - "supply_fans": [ - { - "id": "Supply Fan 1" - } - ] - } - } - ] - } - ] - } - ], - "type": "BASELINE_0" - } - ] - } - } - }, - "rule-23-1-d": { - "Section": 23, - "Rule": 1, - "Test": "d", - "test_description": "The project has one building segment with one zone served by baseline System 4 with a heat pump low shut off temperature below 10 F. The expected result is: pass", - "expected_rule_outcome": "pass", - "standard": { - "rule_id": "23-1", - "ruleset_reference": "G3.1.3.1", - "rule_description": "For baseline systems 2 and 4, the electric air-source heat pumps shall be modeled with electric auxiliary heat and an outdoor air thermostat. The systems shall be controlled to energize auxiliary heat only when the outdoor air temperature is less than 40\u00b0F. The air-source heat pump shall be modeled to continue to operate while auxiliary heat is energized.", - "applicable_rmr": "Baseline Model", - "rule_assertion": "=", - "comparison_value": "Expected Value", - "rule_dependency": "none", - "mandatory_rule": "Applicability", - "schema_version": "0.0.37" - }, - "rmd_transformations": { - "baseline": { - "id": "ASHRAE229 1", - "data_timestamp": "2024-02-12T09:00Z", - "ruleset_model_descriptions": [ - { - "id": "RMD 1", - "buildings": [ - { - "id": "Building 1", - "building_open_schedule": "Required Building Schedule 1", - "building_segments": [ - { - "id": "Building Segment 1", - "zones": [ - { - "id": "Thermal Zone 1", - "thermostat_cooling_setpoint_schedule": "Required Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Required Heating Schedule 1", - "terminals": [ - { - "id": "Air Terminal", - "is_supply_ducted": true, - "type": "CONSTANT_AIR_VOLUME", - "served_by_heating_ventilating_air_conditioning_system": "System Type 4" - } - ] - } - ], - "heating_ventilating_air_conditioning_systems": [ - { - "id": "System Type 4", - "cooling_system": { - "id": "DX Coil 1", - "type": "DIRECT_EXPANSION" - }, - "heating_system": { - "id": "HP Coil 1", - "type": "HEAT_PUMP", - "heatpump_low_shutoff_temperature": -12.777777777777715 + "heatpump_auxilliary_heat_type": "ELECTRIC_RESISTANCE", + "heatpump_low_shutoff_temperature": 1.6666666666666856 }, "fan_system": { "id": "CAV Fan System 1", @@ -301,95 +216,6 @@ { "id": "Supply Fan 1" } - ], - "return_fans": [ - { - "id": "Return Fan 1" - } - ] - } - } - ] - } - ] - } - ], - "type": "BASELINE_0" - } - ] - } - } - }, - "rule-23-1-e": { - "Section": 23, - "Rule": 1, - "Test": "e", - "test_description": "The project has one building segment with one zone served by baseline System 4 with a heat pump low shut off temperature above 10 F. The expected result is: fail", - "expected_rule_outcome": "fail", - "standard": { - "rule_id": "23-1", - "ruleset_reference": "G3.1.3.1", - "rule_description": "For baseline systems 2 and 4, the electric air-source heat pumps shall be modeled with electric auxiliary heat and an outdoor air thermostat. The systems shall be controlled to energize auxiliary heat only when the outdoor air temperature is less than 40\u00b0F. The air-source heat pump shall be modeled to continue to operate while auxiliary heat is energized.", - "applicable_rmr": "Baseline Model", - "rule_assertion": "=", - "comparison_value": "Expected Value", - "rule_dependency": "none", - "mandatory_rule": "Applicability", - "schema_version": "0.0.37" - }, - "rmd_transformations": { - "baseline": { - "id": "ASHRAE229 1", - "data_timestamp": "2024-02-12T09:00Z", - "ruleset_model_descriptions": [ - { - "id": "RMD 1", - "buildings": [ - { - "id": "Building 1", - "building_open_schedule": "Required Building Schedule 1", - "building_segments": [ - { - "id": "Building Segment 1", - "zones": [ - { - "id": "Thermal Zone 1", - "thermostat_cooling_setpoint_schedule": "Required Cooling Schedule 1", - "thermostat_heating_setpoint_schedule": "Required Heating Schedule 1", - "terminals": [ - { - "id": "Air Terminal", - "is_supply_ducted": true, - "type": "CONSTANT_AIR_VOLUME", - "served_by_heating_ventilating_air_conditioning_system": "System Type 4" - } - ] - } - ], - "heating_ventilating_air_conditioning_systems": [ - { - "id": "System Type 4", - "cooling_system": { - "id": "DX Coil 1", - "type": "DIRECT_EXPANSION" - }, - "heating_system": { - "id": "HP Coil 1", - "type": "HEAT_PUMP", - "heatpump_low_shutoff_temperature": -9.4444444444444 - }, - "fan_system": { - "id": "CAV Fan System 1", - "fan_control": "CONSTANT", - "supply_fans": [ - { - "id": "Supply Fan 1" - } - ], - "return_fans": [ - { - "id": "Return Fan 1" - } ] } } From 5ff3cc6d85ee109269a7e844d222b9cd9870a208 Mon Sep 17 00:00:00 2001 From: "Xu, Weili" Date: Wed, 29 Jan 2025 21:56:07 -0800 Subject: [PATCH 3/3] clean up codes --- rct229/rulesets/ashrae9012019/section23/section23rule1.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rct229/rulesets/ashrae9012019/section23/section23rule1.py b/rct229/rulesets/ashrae9012019/section23/section23rule1.py index 330a44a404..e41ebe61d7 100644 --- a/rct229/rulesets/ashrae9012019/section23/section23rule1.py +++ b/rct229/rulesets/ashrae9012019/section23/section23rule1.py @@ -95,14 +95,13 @@ def __init__(self): precision={ "heatpump_auxilliary_heat_high_shutoff_temperature": { "precision": 0.1, - "unit": "K", + "unit": "F", }, }, ) def get_calc_vals(self, context, data=None): hvac_b = context.BASELINE_0 - baseline_system_types_dict = data["baseline_system_types_dict"] heating_system_b = hvac_b["heating_system"] heatpump_aux_high_temp_shutoff = getattr_( @@ -121,9 +120,7 @@ def get_calc_vals(self, context, data=None): } def rule_check(self, context, calc_vals=None, data=None): - heatpump_aux_high_temp_shutoff = calc_vals[ - "heatpump_aux_high_temp_shutoff" - ].to(ureg.kelvin) + heatpump_aux_high_temp_shutoff = calc_vals["heatpump_aux_high_temp_shutoff"] heatpump_aux_heat_energy_source = calc_vals[ "heatpump_aux_heat_energy_source" ]