Vitens / phreeqpython

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

IS and Phase assemblage #4

Closed DFHydrogeologist closed 5 years ago

DFHydrogeologist commented 5 years ago

Hi, when you calculate IS in phreeqc for a mineral you have the IS value, Log IAP and Log K. When you calculate the equilibrium phases you also have 'Moles in assemblage' (initial, final and delta). Do you know how to get those values in phreeqpython? could you help me? Thanks!

DFHydrogeologist commented 5 years ago

How could I get the Initial, Final and Delta mol transfer for diferent phases, not elements.

AbelHeinsbroek commented 5 years ago

Hi @DFHydrogeologist,

PhreeqPython/VIPHREEQC does not expose those values yet, that would require rewriting some of the core logic to use phases as separate objects, similar to what I already did with GAS_PHASES.

If you are in equilibrium with only a single phase however, the Initial Final and Delta mol transfers can be easily calculated.

Lets say you equalize an acidic solution with a 1 mol phase of Calcite (CaCO3):

pp = phreeqpython.PhreeqPython()
sol = pp.add_solution()
sol.equalize('Calcite', to_si=0, in_phase=1)

initial = 1 # 1 mol initial
delta = sol.total_element('Ca', 'mol') # moles of calcium dissolved
final = initial - delta # Calcite left in solid phase

This won't work of course when you equalize with multiple phases with similar molecular composition (for example Calcite and Argonite) at the same time

Let me know if this answers your question

DFHydrogeologist commented 5 years ago

Thanks! That´s what I´m doing.