NREL / ditto

DiTTo is a Distribution Transformation Tool that aims at providing an open source framework to convert various distribution systems modeling formats.
https://nrel.github.io/ditto/
BSD 3-Clause "New" or "Revised" License
68 stars 35 forks source link

OpenDSS reader doesn't allow capacitors and nodes with the same name #342

Open daniel-thom opened 4 years ago

daniel-thom commented 4 years ago

This command

ditto convert --from opendss --to gridlabd --input ./tests/data/big_cases/opendss/epri_j1/master.dss --output output

reports this warning

Duplicate object Capacitor b18944
> ./ditto/models/base.py(33)set_name()
-> warnings.warn("Duplicate name %s being set. Object overwritten." % name)

The name is used multiple times in OpenDSS files:

./tests/data/big_cases/opendss/epri_j1/capacitors.dss:New Capacitor.B18944 bus=B18941 kV=12.47 kvar=1200 conn=wye
./tests/data/big_cases/opendss/epri_j1/capacitors.dss:New Capcontrol.B18944 Capacitor=B18944 element=Line.OH_B18944 terminal=1 Delay=31
./tests/data/big_cases/opendss/epri_j1/lines.dss:New Line.OH_B18947 bus1=B18944.1.2.3 bus2=B18947.1.2.3 length=128.016 units=m linecode=OH-3X_4CU_4CUN phases=3 enabled=True

The warning occurs because DiTTo overwrites a Node with a Capacitor. DiTTo uses an inconsistent naming convention when storing elements in its models dictionary. Sometimes the element type is included in the name and sometimes it is not. Here is what I found (likely not complete):

  1. Elements that have the type stripped off: Line, Transformer, Capacitor
  2. Elements that include the type because the OpenDSS full name is not changed: Storage, PowerSource
  3. Elements where the type is stripped but then added back as <lower_case_type>_<name>: Load, Regulator
  4. Elements that don't include the type because OpenDSS doesn't include them: Bus

This error does not occur if "capacitor_" is prepended to the name.

daniel-thom commented 4 years ago

@tarekelgindy An obvious fix here is to stop stripping the element type off of the Load and Capacitor names. Dheepak says that will cause problems for gridlabd, but that the gridlabd writer could handle it. What is your opinion on how to solve this?

daniel-thom commented 4 years ago

This is also a problem in the Cyme reader. The file tests/data/small_cases/cyme/ieee_13node/network.txt defines a feeder and a node with the name "650", and the same object-overwrite problem happens.