Skip to content

Commit

Permalink
Merge pull request #1196 from pnnl/RCT/JX/Rule5-39
Browse files Browse the repository at this point in the history
RCT/JX/Rule5-39
  • Loading branch information
weilixu authored Jan 16, 2024
2 parents 63ed715 + d20120c commit 97a714f
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
1 change: 1 addition & 0 deletions rct229/rulesets/ashrae9012019/section5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"section5rule35",
"section5rule36",
"section5rule37",
"section5rule38",
"section5rule39",
"section5rule40",
]
Expand Down
57 changes: 57 additions & 0 deletions rct229/rulesets/ashrae9012019/section5/section5rule38.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from rct229.rule_engine.partial_rule_definition import PartialRuleDefinition
from rct229.rule_engine.ruleset_model_factory import produce_ruleset_model_instance
from rct229.rulesets.ashrae9012019.ruleset_functions.get_opaque_surface_type import (
OpaqueSurfaceType as OST,
)
from rct229.rulesets.ashrae9012019.ruleset_functions.get_opaque_surface_type import (
get_opaque_surface_type,
)
from rct229.utils.jsonpath_utils import find_all

UNDETERMINED_MSG = "It cannot be determined if the ground temperature schedule for the project is representative of the project climate."
NOT_APPLICABLE_MSG = "A ground temperature schedule was not found for the project."


class Section5Rule38(PartialRuleDefinition):
"""Rule 38 of ASHRAE 90.1-2019 Appendix G Section 5 (Envelope)"""

def __init__(self):
super(Section5Rule38, self).__init__(
rmrs_used=produce_ruleset_model_instance(
USER=False, BASELINE_0=True, PROPOSED=False
),
id="5-38",
description="It is acceptable to use either an annual average ground temperature or monthly average ground temperatures for calculation of heat loss through below-grade walls and basement floors.",
ruleset_section_title="Envelope",
standard_section="Section G3.1-14(b) Building Envelope Modeling Requirements for the Proposed design and Baseline",
is_primary_rule=False,
required_fields={
"$": ["weather"],
},
)

def is_applicable(self, context, data=None):
rpd = context.BASELINE_0
return any(
[
get_opaque_surface_type(surface_b) == OST.BELOW_GRADE_WALL
for surface_b in find_all(
"$.ruleset_model_descriptions[0].buildings[*].building_segments[*].zones["
"*].surfaces[*]",
rpd,
)
]
)

def get_calc_vals(self, context, data=None):
rpd = context.BASELINE_0
ground_temperature_schedule = rpd["weather"].get("ground_temperature_schedule")
return {"ground_temperature_schedule": ground_temperature_schedule}

def applicability_check(self, context, calc_vals, data):
ground_temperature_schedule = calc_vals["ground_temperature_schedule"]
return ground_temperature_schedule

def get_manual_check_required_msg(self, context, calc_vals=None, data=None):
ground_temperature_schedule = calc_vals["ground_temperature_schedule"]
return UNDETERMINED_MSG if ground_temperature_schedule else NOT_APPLICABLE_MSG
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"Rule": 38,
"Test": "c",
"test_description": "Project has one building segment with one space that includes floor surfaces adjacent to ground. The RPD does not specify a ground temperature schedule.",
"expected_rule_outcome": "fail",
"expected_rule_outcome": "undetermined",
"standard": {
"rule_id": "5-38",
"ruleset_reference": "Table G3.1(14) Proposed Building Performance (b)",
Expand Down Expand Up @@ -228,8 +228,8 @@
"surfaces": [
{
"id": "Surface 1",
"adjacent_to": "EXTERIOR",
"tilt": 30,
"adjacent_to": "GROUND",
"tilt": 120,
"area": 929.0303999999999
}
]
Expand Down

0 comments on commit 97a714f

Please sign in to comment.