-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conductivity discrepancy at high molality #20
Comments
Hello! Thanks for your kind words, glad to hear that you like the work we've done! In your phreeqpython example you use a different input then in your example given above, adding 2000/1000 instead of 1000/500 mol K and C, which obviously results in a different pH and conductivity! However, I think the main discrepancy is caused by a difference in database file. The import phreeqpython
pp = phreeqpython.PhreeqPython(database='/Users/Abel/pitzer.dat')
pp.ip.debug = True
solution = pp.add_solution({'units':'mmol/kgw', #set the units (moles per kg of water)
'pH': '10 charge',
'temp': 20,
'K':1000,
'C': 500
})
pH = solution.pH
cond = solution.sc
print('pH:',pH)
print('Cond:',cond) resulting in:
|
Thanks for your help here! And my mistake, I did try the correct values (1000/500), but accidentally copied the wrong values into the example above! Sorry for the confusion! I've redirected the database to point to the USGS repository, as you suggested, but I'm still somehow seeing the discrepancy. Just figured I'd respond here while I continue debugging in case you have any suggestions. Thanks again! |
Ok, I just wanted to follow up and say that I'm still thoroughly stuck on this. I'm able to call different databases (SIT, minteq, etc.) from the USGS folder to confirm that the database loading function is working properly. BUT, the following function in python which ostensibly should be using pitzer:
results in:
Note that the pH is exactly the same as yours, but the conductivity is still quite off. Do you have any further suggestions here? If you run phreeqc.dat, what conductivity do you get for the same inputs? (I get: pH: 11.70069773360222 |
I see that you use an older version of Phreeqc (3.6.2). What happens if you try the example with the most recent |
Let me know what the outcome is for you! And thank you again for your help with this - it would be a great resource if we can get this to work properly. |
I get the proper results with your databases. I've updated the database files supplied with phreeqpython to the latest versions from USGS and added a case specific test: phreeqpython/tests/test_phreeqpython.py Line 204 in 00a4248
The test seems to run ok on all platforms, including windows: [00:00:26] %PYTHON%/python.exe -m nose -v
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test10_use_non_default_database_directory ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test11_pitzer ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test1_basiscs ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test2_solution_functions ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test3_mixing ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test4_solution_listing ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test5_addition ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test6_misc ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test7_dump_and_load ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test8_raw_solutions ... ok
[00:00:27] tests.test_phreeqpython.TestPhreeqPython.test9_gas_phases ... ok
[00:00:27] tests.test_utility.TestUtility.test_00_convert_units ... ok Would you mind installing the |
Fantastic! I just ran this branch and got the exact same values as you! I'm not sure what was going on there, but this seems to have addressed it! Thank you! Do you think you'll update the master? |
I think the problem stems from PhreeqPython originally using an old version of IPhreeqc (3.3.x), which may have had some Pitzer related bugs. The branch you tested uses the latest version of IPhreeqc (3.7.3) and Pitzer.dat At my company we only use PhreeqPython for calculating drinking water at low conductivity so have never noticed this problem. I need to run a few more integration tests, but given that the new branch passes all unit tests on all platforms I am fairly sure I can safely replace the master and PyPy package soon. |
Sounds good - thanks for working through this. I'm working on the branch now, but will update to master once you've replaced it. Much appreciated! |
Hey there - just following up on this thread and wondering if you all pushed this update to the master? My colleague just pip (re)installed PhreeqPython and seems to be getting different outputs for the same underlying code as me. |
Hi there,
First of all, thank you so much for this fantastic tool! It's really helping us in our research.
Second, I wanted to see if you had a solution to this issue I'm seeing:
I would like to find the conductivity of high molality solution (1 - 3 molal) for potassium carbonate solution. When I use PHREEQC Interactive (the USGS software) directly I get results that match chemistry handbooks. So, for example, entering this input and running the Pitzer model:
Gives 73.3 mS/cm and pH = 11.79
BUT, when I use your phreeqpy function
I get 50.5 mS/cm and the same pH as above (11.79)
There is a substantial difference in conductivity and I'd really like to be able to reconcile that. The phreeqpy function is outputting a lower conductivity than physical measurements and than PHREEQC. Do you have any suggestions for why this may be happening? Note that at molality below ~0.5, I don't see the discrepancy anymore.
Thanks so much, and again, really appreciate this tool!
The text was updated successfully, but these errors were encountered: