This repository contains distribution feeder model converters and validation tools for the GridAPPS-D project. It is also a standalone source of models in these formats:
from these sources:
- IEEE Distribution Test Cases
- PNNL Taxonomy of North American Feeders
- EPRI Large OpenDSS Test Feeders
- EPRI Distributed Photovoltaic (DPV) Test Feeders
The taxonomy feeders are modified, as described in the taxonomy subdirectory.
The blazegraph subdirectory contains a Java program and script files to manage the feeder model conversions to and from CIM. Maven, Java, Jena and Commons Math are required.
Blazegraph requires Java 8, which is no longer widely available for new installations. Blazegraph isn't compatible with Java 9 or newer versions. Therefore, we recommend using Blazegraph in a Docker container:
- Install the Docker Engine
- Issue commands that install and start the containerized Blazegraph engine:
- docker pull lyrasis/blazegraph:2.1.5 to download the container for Blazegraph, only necessary the first time
- docker run --name blazegraph -d -p 8889:8080 lyrasis/blazegraph:2.1.5 to start the container for Blazegraph
- docker logs -f blazegraph to log the database and Java messages to the console
- consult the Docker documentation for more details on how to stop and otherwise manage containers
- Point a web browser to http://localhost:8889/bigdata. On-line help on Blazegraph is available from the browser
- Load some data from a CIM XML file, or any other XML triple-store
- Run a query in the browser
- the file queries.txt contains sample SPARQL that can be pasted into the Blazegraph browser window
- Verify that the Blazegraph namespace is kb and use that for the rest of these examples
- You can use a different namespace, but you'll have to specify that using the -u option for the CIMImporter, handediting the default -u=http://localhost:8889/bigdata/namespace/kb/sparql
- You can use a different namespace, but you may have to hand-edit some of the Python files (e.g. under the Meas directory)
- The GridAPPS-D platform itself may use a different namespace
Helper scripts on Windows:
- compile.bat recompiles the Java CIM Importer; this step can't be included within import.bat on Windows
- drop_all.bat empties the triple-store
- import.bat will run the Java importer against the triple-store. Within this file:
- the
-o=dss
option creates an OpenDSS model from CIM - the
-o=glm
option creates a GridLAB-D model from CIM - the
-o=both
option creates both OpenDSS and GridLAB-D models from CIM - the
-o=idx
option creates a JSON index of all Feeders in the triple-store. Use this to obtain valid mRID values for the -s option
- the
Helper scripts for Linux/Mac OS X:
- import.sh will compile and run the Java importer against the triple-store. Within this file:
- the
-o=dss
option creates an OpenDSS model from CIM - the
-o=glm
option creates a GridLAB-D model from CIM - the
-o=both
option creates both OpenDSS and GridLAB-D models from CIM - the
-o=idx
option creates a JSON index of all Feeders in the triple-store. Use this to obtain valid mRID values for the -s option
- the
If you will need both OpenDSS and GridLAB-D files, the -o=both
option is much more efficient than generating them individually, because over 90% of the execution time is taken up with SPARQL queries that are common to both.
Usage and options for java gov.pnnl.goss.cim2glm.CIMImporter [options] output_root
-s={mRID} // select one feeder by CIM mRID; selects all feeders if not specified
-o={glm|dss|both|idx|cim} // output format; defaults to glm; currently cim supports only CIM14
-l={0..1} // load scaling factor; defaults to 1
-f={50|60} // system frequency; defaults to 60
-n={schedule_name} // root filename for scheduled ZIP loads (defaults to none), valid only for -o=glm
-z={0..1} // constant Z portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
-i={0..1} // constant I portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
-p={0..1} // constant P portion (defaults to 0 for CIM-defined LoadResponseCharacteristic)
-r={0..1} // determine ZIP load fraction based on given xml file or randomized fractions
-h={0..1} // determine if house load objects should be added to supplement EnergyConsumers
-x={0, 1} // indicate whether for glm, the model will be called with a fault_check already created
-t={0, 1} // request timing of top-level methods and SPARQL queries, requires -o=both for methods
-u={http://localhost:8889/bigdata/namespace/kb/sparql} // blazegraph uri (if connecting over HTTP); defaults to http://localhost:8889/bigdata/namespace/kb/sparql
Eleven feeder models are tested routinely for use in GridAPPS-D, summarized in the table below:
Name | Features | Houses | Buses | Nodes | Branches | Load | Origin |
---|---|---|---|---|---|---|---|
ACEP_PSIL | 480-volt microgrid with PV, wind and diesel | No | 8 | 24 | 13 | 0.28 | UAF |
EPRI_DPV_J1 | 1800 kW PV in 11 locations | No | 3434 | 4245 | 4901 | 9.69 | EPRI DPV |
IEEE13 | Added CIM sampler | No | 22 | 57 | 51 | 3.44 | IEEE (mod) |
IEEE13_Assets | Uses line spacings and wires | No | 16 | 41 | 40 | 3.58 | IEEE (mod) |
IEEE37 | Delta system | No | 39 | 117 | 73 | 2.59 | IEEE |
IEEE123 | Includes switches for reconfiguration | No | 130 | 274 | 237 | 3.62 | IEEE |
IEEE123_PV | Added 3320 kW PV in 14 locations | Yes | 214 | 442 | 334 | 0.27 | IEEE/NREL |
IEEE8500 | Large model, balanced secondary loads | Yes | 4876 | 8531 | 6103 | 11.98 | IEEE |
IEEE8500_3subs | Added 2 grid sources and DER | Yes | 5294 | 9499 | 6823 | 9.14 | GridAPPS-D |
R2_12_47_2 | Supports approximately 4000 houses | Yes | 853 | 1631 | 1086 | 6.26 | PNNL |
Transactive | Added 1281 secondary loads to IEEE123 | Yes | 1516 | 3051 | 2812 | 3.92 | GridAPPS-D |
Notes:
- The "CIM Sampler" version of the IEEE 13-bus model added a single breaker, recloser, fuse, center-tap transformer, split-phase secondary load, PV and battery for the purpose of CIM conversion testing
- All models originated with an OpenDSS version, except for Transactive, which originated from a hand-edited GridLAB-D model, then converted to OpenDSS. See code in directory
blazegraph/test/glm/pnnl
for details. - Model marked
Yes
for Houses have been tested with houses, but they don't require houses. Load
is the net OpenDSS source power injection, which is approximately load plus losses, less DER output
The following steps are used to injest these models, and verify that exports from CIM will solve in both GridLAB-D and OpenDSS. (Note: on Linux and Mac OS X, use python3
as shown below. On Windows, it may be that python3
is not defined, in which case use python
to invoke Python 3.)
- Start the Blazegraph engine; existing contents will be removed in the steps below. GridLAB-D and OpenDSSCmd must also have been installed.
- From blazegraph/test directory, issue
./go.sh
orgo.bat
to create the CIM XML files and baseline OpenDSS power flow solutions.- Results will be in the
blazegraph/test
directory rootname.xml
is the CIM XML filerootname_s.csv
contains exported snapshot loadflow summaryrootname_i.csv
contains exported branch currentsrootname_v.csv
contains exported bus voltagesrootname_t.csv
contains exported regulator tap positions
- Results will be in the
- From blazegraph directory, issue
python3 MakeLoopScript.py -b
to create the platform-dependent script for step 3 - From blazegraph directory, issue
./convert_xml.sh
orconvert_xml.bat
to:- Empty and create a new
blazegraph/both
directory - Sequentially ingest the CIM XML files into Blazegraph, and export both OpenDSS and GridLAB-D models
- This step may take a few minutes. When finished, all of the GridLAB-D and OpenDSS models will be in
blazegraph/both
directory - When finished, only the last CIM XML will still be in Blazegraph. This should be deleted before doing any more work in Blazegraph, to ensure compatible namespaces.
- Empty and create a new
- From blazegraph directory, issue
python3 MakeLoopScript.py -d
and thenopendsscmd check.dss
to run OpenDSS power flows on the exported models.- Results will be in the
blazegraph/both
directory rootname_s.csv
contains exported snapshot loadflow summaryrootname_i.csv
contains exported branch currentsrootname_v.csv
contains exported bus voltagesrootname_t.csv
contains exported regulator tap positions
- Results will be in the
- From blazegraph directory, issue
python3 MakeGlmTestScript.py
to create the GridLAB-D wrapper files,*run.glm
and a script execution file inblazegraph/both
- From blazegraph/both diretory, if on Linux or Mac OS X, issue
chmod +x *.sh
and then./check_glm.sh
. If on Windows, just issuecheck_glm
. This runs GridLAB-D power flow on the exported models.- Results will be in the
blazegraph/both
directory rootname_volt.csv
contains the output from a GridLAB-D voltdump, i.e., the node (bus) voltagesrootname_curr.csv
contains the output from a GridLAB-D currdump, i.e., the link (branch) currents
- Results will be in the
- From blazegraph directory, issue
python3 Compare_Cases.py
to compare the power flow solutions from steps 5 and 7 to the baseline solutions from step 2 - In the blazegraph/both directory, comparison results are in a set of files:
*Summary.log
compares the OpenDSS snapshot load flow solutions- Other
*.log
files capture GridLAB-D warnings and errors. At present, the exported IEEE 37-bus model, which is a delta system, does not solve in GridLAB-D *Missing_Nodes_DSS.txt
identifies nodes (buses) that appear in one OpenDSS model (baseline step 2 or exported step 5), but not the other.*Missing_Links_DSS.txt
identifies links (branches) that appear in one OpenDSS model (baseline step 2 or exported step 5), but not the other.*Compare_Voltages_DSS.csv
compares the bus voltages from steps 2 and 5, sorted by increasing difference*Compare_Voltages_GLM.csv
compares the bus voltages from steps 2 and 7, sorted by increasing difference*Compare_Currents_DSS.csv
compares the branch currents from steps 2 and 5, sorted by increasing difference*Compare_Currents_GLM.csv
compares the branch currents from steps 2 and 7, sorted by increasing difference
This is work in progress; essential changes to DPV J1 are not yet under version control. The goal is to verify round-trip model translation and solution between the supported model formats. It also forms the basis for validing eleven feeder models including with GridAPPS-D.
There are currently three supporting Python files in the blazegraph subdirectory:
- MakeLoopScript.py loads the CIM XML files one at a time into Blazegraph, and then extracts a feeder model
- Use this after the CIM XML files have been created
- Blazegraph must be set up
- Invoke
python MakeLoopScript.py -b
to make convert_xml.bat or convert_xml.sh, which converts all CIM XML into DSS and GLM files - Invoke
python MakeLoopScript.py -d
to make check.dss, after which invokeopendsscmd check.dss
to batch-solve all converted DSS files
- MakeGlmTestScript.py creates check_glm.bat or check_glm.sh that will solve all supported test circuits in GridLAB-D
- Compare_Cases.py has been described in steps 8 and 9 above
The funtionality of these two scripts has been incorporated above, so they might be removed:
- MakeTable.py gathers OpenDSS solution summary information from CSV files into table.txt
- MakeConversionScript.py creates ConvertCDPSM.dss that will batch-load all supported test circuits into OpenDSS, and export CIM XML
- Assumes the OpenDSS source tree has been checked out to c:\opendss
- Assumes the EPRI DPV models have been downloaded to directories like c:\epri_dpv|J1 or ~/src/epri_dpv/J1
- After
python MakeConversionScript.py
invokeopendsscmd ConvertCDPSM.dss