-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from pnnl/VAV_turndown
VAV Turndown verification item development
- Loading branch information
Showing
4 changed files
with
268 additions
and
25 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
""" | ||
### Description | ||
When a VAV box is in reheat mode, the ratio of VAV airflow rate to VAV max airflow rate must not be greater than the min design turndown ratio | ||
### Code requirement | ||
- Code Name: ASHRAE 90.1 | ||
- Code Year: 2016 | ||
- Code Section: 6.5.2 Simultaneous Heating and Cooling Limitation | ||
- Code Subsection: 6.5.2.1 Zone Controls | ||
### Verification Approach | ||
- We aim to identify how VAV airflow rate varies when the VAV box is and isn't in reheat mode. | ||
### Verification logic | ||
``` | ||
if reheat_coil_flag: | ||
if V_dot_VAV_max == 0 | ||
Untested | ||
if V_dot_VAV_max > 0.0 and V_dot_VAV / V_dot_VAV_max > VAV_min_turndown_design + turndown_tol | ||
fail | ||
else: | ||
pass | ||
else | ||
Untested | ||
``` | ||
### Data requirements | ||
- reheat_coil_flag: VAV box reheat coil operation status | ||
- V_dot_VAV: actual VAV volume flow | ||
- V_dot_VAV_max: max VAV volume flow | ||
- VAV_min_turndown_design: design VAV box min turndown ratio | ||
- turndown_tol: VAV turndown tolerance | ||
""" | ||
|
||
from constrain.checklib import RuleCheckBase | ||
|
||
|
||
class VAVMinimumTurndownDuringReheat(RuleCheckBase): | ||
points = [ | ||
"reheat_coil_flag", # boolean | ||
"V_dot_VAV", # actual VAV volume flow | ||
"V_dot_VAV_max", # max VAV volume flow | ||
"VAV_min_turndown_design", | ||
"turndown_tol", | ||
] | ||
|
||
def vav_turndown_check(self, data): | ||
if data["reheat_coil_flag"]: | ||
if data["V_dot_VAV_max"] == 0: | ||
return "Untested" | ||
elif ( | ||
data["V_dot_VAV"] / data["V_dot_VAV_max"] | ||
> data["VAV_min_turndown_design"] + data["turndown_tol"] | ||
): | ||
return False | ||
else: | ||
return True | ||
else: | ||
return "Untested" | ||
|
||
def verify(self): | ||
self.result = self.df.apply(lambda d: self.vav_turndown_check(d), axis=1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
import sys | ||
import unittest | ||
|
||
sys.path.append("./constrain") | ||
import datetime | ||
|
||
import pandas as pd | ||
from lib_unit_test_runner import * | ||
|
||
|
||
class TestVAVTurndown(unittest.TestCase): | ||
def test_vav_turndown_untested(self): | ||
points = [ | ||
"reheat_coil_flag", | ||
"V_dot_VAV", | ||
"V_dot_VAV_max", | ||
"VAV_min_turndown_design", | ||
"turndown_tol", | ||
] | ||
|
||
timestamp = [ | ||
datetime(2024, 8, 1, 12, 0, 0), | ||
datetime(2024, 8, 1, 13, 0, 0), | ||
] | ||
|
||
data = [ | ||
[False, 0.005, 0.01, 0.3, 0.01], | ||
[False, 0.005, 0.01, 0.3, 0.01], | ||
] | ||
|
||
df = pd.DataFrame(data, columns=points, index=timestamp) | ||
|
||
verification_obj = run_test_verification_with_data( | ||
"VAVMinimumTurndownDuringReheat", df | ||
) | ||
results = list(verification_obj.result) | ||
expected_results = [ | ||
"Untested", | ||
"Untested", | ||
] | ||
|
||
self.assertEqual(results, expected_results) | ||
self.assertEqual(verification_obj.check_bool(), "Untested") | ||
|
||
def test_vav_turndown_V_dot_max_zero_untested(self): | ||
points = [ | ||
"reheat_coil_flag", | ||
"V_dot_VAV", | ||
"V_dot_VAV_max", | ||
"VAV_min_turndown_design", | ||
"turndown_tol", | ||
] | ||
|
||
timestamp = [ | ||
datetime(2024, 8, 1, 12, 0, 0), | ||
datetime(2024, 8, 1, 13, 0, 0), | ||
] | ||
|
||
data = [ | ||
[True, 0.005, 0.0, 0.3, 0.01], | ||
[True, 0.005, 0.0, 0.3, 0.01], | ||
] | ||
|
||
df = pd.DataFrame(data, columns=points, index=timestamp) | ||
|
||
verification_obj = run_test_verification_with_data( | ||
"VAVMinimumTurndownDuringReheat", df | ||
) | ||
results = list(verification_obj.result) | ||
expected_results = [ | ||
"Untested", | ||
"Untested", | ||
] | ||
|
||
self.assertEqual(results, expected_results) | ||
self.assertEqual(verification_obj.check_bool(), "Untested") | ||
|
||
def test_vav_turndown_pass(self): | ||
points = [ | ||
"reheat_coil_flag", | ||
"V_dot_VAV", | ||
"V_dot_VAV_max", | ||
"VAV_min_turndown_design", | ||
"turndown_tol", | ||
] | ||
|
||
timestamp = [ | ||
datetime(2024, 8, 1, 12, 0, 0), | ||
datetime(2024, 8, 1, 13, 0, 0), | ||
] | ||
|
||
data = [ | ||
[True, 0.005, 0.06, 0.3, 0.01], | ||
[True, 0.005, 0.06, 0.3, 0.01], | ||
] | ||
|
||
df = pd.DataFrame(data, columns=points, index=timestamp) | ||
|
||
verification_obj = run_test_verification_with_data( | ||
"VAVMinimumTurndownDuringReheat", df | ||
) | ||
|
||
results = pd.Series(list(verification_obj.result)) | ||
expected_results = pd.Series( | ||
[ | ||
True, | ||
True, | ||
] | ||
) | ||
self.assertTrue(results.equals(expected_results)) | ||
|
||
binary_result = verification_obj.check_bool() | ||
self.assertTrue(binary_result) | ||
|
||
def test_vav_turndown_fail(self): | ||
points = [ | ||
"reheat_coil_flag", | ||
"V_dot_VAV", | ||
"V_dot_VAV_max", | ||
"VAV_min_turndown_design", | ||
"turndown_tol", | ||
] | ||
|
||
timestamp = [ | ||
datetime(2024, 8, 1, 12, 0, 0), | ||
datetime(2024, 8, 1, 13, 0, 0), | ||
] | ||
|
||
data = [ | ||
[True, 0.005, 0.01, 0.3, 0.01], | ||
[True, 0.005, 0.01, 0.3, 0.01], | ||
] | ||
|
||
df = pd.DataFrame(data, columns=points, index=timestamp) | ||
|
||
verification_obj = run_test_verification_with_data( | ||
"VAVMinimumTurndownDuringReheat", df | ||
) | ||
|
||
results = pd.Series(list(verification_obj.result)) | ||
expected_results = pd.Series( | ||
[ | ||
False, | ||
False, | ||
] | ||
) | ||
self.assertTrue(results.equals(expected_results)) | ||
|
||
binary_result = verification_obj.check_bool() | ||
self.assertFalse(binary_result) |