Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,23 @@ template <symmetry_tag sym> class ShortCircuitSolver {
ComplexTensor<sym>& diagonal_element, ComplexValue<sym>& u_bus,
IdxVector& infinite_admittance_fault_counter, FaultType const& fault_type, IntS phase_1,
IntS phase_2) {
bool infinite_added = false;
for (Idx const fault_number : faults) {
DoubleComplex const y_fault = input.faults[fault_number].y_fault;
if (std::isinf(y_fault.real())) {
assert(std::isinf(y_fault.imag()));
infinite_admittance_fault_counter[bus_number] += 1;
add_fault_with_infinite_impedance(bus_number, y_bus, diagonal_element, u_bus, fault_type, phase_1,
phase_2);
// If there is a fault with infinite admittance, there is no need to add other faults to that
// bus
break;
if (!infinite_added) {
// If there is a fault with infinite admittance, there is no need to add other faults to that
// bus
add_fault_with_infinite_impedance(bus_number, y_bus, diagonal_element, u_bus, fault_type, phase_1,
phase_2);
infinite_added = true;
}
} else {
assert(!std::isinf(y_fault.imag()));
add_fault(y_fault, bus_number, y_bus, diagonal_element, u_bus, fault_type, phase_1, phase_2);
}
assert(!std::isinf(y_fault.imag()));
add_fault(y_fault, bus_number, y_bus, diagonal_element, u_bus, fault_type, phase_1, phase_2);
}
}

Expand Down
60 changes: 60 additions & 0 deletions tests/data/short_circuit/multiple-infinite-faults/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"version": "1.0",
"type": "input",
"is_batch": false,
"attributes": {},
"data": {
"node": [
{
"id": 1,
"u_rated": 10e3
},
{
"id": 2,
"u_rated": 10e3
}
],
"line": [
{
"id": 4,
"from_node": 1,
"to_node": 2,
"from_status": 1,
"to_status": 1,
"r1": 0.2,
"x1": 0.1,
"c1": 0.0001,
"tan1": 0.002,
"r0": 0.1,
"x0": 0.3,
"c0": 0.001,
"tan0": 0.005
}
],
"source": [
{
"id": 10,
"node": 1,
"status": 1,
"u_ref": 1.05,
"sk": 1e12
}
],
"fault": [
{
"id": 13,
"status": 1,
"fault_type": 1,
"fault_phase": 1,
"fault_object": 2
},
{
"id": 14,
"status": 1,
"fault_type": 1,
"fault_phase": 1,
"fault_object": 2
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
9 changes: 9 additions & 0 deletions tests/data/short_circuit/multiple-infinite-faults/params.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"calculation_method": "iec60909",
"rtol": 1e-9,
"atol": {
"default": 1e-9,
"i_(.+)?": 1e-5
},
"short_circuit_voltage_scaling": "maximum"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
22 changes: 22 additions & 0 deletions tests/data/short_circuit/multiple-infinite-faults/sc_output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "1.0",
"type": "sc_output",
"is_batch": false,
"attributes": {},
"data": {
"node": [
{"id": 1, "energized": 1, "u_pu": [1.0996405082410192, 1.1000094150286046, 1.1000044648559839], "u": [6348.7774344476929, 6350.9073187788763, 6350.8787389439258], "u_angle": [-0.00026394338849927446, -2.0943996381772925, 2.0944015882987741]},
{"id": 2, "energized": 1, "u_pu": [0, 1.4519794706567288, 0.92765722666192696], "u": [0, 8383.0073824147275, 5355.8314952896517], "u_angle": [0, -2.0640729354898411, 2.3959770686494464]}
],
"line": [
{"id": 4, "energized": 1, "i_from": [26677.254442408772, 615.1875456999885, 485.92242413445899], "i_from_angle": [-0.79196107133958926, -0.91124276730642428, -1.5067080262047698], "i_to": [26359.514427876158, 0, 6.5765198925356682e-12], "i_to_angle": [2.3522017704414915, 0, -1.5083775167989393]}
],
"source": [
{"id": 10, "energized": 1, "i": [26677.254442411213, 615.18754569687542, 485.9224241315622], "i_angle": [-0.79196107133973304, -0.91124276731195797, -1.5067080261937864]}
],
"fault": [
{"id": 13, "energized": 1, "i_f": [13179.757213938077, 0, 0], "i_f_angle": [-0.78939088314830208, 0, 0]},
{"id": 14, "energized": 1, "i_f": [13179.757213938077, 0, 0], "i_f_angle": [-0.78939088314830208, 0, 0]}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>

SPDX-License-Identifier: MPL-2.0
Loading