Skip to content

Discrepancy between SIs and SIs from 'get_selected_output'  #21

@jeremyfirst22

Description

@jeremyfirst22

Hello,

There seems to be a discrepancy between the saturation indices returned by Solution.si(), and those returned by PhreeqPython.ip.get_selected_output.

If I run:

from phreeqpython import PhreeqPython
pp = PhreeqPython("/hpcdata/fijmjl/iphreeqc-3.7.3-15968/database/phreeqc.dat", debug=True)
soln = pp.add_solution(        
    {    
        "units": "ppm",
        "Mg": 516, 
        "Mn(2)": 2.6, 
    }, 
)
minerals = ["Hausmannite", "Manganite", "Pyrochroite", "Pyrolusite"]
{k: soln.si(k) for k in minerals}

I get the following SIs:

SOLUTION 0
  units ppm
  Mg 516
  Mn(2) 2.6
SAVE SOLUTION 0
END 

{'Hausmannite': -18.90189294986606,
 'Manganite': -8.963964316622022,
 'Pyrochroite': -5.823964316622019,
 'Pyrolusite': -18.003964316622024}

But using the selected output array:

from phreeqpython import PhreeqPython
pp = PhreeqPython("/hpcdata/fijmjl/iphreeqc-3.7.3-15968/database/phreeqc.dat", debug=True)
phases = soln.phases.keys()
pp.ip.run_string(
"""
SOLUTION 1
  units ppm
  Mg 516
  Mn(2) 2.6
SAVE SOLUTION 2

SELECTED_OUTPUT 1
-file selected_output.sel
-reset false
-saturation_indices Hausmannite Manganite Pyrochroite Pyrolusite
END
"""
)
{k: v for k, v in zip(*pp.ip.get_selected_output_array())}

I get different SIs for the minerals:

SOLUTION 1
  units ppm
  Mg 516
  Mn(2) 2.6
SAVE SOLUTION 2

SELECTED_OUTPUT 1
-file selected_output.sel
-reset false
-saturation_indices Hausmannite Manganite Pyrochroite Pyrolusite
END

{'si_Hausmannite': -10.902521584503347,
 'si_Manganite': -4.964278633940662,
 'si_Pyrochroite': -5.824278633940661,
 'si_Pyrolusite': -10.004435792599985}

Worth noting that the latter results match what I get from running the phreeqc desktop application. Any ideas on what might be going on?

Thank you in advance for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions