Add switch between pH or proton concentration#239
Open
ronald-jaepel wants to merge 1 commit intomasterfrom
Open
Add switch between pH or proton concentration#239ronald-jaepel wants to merge 1 commit intomasterfrom
ronald-jaepel wants to merge 1 commit intomasterfrom
Conversation
…tration Add the ###_USE_PROTON_CONCENTRATION flag, which if True sets component 1 to proton concentration and if False sets component 1 to pH (= -log10(proton concentration)). For the colloidal binding, which can be used with or without pH effects entirely: Rename the COL_USE_PH flag to COL_INCLUDE_PH, which if True treats component 1 as either pH or proton concentration and if False treats component 1 as a regular component.
0d44fd1 to
17b3179
Compare
Contributor
|
The first option could benefit from component-specific solver tolerances (to be implemented...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For models that include pH effects two use-cases can be interesting:
Option 1 is thermodynamically correct, but could lead to numerical precision problems if a pH of 10-14 is to be simulated as the concentration of H+ would be as low as 1e-14.
Option 2 leads to incorrect mixing results (a 1:1 mixture of pH 1 and pH 9 is not pH 5 but ~ pH 1.3) but is numerically easier and can still be useful if experiments with a constant pH are simulated.
As the CADET philosophy so far has been to give the user the choice, the suggestion is to add a switch parameter that decides if the model uses proton concentration or pH.
This PR is a starting point for that addition.
ToDos: