Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/pnnl/ruleset-checking-tool
Browse files Browse the repository at this point in the history
… into RS/JX/Rule12-2
  • Loading branch information
Jiarongx-Xie committed Aug 13, 2024
2 parents bbc15f9 + a2b86e6 commit 34aa85c
Show file tree
Hide file tree
Showing 5 changed files with 1,136 additions and 21 deletions.
24 changes: 13 additions & 11 deletions docs/section18/Rule18-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@

- check do_multi_zone_evaluation to determine if this is a multi_zone system. Continue checking whether all the zones it serves are on the same floor: `if do_multi_zone_evaluation:`
- get the list of zones on the same floor by using the function get_zones_on_same_floor: `zones_on_floor = get_zones_on_same_floor(B_RMI,zones_served_by_system[0])`
- check if all the zones served by the system are on the same floor: `if all(zone in zones_on_floor for zone in zones_served_by_system):`
- now check if there are any other systems of the same system type that serve zones on this floor. First loop through baseline_system_types_dict again: `for hvac_system_type2 in baseline_system_types_dict:`
- check if the hvac_system_type2 is the same type: `if baseline_system_type_compare(hvac_system_type2,system_type,FALSE):`
- look through all of the hvacs of this system type: `for hvac_system2_id in baseline_system_types_dict[hvac_system_type2]:`
- make sure that hvac_system2_id is not the same as hvac_system_id: `if hvac_system2_id != hvac_system_id:`
- now check if hvac_system2 serves any of the zones on the same floor as hvac_system. Get the zones served by hvac_system2: `zones_served_by_system2 = zones_and_terminal_unit_list_dict[hvac_system2_id]["ZONE_LIST"]`
- use set.intersection to see if any of these zones are on the same floor: `if(len(set(zones_served_by_system2).intersection(zones_on_floor))) > 0:`
- the system fails: `result = FAIL`
- UNLESS system_type is SYS_5 or SYS_7 AND all of the zones in hvac_system2 are lab zones: `if hvac_system2_id in? lab_zone_hvac_systems["LAB_ZONES_ONLY"] && len(lab_zone_hvac_systems["LAB_ZONES_ONLY"]) == 1 && building_total_lab_zone_exhaust > 15000: result = PASS`
- otherwise then if it's the only lab zone system, but we aren't sure about the exhaust air volume, result = UNDETERMINED: `if hvac_system2_id in? lab_zone_hvac_systems["LAB_ZONES_ONLY"] && len(lab_zone_hvac_systems["LAB_ZONES_ONLY"]) == 1: result = UNDETERMINED; note = "This HVAC system is on the same floor as " + hvac_system2_id + ", which servese lab zones in the building. If the building has greater than 15,000 cfm of lab exhaust and " + hvac_system2_id + " is System type 5 or 7 serving only lab zones, this system passes, otherwise it fails"`
- otherwise the system isn't a lab system, set result to fail: `result = FAIL`
- check if all the zones served by the system are on the same floor: `if all(zone in zones_on_floor for zone in zones_served_by_system):`
- set the result to PASS. There are checks on the following lines that will set the result to fail a zone is also served by another system, or if the system serves lab zones: `result = PASS`
- now check if there are any other systems of the same system type that serve zones on this floor. First loop through baseline_system_types_dict again: `for hvac_system_type2 in baseline_system_types_dict:`
- check if the hvac_system_type2 is the same type: `if baseline_system_type_compare(hvac_system_type2,system_type,FALSE):`
- look through all of the hvacs of this system type: `for hvac_system2_id in baseline_system_types_dict[hvac_system_type2]:`
- make sure that hvac_system2_id is not the same as hvac_system_id: `if hvac_system2_id != hvac_system_id:`
- now check if hvac_system2 serves any of the zones on the same floor as hvac_system. Get the zones served by hvac_system2: `zones_served_by_system2 = zones_and_terminal_unit_list_dict[hvac_system2_id]["ZONE_LIST"]`
- use set.intersection to see if any of these zones are on the same floor: `if(len(set(zones_served_by_system2).intersection(zones_on_floor))) > 0:`
- the system fails: `result = FAIL`
- UNLESS system_type is SYS_5 or SYS_7 AND all of the zones in hvac_system2 are lab zones: `if hvac_system2_id in? lab_zone_hvac_systems["LAB_ZONES_ONLY"] && len(lab_zone_hvac_systems["LAB_ZONES_ONLY"]) == 1 && lab_zone_exhaust > 15000: result = PASS`
- otherwise then if it's the only lab zone system, but we aren't sure about the exhaust air volume, result = UNDETERMINED: `if hvac_system2_id in? lab_zone_hvac_systems["LAB_ZONES_ONLY"] && len(lab_zone_hvac_systems["LAB_ZONES_ONLY"]) == 1: result = UNDETERMINED; note = "This HVAC system is on the same floor as " + hvac_system2_id + ", which serves lab zones in the building. If the building has greater than 15,000 cfm of lab exhaust and " + hvac_system2_id + " is System type 5 or 7 serving only lab zones, this system passes, otherwise it fails"`
- otherwise the other system isn't a lab system, set result to fail: `result = FAIL`


**Rule Assertion - Zone:**
Expand Down
21 changes: 11 additions & 10 deletions rct229/rulesets/ashrae9012019/section19/section19rule18.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
get_fan_system_object_supply_return_exhaust_relief_total_power_flow,
)
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_one
from rct229.utils.pint_utils import ZERO
from rct229.utils.std_comparisons import std_equal

ENERGY_RECOVERY = SchemaEnums.schema_enums["EnergyRecoveryOptions"]
APPLICABLE_SYS_TYPES = [
HVAC_SYS.SYS_3,
HVAC_SYS.SYS_4,
Expand Down Expand Up @@ -172,9 +174,7 @@ def get_calc_vals(self, context, data=None):
)
supply_flow_b = fan_sys_info_b["supply_fans_airflow"].to(ureg.cfm)

more_than_one_supply_fan_b = (
fan_sys_info_b["supply_fans_qty"] != 1
) # the reason why > 1 isn't used is to prevent an error when no supply fan exists
exactly_one_supply_fan = fan_sys_info_b["supply_fans_qty"] == 1
total_fan_power_b = (
(
fan_sys_info_b["supply_fans_power"]
Expand All @@ -183,15 +183,16 @@ def get_calc_vals(self, context, data=None):
+ fan_sys_info_b["relief_fans_power"]
+ zonal_exhaust_fan_elec_power_b
)
if not more_than_one_supply_fan_b
if exactly_one_supply_fan
else ZERO.POWER
).to(ureg.hp)

A = 0.0
more_than_one_exhaust_fan_and_energy_rec_is_relevant_b = False
if (
fan_sys_b.get("air_energy_recovery")
and fan_sys_info_b["exhaust_fans_qty"] == 1
and fan_sys_b["air_energy_recovery"].get("type") != ENERGY_RECOVERY.NONE
and fan_sys_info_b["exhaust_fans_qty"] > 1
):
more_than_one_exhaust_fan_and_energy_rec_is_relevant_b = True
enthalpy_reco_ratio_b = getattr_(
Expand Down Expand Up @@ -257,23 +258,23 @@ def get_calc_vals(self, context, data=None):
min_fan_wattage_b = min_BHP_b / min_motor_efficiency_b

return {
"more_than_one_supply_fan_b": more_than_one_supply_fan_b,
"exactly_one_supply_fan": exactly_one_supply_fan,
"more_than_one_exhaust_fan_and_energy_rec_is_relevant_b": more_than_one_exhaust_fan_and_energy_rec_is_relevant_b,
"total_fan_power_b": total_fan_power_b,
"expected_fan_wattage_b": expected_fan_wattage_b,
"min_fan_wattage_b": min_fan_wattage_b,
}

def manual_check_required(self, context, calc_vals=None, data=None):
more_than_one_supply_fan_b = calc_vals["more_than_one_supply_fan_b"]
exactly_one_supply_fan = calc_vals["exactly_one_supply_fan"]
more_than_one_exhaust_fan_and_energy_rec_is_relevant_b = calc_vals[
"more_than_one_exhaust_fan_and_energy_rec_is_relevant_b"
]
total_fan_power_b = calc_vals["total_fan_power_b"]
expected_fan_wattage_b = calc_vals["expected_fan_wattage_b"]

return (
more_than_one_supply_fan_b
not exactly_one_supply_fan
or more_than_one_exhaust_fan_and_energy_rec_is_relevant_b
or (
not std_equal(total_fan_power_b, expected_fan_wattage_b)
Expand All @@ -288,7 +289,7 @@ def get_manual_check_required_msg(self, context, calc_vals=None, data=None):
more_than_one_exhaust_fan_and_energy_rec_is_relevant_b = calc_vals[
"more_than_one_exhaust_fan_and_energy_rec_is_relevant_b"
]
more_than_one_supply_fan_b = calc_vals["more_than_one_supply_fan_b"]
exactly_one_supply_fan = calc_vals["exactly_one_supply_fan"]
expected_fan_wattage_b = calc_vals["expected_fan_wattage_b"]

black_word = (
Expand All @@ -299,7 +300,7 @@ def get_manual_check_required_msg(self, context, calc_vals=None, data=None):

undetermined_msg = ""
if (
more_than_one_supply_fan_b
not exactly_one_supply_fan
or more_than_one_exhaust_fan_and_energy_rec_is_relevant_b
):
undetermined_msg = (
Expand Down
Loading

0 comments on commit 34aa85c

Please sign in to comment.