-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathG36SupplyAirTemperatureSetpoint.py
160 lines (133 loc) · 5.69 KB
/
G36SupplyAirTemperatureSetpoint.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
"""
### Description
Section 5.16.2.3
- Supply air temperature shall be controlled to setpoint using a control loop whose output is mapped to sequence the heating coil (if applicable), outdoor air damper, return air damper, and cooling coil
### Code requirement
- Code Name: ASHRAE Guideline 36
- Code Year: 2021
- Code Section: 5.16.2 Supply Air Temperature Control
- Code Subsection: 5.16.2.2 Supply Air Temperature Setpoint
### Verification Approach
The verification checks supply air temperature setpoint calculation in multiple steps:
1. Verify maximum temperature limit is not exceeded
2. Calculate setpoint based on operation mode:
- Cooldown: Use minimum cooling setpoint
- Warmup/Setback: Use fixed high temperature (35°C/95°F)
- Occupied/Setup: Calculate based on outdoor air temperature using linear reset
3. Verify actual setpoint matches calculated value within tolerance
### Verification Applicability
- Building Type(s): any
- Space Type(s): any
- System(s): Air handling units
- Climate Zone(s): any
- Component(s): supply air temperature sensors, control sequences
### Verification Algorithm Pseudo Code
```python
# First check maximum temperature limit
if temperature_air_supply_max > temperature_air_supply_setpoint_cool_max:
fail
# Calculate setpoint based on mode
match mode_operation:
case "cooldown":
t_sa_sp_calc = temperature_air_supply_setpoint_cool_min
case "warmup" | "setback":
t_sa_sp_calc = 35.0 # 95°F
case "occupied" | "setup":
if temperature_air_outdoor <= temperature_air_outdoor_supply_min:
t_sa_sp_calc = temperature_air_supply_max
elif temperature_air_outdoor >= temperature_air_outdoor_supply_max:
t_sa_sp_calc = temperature_air_supply_setpoint_cool_min
else:
# Linear interpolation
t_sa_sp_calc = (temperature_air_outdoor - temperature_air_outdoor_supply_min) * (temperature_air_supply_max - temperature_air_supply_setpoint_cool_min) / (temperature_air_outdoor_supply_min - temperature_air_outdoor_supply_max) + temperature_air_supply_max
# Verify setpoint matches calculated value
if abs(t_sa_sp_calc - temperature_air_supply_setpoint) = 0:
pass
else:
fail
```
### Data requirements
- mode_operation: System operation mode
- Data Value Unit: enumeration
- Data Point Affiliation: System control
- temperature_air_supply_max: Maximum supply air temperature
- Data Value Unit: temperature
- Data Point Affiliation: System configuration
- temperature_air_supply_setpoint_cool_max: Maximum cooling supply air temperature setpoint
- Data Value Unit: temperature
- Data Point Affiliation: System configuration
- temperature_air_supply_setpoint_cool_min: Minimum cooling supply air temperature setpoint
- Data Value Unit: temperature
- Data Point Affiliation: System configuration
- temperature_air_outdoor: Outdoor air temperature
- Data Value Unit: temperature
- Data Point Affiliation: Environmental conditions
- temperature_air_outdoor_supply_min: Minimum outdoor air temperature
- Data Value Unit: temperature
- Data Point Affiliation: System configuration
- temperature_air_outdoor_supply_max: Maximum outdoor air temperature
- Data Value Unit: temperature
- Data Point Affiliation: System configuration
- temperature_air_supply_setpoint: Supply air temperature setpoint
- Data Value Unit: temperature
- Data Point Affiliation: System control
"""
from constrain.checklib import RuleCheckBase
class G36SupplyAirTemperatureSetpoint(RuleCheckBase):
points = [
"mode_operation",
"temperature_air_supply_max",
"temperature_air_supply_setpoint_cool_max",
"temperature_air_supply_setpoint_cool_min",
"temperature_air_outdoor",
"temperature_air_outdoor_supply_min",
"temperature_air_outdoor_supply_max",
"temperature_air_supply_setpoint",
]
def supply_air_temperature_setpoint(self, data):
if (
data["temperature_air_supply_max"]
> data["temperature_air_supply_setpoint_cool_max"]
):
return False
sa_t_sp = -999
if data["mode_operation"] == "cooldown":
sa_t_sp = data["temperature_air_supply_setpoint_cool_min"]
elif data["mode_operation"] in ["warmup", "setback"]:
sa_t_sp = 35.0 # 95 deg. F
elif data["mode_operation"] in ["occupied", "setup"]:
if (
data["temperature_air_outdoor"]
<= data["temperature_air_outdoor_supply_min"]
):
sa_t_sp = data["temperature_air_supply_max"]
elif (
data["temperature_air_outdoor"]
>= data["temperature_air_outdoor_supply_max"]
):
sa_t_sp = data["temperature_air_supply_setpoint_cool_min"]
else:
sa_t_sp = (
data["temperature_air_outdoor"]
- data["temperature_air_outdoor_supply_min"]
) * (
data["temperature_air_supply_max"]
- data["temperature_air_supply_setpoint_cool_min"]
) / (
data["temperature_air_outdoor_supply_min"]
- data["temperature_air_outdoor_supply_max"]
) + data[
"temperature_air_supply_max"
]
if sa_t_sp == -999:
return "Untested"
if abs(sa_t_sp - data["temperature_air_supply_setpoint"]) < self.get_tolerance(
"temperature", "supply_air"
):
return True
else:
return False
def verify(self):
self.result = self.df.apply(
lambda d: self.supply_air_temperature_setpoint(d), axis=1
)