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 method to ED1d for calculating membrane resistance as a function of ion concentration #1522

Merged
merged 18 commits into from
Dec 18, 2024

Conversation

lbibl
Copy link
Contributor

@lbibl lbibl commented Nov 12, 2024

Fixes/Resolves:

(replace this with the issue # fixed or resolved, if no issue exists then a brief statement of what this PR does)

Summary/Motivation:

  • Add method to ED1d for calculating membrane resistance as a function of ion concentration
  • Adapt all tests and relevant flowsheet to this change.
  • Minor improvement on the single-pass Ed flowsheet for stability.

Changes proposed in this PR:

  • As above.

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.

@lbibl lbibl changed the title Memb resis Add method to ED1d for calculating membrane resistance as a function of ion concentration Nov 12, 2024
@lbibl lbibl marked this pull request as ready for review November 13, 2024 18:24
@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Nov 14, 2024
Copy link
Contributor

@johnson12742 johnson12742 left a comment

Choose a reason for hiding this comment

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

Which references talks about the membrane resistance as a function of ion concentration? I quickly glanced through a few and didn't find one that talks about this function.

I was recommended the Galama paper for it (https://doi.org/10.1016/j.memsci.2014.05.046)
Also, this is an empirical relationship (is that correct?). Maybe make a note of that.

Everything else looks good.

@hunterbarber
Copy link
Contributor

@lbibl Can you clarify on the meaning of the spacer_conductivity_coefficient? I'm a little confused while going through the review.

@lbibl
Copy link
Contributor Author

lbibl commented Nov 25, 2024

@lbibl Can you clarify on the meaning of the spacer_conductivity_coefficient? I'm a little confused while going through the review.

Added notes in doc: "We used a coefficient multiplied by the solution conductance, denoted by :math:\sigma, to account for the spacer's conductance shadowing effect." There are cases where the shadowing effect is treated as a coefficient to resistance rather than conductance. This would be a clearer naming with the added notation.

@lbibl
Copy link
Contributor Author

lbibl commented Nov 25, 2024

Which references talks about the membrane resistance as a function of ion concentration? I quickly glanced through a few and didn't find one that talks about this function.

I was recommended the Galama paper for it (https://doi.org/10.1016/j.memsci.2014.05.046) Also, this is an empirical relationship (is that correct?). Maybe make a note of that.

Everything else looks good.

Updates on references underway.

Copy link
Contributor

@hunterbarber hunterbarber left a comment

Choose a reason for hiding this comment

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

Only minor comments that should be considered before merging.

watertap/unit_models/electrodialysis_1D.py Show resolved Hide resolved
watertap/unit_models/electrodialysis_1D.py Show resolved Hide resolved
watertap/unit_models/electrodialysis_1D.py Outdated Show resolved Hide resolved
watertap/unit_models/tests/test_electrodialysis_1D.py Outdated Show resolved Hide resolved
watertap/unit_models/tests/test_electrodialysis_1D.py Outdated Show resolved Hide resolved
watertap/unit_models/tests/test_electrodialysis_1D.py Outdated Show resolved Hide resolved
@lbibl
Copy link
Contributor Author

lbibl commented Dec 13, 2024

@hunterbarber changing "Watt" to"W" is causing several test failing because that string was used as keys in many tests consistently. I consider this change very trivial and not worthy of the time to go through so I am dismissing it. If you insist, please feel free to open another PR for changes.

@hunterbarber
Copy link
Contributor

@hunterbarber changing "Watt" to"W" is causing several test failing because that string was used as keys in many tests consistently. I consider this change very trivial and not worthy of the time to go through so I am dismissing it. If you insist, please feel free to open another PR for changes.

This string has already been changed in this PR though, meaning the repetitive checks for it were already revised once. I don't think it should hold up this being merged, but if the typo and consistency change from "consumption(Watt)" to "consumption (W)" doesn't happen in this PR, I bet it won't ever get corrected.

@lbibl
Copy link
Contributor Author

lbibl commented Dec 13, 2024

@hunterbarber changing "Watt" to"W" is causing several test failing because that string was used as keys in many tests consistently. I consider this change very trivial and not worthy of the time to go through so I am dismissing it. If you insist, please feel free to open another PR for changes.

This string has already been changed in this PR though, meaning the repetitive checks for it were already revised once. I don't think it should hold up this being merged, but if the typo and consistency change from "consumption(Watt)" to "consumption (W)" doesn't happen in this PR, I bet it won't ever get corrected.

No it's not changed now. I had to push it back. are you referring "Watt" as a typo but it is not?

@hunterbarber
Copy link
Contributor

@hunterbarber changing "Watt" to"W" is causing several test failing because that string was used as keys in many tests consistently. I consider this change very trivial and not worthy of the time to go through so I am dismissing it. If you insist, please feel free to open another PR for changes.

This string has already been changed in this PR though, meaning the repetitive checks for it were already revised once. I don't think it should hold up this being merged, but if the typo and consistency change from "consumption(Watt)" to "consumption (W)" doesn't happen in this PR, I bet it won't ever get corrected.

No it's not changed now. I had to push it back. are you referring "Watt" as a typo but it is not?

Looking at the code difference, it looks like the addition of units into the print strings within the var dictionary was a change in this PR. The lack of a space in the spring being the typo, and using Watt here and kW, h, m, etc. elsewhere as the inconsistency.

@lbibl lbibl requested a review from hunterbarber December 15, 2024 21:42
@lbianchi-lbl lbianchi-lbl enabled auto-merge (squash) December 18, 2024 13:25
@lbianchi-lbl lbianchi-lbl merged commit 3d2c4a0 into watertap-org:main Dec 18, 2024
19 checks passed
lbianchi-lbl pushed a commit that referenced this pull request Dec 18, 2024
…of ion concentration (#1522)

* add new methods for resistance calc

* update doc to reflect the changes

* format

* changes on the ui.py and format of rst

* format

* debug macos err

* format

* debug err in macos x86

* debug err in macos x86

* debug err in macos x86

* debug err in macos x86

* typos, single-pass ed flowsheet refined for stability across os

* notations on doc, citation updates

* format

* rename a var in rst

* rename var; typo corr

* blk

(cherry picked from commit 3d2c4a0)
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants