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

Fixing spurious DoF in Gibbs reactor model #1393

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions idaes/models/unit_models/gibbs_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ def gibbs_minimization(b, t, p, j):
j
][e]
for e in b.control_volume.config.property_package.element_list
if b.control_volume.properties_out[
t
].config.parameters.element_comp[j][e]
!= 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use 0, or a very small value? Does the Pyomo solver writer specifically check for "exactly 0" values and filter those variables out?

Copy link
Member Author

@andrewlee94 andrewlee94 Apr 9, 2024

Choose a reason for hiding this comment

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

This is only for exact zero (and a fixed value at that). The issue is that the solver writer is filtering these out for us, but when we use the degrees_of_freedom function we still see these (and hence see spurious DoF).

This is to catch cases where the multiplier is a constant of 0 and filter them out of the expression.

Copy link
Member Author

@andrewlee94 andrewlee94 Apr 9, 2024

Choose a reason for hiding this comment

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

I also just worked out a better solution to remove the unneeded multipliers entirely (so that they don't end up as unused variables).

)
)

Expand Down
Loading