CADET-Core
CADET-Core copied to clipboard
Add switch between pH or proton concentration
For models that include pH effects two use-cases can be interesting:
- Simulate the proton concentration (H+) as a component
- Simulate the pH (-log10(H+)) as a component
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:
- [ ] Decide on a good parameter name.
- [ ] My suggestion is ###_USE_PROTON_CONCENTRATION or ###_CALCULATE_PH_FROM_PROTON_CONCENTRATION for the toggle and ###_INCLUDE_PH_COMPONENT for an optional flag for the models that can be used with or without pH dependence entirely. This is only a first attempt and open to change.
- [ ] Extend the documentation
- [ ] GIEX
- [ ] Colloidal
- [ ] Unified HIC (if merged before this is merged)
- [ ] Extend the flux implementations
- [ ] GIEX
- [ ] Colloidal
- [ ] Unified HIC (if merged before this is merged)
- [ ] Extend the jacobian
- [ ] GIEX
- [ ] Colloidal
- [ ] Unified HIC (if merged before this is merged)