Skip to content

Commit ffbd2b2

Browse files
patch the validation that was accidentally incorrectly removed
Signed-off-by: Jerry Guo <Jerry.Jinfeng.Guo@alliander.com>
1 parent f60d8de commit ffbd2b2

File tree

3 files changed

+983
-6
lines changed

3 files changed

+983
-6
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/optimizer/tap_position_optimizer.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ inline auto get_edge_weights(TransformerGraph const& graph) -> TrafoGraphEdgePro
331331
if (!is_unreachable(edge_res)) {
332332
if (edge_src_rank != edge_tgt_rank - 1) {
333333
throw AutomaticTapInputError("The control side of a transformer regulator should be relatively further "
334-
"away from the source than the tap side.\n");
335-
}
334+
"away from the source than the tap side.\n");
335+
}
336336
result.emplace_back(graph[e].regulated_idx, edge_tgt_rank);
337337
}
338338
}

tests/data/power_flow/automatic-tap-regulator/pgm-automatic-tap-any/input.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@
1111
{"id": 3, "u_rated": 10500},
1212
{"id": 4, "u_rated": 10500},
1313
{"id": 5, "u_rated": 21000},
14-
{"id": 6, "u_rated": 10500}
14+
{"id": 6, "u_rated": 10500},
15+
{"id": 25, "u_rated": 21000},
16+
{"id": 26, "u_rated": 10500}
1517
],
1618
"line": [
1719
{"id": 7, "from_node": 2, "to_node": 3, "from_status": 1, "to_status": 1, "r1": 0.506, "x1": 1.07, "c1": 5.099999999999999e-06, "tan1": 0, "r0": 11.47, "x0": 2.94, "c0": 5.099999999999999e-06, "tan0": 0, "i_n": 604},
18-
{"id": 8, "from_node": 1, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 1.01, "x1": 1.92, "c1": 3.2e-06, "tan1": 0, "r0": 22.36, "x0": 6.11, "c0": 3.2e-06, "tan0": 0, "i_n": 431}
20+
{"id": 8, "from_node": 1, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 1.01, "x1": 1.92, "c1": 3.2e-06, "tan1": 0, "r0": 22.36, "x0": 6.11, "c0": 3.2e-06, "tan0": 0, "i_n": 431},
21+
{"id": 27, "from_node": 1, "to_node": 25, "from_status": 0, "to_status": 1, "r1": 1.01, "x1": 1.92, "c1": 3.2e-06, "tan1": 0, "r0": 22.36, "x0": 6.11, "c0": 3.2e-06, "tan0": 0, "i_n": 431}
1922
],
2023
"transformer": [
2124
{"id": 9, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "u1": 150000, "u2": 11000, "sn": 12000000, "uk": 0.204, "pk": 60000, "i0": 0, "p0": 0, "winding_from": 1, "winding_to": 2, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -11, "tap_max": 9, "tap_nom": 0, "tap_size": 2500, "uk_min": 0.204, "uk_max": 0.204, "pk_min": 60000, "pk_max": 60000, "r_grounding_from": 0, "x_grounding_from": 0},
2225
{"id": 10, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "u1": 150000, "u2": 11000, "sn": 12000000, "uk": 0.204, "pk": 60000, "i0": 0, "p0": 0, "winding_from": 1, "winding_to": 2, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -11, "tap_max": 9, "tap_nom": 0, "tap_size": 2500, "uk_min": 0.204, "uk_max": 0.204, "pk_min": 60000, "pk_max": 60000, "r_grounding_from": 0, "x_grounding_from": 0},
2326
{"id": 11, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "u1": 150000, "u2": 21000, "sn": 25000000, "uk": 0.208, "pk": 80000, "i0": 0, "p0": 0, "winding_from": 1, "winding_to": 2, "clock": 1, "tap_side": 0, "tap_pos": 0, "tap_min": -16, "tap_max": 16, "tap_nom": 0, "tap_size": 1730, "uk_min": 0.208, "uk_max": 0.208, "pk_min": 80000, "pk_max": 80000, "r_grounding_from": 0, "x_grounding_from": 0},
2427
{"id": 12, "from_node": 5, "to_node": 6, "from_status": 1, "to_status": 1, "u1": 21000, "u2": 10000, "sn": 12000000, "uk": 0.08, "pk": 60000, "i0": 0, "p0": 0, "winding_from": 1, "winding_to": 0, "clock": 0, "tap_side": 0, "tap_pos": 0, "tap_min": -15, "tap_max": 15, "tap_nom": 0, "tap_size": 270, "uk_min": 0.08, "uk_max": 0.08, "pk_min": 60000, "pk_max": 60000, "r_grounding_from": 0, "x_grounding_from": 0},
25-
{"id": 13, "from_node": 3, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10500, "u2": 10500, "sn": 12000000, "uk": 0.005, "pk": 0, "i0": 0, "p0": 0, "winding_from": 0, "winding_to": 0, "clock": 0, "tap_side": 0, "tap_pos": 7, "tap_min": 1, "tap_max": 13, "tap_nom": 7, "tap_size": 150, "uk_min": 0.004500000000000001, "uk_max": 0.006, "pk_min": 0, "pk_max": 0, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0}
28+
{"id": 13, "from_node": 3, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10500, "u2": 10500, "sn": 12000000, "uk": 0.005, "pk": 0, "i0": 0, "p0": 0, "winding_from": 0, "winding_to": 0, "clock": 0, "tap_side": 0, "tap_pos": 7, "tap_min": 1, "tap_max": 13, "tap_nom": 7, "tap_size": 150, "uk_min": 0.004500000000000001, "uk_max": 0.006, "pk_min": 0, "pk_max": 0, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0},
29+
{"id": 24, "from_node": 25, "to_node": 26, "from_status": 1, "to_status": 1, "u1": 21000, "u2": 10500, "sn": 12000000, "uk": 0.08, "pk": 60000, "i0": 0, "p0": 0, "winding_from": 1, "winding_to": 0, "clock": 0, "tap_side": 0, "tap_pos": 0, "tap_min": -15, "tap_max": 15, "tap_nom": 0, "tap_size": 270, "uk_min": 0.08, "uk_max": 0.08, "pk_min": 60000, "pk_max": 60000, "r_grounding_from": 0, "x_grounding_from": 0}
2630
],
2731
"source": [
2832
{"id": 14, "node": 0, "status": 1, "u_ref": 1, "sk": 1e+20, "rx_ratio": 0.1, "z01_ratio": 3}
@@ -38,7 +42,8 @@
3842
{"id": 20, "regulated_object": 10, "status": 1, "control_side": 1, "u_set": 10600, "u_band": 1000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0},
3943
{"id": 21, "regulated_object": 11, "status": 1, "control_side": 1, "u_set": 21000, "u_band": 2000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0},
4044
{"id": 22, "regulated_object": 12, "status": 1, "control_side": 1, "u_set": 10500, "u_band": 1000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0},
41-
{"id": 23, "regulated_object": 13, "status": 1, "control_side": 1, "u_set": 10500, "u_band": 1000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0}
45+
{"id": 23, "regulated_object": 13, "status": 1, "control_side": 1, "u_set": 10500, "u_band": 1000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0},
46+
{"id": 28, "regulated_object": 24, "status": 1, "control_side": 1, "u_set": 10500, "u_band": 1000, "line_drop_compensation_r": 0, "line_drop_compensation_x": 0}
4247
]
4348
}
4449
}

0 commit comments

Comments
 (0)