-
Notifications
You must be signed in to change notification settings - Fork 5
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/YJ/Rule 22-12 #1156
Merged
Merged
RS/YJ/Rule 22-12 #1156
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
933d368
finish development
yunjoonjung-PNNL bba33df
Updated chiller master JSON with heat rejection TCDs for Section 22 r…
cf11d21
Merge branch 'RT/JG/heat_rejection_updates' of https://github.com/pnn…
yunjoonjung-PNNL d0067b9
test with TCD
yunjoonjung-PNNL 8988661
Address PR comments
yunjoonjung-PNNL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
rct229/rulesets/ashrae9012019/section22/section22rule12.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from rct229.rule_engine.rule_base import RuleDefinitionBase | ||
from rct229.rule_engine.user_baseline_proposed_vals import UserBaselineProposedVals | ||
from rct229.rulesets.ashrae9012019.ruleset_functions.get_heat_rejection_loops_connected_to_baseline_systems import ( | ||
get_heat_rejection_loops_connected_to_baseline_systems, | ||
) | ||
from rct229.utils.assertions import getattr_ | ||
from rct229.utils.jsonpath_utils import find_all | ||
|
||
|
||
class Section22Rule12(RuleDefinitionBase): | ||
"""Rule 12 of ASHRAE 90.1-2019 Appendix G Section 22 (Chilled water loop)""" | ||
|
||
def __init__(self): | ||
super(Section22Rule12, self).__init__( | ||
rmrs_used=UserBaselineProposedVals(False, True, False), | ||
id="22-12", | ||
description="The heat rejection system shall be a single loop, modeled with a single cooling tower.", | ||
ruleset_section_title="HVAC - Chiller", | ||
standard_section="Section 22 CHW&CW Loop", | ||
is_primary_rule=True, | ||
rmr_context="ruleset_model_descriptions/0", | ||
) | ||
|
||
def is_applicable(self, context, data=None): | ||
rmd_b = context.baseline | ||
heat_rejection_loop_ids_b = ( | ||
get_heat_rejection_loops_connected_to_baseline_systems(rmd_b) | ||
) | ||
|
||
return heat_rejection_loop_ids_b | ||
|
||
def get_calc_vals(self, context, data=None): | ||
rmd_b = context.baseline | ||
heat_rejection_loop_ids_b = ( | ||
get_heat_rejection_loops_connected_to_baseline_systems(rmd_b) | ||
) | ||
|
||
number_of_baseline_heat_rejections_b = len( | ||
[ | ||
heat_rejection_b | ||
for heat_rejection_b in find_all("$.heat_rejections[*]", rmd_b) | ||
if getattr_(heat_rejection_b, "heat_rejections", "loop") | ||
in heat_rejection_loop_ids_b | ||
] | ||
) | ||
|
||
return { | ||
"heat_rejection_loop_ids_b": heat_rejection_loop_ids_b, | ||
"number_of_baseline_heat_rejections_b": number_of_baseline_heat_rejections_b, | ||
} | ||
|
||
def rule_check(self, context, calc_vals=None, data=None): | ||
heat_rejection_loop_ids_b = calc_vals["heat_rejection_loop_ids_b"] | ||
number_of_baseline_heat_rejections_b = calc_vals[ | ||
"number_of_baseline_heat_rejections_b" | ||
] | ||
|
||
return ( | ||
number_of_baseline_heat_rejections_b == 1 | ||
and len(heat_rejection_loop_ids_b) == 1 | ||
) | ||
|
||
def get_fail_msg(self, context, calc_vals=None, data=None): | ||
heat_rejection_loop_ids_b = calc_vals["heat_rejection_loop_ids_b"] | ||
number_of_baseline_heat_rejections_b = calc_vals[ | ||
"number_of_baseline_heat_rejections_b" | ||
] | ||
len_heat_rejection_loop_ids_b = len(heat_rejection_loop_ids_b) | ||
|
||
if ( | ||
number_of_baseline_heat_rejections_b == 1 | ||
and len_heat_rejection_loop_ids_b > 1 | ||
): | ||
FAIL_MSG = "There is more than one condenser loop for this project. There should only be one condenser loop attached to all chillers in the baseline chiller plant." | ||
elif ( | ||
number_of_baseline_heat_rejections_b > 1 | ||
and len_heat_rejection_loop_ids_b == 1 | ||
): | ||
FAIL_MSG = "There is more than one cooling tower for the baseline chiller plant. There should only be one cooling tower attached to the condenser loop." | ||
else: | ||
FAIL_MSG = ( | ||
"There is more than one cooling tower on this loop and there is more than one condenser loop for the chiller plant. " | ||
"For the baseline chiller plant, there should be only one condenser loop with only one cooling tower." | ||
) | ||
|
||
return FAIL_MSG |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to do it could be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Addressed.