ORNL / ORNL/GridKit

Needs for interfacing with partitioned DAE integrator

Open
#143 4 comments 0 reactions 2 assignees View on GitHub

@superwhiskers is already working on this.

Since Aug 19, 2026.

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

Description

Note: This is a draft that will evolve as the numerical methods and software are developed.

With the mathematical model

Image

GridKit will need provide the SUNDIALS integrator with the $\tilde{\mathbf{f}}^{{r}}$ functions and Jacobians (although this might change to a mass matrix style interface). I expect these to have essentially the same interface as IDA's IDAResFn and IDALsJacFn. Instead of having one of each like IDA does currently, there will need to be $N$. The dimensions and content of the N_Vectors passed to the residual function for a component is very important. I'm tentatively thinking that the state y will be a ManyVector representing $[\mathbf{y}^{{r}}, \mathbf{w}^{{r}}]$. A ModelEvaluator will need some way to take in the coupling state $\mathbf{w}^{{r}}$. Perhaps this can be done through the parameters. I think standard N_Vectors of dimension $n_r$ can be used for yp and res in the residual function. The biggest feature needed here is some way to partition a ModelEvaluator into the $N$ components. The partitioned DAE integrator class will need to be passed something like a std::vector of ModelEvaluator or a composite object like SystemModel where the residual function and other properties can be indexed by component.

The implementation of the residual function for $h$ (sum over $\mathbf{h}^{{b,r}}$) in GridKit will need to leverage the special summation structure and potential for parallelism. The continuous partitioned Euler method performs an algebraic solve involving not just $h$ but also algebraic constraints from the components (denoted by $\mathbf{g}^{{r}}$ in report). A ModelEvaluator will need to provide this $\mathbf{g}^{{r}}$ function. Another option is to pass SUNDIALS one monolithic residual function that concatenates the $h$ and $g$ functions. Both will require some extra bookkeeping to indicate which variables are differential and which are algebraic. Ideally a ModelEvaluator will use a convention of putting differential variables first followed by algebraic without interweaving them. An index to the offset of the algebraic variables within a ModelEvaluator is needed. I suspect this interface will evolve significantly as we settle on the nonlinear solver and usage of tricks like nonlinear elimination.

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.