Calculation of pH for systems in equilibrium with atmospheric carbon dioxide#6
Calculation of pH for systems in equilibrium with atmospheric carbon dioxide#6mhvwerts wants to merge 6 commits intornelsonchem:masterfrom mhvwerts:air_equilibrated
Conversation
|
@mhvwerts Thanks so much for this very detailed PR! I have been looking it over these past couple of days, and this led to a couple of big picture thoughts...
So anyway, I tried to do this using a different strategy -- a new |
rnelsonchem
left a comment
There was a problem hiding this comment.
Some file-specific comments on this PR
|
Your new #7 indeed provides a superior method for taking into account a solution in equilibrium with a gas-phase reservoir for a species. I will use that from now on, and we may close this particular pull request. |
Hello Ryan,
As discussed, here is the code for calculation of pH of a system in equilibrium with ambient air using pHcalc.
It takes the form of a subclass of
System, calledSystemAirEquilibrated, which adds the necessary carbon dioxide/carbonic acid equilibria. The central property is the total 'dissolved inorganic carbon' (DIC), which is adjusted by the algorithm such that the dissolved CO2 is at equilibrium with the CO2 in the air, recalculating pH in the process.I have made initial docstrings and added further details as comments in the code. There is also a test/example script
test_air_equilibrated.py(reminding us that atmospheric CO2 levels are rising). I will be happy to update the documentation inREADME.rstlater on.All new code is in separate files. I did make some very minor edits to the core
pHcalc.pybut these are essentially cosmetic. As you may notice, I anticipated the re-naming ofAcidandInertbut kept this compatible with the existing names.Best wishes,
Martin