Skip to content

Conversation

@vineetbansal
Copy link
Collaborator

Summary

Introduced a get_diffusion_coefficient method in the PHRQSol class.

Since pyEQL's Solution class was calculating this property itself (regardless of its engine), the way I'm gradually introducing this is to use an optional use_engine parameter in the following methods in the Solution class:

  • get_diffusion_coefficient / _get_diffusion_coefficient - This delegates to the new wrapper if True, with minimal handling of edge cases in the Solution class itself (default value etc).
  • _get_molar_conductivity - calls get_diffusion_coefficient with the same use_engine it got called with.
  • get_transport_number - calls _get_molar_conductivity with the same use_engine it got called with.

Behavior is unchanged of use_engine is False (the default).

If there's an alternate way to start adding this functionality, I'm happy to refactor.

I've introduced a new test module test_solution_pyeql_engine.py in parallel with test_solution.py, with the former building up to the latter as we add more functionality to the new wrapper and expose them through the Solution class.

The relevant diff between the two cases that we may want to discuss is below. Looks like with phreeqc, diffusion coefficient of H+ is unaffected by presence of NaCl, and significantly increasing concentration of NaCl (or KCl) has no affect on diffusion coefficient for their ions either.

Screenshot from 2026-01-16 17-09-23

Checklist

  • Google format doc strings added.
  • Code linted with ruff. (For guidance in fixing rule violates, see rule list)
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • I have run the tests locally and they passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants