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

NGFC Flowsheet Improvements #105

Merged
merged 9 commits into from
Apr 25, 2024
Merged

NGFC Flowsheet Improvements #105

merged 9 commits into from
Apr 25, 2024

Conversation

AlexNoring
Copy link
Contributor

@AlexNoring AlexNoring commented Apr 19, 2024

NGFC Flowsheet Improvements

Updates to the NGFC flowsheet to fix initialization failure

  • Appropriate solver options are now being used for flowsheet initialization
  • Improved model scaling
  • Adjusted the initialization/solve sequence for the main flowsheet and the solver options for the final solve
  • Reformer and power island sections can be now be build separately for debugging

Legal Acknowledgement

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

I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
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.

📚 Documentation preview 📚: https://idaes-examples--105.org.readthedocs.build/en/105/

@AlexNoring AlexNoring added Priority:Normal Normal Priority Issue or PR bug Something isn't working labels Apr 19, 2024
Copy link
Member

@andrewlee94 andrewlee94 left a comment

Choose a reason for hiding this comment

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

I don't see any major issues, however we do need to resolve the testing issue due to PySimpleGUI.

@@ -725,7 +726,7 @@ def set_reformer_inputs(m):
m.fs.reformer_bypass.split_fraction[0, "bypass_outlet"].fix(0.6)

# air to reformer
m.fs.air_compressor_s1.inlet.flow_mol[0] == 1332.9 # mol/s
m.fs.air_compressor_s1.inlet.flow_mol[0] = 1332.9 # mol/s
Copy link
Member

Choose a reason for hiding this comment

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

Minor comment for the future - using var.set_value() is probably the better way to do this, as it avoid a number of potential issues.

for t, c in unit.isentropic.items():
iscale.constraint_scaling_transform(c, 1e-1, overwrite=False)

# pressure changer
if hasattr(unit, "isentropic_energy_balance"):
Copy link
Member

Choose a reason for hiding this comment

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

Probably outside the scope of this PR, but are all these 'if' checks required? They make sense for a generic unit model where users have options over what terms might be included, but for a flowsheet example I would have thought most of these would be concretely defined (i.e. you know if it is here or not).

" \"nlp_scaling_method\": \"user-scaling\"\n",
"}\n",
"\n",
"# suppress warnings about missing scaling factors\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor comment, should we have this warnings suppressed?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should suppress all these warnings in examples.

"scaling_log.setLevel(idaeslog.ERROR)\n",
"\n",
"# suppress NL writer warnings\n",
"nl_writer_log = logging.getLogger(\"pyomo.repn.plugins.nl_writer\")\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, here as well should we this warnings suppressed?

@JavalVyas2000
Copy link
Contributor

@andrewlee94 should we move this example from archive to docs?

@andrewlee94
Copy link
Member

@JavalVyas2000 I believe it was on the list of examples Miguel suggested we make public so the answer is yes (assuming we can get it working reliably). I'll leave it up to you and @AlexNoring as to whether that should be done in this PR or not - note that if we do that we should add more diagnostics checks as well (assert_no_strucutral_issues and assert_no_numerical_issues) to make sure the flowsheet is well posed and robust.

@AlexNoring
Copy link
Contributor Author

Let's leave moving this example to docs for a separate PR.

@ksbeattie ksbeattie enabled auto-merge (squash) April 25, 2024 18:27
@ksbeattie ksbeattie merged commit b68cb08 into IDAES:main Apr 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants