American Public Power Association tools




Pay Notebook Creator: Salah Ahmed0
Set Container: Numerical CPU with TINY Memory for 10 Minutes 0
Total0

LIGHTNING TRIPOUT PROGRAM: OLD

This program was originally written in Fortran in 1989 by David R. Brown and the American Public Power Association.

The following sources provided data on the electrical properties of different conductors:

  • AL/ACSR data: Aluminum Electrical Conductor Handbook, 1982.
  • Alumoweld data: Copperweld Steel Company, Southern Division, Fayetteville, TN.
  • Steel data: Mechanical Data from ASTM Standards, ASTM Standard A475.
  • CU data: Westinghouse T&D Reference, 1964, ABB Power Systems Inc.

{t : KERAUNIC LEVEL ? THE NUMBER OF THUNDERSTORM DAYS PER YEAR}

{span: AVERAGE SPAN LENGTH IN FEET}

{sag: CONDUCTOR SAG IN FEET}

{w: PHASE BUNDLE INSULATOR STRING LENGTH IN FEET ? USE DISTANCE TO CROSSARM FOR V-STRINGS.)}

{zt: ESTIMATE FOR TOWER SURGE IMPEDANCE IN OHMS}

{tres: TOWER FOOTING RESISTANCE (OHMS)}

In [2]:
# Click the Blue Plane to preview this as a CrossCompute tool
conductor_table_path = 'conductors.csv'
phase_table_path = 'phases.csv'
shield_table_path = 'shields.csv'
span_table_path = 'spans.csv'

t = 10
span = 3
sag = 3
w = 3
zt = 10
tres = 25

target_folder = '/tmp'
In [3]:
from os.path import join
output_text_path = join(target_folder, 'ltrpold.log')
target_text_path = join(target_folder, 'ltrpold.txt')
In [4]:
from macros import transmogrify_conductors
conductor_text_path = transmogrify_conductors(join(
    target_folder, 'conductors.dat'), conductor_table_path)
In [5]:
from macros import transmogrify_pylons
pylon_text_path = transmogrify_pylons(join(
    target_folder, 'pylons.dat',
), phase_table_path, shield_table_path, span_table_path)
In [1]:
from subprocess import run

executable = 'ltrpold.out'
script = 'ltrpold.f'

output_text = run([
    'gfortran',
    '-o',
    executable,
    script,])
In [6]:
from os.path import expanduser
from subprocess import check_output, STDOUT
output_text = check_output([
    join('.', executable),
    conductor_text_path,
    pylon_text_path,
    expanduser(target_text_path),
    str(t),
    str(span),
    str(sag),
    str(w),
    str(zt),
    str(tres),
], stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
    output_file.write(output_text)
In [7]:
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)
output_text_path = /tmp/ltrpold.log
target_text_path = /tmp/ltrpold.txt