I think there is a bug with the alkalinity calculation in pyEQL.Solution. Example:
In [1]: import pyEQL as pyeql
In [2]: sol = pyeql.Solution.from_preset("seawater", engine="phreeqc2026", balance_charge="pH")
/Users/jonathan/Library/Python/3.12/lib/python/site-packages/pyEQL/solution.py:339: UserWarning: After initialization, the calculated solution pH of 8.220 does not match the specified pH of 8.099. This might be a result of erroneous input (e.g., specifying both pH and H+), or it can happen during from_dict / from_preset if you use a different engine than the one which generated the original dict.
warnings.warn(
In [3]: sol.alkalinity # this looks OK
Out[3]: <Quantity(117.4375715148465, 'milligram / liter')>
In [4]: sol.equilibrate(atmosphere=True)
In [5]: sol.alkalinity # too high!
Out[5]: <Quantity(753.3507804556849, 'milligram / liter')>
Otherwise, the solution and its properties seem reasonable, e.g., pH = 8.2.
As a workaround, I'd like to retrieve the alkalinity calculated by the phreeqc2026 (or phreeqc) engine, but I could not find a way to do that. I do see some discussion of retrieving alkalinity and other properties in issue #310, but it is not clear what are the low-level calls to do this.
I think there is a bug with the alkalinity calculation in pyEQL.Solution. Example:
Otherwise, the solution and its properties seem reasonable, e.g., pH = 8.2.
As a workaround, I'd like to retrieve the alkalinity calculated by the
phreeqc2026(orphreeqc) engine, but I could not find a way to do that. I do see some discussion of retrieving alkalinity and other properties in issue #310, but it is not clear what are the low-level calls to do this.