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

Rs/wx/update 23 1 #1605

Merged
merged 5 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 25 additions & 68 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,86 +93,41 @@ def __init__(self):
"$": ["heating_system"],
},
precision={
"heatpump_low_shutoff_b": {
"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_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"]
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
)
Loading
Loading