ORNL / ORNL/GridKit

Separate adding components from adding buses in PowerElectronics system assembly.

Open
#353 6 comments 0 reactions 1 assignee View on GitHub

@alexander-novo is already working on this.

Since Mar 31, 2026.

enhancement
Dominant language
C++
Stars
27
Forks
11
Avg merge
3d 8h
Merged PRs (30d)
23

Description

Summary
Suggested Change

In class PowerElectronicsModel when assembling the system and evaluating residual vectors and Jacobian matrices use separate loops to add contributions from components and connection nodes (buses).

Definitions
  • Components are objects that:
    • own and evaluate their internal equations
    • contribute to the coupling equations
    • may own their internal but not coupling variables
  • Coupling nodes (buses) are objects that:
    • own coupling equations and coupling variables
    • may contribute to coupling equations
Current State
  • Internal and external variables are updated from the system solver class using distribute Vectors method called by the system model.
  • Components have coupling variables tagged with values in extern_indices_, which is a std::set. It would give us more flexibility if components own arrays with mapping indices for internal and external (coupling) variables instead.
  • There are no mapping vectors for component residual values.
Rationale
  • Internal component equations can be updated by embarrassingly parallel computations. Separating components from buses helps expose this parallelism.
  • Coupling variables are owned by coupling nodes (buses). Exposing these, provides better access to the variables that need to be communicated.
  • Separating component's residual and Jacobian into internal part and contributions to the coupling (external) part will likely simplify implementation of co-simulation and multimethod integration methods.
  • Mapping indices to variable and residual vectors, as well as Jacobians should be set in allocate function. That way we can preconfigure sparsity of the Jacobian to have favorable pattern for matrix factorization.
  • Components owning mapping indices will allow us to remove local data copies in components and let components operate on system vectors and Jacobian.
Description
  • Consider making function distributeVectors an internal method to component classes (and select better descriptive name for it). Upon allocation, each component should have a mapping vector with indices to the variable locations in global variable vector. Probably a good idea to have method updateVariables that would be called inside component's evaluateResidual and evaluateJacobian methods.
  • Consider implementing separate methods to update internal component variables and coupling variables.
  • Create separate component methods to update internal equations residuals and to add contributions to the coupling equations. Have each component own a mapping vector to the global residual vector.
  • Change class name PowerElectronicsModel --> SystemModelPowerElectronics.
Additional information

Also, see #339.

CC @nkoukpaizan @PhilipFackler

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.