pcsorptionmetals1.ppi

# plots % sorption vs pH curve for a variety of metals in the presence of Hfo and CO2(g) in 0.1M NaNO3
SPECIATION
  calculationType                      "custom"
  calculationMethod                    1
  xmin                                 -10                 # range of logH
  xmax                                 -3

  loopMin                              -3                  # each curve is for a different total metal concn (= z-loop value)
  loopMax                              -3                  # (here only 1 set of curves but the capability is there to do more)
  loopInt                              0.0
  loopLogVar                           1

  resolution                           100                 # this controls the smoothness of the output
  numericTags                          <pco2> = -3.5       # change this to change the log10(PCO2(g))

PLOT
  plotTitle                            "%sorbed vs pH curves: 8 elements"
  xtitle                               "pH"
  ytitle                               "%sorbed"
  lines                                Pb As Ni Zn Cd Cu Ca Mg
  lineWidth                            0.4
  labelSize                            2.0
  legendTextSize                       2                   # size of text in the legend which is placed by default to the right
  customXcolumn                        "pH"                #   ... change position of legend with <legend> in extratext file.
  extratext                            extratextmetals1.dat  # additional text to be added to the plot

CHEMISTRY

# all in one simulation

include hfo.inc                                            # standard Hfo block (consistent with Dzombak and Morel's HFO)

PHASES
Fix_H+
   H+ = H+
   log_k  0.0

SOLUTION 1
   -units mol/kgw
   pH     3.0
   Pb     <loop>                                           # equimolar total concns
   As     <loop>
   Ni     <loop>
   Zn     <loop>
   Cd     <loop>
   Cu     <loop>
   Ca     <loop>
   Mg     <loop>

   Fe     1e-2
   Na     0.1                                              # background electrolyte
   N(5)   0.1  charge

SELECTED_OUTPUT
  -high_precision TRUE
  -reset FALSE

USER_PUNCH
-headings pH Pb As Ni Zn Cd Cu Ca Mg                       # this determines the order of the curves
1 Pb = 0
2 As = 0
3 Ni= 0
4 Cd = 0
5 Zn = 0
6 Cu = 0
7 Ca = 0
8 Mg = 0
10 if (SYS("Pb")<=0) THEN 20
11 Pb = 100*SURF("Pb","Hfo")/SYS("Pb")
20 if (SYS("As")<=0) THEN 30
21 As = 100*SURF("As","Hfo")/SYS("As")
30 if (SYS("Ni")<=0) THEN 40
31 Ni = 100*SURF("Ni","Hfo")/SYS("Ni")
40 if (SYS("Cd")<=0) THEN 50
41 Zn = 100*SURF("Zn","Hfo")/SYS("Zn")
50 if (SYS("Cd")<=0) THEN 60
51 Cd = 100*SURF("Cd","Hfo")/SYS("Cd")
60 if (SYS("Cu")<=0) THEN 70
61 Cu = 100*SURF("Cu","Hfo")/SYS("Cu")
70 if (SYS("Ca")<=0) THEN 80
71 Ca = 100*SURF("Ca","Hfo")/SYS("Ca")
80 if (SYS("Mg")<=0) THEN 90
81 Mg = 100*SURF("Mg","Hfo")/SYS("Mg")
90 punch -la("H+"), Pb, As, Ni, Zn, Cd, Cu, Ca, Mg

EQUILIBRIUM_PHASES 1
   Fix_H+   <x_axis>   NaOH    10.0
     -force_equality true
   O2(g)  -0.67                                            # atmospheric
   CO2(g) <pco2>                                           # defined as a tag above (albeit a constant)
   Fe(OH)3(a)  0  0                                        # ppt but do not dissolve
END