Skip to content

Single-phase and split phase transformers#96

Merged
Saelyos merged 7 commits intodevelopfrom
transformers
Jul 12, 2023
Merged

Single-phase and split phase transformers#96
Saelyos merged 7 commits intodevelopfrom
transformers

Conversation

@Saelyos
Copy link
Collaborator

@Saelyos Saelyos commented Jul 12, 2023

  • Add support for non-ideal single-phase transformers
  • Add support for non-ideal split-phase transformers
  • Remove TransformerType

@Saelyos Saelyos added the enhancement New feature or request label Jul 12, 2023
@Saelyos Saelyos requested review from alihamdan and benoit9126 July 12, 2023 08:42
@Saelyos Saelyos self-assigned this Jul 12, 2023
@Saelyos Saelyos linked an issue Jul 12, 2023 that may be closed by this pull request
Copy link
Member

@benoit9126 benoit9126 left a comment

Choose a reason for hiding this comment

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

@Saelyos I think there is a missing check

self,
id: Id,
windings: str,
type: str,
Copy link
Member

Choose a reason for hiding this comment

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

We are lucky because the windings argument was stored as type in the json file format. We do not need to create a new file schema version.

Comment on lines +220 to +228
if phases2 is None:
phases2 = "".join(p for p in bus2.phases if p in bus1.phases or p == "n")
if len(phases2) != 3:
msg = f"Phases (2) of transformer {id!r} can not be deduced from the buses, they need to be specified."
logger.error(msg)
raise RoseauLoadFlowException(msg=msg, code=RoseauLoadFlowExceptionCode.BAD_PHASE)
else:
self._check_phases(id, allowed_phases=self._allowed_phases_split_secondary, phases2=phases2)
self._check_bus_phases(id, bus2, phases2=phases2)
Copy link
Member

Choose a reason for hiding this comment

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

In the second option phases2 is not None, you ensure that the neutral is present in the secondary phases using the self._allowed_phases_split_secondary variable (all the options have a neutral). Not in the first option phases2 is None. If I provide bus1.phases="abcn" and bus2.phases="abc", I get phases2="abc" and len(phases2)==3. As far as I remember, the neutral is mandatory for split phase transformer (secondary).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, good catch. The check with len was ok for single-phase, but not here.

Copy link
Member

@alihamdan alihamdan left a comment

Choose a reason for hiding this comment

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

Thanks. I left a few comments, mostly nits.

Could you please replace all "can not" in the error messages by "cannot" (no space)? thanks.

Saelyos and others added 2 commits July 12, 2023 11:46
Co-authored-by: Ali Hamdan <ali.hamdan@roseautechnologies.com>
@Saelyos Saelyos merged commit 7597c47 into develop Jul 12, 2023
@Saelyos Saelyos deleted the transformers branch July 12, 2023 10:33
@benoit9126 benoit9126 mentioned this pull request Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Transformers

3 participants