Short Circuit Reference

Public API

Sparlectra.NativeShortCircuitData — Type
NativeShortCircuitData

Short-circuit source records of a natively built network (addExternalGrid!), consumed by runShortCircuit! exactly like the CGMES harvest.

Deliberately field-identical to CGMESImporter.CGMESShortCircuitData and not related to it through a common supertype: the short-circuit engine is duck-typed over the record contract (issue #299): the seven Vector{NamedTuple} fields with their tuple keys ARE the interface, and a type hierarchy would suggest a coupling that does not exist. Keep both structs in sync field-by-field when the contract evolves.

All-empty by default; addExternalGrid! fills external_network_injections. The remaining vectors exist so the engine's machine/equivalent loops iterate empty collections instead of needing per-container special cases.

source
Sparlectra.ShortCircuitResult — Type
ShortCircuitResult

Result of one runShortCircuit! evaluation (one case, one or many fault buses). Deliberately a separate type: it neither extends nor embeds into ACPFlowReport (precedent: rundcpf! with its own report type).

Fields

  • case::Symbol: :max or :min.
  • base_mva::Float64: network power base used for the per-unit assembly.
  • c_factor_override::Float64: 0.0 = IEC 60909-0 Table 1 by voltage level; positive = the scalar override used for every bus.
  • rows::Vector{NamedTuple}: one row per requested fault bus with bus (name), bus_idx, vn_kV, island, status (:ok / :no_source / :isolated), c, zk_ohm, rx_ratio, ik_kA, sk_MVA, kappa, ip_kA, contains_defaulted_data, lower_bound, reasons. Safety-flag contract: whenever a source value was substituted with a documented default or a contribution was skipped, the affected rows carry contains_defaulted_data = true plus the reason list. In the :max case a skipped contribution makes ik_kA a lower bound, which is the non-conservative direction for equipment rating: every row of that island carries lower_bound = true. A row on a default or a substitute only is flagged but no lower bound.
  • messages::Vector{String}: the run's warnings/notices (same texts that were logged).
  • status::Symbol: the run status, :succeeded, :warning (some or all sources without their data, entered with defaults) or :failed (no source carries anything an impedance can come from, or no bus could be evaluated). The service reports the same status (one rule, see Short circuit).
  • status_reason::Union{Nothing,String}: the reason code that goes with the status (short_circuit_partial_defaults, short_circuit_defaults_only, short_circuit_flagged_lower_bound, short_circuit_flagged_defaults, short_circuit_data_missing), or nothing for a run without any flag.
source
Sparlectra.printShortCircuitResult — Method
printShortCircuitResult(io::IO, result::ShortCircuitResult; max_rows = 50)
printShortCircuitResult(result::ShortCircuitResult; max_rows = 50)

Pretty-print a ShortCircuitResult. The first line names the run status with its reason, the number of flagged rows (defaulted or substituted data, skipped sources) and the number of rows whose Ik''max is a lower bound. Then one table row per fault bus (Ik'', Sk'', kappa, i_p, flag column), followed by the reason list of every flagged row. The Web UI "Short circuit" run writes the same rows as short_circuit_max.csv / short_circuit_min.csv and shows the first line above the table.

source
Sparlectra.runShortCircuit! — Method
runShortCircuit!(net, sc_data; buses = :all, case = :max, c_factor = 0.0) -> ShortCircuitResult
runShortCircuit!(result::CGMESImporter.CGMESImportResult; kwargs...) -> ShortCircuitResult

Balanced 3-phase initial symmetrical short-circuit current per IEC 60909-0 (issue #277): equivalent voltage source at the fault location, positive sequence only, series impedances only.

  • sc_data: the CGMES short-circuit harvest (CGMESImportResult.shortcircuit).
  • buses: :all (per-bus sweep as a loop over the per-bus path) or a vector of bus names.
  • case: :max (equipment rating, c_max) or :min (protection sensitivity, c_min). Asynchronous machines and converter-connected units never contribute to :min.
  • c_factor: 0.0 uses the hardcoded IEC 60909-0 Table-1 values per voltage level (short_circuit.c_factor carries the same semantics in YAML); a positive scalar overrides the table for every bus.
  • converter_current_factor: 0.0 (off) or the fault current of a converter without maxIFault as a multiple of its rated current (below).

Per fault bus the short-circuit impedance is obtained by a Z-bus column solve: one sparse LU factorization per island and case, one triangular solve per fault bus: the full inverse is never formed. Outputs per bus: Ik'' (kA), Sk'' (MVA), and kappa/i_p from the R/X ratio at the fault location (IEC 60909-0 method b: κ = min(1.15·(1.02 + 0.98·e^{-3R/X}), cap) with cap 1.8 below 1 kV and 2.0 above).

Converter-connected units (sc_data.power_electronics_connections, one record per mapped CGMES 3.0 PowerElectronicsConnection) feed :max as current sources, the model IEC 60909-0:2016 gives power station units with full size converter (clause 6.9). The current of a unit is I_sk = maxIFault·ratedS/(√3·ratedU) (maxIFault is in per unit of the rated current; a missing ratedU is replaced by the bus nominal voltage and flagged). maxIFault is a CIM17 attribute that no CGMES 3.0 profile defines: a conforming delivery has none, and its converters take the lower-bound flag below. converter_current_factor (config short_circuit.converter_current_factor, default 0.0 = off) replaces a missing maxIFault by that multiple of the rated current; the rows of the island are flagged with the substitute instead of the lower bound. A stated maxIFault wins, also one that is not positive. The converter share at fault bus i is superposed on the equivalent voltage source: Ik'' = c·Un/(√3·|Z_ii|) + (1/|Z_ii|)·Σ_j |Z_ij|·I_sk,j, with Z the impedance matrix of the island in which the voltage sources are short-circuited (the matrix the first term uses) and j over the converter buses. Magnitudes are added, which bounds the complex sum from above for any phase of the converter currents. κ belongs to the first term: i_p = κ·√2·I''_vs + √2·I''_conv. zk_ohm and rx_ratio stay those of Z_ii, so with converters ik_kA is more than c·Un/(√3·zk_ohm). A unit without maxIFault (factor off), with a maxIFault that is not positive or without ratedS, and a converter prosumer whose bus has no record, feeds nothing and flags its island as a lower bound. An island fed by converters alone has no voltage source and no Z_ii: every bus of it reports :ok with the arithmetic sum of the converter currents of the island, i_p = √2·Ik'', NaN for zk_ohm, rx_ratio and κ, and the flagged reason converter-only island, arithmetic sum, no voltage source (an upper bound, no lower bound of its own). Without any feeding converter (factor off, no maxIFault) such an island stays :no_source.

A synchronous machine record with converter_unit set (a CGMES SynchronousMachine on a WindGeneratingUnit or SolarGeneratingUnit, an IIDM generator with energySource WIND or SOLAR) takes the same path instead of the machine path: converter_current_factor times the rated current, the rated power from ratedS_MVA, else from pmax_MW (the maximum active power of the unit, at power factor 1), each unless a placeholder (SC_RATEDS_PLACEHOLDER_MVA, SC_PMAX_PLACEHOLDER_MW). With the factor off or without a size it feeds nothing and flags its island as a lower bound. Such a machine never enters :min.

Substituted defaults and skipped contributions are flagged on the affected result rows (contains_defaulted_data + reasons), not only logged: for :max a skipped contribution makes the result a lower bound. Buses in islands without any short-circuit source report status = :no_source with NaN currents; isolated buses report status = :isolated.

Closed links (busbar couplers, retained switches) are contracted as in the power flow: the buses of one closed-link group are one node of the short-circuit matrix. Every member of a fed group reports the Ik'' of that node and the same island, sources on any member feed it, and the reasons of every member appear on each member's row. A branch between two buses of one group is shorted by the link and left out. A group counts as isolated only when all its members are in net.isoNodes.

The function does not modify net; the ! marks it as the acting entry point of the module family (runpf!, rundcpf!). Failure behavior: throws ArgumentError for an unknown bus name or an invalid case.

All-bus sweeps fan out over Julia threads: the fault-bus list is split into runtime.parallel.max_tasks chunks, each task solving on its own copy of the island factorization with reusable RHS/solution buffers. Results are row-identical to the serial sweep. The keywords parallel_enabled, parallel_max_tasks, and parallel_min_work_items override the active runtime.parallel.* configuration (nothing = use the configured values); with one Julia thread or below min_work_items fault buses the sweep runs serially.

sweep_method selects the all-bus Thevenin sweep strategy. :takahashi computes all Thevenin impedances of an island in ONE selected-inverse pass over the factorization instead of one triangular solve per bus (takahashi_diag; measured 34x to 264x over the serial sweep, growing with island size). Values agree with :solves to machine precision but not bitwise; islands where the method does not apply (unsymmetric pivot ordering) automatically fall back to solves. The default :auto uses Takahashi for islands with at least takahashi_min_buses buses and plain solves below (the pass overhead only pays off from a certain island size); :solves forces the per-bus solves everywhere. The service and Web UI paths take both settings from short_circuit.sweep_method / short_circuit.takahashi_min_buses, and converter_current_factor from short_circuit.converter_current_factor.

source