Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step-up transformer tap changer support: additional tests #868

Draft
wants to merge 4 commits into
base: feature/step-up-transformer-tap-changer-support
Choose a base branch
from

Conversation

figueroa1395
Copy link
Contributor

@figueroa1395 figueroa1395 commented Jan 8, 2025

Add missing tests and refactor inappropriate ones for (#826):

  • Add missing validation tests for step up transformer . These tests are marked as failing, as the control logic is not yet implemented.
  • Add new test grid for transformer ranking that works with the new logic.

Signed-off-by: Santiago Figueroa Manrique <[email protected]>
@figueroa1395 figueroa1395 added the feature New feature or request label Jan 8, 2025
@figueroa1395 figueroa1395 self-assigned this Jan 8, 2025
@figueroa1395 figueroa1395 marked this pull request as draft January 8, 2025 14:15
@Jerry-Jinfeng-Guo
Copy link
Contributor

@figueroa1395 figueroa1395 changed the title Validation tests for step up transformer Step-up transformer tap changer support: additional tests Jan 8, 2025
@figueroa1395
Copy link
Contributor Author

Could you update the naming etc as per agreement? https://power-grid-model.readthedocs.io/en/stable/contribution/CONTRIBUTING.html#pull-request-process

Thanks for the reminder, I had forgotten. Fixed accordingly.

Signed-off-by: Santiago Figueroa Manrique <[email protected]>
@figueroa1395 figueroa1395 marked this pull request as ready for review January 9, 2025 14:24
@nitbharambe
Copy link
Member

nitbharambe commented Jan 10, 2025

AKI's use case was this way:

source -- (HV)transformer(MV) -- (MV)transformer(higher MV with tap and control side) -- load

Can you also create a case? Such that source are at other place than control and tap_side?

Signed-off-by: Santiago Figueroa Manrique <[email protected]>
Copy link
Contributor

@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The step-up-transformer-single should not live under tests/data/power_flow/ directly, instead, the content should be arranged like all other cases in tests/data/power_flow/automatic_tap_regulator and have step-up-transformer-single prefixing all cases
  • Could you explain to me how is the validation case in the input json files constructed? You put the control side at the other side, but you still have high voltage at from side

@@ -184,7 +184,7 @@ TEST_CASE("Test Transformer ranking") {
CHECK_NOTHROW(pgm_tap::build_transformer_graph(get_state(6, 2, 1, 4, 5)));
}

SUBCASE("Full grid") {
SUBCASE("Full grid 1") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename the test case to be more descriptive like "Full radial grid" etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed. Both grids 1 and 2 are really just full meshed grids, so I tried to add a bit more description to the name. If you have another suggestion, just let me know. Maybe some in code comments can be added as well if deemed necessary.

CHECK_THROWS_AS(pgm_tap::rank_transformers(state), AutomaticTapInputError);
}
}

// The test grid 2 is compatible with the updated logic for step up transformers
SUBCASE("Full grid 2") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rename the test case to be more descriptive like "Full meshed grid" etc

Copy link
Contributor Author

@figueroa1395 figueroa1395 Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed. See above.

Comment on lines +334 to +353
// =====Test Grid=====
// ________[0]________
// || | |
// [1] [4]--[5]
// | | |
// [2] | [8]
// | [6] |
// [3]----[7]---| [9]
// | |
// L--------------[10]
TestState state;
std::vector<NodeInput> nodes{{0, 150e3}, {1, 10e3}, {2, 10e3}, {3, 10e3}, {4, 10e3}, {5, 50e3},
{6, 10e3}, {7, 10e3}, {8, 10e3}, {9, 10e3}, {10, 10e3}};
main_core::add_component<Node>(state, nodes.begin(), nodes.end(), 50.0);

std::vector<TransformerInput> transformers{
get_transformer(11, 0, 1, BranchSide::from), get_transformer(12, 0, 1, BranchSide::from),
get_transformer(13, 2, 3, BranchSide::from), get_transformer(14, 6, 7, BranchSide::from),
get_transformer(15, 5, 8, BranchSide::from), get_transformer(16, 9, 10, BranchSide::from)};
main_core::add_component<Transformer>(state, transformers.begin(), transformers.end(), 50.0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this test grid?

Copy link
Contributor Author

@figueroa1395 figueroa1395 Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the introduction of the new logic, the old grid was no longer valid for the transformer ranking algorithm, as it was pointed out by you in b642c97. Hence, the old grid was left in since it was still valid for the other parts of the "full" algorithm, while marking the transformer ranking part with CHECK_THROWS_AS(pgm_tap::rank_transformers(state), AutomaticTapInputError) in d947149; whereas the new grid is only used for the ranking itself.

Signed-off-by: Santiago Figueroa Manrique <[email protected]>
@figueroa1395
Copy link
Contributor Author

  • The step-up-transformer-single should not live under tests/data/power_flow/ directly, instead, the content should be arranged like all other cases in tests/data/power_flow/automatic_tap_regulator and have step-up-transformer-single prefixing all cases

Okay, addressed. In addition, given your other question, I have renamed those test with the prefix trafo-control-side-HV. The prefix step-up-transformer will be used in the remaining test (work in progress).

  • Could you explain to me how is the validation case in the input json files constructed? You put the control side at the other side, but you still have high voltage at from side

To my understanding, previously it was forbidden to have the control side on the HV side, however, with the change of logic, it can now be positioned at the LV side. Hence, the current validation cases try to reflect this. On the contrary, this validation case doesn't reflect the specific edge case that AKI ran into, pointed out by you and @nitbharambe as well.

For this reason, I am working in an additional validation case, which will include not only the control side at the HV (relative) side, but also away from the source. These set of tests are to be prefixed step-up-transformer.

Until I add the missing validation test, I am putting back this PR into draft.

@figueroa1395 figueroa1395 marked this pull request as draft January 13, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants