-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add example of debugging a structural singularity #114
Conversation
Thank you very much @Robbybp , this look great! Edit: Updated the discussion to better reflect both the BFB and MB models A couple of suggestions to help users understand what is going on:
Another way to think of this is in terms of the physical behaviour of the system. Consider a finite element in the system with solids flowing in and out of the element. The total flowrate of solids leaving nay element is defined by
If we look at the equations, we see that |
@andrewlee94 Thanks for the feedback! I will incorporate it when I get around to the other improvements I mentioned above. |
I've spent a couple of days now trying to update units in these property packages, but it may not be worth the effort. For one, we will not be able to get rid of all the unit inconsistency warnings, as many are due to accumulation equations (see Pyomo/pyomo#1790). Also, changing units of some variables (pressure and solid phase energies) makes the model numerically unstable, and significantly increases the amount of time we have to wait for the model to initialize. I seem to remember this being pretty annoying to fix the last time I had to update units for this model. For now, I'm planning to just leave the model as-is, disable the logger when running the structural diagnostics, and leave the remark about ignoring unit inconsistencies in the notebook. |
I've tried to remove this jargon. I still assume some mathematical knowledge (e.g. "Jacobian is singular"), but I think it is more manageable.
I've attempted to add this as well. The problem with particle porosity is that, as written, particle density and skeletal density are both uniquely determined by the material holdups, so there is no reason for the |
@MarcusHolly @bpaul4 @JavalVyas2000 Would you be able to find some time to review this and provide comments? This would probably also be useful for you to learn more about structural singularities and how they can occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos that I will fix when responding to other review comments.
idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb
Outdated
Show resolved
Hide resolved
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"2024-05-30 11:42:42 [WARNING] idaes.core.base.property_meta: DEPRECATED: The property name diffusion_comp in property metadata is\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these warnings be hidden, or resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the doc
notebook next time I'm on a computer with a working jupyter environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an old model, and only runs for the purpose of this example. It's probably not worth it to try to get rid of all of the warnings.
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,780 @@ | |||
############################################################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the gas-solid contactor files need to be duplicated here, or could they just be imported from https://github.com/IDAES/idaes-pse/tree/main/idaes/models_extra/gas_solid_contactors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files need to be duplicated. They are ported from IDAES 1.7, and include a "broken" version of the model, so they should not be distributed with the current version of IDAES. I also don't think it's a good idea (a) enforce that this notebook be run with IDAES 1.7 or (b) somehow import these file directly from 1.7.
...nostics/gas_solid_contactors/properties/methane_iron_OC_reduction/tests/test_CLC_gas_prop.py
Show resolved
Hide resolved
idaes_examples/mod/diagnostics/gas_solid_contactors/unit_models/moving_bed.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, very interesting and I enjoyed reading through it. Nice job, @Robbybp!
I will try to read through this today or tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a couple of minor typos
idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb
Outdated
Show resolved
Hide resolved
idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, apart from the first cell in structural_singularity.ipynb file. @Robbybp, another minor comment would be that the notebook are not ran but the markdown writeup is written such that it would click well with the outputs being shown. I would suggest running the notebook before we merge it.
idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb
Outdated
Show resolved
Hide resolved
Thanks for the reviews, all. I'll fix the couple remaining typos and update the auxiliary notebooks soon. We can merge then. |
@JavalVyas2000 I think I'll leave the base notebook with output cleared. The _doc notebook will have output displayed for easy viewing, so I don't think the base notebook needs this as well. |
@Robbybp yes its fine. Even if one of the notebooks is ran it should be fine. |
As far as I'm concerned, this is ready to merge once tests pass. |
Adds an end-to-end diagnostics example, fixing a real problem that we encountered a few years ago.
Some to-dos on this example:
ipopt.opt
file in the user's working directoryLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
📚 Documentation preview 📚: https://idaes-examples--114.org.readthedocs.build/en/114/