surfacecharging.ppi

# Example from Tony Appelo

selectedOutputLines auto             # pick up all the selected output lines from REACTION, not just the last one
mainLoop                  2          # on each PhreePlot iteration, start from PHREEQC simulation 2 and go to the end
loopfile loop.dat                    # use this file to define the number of iterations and a set of variables for each iteration

plottitle "Relative proton adsorption by goethite<br>as affected by the background electrolyte"
customXcolumn pH
points s_H+/(umol/m2)
lines s_H+/(umol/m2)
xaxislength 130 # mm
ytitle "H<sup>+</sup> adsorption (\mmol m<sup>-2</sup>)"  #\m is Greek mu
extraText extraTextsurfacecharging.dat 

changeColor   T
labelSize 2.5
legendtextsize 2.2
axistitlesize 3.5
axisnumbersize 3.5
pdf t

CHEMISTRY

# database wateq4f.dat
# Data from Rahnemaie et al., Journal of Colloid and Interface Science 297 (2006) 379-388
# and Journal of Colloid and Interface Science 293 (2006) 312-321.

SURFACE_MASTER_SPECIES
# Fe-O sites...
Goe_uni Goe_uniOH-0.5
# Fe3-O sites...
Goe_tri Goe_triO-0.5

SURFACE_SPECIES

## tri sites

Goe_triO-0.5 = Goe_triO-0.5
  -cd_music  0 0 0 0 0; log_k 0
Goe_triO-0.5 + H+ = Goe_triOH+0.5
  -cd_music  1  0  0 0 0; log_k 9
# Delta    z0^ z1^ z2^

# cations
Goe_triO-0.5 + Li+ = Goe_triOLi+0.5
  -cd_music  0 0.46 0.54 0 0; log_k 0.46

Goe_triO-0.5 + Na+ = Goe_triONa+0.5
  -cd_music  0 0.59 0.41 0 0; log_k -0.38

Goe_triO-0.5 + K+ = Goe_triOK+0.5
  -cd_music  0 0 1 0 0; log_k -0.38

2Goe_triO-0.5 + Mg+2 = (Goe_triO)2Mg+
  -cd_music  0.62 1.38 0 0 0; log_k 4.33

2Goe_triO-0.5 + Mg+2 + H2O = (Goe_triO)2MgOH + H+
  -cd_music  0.62 0.38 0 0 0; log_k -6.61

# anions
Goe_triO-0.5 + H+ + Cl- = Goe_triOHCl-0.5
  -cd_music  1 -1 0 0 0; log_k 8.47 #-0.53

Goe_triO-0.5 + H+ + NO3- = Goe_triOHNO3-0.5
  -cd_music  1 -0.7 -0.3 0 0; log_k 8.57 #-0.43


## uni sites

Goe_uniOH-0.5 = Goe_uniOH-0.5
  -cd_music  0 0 0 0 0; log_k 0

Goe_uniOH-0.5 + H+ = Goe_uniOH2+0.5
  -cd_music  1 0 0 0 0; log_k 9

# cations
Goe_uniOH-0.5 + Li+ = Goe_uniOHLi+0.5
  -cd_music  0 0.46 0.54 0 0; log_k 0.46

Goe_uniOH-0.5 + Na+ = Goe_uniOHNa+0.5
  -cd_music  0 0.59 0.41 0 0; log_k -0.38

Goe_uniOH-0.5 + K+ = Goe_uniOHK+0.5
  -cd_music  0 0 1 0 0; log_k -0.38

2Goe_uniOH-0.5 + Mg+2 = (Goe_uniOH)2Mg+
  -cd_music  0.62 1.38 0 0 0; log_k 4.33

2Goe_uniOH-0.5 + Mg+2 + H2O = (Goe_uniOH)2MgOH + H+
  -cd_music  0.62 0.38 0 0 0; log_k -6.61

# anions
Goe_uniOH-0.5 + H+ + Cl- = Goe_uniOH2Cl-0.5
  -cd_music  1 -1 0 0 0; log_k 8.47 #-0.53

Goe_uniOH-0.5 + H+ + NO3- = Goe_uniOH2NO3-0.5
  -cd_music  1 -0.7 -0.3 0 0; log_k 8.53 #-0.43
END

SOLUTION 1; pH 5; <cation> <concentration>; N(5) 200 charge; -pe 14 O2(g) -0.68
END

SURFACE 1
Goe_uniOHH0.5 3.45 98.6  16.52
#        sites/nm2^    m2/g^  g^
-sites_units density
# Goe_uni 0.009332 98.6  16.52 # mol sites
Goe_triOH0.5  2.7
# Goe_tri  0.007303
-cap       0.98  0.73
# layer capacitance 1^  2^
-cd_music
-equilibrate 1  # initial composition in equilibrium with solution 1
# -donnan 1e-10
END


SELECTED_OUTPUT; -file rahn.txt; -reset false;#  -high_pr

USER_PUNCH; -headings pH s_H+/(umol/m2) H+_sorbed # Goe_charge??/(eq/L) E.B./% sim_no
 1 if step_no = 0 then goto 100
10 s1 = mol("Goe_triOH+0.5") + mol("Goe_triOHCl-0.5")
20 s2 = mol("Goe_triOHNO3-0.5") - mol("(Goe_triO)2MgOH")
30 s3 = mol("Goe_uniOH2+0.5") + mol("Goe_uniOH2Cl-0.5")
40 s4 = mol("Goe_uniOH2NO3-0.5") - mol("(Goe_uniOH)2MgOH")
41 H_sor = s1 + s2 + s3 + s4
42 if step_no = 1 then put(H_sor, 1)
43 if step_no = 1 then put((mol("OH-") - mol("H+")), 2)
44  if step_no = 1 then put(sys("Na"), 3)
46  if step_no = 2 then put(sys("Na") - get(3), 3)
48 um_m2 = 1e6 / (98.6 * 16.52)
50 punch -la("H+"), (H_sor - get(1)) * um_m2, (mol("OH-") - mol("H+") - get(2) - get(3) * (step_no - 1)) * um_m2
100 end

USE solution 1
USE surface 1

REACTION 1
NaOH 3e-4
  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

END