American Public Power Association tools




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

MAGNETIC FIELDS ANALYSIS 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.

EARTH RETURN EFFECTS ARE INCLUDED.

{rho: EARTH RESISTIVITY IN OHM-METERS}

{epsrel: RELATIVE EARTH PERMITTIVITY }

THE PROGRAM CALCULATES FIELDS AT A FIXED ELEVATION, Y, FOR A RANGE OF X COORDINATES.

For example, if xstart is 0, xstop is 10 and the number of data points is 3, then the program will calculate noise at ground level at the following distances away from the distribution line: 0 feet, 5 feet, 10 feet.

{y : Y feet }

RANGE OF X VALUES

{xstart: xstart (feet)}

{xstop: xstop (feet)}

{n_datapoints: NUMBER OF DATA POINTS}

IF SHIELDS ARE SEGMENTED (INSULATED) TO PREVENT 60 HZ SHIELD WIRE CURRENTS, OR IF YOU WISH TO NEGLECT EFFECTS OF SHIELD WIRE CURRENTS, SHIELD WIRE CURRENTS SHOULD BE SET TO ZERO.

{nins : shield_currents ? TO INCLUDE SHIELD WIRE CURRENTS, TYPE A 1. TO SET SHIELD CURRENTS TO ZERO, TYPE A 2.}

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'

rho = 100
epsrel = 2.8
y = 3.28084
xstart = 0
xstop = 250
n_datapoints = 51
nins = 1

target_folder = '/tmp'
In [3]:
nins = 1 if int(nins) == 1 else 2
In [4]:
from os.path import join
output_text_path = join(target_folder, 'mfldold.log')
target_text_path = join(target_folder, 'mfldold.txt')
In [5]:
from macros import transmogrify_conductors
conductor_text_path = transmogrify_conductors(join(
    target_folder, 'conductors.dat'), conductor_table_path)
In [6]:
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 = 'mfldold.out'
script = 'mfldold.f'

output_text = run([
    'gfortran',
    '-o',
    executable,
    script,])
In [7]:
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(rho),
    str(epsrel),
    str(y),
    str(xstart),
    str(xstop),
    str(n_datapoints),
    str(nins),
], stderr=STDOUT)
with open(output_text_path, 'wb') as output_file:
    output_file.write(output_text)
In [8]:
print('output_text_path = ' + output_text_path)
print('target_text_path = ' + target_text_path)
output_text_path = /tmp/mfldold.log
target_text_path = /tmp/mfldold.txt