Vitens / phreeqpython

Object-oriented python wrapper for the VIPhreeqc module
Apache License 2.0
68 stars 19 forks source link

solution.equalize syntax #27

Closed uliw closed 1 year ago

uliw commented 1 year ago

in phreeqc I can write

 EQUILIBRIUM_PHASES
Goethite 0 1.04e-3

which states that Geothite should be in equilibrium but that at best only 1.04e-3 mol can be dissolved in order to attain equilibrium. I am unclear on how to achieve this with the solution.equalize method. Thx for any pointers!

AbelHeinsbroek commented 1 year ago

Hi,

The solution.equalize method has the following parameters:

phases, to_si=[0], in_phase=[10], with_chemical=[None]

The in_phase parameter describes the amount of phase available.

To achieve your example above you thus need to write:

sol.equalize("Geothite", 0, 1.04e-3)

which will generate the following block of PHREEQC code

USE SOLUTION 0
EQUILIBRIUM PHASES 1
Geothite 0 0.00104
SAVE SOLUTION 0
END

When in doubt you can always enable debug mode using pp.ip.debug=True to see what PhreeqPython is sending to PHREEQC.

uliw commented 1 year ago

ah ok!. pp.ip.debug is a godsend, Thx!