Substation Builder¶
The cimbuilder.substation_builder module builds node-breaker substations: the Substation, one
VoltageLevel per nominal voltage, the busbars, and every breaker, disconnector and junction node between
the buses and the branches. There is one builder class per common layout, each with its own page:
| Builder | add_buses options |
add_branch connection point |
|---|---|---|
SingleBusSubstationBuilder |
number |
|
SectionalizedBusSubstationBuilder |
sections=2 |
section, number |
MainAndTransferSubstationBuilder |
number |
|
DoubleBusSingleBreakerSubstationBuilder |
number, bus=1 |
|
RingBusSubstationBuilder |
sections=4 |
section |
BreakerAndHalfSubstationBuilder |
diameters=2 |
diameter, side |
Every add_branch also takes node, the mRID of the branch end (see Branch nodes and
feeders).
The call order¶
The layout builders follow the same pattern as the object builders. Each is constructed with the CIMantic Graphs network and the container it writes into. Every method takes the object it extends plus keyword-only arguments, refers to other objects by mRID string, and returns the object it was given plus whatever it created. The methods are called in this order:
create(mRID=..., name=...): theSubstation.add_connectivity(substation, Region=...): optional, theSubGeographicalRegionholding the substation.add_voltage_level(substation, mRID=..., BaseVoltage=...): oneVoltageLevelper nominal voltage. Returns(substation, voltage_level).add_bay(voltage_level, ...): optional, aBayrecording a breaker and busbar configuration.add_buses(voltage_level, ...): the busbars and bus ties of the layout. Returns(voltage_level, busbars, switches).add_branch(voltage_level, ..., node=...): the switches between a bus and a branch node. Returns(voltage_level, switches).
builder = SingleBusSubstationBuilder(network, container)
substation = builder.create(mRID="sub_1", name="Substation 1")
substation, voltage_level = builder.add_voltage_level(
substation, mRID="vl_115", BaseVoltage="bv_115kV"
)
voltage_level, busbars, ties = builder.add_buses(voltage_level)
voltage_level, switches = builder.add_branch(voltage_level, number=1, node="line_1")
add_branch needs the buses it connects to, so calling it before add_buses raises a ValueError.
Names and containment¶
Every node and switch a layout builds goes in the VoltageLevel and takes its BaseVoltage. Their mRIDs
are prefixed with the VoltageLevel mRID, written <vl> below (vl_115 in the examples):
- A bus is the node
<vl>_bus_<label>(label1,2, ... ormainandtransfer), with aBusbarSection<vl>_bus_<label>_bbson it. - Most connections are a breaker bay: a
Breakerbetween two isolatingDisconnectors, with a junction node on either side of the breaker. A bay with prefixpbetweennode1andnode2is
flowchart LR
node1(["node1"]) --- d1["Disconnector<br/>p_d1"] --- j1(["p_j1"]) --- brk["Breaker<br/>p_brk"] --- j2(["p_j2"]) --- d2["Disconnector<br/>p_d2"] --- node2(["node2"])
- Switches are closed unless the layout makes them normally open, such as a main-and-transfer bypass or
the unused bus selector of a double-bus branch.
normalOpenand the steady-stateopenare set together.
Each layout page has a table of the mRIDs it writes.
Branch nodes and feeders¶
node is the far end of a branch. If there is no ConnectivityNode with that mRID yet, add_branch
creates it in the VoltageLevel: a new node for a transmission line, transformer or shunt, which that
equipment then connects to through its own object builder. If the node already exists, for example the
head node of a distribution feeder loaded into the same graph, the switches connect to it and the node
stays in its own container.
To insert an existing distribution feeder into a substation:
- Load the feeder into the same graph as the substation, for example with a cim-graph
FeederModelandXMLFile. - Call
add_branchwith the feeder's head node (itssourcebus) asnode. - Link the feeder container to the substation:
FeederBuilder(network, container).add_connectivity(feeder, NormalEnergizingSubstation=substation.mRID).
The example notebooks¶
Each layout page builds a 115 kV substation around the IEEE 13 and IEEE 13 Assets node test feeders from
tests/test_models. It adds a branch to a new line node and to each feeder's sourcebus, links the
feeders to the substation, writes everything to one CIM XML file, and reads that file back to check the
result. All layouts does the same for all six layouts in one notebook.
<style>
['pre { line-height: 125%; }\ntd.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\nspan.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\ntd.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\nspan.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\n.highlight-ipynb .hll { background-color: var(--jp-cell-editor-active-background) }\n.highlight-ipynb { background: var(--jp-cell-editor-background); color: var(--jp-mirror-editor-variable-color) }\n.highlight-ipynb .c { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment */\n.highlight-ipynb .err { color: var(--jp-mirror-editor-error-color) } /* Error */\n.highlight-ipynb .k { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword */\n.highlight-ipynb .o { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator */\n.highlight-ipynb .p { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation */\n.highlight-ipynb .ch { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Hashbang */\n.highlight-ipynb .cm { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Multiline */\n.highlight-ipynb .cp { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Preproc */\n.highlight-ipynb .cpf { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.PreprocFile */\n.highlight-ipynb .c1 { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Single */\n.highlight-ipynb .cs { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Special */\n.highlight-ipynb .kc { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Constant */\n.highlight-ipynb .kd { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Declaration */\n.highlight-ipynb .kn { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Namespace */\n.highlight-ipynb .kp { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Pseudo */\n.highlight-ipynb .kr { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Reserved */\n.highlight-ipynb .kt { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Type */\n.highlight-ipynb .m { color: var(--jp-mirror-editor-number-color) } /* Literal.Number */\n.highlight-ipynb .s { color: var(--jp-mirror-editor-string-color) } /* Literal.String */\n.highlight-ipynb .ow { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator.Word */\n.highlight-ipynb .pm { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation.Marker */\n.highlight-ipynb .w { color: var(--jp-mirror-editor-variable-color) } /* Text.Whitespace */\n.highlight-ipynb .mb { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Bin */\n.highlight-ipynb .mf { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Float */\n.highlight-ipynb .mh { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Hex */\n.highlight-ipynb .mi { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer */\n.highlight-ipynb .mo { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Oct */\n.highlight-ipynb .sa { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Affix */\n.highlight-ipynb .sb { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Backtick */\n.highlight-ipynb .sc { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Char */\n.highlight-ipynb .dl { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Delimiter */\n.highlight-ipynb .sd { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Doc */\n.highlight-ipynb .s2 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Double */\n.highlight-ipynb .se { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Escape */\n.highlight-ipynb .sh { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Heredoc */\n.highlight-ipynb .si { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Interpol */\n.highlight-ipynb .sx { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Other */\n.highlight-ipynb .sr { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Regex */\n.highlight-ipynb .s1 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Single */\n.highlight-ipynb .ss { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Symbol */\n.highlight-ipynb .il { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer.Long */']
</style>