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

[DNMY] Support in the loop PowerFlow evaluation #1040

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

jd-lara
Copy link
Member

@jd-lara jd-lara commented Jan 9, 2024

This is a WIP branch to integrate the evaluation of PowerFlows into a simulation loop.

src/core/network_model.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
Base automatically changed from jd/radial_branch_reduction to main January 22, 2024 22:31
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/core/powerflow_data_wrapper.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
src/network_models/powerflow_evaluation.jl Outdated Show resolved Hide resolved
@jd-lara jd-lara self-assigned this Jan 24, 2024
pf_data = get_power_flow_data(pf_e_data)
# Maps the StaticInjection component type by name to the
# index in the PowerFlow data arrays going from Bus number to bus index
temp_component_bus_map = Dict{DataType, Dict{String, Int}}()
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like wherever temp_component_bus_map is read, both a type and a name are being passed in to get directly to a bus number. Since we never make use of the nested structure, I'd recommend Dict{Tuple{DataType, String}, Int}; that should also simplify the first loop a bit.

name_bus_ix_map = Dict{String, Int}()
comp_type = get_component_type(key)
push!(added_injection_types, comp_type)
for n in axes(array)[1]
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming n here is a component name because that is how it is used, maybe rename so it doesn't sound like a number. Also, what would be the best way for me to obtain a typical OptimizationContainer that would get passed to this function so I can experiment with how it works?

end

for (key, array) in get_aux_variables(container)
if get_entry_type(key) ∉ ACTIVE_POWER_INJECTION_KEYS
Copy link
Contributor

Choose a reason for hiding this comment

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

Helper function-ify the entire loop to avoid code duplication across variables, aux_variables, parameters

@jd-lara jd-lara changed the base branch from main to psy4 March 6, 2024 15:15
@jd-lara jd-lara added this to In progress in v1.0 Mar 6, 2024
Base automatically changed from psy4 to main June 27, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
v1.0
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants