-
Notifications
You must be signed in to change notification settings - Fork 1
/
G36SupplyFanStatus.py
69 lines (53 loc) · 2.13 KB
/
G36SupplyFanStatus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
G36 2021
### Description
Section 5.16.1.1,
- a. Supply fan shall run when system is in the Cooldown Mode, Setup Mode, or Occupied Mode.
- b. If there are any VAV-reheat boxes on perimeter zones, supply fan shall also run when system is in Setback Mode or Warmup Mode (i.e., all modes except unoccupied).
### Verification logic
```python
if has_reheat_box_on_perimeter_zones == True:
if sys_mode != 'unoccupied' and supply_fan_status == 'off':
fail
else:
if sys_mode in ['occupied', 'setup', 'cooldown'] and supply_fan_staus == 'off':
fail
if ['occupied', 'unoccupied'] in sys_mode:
pass
else:
untested
```
### Data requirements
- sys_mode: AHU system mode mode, enumeration of ['occupied', 'unoccupied', 'cooldown', 'warmup', 'setback', 'setup']
- has_reheat_box_on_perimeter_zones: binary flag of If there are any VAV-reheat boxes on perimeter zones.
- supply_fan_status: supply fan status (speed): ['on', 'off'] (can be replaced by binary or numeric variables)
"""
import pandas as pd
from constrain.checklib import RuleCheckBase
import numpy as np
class G36SupplyFanStatus(RuleCheckBase):
points = ["sys_mode", "supply_fan_status", "has_reheat_box_on_perimeter_zones"]
def ts_verify_logic(self, t):
if bool(t["has_reheat_box_on_perimeter_zones"]):
if (t["sys_mode"].strip().lower() != "unoccupied") and (
not bool(t["supply_fan_status"])
):
return False
return True
else:
if (
t["sys_mode"].strip().lower() in ["occupied", "setup", "cooldown"]
) and (not bool(t["supply_fan_status"])):
return False
return True
def verify(self):
self.result = self.df.apply(lambda t: self.ts_verify_logic(t), axis=1)
def check_bool(self):
if len(self.result[self.result == False] > 0):
return False
else:
obs_modes = [s.lower().strip() for s in list(self.df["sys_mode"].unique())]
if ("occupied" in obs_modes) and ("unoccupied" in obs_modes):
return True
else:
return "Untested"