Skip to content

Commit

Permalink
UPDATE 23-1 based on modification in #1434
Browse files Browse the repository at this point in the history
  • Loading branch information
weilixu committed Jan 17, 2025
1 parent c4f2d81 commit ed4d02b
Showing 1 changed file with 26 additions and 66 deletions.
92 changes: 26 additions & 66 deletions rct229/rulesets/ashrae9012019/section23/section23rule1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand All @@ -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,
Expand Down Expand Up @@ -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",
},
Expand All @@ -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
)

0 comments on commit ed4d02b

Please sign in to comment.