Added conductor amps and updated tables.
This commit is contained in:
parent
4a93da354a
commit
d979d72e86
4 changed files with 152 additions and 21 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# CEC 2021, Table 1
|
# CEC 2021, Tables
|
||||||
|
|
||||||
table1 = [
|
cec21table1 = [
|
||||||
#['size', '60', '75', '90'],
|
#['size', '60', '75', '90'],
|
||||||
['14', 25, 30, 35],
|
['14', 25, 30, 35],
|
||||||
['12', 30, 35, 40],
|
['12', 30, 35, 40],
|
||||||
|
|
@ -30,4 +30,94 @@ table1 = [
|
||||||
['1500', 985, 1175, 1325],
|
['1500', 985, 1175, 1325],
|
||||||
['1750', 1070, 1280, 1445],
|
['1750', 1070, 1280, 1445],
|
||||||
['2000', 1160, 1385, 1560]
|
['2000', 1160, 1385, 1560]
|
||||||
|
]
|
||||||
|
cec21table2 = [
|
||||||
|
#['size', '60', '75', '90'],
|
||||||
|
['14', 15, 20, 25],
|
||||||
|
['12', 20, 25, 30],
|
||||||
|
['10', 30, 35, 40],
|
||||||
|
['8', 40, 50, 55],
|
||||||
|
['6', 40, 50, 55],
|
||||||
|
['4', 70, 85, 95],
|
||||||
|
['3', 85, 100, 115],
|
||||||
|
['2', 95, 115, 130],
|
||||||
|
['1', 110, 130, 145],
|
||||||
|
['1/0', 125, 150, 170],
|
||||||
|
['2/0', 145, 175, 195],
|
||||||
|
['3/0', 165, 200, 225],
|
||||||
|
['4/0', 195, 230, 260],
|
||||||
|
['250', 215, 255, 290],
|
||||||
|
['300', 240, 285, 320],
|
||||||
|
['350', 260, 310, 350],
|
||||||
|
['400', 280, 335, 380],
|
||||||
|
['500', 320, 380, 430],
|
||||||
|
['600', 350, 420, 475],
|
||||||
|
['700', 385, 460, 520],
|
||||||
|
['750', 400, 475, 535],
|
||||||
|
['800', 410, 490, 555],
|
||||||
|
['900', 435, 520, 585],
|
||||||
|
['1000', 455, 545, 615],
|
||||||
|
['1250', 495, 590, 615],
|
||||||
|
['1500', 525, 625, 705],
|
||||||
|
['1750', 545, 650, 735],
|
||||||
|
['2000', 555, 665, 750]
|
||||||
|
]
|
||||||
|
cec21table3 = [
|
||||||
|
#['size', '60', '75', '90'],
|
||||||
|
['12', 25, 30, 35],
|
||||||
|
['10', 35, 40, 45],
|
||||||
|
['8', 45, 55, 60],
|
||||||
|
['4', 65, 75, 85],
|
||||||
|
['3', 95, 115, 130],
|
||||||
|
['2', 115, 135, 150],
|
||||||
|
['1', 134, 155, 175],
|
||||||
|
['1/0', 150, 180, 205],
|
||||||
|
['2/0', 175, 210, 235],
|
||||||
|
['3/0', 200, 240, 270],
|
||||||
|
['4/0', 235, 280, 315],
|
||||||
|
['250', 265, 315, 355],
|
||||||
|
['300', 295, 350, 395],
|
||||||
|
['350', 330, 395, 445],
|
||||||
|
['400', 355, 425, 480],
|
||||||
|
['500', 405, 485, 545],
|
||||||
|
['600', 455, 545, 615],
|
||||||
|
['700', 500, 595, 670],
|
||||||
|
['750', 520, 620, 700],
|
||||||
|
['800', 540, 645, 725],
|
||||||
|
['900', 585, 700, 790],
|
||||||
|
['1000', 630, 750, 845],
|
||||||
|
['1250', 715, 855, 965],
|
||||||
|
['1500', 795, 950, 1070],
|
||||||
|
['1750', 880, 1050, 1185],
|
||||||
|
['2000', 965, 1150, 1295]
|
||||||
|
]
|
||||||
|
cec21table4 = [
|
||||||
|
#['size', '60', '75', '90'],
|
||||||
|
['12', 15, 20, 25],
|
||||||
|
['10', 25, 30, 35],
|
||||||
|
['8', 35, 40, 45],
|
||||||
|
['6', 40, 50, 55],
|
||||||
|
['4', 55, 65, 75],
|
||||||
|
['3', 65, 75, 85],
|
||||||
|
['2', 75, 90, 100],
|
||||||
|
['1', 85, 100, 115],
|
||||||
|
['1/0', 100, 120, 165],
|
||||||
|
['2/0', 115, 165, 150],
|
||||||
|
['3/0', 160, 155, 175],
|
||||||
|
['4/0', 150, 180, 205],
|
||||||
|
['250', 170, 205, 230],
|
||||||
|
['300', 195, 230, 260],
|
||||||
|
['350', 210, 250, 280],
|
||||||
|
['400', 225, 270, 305],
|
||||||
|
['500', 260, 310, 350],
|
||||||
|
['600', 285, 340, 385],
|
||||||
|
['700', 315, 375, 425],
|
||||||
|
['750', 320, 385, 435],
|
||||||
|
['800', 330, 395, 445],
|
||||||
|
['900', 355, 425, 480],
|
||||||
|
['1000', 375, 445, 500],
|
||||||
|
['1250', 405, 485, 545],
|
||||||
|
['1500', 435, 520, 585],
|
||||||
|
['1750', 455, 545, 615],
|
||||||
|
['2000', 470, 560, 630]
|
||||||
]
|
]
|
||||||
|
|
@ -11,6 +11,9 @@ from .jepl_circuits import *
|
||||||
from .jepl_templates import *
|
from .jepl_templates import *
|
||||||
from .jepl_safety import *
|
from .jepl_safety import *
|
||||||
|
|
||||||
|
|
||||||
|
#print(cec21table1)
|
||||||
|
|
||||||
def Test():
|
def Test():
|
||||||
print( "JMK Python Module works! !")
|
print( "JMK Python Module works! !")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ import math
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import bisect
|
import bisect
|
||||||
|
|
||||||
|
# Need to add the various table files here.
|
||||||
|
from .Tables.CEC21Tables import *
|
||||||
|
|
||||||
|
|
||||||
def vd(current,length,resistance,runs=1):
|
def vd(current,length,resistance,runs=1):
|
||||||
|
|
||||||
|
|
@ -237,16 +240,15 @@ def conductor_size(current, temp = 75, material = 'cu', code = 'CEC', raceway =
|
||||||
|
|
||||||
|
|
||||||
# Seclect the proper table
|
# Seclect the proper table
|
||||||
|
|
||||||
if (code == 'CEC'):
|
if (code == 'CEC') & (material == 'CU') & (raceway == False):
|
||||||
import jepl.Tables.CEC21Tables as cec21tables # This isn't as clean as I want it.
|
df = pd.DataFrame(cec21table1, columns=['size', '60C', '75C', '90C'])
|
||||||
|
elif (code == 'CEC') & (material == 'CU') & (raceway == True):
|
||||||
if (material == 'CU') & (raceway == False):
|
df = pd.DataFrame(cec21table2, columns=['size', '60C', '75C', '90C'])
|
||||||
df = pd.DataFrame(cec21tables.table1, columns=['size', '60C', '75C', '90C'])
|
elif (code == 'CEC') & (material == 'AL') & (raceway == False):
|
||||||
|
df = pd.DataFrame(cec21table3, columns=['size', '60C', '75C', '90C'])
|
||||||
elif (material == 'CU') & (raceway == True):
|
elif (code == 'CEC') & (material == 'AL') & (raceway == True):
|
||||||
df = pd.DataFrame(cec21tables.table3, columns=['size', '60C', '75C', '90C'])
|
df = pd.DataFrame(cec21table4, columns=['size', '60C', '75C', '90C'])
|
||||||
|
|
||||||
elif (code =='NEC') & (material =='CU'):
|
elif (code =='NEC') & (material =='CU'):
|
||||||
return (' I haven\'t created this table yet')
|
return (' I haven\'t created this table yet')
|
||||||
elif (code =='NEC') & (material =='AL'):
|
elif (code =='NEC') & (material =='AL'):
|
||||||
|
|
@ -304,15 +306,14 @@ def conductor_ampacity(conductor, temp = 75, material = 'cu', code = 'CEC', race
|
||||||
else:
|
else:
|
||||||
column = '60C'
|
column = '60C'
|
||||||
|
|
||||||
if (code == 'CEC') & (material == 'CU') & (raceway == False): # CEC Table 1
|
if (code == 'CEC') & (material == 'CU') & (raceway == False):
|
||||||
df = pd.DataFrame(cec21tables.table1, columns=['size', '60C', '75C', '90C'])
|
df = pd.DataFrame(cec21table1, columns=['size', '60C', '75C', '90C'])
|
||||||
|
elif (code == 'CEC') & (material == 'CU') & (raceway == True):
|
||||||
elif (code == 'CEC') & (material == 'CU') & (raceway == True): # CEC Table 2
|
df = pd.DataFrame(cec21table2, columns=['size', '60C', '75C', '90C'])
|
||||||
df = pd.DataFrame(cec21tables.table2, columns=['size', '60C', '75C', '90C'])
|
elif (code == 'CEC') & (material == 'AL') & (raceway == False):
|
||||||
|
df = pd.DataFrame(cec21table3, columns=['size', '60C', '75C', '90C'])
|
||||||
elif (code =='CEC') & (material =='AL') & (raceway == False): # CEC Table 3
|
elif (code == 'CEC') & (material == 'AL') & (raceway == True):
|
||||||
df = pd.DataFrame(cec21tables.table3, columns=['size', '60C', '75C', '90C'])
|
df = pd.DataFrame(cec21table4, columns=['size', '60C', '75C', '90C'])
|
||||||
|
|
||||||
elif (code =='NEC') & (material =='CU'):
|
elif (code =='NEC') & (material =='CU'):
|
||||||
return (' I haven\'t created this table yet')
|
return (' I haven\'t created this table yet')
|
||||||
elif (code =='NEC') & (material =='AL'):
|
elif (code =='NEC') & (material =='AL'):
|
||||||
|
|
|
||||||
37
tools.py
37
tools.py
|
|
@ -72,6 +72,34 @@ def condsize(args):
|
||||||
result = jmk.conductor_size(args.current, temp = temp, material = material, code = code, raceway = raceway, max = maxsize, load_type = loadtype )
|
result = jmk.conductor_size(args.current, temp = temp, material = material, code = code, raceway = raceway, max = maxsize, load_type = loadtype )
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
|
def condamp(args):
|
||||||
|
if args.temp == None:
|
||||||
|
temp = 60
|
||||||
|
else:
|
||||||
|
temp = args.temp
|
||||||
|
if args.material == None:
|
||||||
|
material = 'cu'
|
||||||
|
else:
|
||||||
|
material = args.material
|
||||||
|
if args.code == None:
|
||||||
|
code = 'CEC'
|
||||||
|
else:
|
||||||
|
code = args.code
|
||||||
|
if args.raceway == None:
|
||||||
|
raceway = True
|
||||||
|
elif args.raceway == 'n':
|
||||||
|
raceway = False
|
||||||
|
else:
|
||||||
|
raceway = True
|
||||||
|
if args.ambient == None:
|
||||||
|
ambient = 30
|
||||||
|
else:
|
||||||
|
ambient = args.ambient
|
||||||
|
result = jmk.conductor_ampacity(args.conductor, temp = temp, material = material, code = code, raceway = raceway)
|
||||||
|
print(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Solar
|
# Solar
|
||||||
|
|
||||||
def temp_adj_Voc(args):
|
def temp_adj_Voc(args):
|
||||||
|
|
@ -127,6 +155,15 @@ try:
|
||||||
condsize_parser.add_argument("--type",type=str, help="Load type {}'normal','xfmr','xfmrp','xfmrs','motor',None}, default: None")
|
condsize_parser.add_argument("--type",type=str, help="Load type {}'normal','xfmr','xfmrp','xfmrs','motor',None}, default: None")
|
||||||
condsize_parser.set_defaults(func=condsize)
|
condsize_parser.set_defaults(func=condsize)
|
||||||
|
|
||||||
|
condamp_parser = subparsers.add_parser("condamp", help="Determine the ampacity of a conductor.")
|
||||||
|
condamp_parser.add_argument("conductor", type=str, help="TThe conductor size in AWG/kcmil")
|
||||||
|
condamp_parser.add_argument("-t", "--temp", type=int, help="The temperature rating for the insulation, if none included is 60C. default: 60" )
|
||||||
|
condamp_parser.add_argument("-m", "--material", type=str, help="This should be cu or al, for copper or aluminum. If none defined cu will be used.")
|
||||||
|
condamp_parser.add_argument("-c", "--code", type=str, help="Currently this will either be CEC or NEC. default CEC")
|
||||||
|
condamp_parser.add_argument("-r", "--raceway", type=str, help="If the conductors are in a raceway use y for yes and n for no.")
|
||||||
|
condamp_parser.add_argument("-a", "--ambient", type=float, help="Ambient temperature in celsious. default: 30")
|
||||||
|
condamp_parser.set_defaults(func=condamp)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue