Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ditto/models/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ class Load(DiTToHasTraits):
default_value=False,
)

# TODO: should this be in phase load
is_grounded = Bool(
help="""Flag that indicates whether load is grounded or not""",
default_value=False,
)

# Modification: Nicolas (July 2018)
is_center_tap = Bool(
help="""Flag that indicates whether the element is a center tap load or not.""",
Expand Down
29 changes: 12 additions & 17 deletions ditto/modify/system_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, model, *args):
if len(srcs) == 0:
raise ValueError("No PowerSource object found in the model.")
elif len(srcs) > 1:
raise ValueError("Mupltiple sourcebus found: {srcs}".format(srcs=srcs))
raise ValueError("Multiple sourcebus found: {srcs}".format(srcs=srcs))
else:
source = srcs[0]

Expand Down Expand Up @@ -840,24 +840,19 @@ def center_tap_load_preprocessing(self):
# Try to get the corresponding DiTTo object by name
# Note: This should work if set_names() has been called before...
# If it fails, raise an error...
try:
t_obj = self.model[t_name]
# Get the phases and clean
_phases = np.array(
t_obj = self.model[t_name]
# Get the phases and clean
_phases = np.array(
[
[
[
phase_winding.phase
for phase_winding in winding.phase_windings
]
for winding in t_obj.windings
phase_winding.phase
for phase_winding in winding.phase_windings
]
)
_phases = np.unique(_phases.flatten())
phases.append(_phases)
except:
raise ValueError(
"Unable to retrieve DiTTo object with name {}".format(t_name)
)
for winding in t_obj.windings
]
)
_phases = np.unique(_phases.flatten())
phases.append(_phases)

# Now, we have all the transformers and their phases
# The next step is to loop over the loads, modify their phases according to the upstream transformer phase
Expand Down
18 changes: 7 additions & 11 deletions ditto/readers/abstract_reader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# coding: utf8
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function
from builtins import super, range, zip, round, map
Expand Down Expand Up @@ -149,9 +149,9 @@ def convert_to_meters(self, quantity, unit, **kwargs):

if unit.lower() == "mi":
if inverse:
return quantity / 1609.34
return quantity / 1609.344
else:
return 1609.34 * quantity
return 1609.344 * quantity

elif unit.lower() == "km":
if inverse:
Expand Down Expand Up @@ -258,9 +258,9 @@ def convert_from_meters(self, quantity, unit, **kwargs):

if unit.lower() == "mi":
if inverse:
return quantity / 0.000621371
return quantity * 1609.344
else:
return 0.000621371 * quantity
return quantity / 1609.344

elif unit.lower() == "km":
if inverse:
Expand Down Expand Up @@ -658,9 +658,7 @@ def get_phase_impedances(
].concentric_neutral_outside_diameter

if wire_list[i].concentric_neutral_resistance is None:
concentric_neutral_resistance_meters = (
0.000269
) # Aluminium wire resistivity per meter for 4/0 wire (Nexans)
concentric_neutral_resistance_meters = 0.000269 # Aluminium wire resistivity per meter for 4/0 wire (Nexans)
self.logger.warning(
"Warning - using default concentric_neutral_resistance of "
+ str(concentric_neutral_resistance_meters)
Expand All @@ -671,9 +669,7 @@ def get_phase_impedances(
].concentric_neutral_resistance

if wire_list[i].resistance is None:
resistance_meters = (
0.000269
) # Aluminium wire resistivity per meter for 4/0 wire (Nexans)
resistance_meters = 0.000269 # Aluminium wire resistivity per meter for 4/0 wire (Nexans)
self.logger.warning(
"Warning - using default resistance of "
+ str(resistance_meters)
Expand Down
Loading