-
Notifications
You must be signed in to change notification settings - Fork 39
Adds multi-component partitioning to diafiltration #164
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
base: main
Are you sure you want to change the base?
Adds multi-component partitioning to diafiltration #164
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
==========================================
+ Coverage 85.83% 87.54% +1.71%
==========================================
Files 73 73
Lines 9508 9558 +50
Branches 1266 1276 +10
==========================================
+ Hits 8161 8368 +207
+ Misses 1143 985 -158
- Partials 204 205 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/prommis/nanofiltration/tests/test_diafiltration_two_salt.py
Outdated
Show resolved
Hide resolved
dallan-keylogic
left a comment
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 comments.
| "of the valid range for the diffusion coefficient approximations " | ||
| "(50-80 mM). The linearized approximation should be re-calculated." | ||
| ) | ||
|
|
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.
There's an old and little-used API for validation like this: the model_check method on the unit model block. It would probably be good to implement these checks by implementing a model_check method on your unit model.
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 was able to implement the analytical version of the equations that used this model check. These equations are not limited to a valid concentration range. Thus, the need for this model_check and isn't needed anymore (at least for now). I will keep this in mind if/when we return to any concentration-limited surrogates.
|
|
||
| Additionally, there are two required arguments, ``NFEx`` and ``NFEz``, to specfiy the desired number of finite elements across the width and thickness of the membrane, respectively. | ||
| There are two required arguments, ``NFE_module_length`` and ``NFE_membrane_thickness``, to specify the desired number of finite elements across the width and thickness of the membrane, respectively. There is one optional argument, ``charged_membrane``, which is a Boolean (default = ``True``) to specify if the membrane has a fixed surface charge. |
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.
Does the model structure change depending on whether the membrane has a fixed surface charge or is uncharged?
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.
It seems like the big thing that changes is which set of parameters is loaded in. Instead of using a Bool here, consider using an Enum like is done in the heat exchanger. That allows you to naturally extend the system if you want to try, for example, a third level of charge.
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.
Similarly, I think this comment can be moved to the back burner, as the analytical equations take the fixed membrane charge as an input and there are no longer different parameter sets to load in.
|
@bpaul4 @dallan-keylogic This PR is ready for another round of reviews. The codecov/patch test is now failing, with the uncovered file being |
|
@mollydougher yes I would suggest adding a test file to ensure that the flowsheet is covered and that it works as expected. Something simple, like smoke test the |
Summary/Motivation:
This PR extends the mathematical model in
diafiltration_two_salt.pyto incorporate the multi-component partitioning behavior at the solution-membrane interfaces. Additionally, this PR adds the functionality to account for a fixed surface charge on the membrane, which is typically seen in nanofiltration membranes such as NF270.Changes proposed in this PR:
Reviewer's checklist / merge requirements:
mainbranch on the PR author's forkLegal 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.md 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.