Add switch between pH or proton concentration #239
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: