PhreeqcUsers Discussion Forum

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • USER_PUNCH/USER_GRAPH »
  • BASIC functions »
  • Ligand and metal speciation as a function of pH
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Ligand and metal speciation as a function of pH  (Read 758 times)

Juho.Yliniemi

  • Contributor
  • Posts: 9
Ligand and metal speciation as a function of pH
« on: August 07, 2020, 11:05:56 AM »
Hi,

I would like to plot a figure similar to the attached "Phthalate complexes.jpg". Figure is taken from: https://www.sciencedirect.com/science/article/pii/S0016703715002628#s0090

Let's say I want to see how the speciation of tartrate, Mg and Ca changes between pH 2 and 14. What would be a suitable code to do this? I know that there are templates for speciation figures in PhreePlot, but I would like to try Phreeqc first and play around with it.

Thanks in advance for suggestions.

BR,
Juho
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2483
Re: Ligand and metal speciation as a function of pH
« Reply #1 on: August 07, 2020, 05:38:19 PM »
This may be a bit much, but here is a rough version of what you describe for Tartrate. The minteq.v4.dat   has some data for "Tartarate", which I assume is Tartrate, including Ca and Mg pairs for Tartrate and HTartrate. You may want to make your own definitions Tartrate and the log Ks for species.

The pH adjustment uses a trick described in a footnote of Example 8 of the manual. The use of SELECTED_OUTPUT and USER_PUNCH to write the script used to scan pH is also demonstrated in Example 8.

USER_GRAPH 1 gives examples of how to graph some of the results.

Code: [Select]
PHASES
Fix_H+
    H+ = H+
    log_k     0
NaCl
    NaCl = Cl- + Na+
    log_k     -20
END
SOLUTION 1
    temp      25
    pH        7 charge
    units     mmol/kgw
    density   1
    Ca        1
    Mg        1
    Na        1
    Tartarate  10
    -water    1 # kg
SELECTED_OUTPUT 1
-file tartrate_input.pqi
-reset false
USER_PUNCH 1
10 FOR ph = 2 to 14 step 0.25
20 PUNCH "USE solution 1", EOL$
30 PUNCH "EQUILIBRIUM_PHASES 1", EOL$
40 PUNCH "NaCl 0 NaOH 10", EOL$
50 PUNCH "Fix_H+ ", -ph, " HCl 10", EOL$
60 PUNCH "END", EOL$
70 NEXT ph
END
SELECTED_OUTPUT 1
-active false
END
USER_GRAPH 1
    -headings               pH CaTartrate CaHTartarate+ MgTartrate MgHTartarate+
    -axis_titles            "pH" "Percent metal" ""
    -axis_scale x_axis      2 14 auto auto
    -axis_scale y_axis      auto 100 auto auto
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X -LA("H+")
20 GRAPH_Y 100*MOL("Ca(Tartarate)")/TOT("Ca")
30 GRAPH_Y 100*MOL("CaH(Tartarate)+")/TOT("Ca")
40 GRAPH_Y 100*MOL("Mg(Tartarate)")/TOT("Mg")
50 GRAPH_Y 100*MOL("MgH(Tartarate)+")/TOT("Mg")
  -end
END
INCLUDE$ tartrate_input.pqi
Logged

John Mahoney

  • Top Contributor
  • Posts: 81
Re: Ligand and metal speciation as a function of pH
« Reply #2 on: August 07, 2020, 06:11:35 PM »
Here is a PhreePlot script for those type of figure percentage speciation plots.  I waited to see what David Parkhurst came up with first.   One can also do log distributions by changing the include file. It will include all the tartarate species in the first diagram then the other three figure will include specific cations.  You will need to put in the concentrations (I just guessed at some). I attached four pdf files the script also makes png's but there is a problem uploading PNG files from PhreePlot to this site.  I used sulfuric acid for pH adjustment.  so in the metal files me-sulfate complexes will show up.  If you just want tartarate, say for simple proton speciation remove the other species from the solution.   
 
Code: [Select]

SPECIATION
  jobTitle                "Tartarate-H2O"   # aqueous, minerals and surface species
  database               "MINTEQ.v4.dat"
  calculationType                      species
  calculationMethod                    1
  mainSpecies                       Tartarate  Ca Mg Al
  xmin                                1.0
  xmax                                 9.0
  resolution                           250
 
PLOT
  plotTitle        "Speciation diagram for the system Tartarate-metals-H<sub>2</sub>O at 25°C <br> Tartarate 10 mmol/L Ca, Mg, Al all at 5 mmol/l, H2SO4 added"
  xtitle                               pH
  pymin                                0
  pymax                               100.0
  LineWidth                            0.9
   pdf true
   png true
tracksymbolcolor black 
numericTags <x> = -<x_axis>
CHEMISTRY
include 'ht1.inc'           # ht1.inc treats all Hfo-As  surface species as separate species for plotting
include 'speciesvsph.inc'

PHASES
Fix_H+
H+ = H+
log_k 0.0

SOLUTION 1
temperature  25
   pH        9
  Tartarate  10
  Ca 5
  Mg 5
  Al 5
 
END
USE solution 1
EQUILIBRIUM_PHASES 1
   Fix_H+ <x> H2SO4 10
     -force_equality true
   O2(g)  -10  0.5   # you might be able to eliminate this line
END
Logged

Juho.Yliniemi

  • Contributor
  • Posts: 9
Re: Ligand and metal speciation as a function of pH
« Reply #3 on: August 11, 2020, 07:51:03 AM »
Perfect! Thank you both. I knew you would come up with very elegant piece of code.

And yes - I will look for more log Ks for species from NIST metal complexes database. I'll play with Phreeqc first and then try PhreePlot.

Many thanks
Logged

AnnaJulIQ

  • Frequent Contributor
  • Posts: 17
Re: Ligand and metal speciation as a function of pH
« Reply #4 on: April 21, 2021, 10:35:14 PM »
Hello, I am trying to do the same situation: the recovery of metals such as zinc and manganese with some reducing agent, the different thing is that I am placing pyrolusite and zincite in phase equilibrium. I do not know what error could be made or what limitation there is in the program because no graph is generated

Thank you for your attention.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • USER_PUNCH/USER_GRAPH »
  • BASIC functions »
  • Ligand and metal speciation as a function of pH
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2