Skip to content

Conversation

@dallan-keylogic
Copy link
Contributor

Summary/Motivation:

This PR is intended to allow PETSc to be used in problems where the DAE index has been reduced by deactivating some discretization equations and adding additional constraints. Frequently in IDAES models, we end up having to deactivate the discretization equations for a specific index, e.g., m.fs.unit.control_volume.material_accumulation_disc_eq[:, "Liq", "H2O"].deactivate(). This PR adds checks about whether the discretization equations for that index are active, then adds a DerivativeVar to the set of initial conditions to be fixed only if it is active.

It also contains a workaround for Pyomo/pyomo#3734 .

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@dallan-keylogic
Copy link
Contributor Author

@blnicho , @Robbybp , @eslickj , this fix causes issues with a few tests when a central or forward difference scheme is used. What should we have when the user discretizes with a Forward or Central scheme and no discretization equation exists at the final time?

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Sep 25, 2025
@ksbeattie ksbeattie requested a review from blnicho September 25, 2025 18:23
@ksbeattie ksbeattie requested a review from Robbybp October 9, 2025 18:39
@ksbeattie
Copy link
Member

@blnicho says she should have time to look at this by early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority:Normal Normal Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants