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

Opendss writer: add unbalanced loads #408

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nlaws-camus
Copy link
Collaborator

currently the opendss writer sums up all phase loads to place them on a bus (which implies that loads are balanced equally on each phase at each bus):

for phase_load in i.phase_loads:
if hasattr(phase_load, "p") and phase_load.p is not None:
total_P += phase_load.p
txt += " kW={P}".format(P=total_P * 10 ** -3)

this PR allows for defining individual phase loads by creating New Load for each PhaseLoad.

@nlaws-camus
Copy link
Collaborator Author

@tarekelgindy review this after #401 is merged (o.w. unnecessary changes show up in this PR)

@nlaws-camus nlaws-camus changed the base branch from master to Add-units-to-models November 18, 2022 21:14
@nlaws-camus nlaws-camus changed the base branch from Add-units-to-models to master November 18, 2022 21:14
@nlaws-camus nlaws-camus changed the base branch from master to Add-units-to-models November 18, 2022 21:18
@nlaws-camus nlaws-camus changed the base branch from Add-units-to-models to master November 18, 2022 21:18
ditto/writers/opendss/write.py Outdated Show resolved Hide resolved

# positions (Not mapped)

for phase_load in i.phase_loads:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm isn't the section below potentially duplicating the changes made above to txt? Should the section below be removed?

Copy link
Collaborator Author

@nlaws-camus nlaws-camus Jul 11, 2023

Choose a reason for hiding this comment

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

This section already existed and it only applies to ZIP load models. It has been awhile but I think I just left this here because I was not sure where it should go. I have not used the ZIP model in OpenDSS. Are you familiar with how we should parse it for unbalanced loads? Maybe the if can be part of the for phase_load in i.phase_loads above on line 1967

ditto/writers/opendss/write.py Outdated Show resolved Hide resolved
txt += " kvar={Q}".format(Q=kvars[n])

txt += vmin_txt
txt += vmax_txt
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment above. I think some aspects of the original mapping might not be included here. Is that intentional?
I think that this could be restructured to include duplication with the balanced section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants