Skip to content
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

Retrieving phase dissolved or precipitated #43

Open
cevans3098 opened this issue Jun 25, 2024 · 0 comments
Open

Retrieving phase dissolved or precipitated #43

cevans3098 opened this issue Jun 25, 2024 · 0 comments

Comments

@cevans3098
Copy link

Curious if you could provide some insight on how you can retrieve the amount of moles of a phase dissolved or precipitated. I can see how to do this for individual elements or species, but it is unclear how to do this for a phase.

for example, given the code, where I have water with a pH of 1 and I add Cu metal to the solution. If I equalize to a SI =0 for all phases, how can I see how much of each phase exists in the solution?

from phreeqpython import PhreeqPython
from pathlib import Path


db_dir = Path('C:/Users/Craig/source/repos/eWasteSim/Database')
db = Path('minteq.dat')

pp = PhreeqPython(database= db, database_directory= db_dir, debug= False)

# this is for simulation purposes, in the model this will be a copy of the block from the left
solidsInlet = {
            'CuMetal'           : 10.0, 
            'Atacamite'         : 0.0, 
            'Cu(OH)2'           : 0.0, 
            'Cuprite'           : 0.0, 
            'Melanothallite'    : 0.0, 
            'Nantokite'         : 0.0, 
            'Tenorite'          : 0.0
}

# This is for simulations purposes, in the model this will be a copy of the block from above
liquidsInlet = solution = pp.add_solution({
                            'units' :   'mol/kgw',
                            'pH'    :   1,
                            'temp'  :   50.0,
                            'redox' :   'pe',
                            'Cu'    :   0,
                            'Cl'    :   '1 charge',
                            'O(0)'  :   0
})

liquidsOulet = liquidsInlet.copy()
liquidsOulet.change_temperature(60)

phasesInlet = [k for k in solidsInlet.keys()]
inletMoles = [v for v in solidsInlet.values()]
SI_Target = [0]*len(phasesInlet)

liquidsOulet.equalize(phases= phasesInlet, to_si= SI_Target, in_phase= inletMoles)

This can be more complicated when more than one metal exists and the pH is changing. Can you recommend a method to obtain the moles of a given phase exist?

Thanks

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

No branches or pull requests

1 participant