-
Notifications
You must be signed in to change notification settings - Fork 5
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 #1346 from pnnl/RS/YJ/Rule_16-1
RS/YJ/Rule 16-1
- Loading branch information
Showing
15 changed files
with
1,379 additions
and
39 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
23 changes: 23 additions & 0 deletions
23
rct229/rulesets/ashrae9012019/data/ashrae_90_1_table_G3_9_1.json
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,23 @@ | ||
{ | ||
"performance_rating_method_motor_efficiency_requirements": [ | ||
{"shaft_input_power": 1.0, "full_load_motor_efficiency_for_modeling": 0.825}, | ||
{"shaft_input_power": 1.5, "full_load_motor_efficiency_for_modeling": 0.840}, | ||
{"shaft_input_power": 2.0, "full_load_motor_efficiency_for_modeling": 0.840}, | ||
{"shaft_input_power": 3.0, "full_load_motor_efficiency_for_modeling": 0.875}, | ||
{"shaft_input_power": 5.0, "full_load_motor_efficiency_for_modeling": 0.875}, | ||
{"shaft_input_power": 7.5, "full_load_motor_efficiency_for_modeling": 0.895}, | ||
{"shaft_input_power": 10.0, "full_load_motor_efficiency_for_modeling": 0.895}, | ||
{"shaft_input_power": 15.0, "full_load_motor_efficiency_for_modeling": 0.910}, | ||
{"shaft_input_power": 20.0, "full_load_motor_efficiency_for_modeling": 0.910}, | ||
{"shaft_input_power": 25.0, "full_load_motor_efficiency_for_modeling": 0.924}, | ||
{"shaft_input_power": 30.0, "full_load_motor_efficiency_for_modeling": 0.924}, | ||
{"shaft_input_power": 40.0, "full_load_motor_efficiency_for_modeling": 0.930}, | ||
{"shaft_input_power": 50.0, "full_load_motor_efficiency_for_modeling": 0.930}, | ||
{"shaft_input_power": 60.0, "full_load_motor_efficiency_for_modeling": 0.936}, | ||
{"shaft_input_power": 75.0, "full_load_motor_efficiency_for_modeling": 0.941}, | ||
{"shaft_input_power": 100.0, "full_load_motor_efficiency_for_modeling": 0.945}, | ||
{"shaft_input_power": 125.0, "full_load_motor_efficiency_for_modeling": 0.945}, | ||
{"shaft_input_power": 150.0, "full_load_motor_efficiency_for_modeling": 0.950}, | ||
{"shaft_input_power": 200.0, "full_load_motor_efficiency_for_modeling": 0.950} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
rct229/rulesets/ashrae9012019/data/ashrae_90_1_table_G3_9_2.json
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,14 @@ | ||
{ | ||
"performance_rating_method_baseline_elevator_motor": [ | ||
{ | ||
"number_of_stories": "less than or equal to 4", | ||
"motor_type": "Hydraulic", | ||
"mechanical_efficiency": 0.58 | ||
}, | ||
{ | ||
"number_of_stories": "greater than 4", | ||
"motor_type": "Traction", | ||
"mechanical_efficiency": 0.64 | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
rct229/rulesets/ashrae9012019/data/ashrae_90_1_table_G3_9_3.json
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,9 @@ | ||
{ | ||
"performance_rating_method_hydraulic_elevator_motor_efficiency": [ | ||
{"shaft_input_power": 10, "full_load_motor_efficiency_for_modeling": 0.72}, | ||
{"shaft_input_power": 20, "full_load_motor_efficiency_for_modeling": 0.75}, | ||
{"shaft_input_power": 30, "full_load_motor_efficiency_for_modeling": 0.78}, | ||
{"shaft_input_power": 40, "full_load_motor_efficiency_for_modeling": 0.78}, | ||
{"shaft_input_power": 100, "full_load_motor_efficiency_for_modeling": 0.80} | ||
] | ||
} |
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
42 changes: 42 additions & 0 deletions
42
rct229/rulesets/ashrae9012019/data_fns/table_G3_9_2_fins.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,42 @@ | ||
from typing import TypedDict | ||
|
||
from rct229.rulesets.ashrae9012019.data import data | ||
from rct229.rulesets.ashrae9012019.data_fns.table_utils import find_osstd_table_entry | ||
|
||
|
||
class MechanicalEfficiency(TypedDict): | ||
mechanical_efficiency: float | ||
motor_type: str | ||
|
||
|
||
def table_G3_9_2_lookup(number_of_stories: int) -> MechanicalEfficiency: | ||
"""Returns the full-load motor efficiency for motors as required by ASHRAE 90.1 Table G3.9.2 | ||
Parameters | ||
---------- | ||
number_of_stories: int | ||
number of stories including basement - the value must be greater than 0. | ||
Returns | ||
------- | ||
dict | ||
{mechanical_efficiency - The mechanical efficiency by Table G3.9.2 | ||
motor_type - The motor type by Table G3.9.2} | ||
Raises: | ||
------- | ||
TypeError: when the number_of_stories is less or equal to 0, the function will raise this error | ||
""" | ||
|
||
number_of_stories = ( | ||
"less than or equal to 4" if number_of_stories <= 4 else "greater than 4" | ||
) | ||
|
||
ashrae_90_1_table_G3_9_2 = find_osstd_table_entry( | ||
[("number_of_stories", number_of_stories)], | ||
osstd_table=data["ashrae_90_1_table_G3_9_2"], | ||
) | ||
|
||
mechanical_efficiency = ashrae_90_1_table_G3_9_2["mechanical_efficiency"] | ||
motor_type = ashrae_90_1_table_G3_9_2["motor_type"] | ||
|
||
return {"mechanical_efficiency": mechanical_efficiency, "motor_type": motor_type} |
13 changes: 13 additions & 0 deletions
13
rct229/rulesets/ashrae9012019/data_fns/table_G3_9_2_fins_test.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,13 @@ | ||
from rct229.rulesets.ashrae9012019.data_fns.table_G3_9_2_fins import table_G3_9_2_lookup | ||
|
||
|
||
def test__table_G3_9_lookup__4_story_building(): | ||
assert table_G3_9_2_lookup( | ||
number_of_stories=4, | ||
) == {"mechanical_efficiency": 0.58, "motor_type": "Hydraulic"} | ||
|
||
|
||
def test__table_G3_9_lookup__6_story_building(): | ||
assert table_G3_9_2_lookup( | ||
number_of_stories=6, | ||
) == {"mechanical_efficiency": 0.64, "motor_type": "Traction"} |
46 changes: 46 additions & 0 deletions
46
rct229/rulesets/ashrae9012019/data_fns/table_G3_9_3_fins.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,46 @@ | ||
import math | ||
|
||
from pint import Quantity | ||
from rct229.rulesets.ashrae9012019.data import data | ||
from rct229.rulesets.ashrae9012019.data_fns.table_G3_9_1_fins import ( | ||
FullLoadMotorEfficiency, | ||
) | ||
from rct229.rulesets.ashrae9012019.data_fns.table_utils import find_osstd_table_entry | ||
from rct229.utils.assertions import assert_ | ||
|
||
|
||
def table_G3_9_3_lookup(shaft_input_power: Quantity) -> FullLoadMotorEfficiency: | ||
"""Returns the full-load motor efficiency for motors as required by ASHRAE 90.1 Table G3.9.2 | ||
Parameters | ||
---------- | ||
shaft_input_power: Quantity | ||
shaft input power value | ||
Returns | ||
------- | ||
dict | ||
{full_load_motor_efficiency_for_modeling - The full load motor efficiency for modeling by Table G3.9.3} | ||
Raises: | ||
------- | ||
TypeError: when the shaft_input_power_mag is less or equal to 0, the function will raise this error | ||
""" | ||
|
||
shaft_input_power_mag = shaft_input_power.to("hp").magnitude | ||
assert_( | ||
shaft_input_power_mag > 0, | ||
"shaft input power is a negative value, incorrect data.", | ||
) | ||
shaft_input_power = math.ceil(shaft_input_power_mag / 10) * 10 | ||
|
||
if shaft_input_power > 40: | ||
shaft_input_power = 100 | ||
|
||
full_load_motor_efficiency_for_modeling = find_osstd_table_entry( | ||
[("shaft_input_power", shaft_input_power)], | ||
osstd_table=data["ashrae_90_1_table_G3_9_3"], | ||
)["full_load_motor_efficiency_for_modeling"] | ||
|
||
return { | ||
"full_load_motor_efficiency_for_modeling": full_load_motor_efficiency_for_modeling | ||
} |
20 changes: 20 additions & 0 deletions
20
rct229/rulesets/ashrae9012019/data_fns/table_G3_9_3_fins_test.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,20 @@ | ||
from rct229.rulesets.ashrae9012019.data_fns.table_G3_9_3_fins import table_G3_9_3_lookup | ||
from rct229.schema.config import ureg | ||
|
||
|
||
def test__table_G3_9_lookup__15_hp_shaft_power(): | ||
assert table_G3_9_3_lookup( | ||
shaft_input_power=15.0 * ureg("hp"), | ||
) == {"full_load_motor_efficiency_for_modeling": 0.75} | ||
|
||
|
||
def test__table_G3_9_lookup__25_hp_shaft_power(): | ||
assert table_G3_9_3_lookup( | ||
shaft_input_power=25.0 * ureg("hp"), | ||
) == {"full_load_motor_efficiency_for_modeling": 0.78} | ||
|
||
|
||
def test__table_G3_9_lookup__105_hp_shaft_power(): | ||
assert table_G3_9_3_lookup( | ||
shaft_input_power=105.0 * ureg("hp"), | ||
) == {"full_load_motor_efficiency_for_modeling": 0.80} |
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
Oops, something went wrong.