Skip to content
Open
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
44 changes: 41 additions & 3 deletions rct229/rulesets/ashrae9012019/section6/section6rule5.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@
normalize_interior_lighting_schedules,
)
from rct229.schema.config import ureg
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.assertions import getattr_
from rct229.utils.jsonpath_utils import find_all, find_exactly_one_with_field_value
from rct229.utils.masks import invert_mask
from rct229.utils.pint_utils import ZERO
from rct229.utils.pint_utils import ZERO, CalcQ

BUILDING_AREA_CUTTOFF = ureg("5000 ft2")
BUILDING_AREA_CUTTOFF = 5000 * ureg("ft2")
SPACE_FUNCTION = SchemaEnums.schema_enums["SpaceFunctionOptions"]

ACCEPTABLE_SPACE_FUNCTION = [
SPACE_FUNCTION.CRAWL_SPACE,
SPACE_FUNCTION.INTERSTITIAL_SPACE,
SPACE_FUNCTION.PLENUM,
]


class PRM9012019Rule08a45(RuleDefinitionListIndexedBase):
Expand Down Expand Up @@ -172,10 +180,40 @@ def get_calc_vals(self, context, data=None):
mask_schedule=invert_mask(hourly_building_open_schedule_b),
)

total_space_LPD_b = sum(
[
int_ltg.get("power_per_area", 0 * ureg("W/m2"))
for int_ltg in find_all(
"$.interior_lighting[*]", space_b
)
]
)
space_function_b = getattr_(space_b, "spaces", "function")

return {
"schedule_comparison_result": schedule_comparison_result
"schedule_comparison_result": schedule_comparison_result,
"total_space_LPD_b": CalcQ(
"power_density", total_space_LPD_b
),
"space_function_b": space_function_b,
}

def manual_check_required(self, context, calc_vals=None, data=None):
total_space_LPD_b = calc_vals["total_space_LPD_b"]
space_function_b = calc_vals["space_function_b"]

return (
total_space_LPD_b > 0 * ureg("W/m2")
and space_function_b in ACCEPTABLE_SPACE_FUNCTION
)

def get_manual_check_required_msg(
self, context, calc_vals=None, data=None
):
space_function_b = calc_vals["space_function_b"]

return f"Space function is {space_function_b} and has lighting power modeled. Unable to determine whether this space should be included in the check."

def rule_check(self, context, calc_vals=None, data=None):
schedule_comparison_result = calc_vals[
"schedule_comparison_result"
Expand Down
44 changes: 41 additions & 3 deletions rct229/rulesets/ashrae9012022/section6/section6rule5.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@
normalize_interior_lighting_schedules,
)
from rct229.schema.config import ureg
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.assertions import getattr_
from rct229.utils.jsonpath_utils import find_all, find_exactly_one_with_field_value
from rct229.utils.masks import invert_mask
from rct229.utils.pint_utils import ZERO
from rct229.utils.pint_utils import ZERO, CalcQ

BUILDING_AREA_CUTTOFF = ureg("5000 ft2")
BUILDING_AREA_CUTTOFF = 5000 * ureg("ft2")
SPACE_FUNCTION = SchemaEnums.schema_enums["SpaceFunctionOptions"]

ACCEPTABLE_SPACE_FUNCTION = [
SPACE_FUNCTION.CRAWL_SPACE,
SPACE_FUNCTION.INTERSTITIAL_SPACE,
SPACE_FUNCTION.PLENUM,
]


class PRM9012022Rule08a45(RuleDefinitionListIndexedBase):
Expand Down Expand Up @@ -172,10 +180,40 @@ def get_calc_vals(self, context, data=None):
mask_schedule=invert_mask(hourly_building_open_schedule_b),
)

total_space_LPD_b = sum(
[
int_ltg.get("power_per_area", 0 * ureg("W/m2"))
for int_ltg in find_all(
"$.interior_lighting[*]", space_b
)
]
)
space_function_b = getattr_(space_b, "spaces", "function")

return {
"schedule_comparison_result": schedule_comparison_result
"schedule_comparison_result": schedule_comparison_result,
"total_space_LPD_b": CalcQ(
"power_density", total_space_LPD_b
),
"space_function_b": space_function_b,
}

def manual_check_required(self, context, calc_vals=None, data=None):
total_space_LPD_b = calc_vals["total_space_LPD_b"]
space_function_b = calc_vals["space_function_b"]

return (
total_space_LPD_b > 0 * ureg("W/m2")
and space_function_b in ACCEPTABLE_SPACE_FUNCTION
)

def get_manual_check_required_msg(
self, context, calc_vals=None, data=None
):
space_function_b = calc_vals["space_function_b"]

return f"Space function is {space_function_b} and has lighting power modeled. Unable to determine whether this space should be included in the check."

def rule_check(self, context, calc_vals=None, data=None):
schedule_comparison_result = calc_vals[
"schedule_comparison_result"
Expand Down
Loading
Loading