Skip to content

MSContactor Scaler#1681

Merged
dallan-keylogic merged 9 commits intoIDAES:scaling_toolboxfrom
dallan-keylogic:mscontactor_scaler
Oct 20, 2025
Merged

MSContactor Scaler#1681
dallan-keylogic merged 9 commits intoIDAES:scaling_toolboxfrom
dallan-keylogic:mscontactor_scaler

Conversation

@dallan-keylogic
Copy link
Contributor

Summary/Motivation:

Adds scaler object for MSContactor unit model.

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.

@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 95.98394% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.30%. Comparing base (0a8eed3) to head (37c857b).
⚠️ Report is 24 commits behind head on scaling_toolbox.

Files with missing lines Patch % Lines
idaes/models/unit_models/mscontactor.py 95.93% 2 Missing and 8 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           scaling_toolbox    #1681      +/-   ##
===================================================
+ Coverage            77.21%   77.30%   +0.08%     
===================================================
  Files                  395      395              
  Lines                63859    64106     +247     
  Branches             10606    10707     +101     
===================================================
+ Hits                 49306    49554     +248     
+ Misses               12065    12064       -1     
  Partials              2488     2488              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@MarcusHolly MarcusHolly left a comment

Choose a reason for hiding this comment

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

I agree with former comments that it'd be nice to flesh out the documentation we have on the current scaling tools, but I recognize that 's not as high priority as getting these things merged before the end of the month

# equality constraint involving geometry in the parent
# unit model.
"volume": DefaultScalingRecommendation.userInputRequired,
"volume_frac_stream": 2,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this 2 as opposed to 1 or 10? Just because the average volume fraction is 0.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. There will typically be two streams, and, without additional user information, we'd expect the volume to be evenly divided between streams.

# "stream_name_phase_fraction" Vars. Because we do not know the stream
# names a priori, this value is copied for those streams as part of
# the variable_scaling_routine (if the user hasn't already set a value)
"phase_fraction": 10,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above... why not 1 or 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started using 10 for phase fraction because it's what I was using for mole fraction. 2 might have been a better choice, but I put 10 elsewhere so I put it here to be consistent.

Copy link
Contributor

@Ryan-Hughes-8 Ryan-Hughes-8 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. I second Marcus's comment about improving the documents and/or examples once these scalers are all merged.

@dallan-keylogic dallan-keylogic merged commit 3ddc9c4 into IDAES:scaling_toolbox Oct 20, 2025
76 checks passed
@dallan-keylogic dallan-keylogic deleted the mscontactor_scaler branch October 20, 2025 17:08
dallan-keylogic added a commit that referenced this pull request Nov 6, 2025
* rescue mscontactor scaler from branch

* test geometry scaling

* dynamics scaling

* Energy balance testing

* test inherent reaction scaling

* final stage of tests

* run black

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants