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

Add diagnostics to Gibbs reactor tests #1305

Merged
merged 39 commits into from
Feb 22, 2024

Conversation

andrewlee94
Copy link
Member

@andrewlee94 andrewlee94 commented Dec 15, 2023

Requires #1284

Summary/Motivation:

Adds tests to assert no structural or numerical issues are present in Gibbs reactor tests.

Changes proposed in this PR:

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.

@andrewlee94 andrewlee94 added Priority:Normal Normal Priority Issue or PR testing Issues dealing with testing of code unit models Issues dealing with the unit model libraries labels Dec 15, 2023
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.58%. Comparing base (ff8c0be) to head (2f9fa7f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1305      +/-   ##
==========================================
- Coverage   77.58%   77.58%   -0.01%     
==========================================
  Files         391      391              
  Lines       64288    64288              
  Branches    11815    11815              
==========================================
- Hits        49881    49878       -3     
- Misses      11825    11829       +4     
+ Partials     2582     2581       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrewlee94 andrewlee94 marked this pull request as draft December 18, 2023 13:54
@andrewlee94 andrewlee94 changed the title Add diagnostics to Gibbs reactor tests [WIP] Add diagnostics to Gibbs reactor tests Dec 19, 2023
@andrewlee94 andrewlee94 marked this pull request as ready for review February 22, 2024 16:00
@andrewlee94 andrewlee94 changed the title [WIP] Add diagnostics to Gibbs reactor tests Add diagnostics to Gibbs reactor tests Feb 22, 2024
Copy link
Contributor

@bpaul4 bpaul4 left a comment

Choose a reason for hiding this comment

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

Looks good overall, I spotted a couple typos and have one question about the solution checks.

idaes/models/unit_models/tests/test_gibbs.py Outdated Show resolved Hide resolved
idaes/models/unit_models/tests/test_gibbs.py Outdated Show resolved Hide resolved
assert pytest.approx(250.06, abs=1e-1) == value(
methane.fs.unit.outlet.flow_mol[0]
)
assert pytest.approx(0.0, abs=1e-4) == value(
methane.fs.unit.outlet.mole_frac_comp[0, "CH4"]
)
assert pytest.approx(0.103863, abs=1e-4) == value(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did these values change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added scaling to satisfy the numerical diagnostics tests. I don;t recall the values changed that significantly.

Copy link
Contributor

@agarciadiego agarciadiego left a comment

Choose a reason for hiding this comment

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

LGTM. Had the same question about the change in values but that has been asnwered

@andrewlee94 andrewlee94 enabled auto-merge (squash) February 22, 2024 19:01
@andrewlee94 andrewlee94 merged commit 42b4634 into IDAES:main Feb 22, 2024
39 checks passed
@andrewlee94 andrewlee94 deleted the gibbs_reactor_diagnostics branch February 22, 2024 21:16
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 testing Issues dealing with testing of code unit models Issues dealing with the unit model libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants