PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Surface Complexation »
  • titration of clay minerals
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: titration of clay minerals  (Read 3053 times)

nvgroeni

  • Contributor
  • Posts: 3
titration of clay minerals
« on: 09/05/17 10:48 »
Dear PHREEQC users,

I'm currently trying to setup a Phreeqc file to be able to fit the data I got for the titration of a smectite. I would like to have a good spread of the pH and I based myself on one of the examples to write the file. Unfortunately I can't make it work.

Here is a copy of my file, can you let me know what I did wrong?

Thanks!
------

SOLUTION 1
Ca   0.001
Cl   0.002
-units mol/kgw
pe 0.2

SOLUTION_SPECIES
Ca+2 + 2H2O = Ca(OH)2 + 2H+
-log_k -24.17

EXCHANGE 1
X- 0.0002625

EXCHANGE_SPECIES
H+ + X- = HX
-log_k   1.0
-gamma   9.0   0

     
SURFACE_MASTER_SPECIES
    Y Y-0.5   
   

SURFACE 1
    -sites DENSITY
    Y-0.5    4         18.92     0.15
        -capacitance 1.17   1.17
    -cd_music


SURFACE_SPECIES
Y-0.5 = Y-0.5
    log_k     0
    -cd_music -0.5 0 0 0 0

 H+ + Y-0.5 = YH+0.5
    log_k     4.5
    -cd_music 0.5 0 0 0 0
   
Cl- + H+ + Y-0.5   = YHCl-0.5
    log_k     -8
    -cd_music 0.5 -1 0 0 0
   
Ca+2 + 2Y-0.5   = (Y)2Ca+
    log_k     15
    -cd_music -1 2 0 0 0
   

# REACTION
       # Ca(OH)2 2; 0.1 mmol in 20 steps
 

 

  PHASES
       Fix_pH
       H+ = H+
     log_k 0.0
    CaCl2     
      CaCl2 = Ca+2 + 2Cl-; -log_k -20   

   
     
     SELECTED_OUTPUT
     -file titration Syn
     -reset false

 
  USER_PUNCH
   10 FOR i = 4 TO 10 STEP 0.2
   20   punch EOL$ + 'USE solution 1'
   30   punch EOL$ + 'EQUILIBRIUM_PHASES 1'
   40   punch EOL$ + 'CaCl2'
   50   punch EOL$ + 'exchange 1'
   60   punch EOL$ + 'surface 1'
   70   punch EOL$ + ' Fix_pH ' + TRIM(STR$(-i)) + 'Ca(OH)2 10'
   80   punch EOL$ + 'END'
  90 NEXT i
 END
 
 PRINT     
     -reset false
     -echo_input true
     -selected_out false


 USER_GRAPH 1 H+sorption on Syn
      -headings CaOH Ca(OH)2 YH+0.5 Y2Ca HX
      -axis_titles pH "sorbed H+"
      # -axis_scale y_axis -10 -3
     -axis_scale x_axis 4 10
      -initial_solutions true
      10 pH = -la("H+")
      20 plot_xy pH, mol("CaOH+"), color = red
      30 plot_xy pH, mol("Ca(OH)2"), color = green
      40 plot_xy pH, mol("YH+0.5"), color = Blue
      50 plot_xy pH, mol("(Y)2Ca+"), color = orange
      60 plot_xy pH, mol("HX"), color = black
 END
   
   
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4034
Re: titration of clay minerals
« Reply #1 on: 09/05/17 15:35 »
For starters, the USER_PUNCH block does not look right.

The result should be more like perhaps be

USE solution 1
EQUILIBRIUM_PHASES 1
CaCl2
Fix_pH  -7 Ca(OH)2 10'
USE exchange 1
USE surface 1
END
Logged

cayako

  • Contributor
  • Posts: 1
Re: titration of clay minerals
« Reply #2 on: 01/02/23 23:44 »
It looks like your Phreeqc input file is mostly correct, but there are a few changes you can make to improve its functionality:

1. Replace "CaOH" with "Ca(OH)2" in line 20 of the USER_GRAPH block.
2. In the PRINT block, add "END" after the "-selected_out false" line.
3. Change the "log_k" value for the "Fix_pH" phase to "-log_k 14".

Here is the corrected code:
Code: [Select]
SOLUTION 1
Ca   0.001
Cl   0.002
-units mol/kgw
pe 0.2

SOLUTION_SPECIES
Ca+2 + 2H2O = Ca(OH)2 + 2H+
-log_k -24.17

EXCHANGE 1
X- 0.0002625

EXCHANGE_SPECIES
H+ + X- = HX
-log_k   1.0
-gamma   9.0   0

     
SURFACE_MASTER_SPECIES
    Y Y-0.5   
   

SURFACE 1
    -sites DENSITY
    Y-0.5    4         18.92     0.15
        -capacitance 1.17   1.17
    -cd_music


SURFACE_SPECIES
Y-0.5 = Y-0.5
    log_k     0
    -cd_music -0.5 0 0 0 0

 H+ + Y-0.5 = YH+0.5
    log_k     4.5
    -cd_music 0.5 0 0 0 0
   
Cl- + H+ + Y-0.5   = YHCl-0.5
    log_k     -8
    -cd_music 0.5 -1 0 0 0
   
Ca+2 + 2Y-0.5   = (Y)2Ca+
    log_k     15
    -cd_music -1 2 0 0 0
   

# REACTION
       # Ca(OH)2 2; 0.1 mmol in 20 steps
 

 

  PHASES
       Fix_pH
       H+ = H+
     -log_k 14.0
    CaCl2     
      CaCl2 = Ca+2 + 2Cl-; -log_k -20   

   
     
     SELECTED_OUTPUT
     -file titration Syn
     -reset false

 
  USER_PUNCH
   10 FOR i = 4 TO 10 STEP 0.2
   20   punch EOL$ + 'USE solution 1'
   30   punch EOL$ + 'EQUILIBRIUM_PHASES 1'
   40   punch EOL$ + 'CaCl2'
   50   punch EOL$ + 'exchange 1'
   60   punch EOL$ + 'surface 1'
   70   punch EOL$ + ' Fix_pH ' + TRIM(STR$(-i)) + 'Ca(OH)2 10'
   80   punch EOL$ + 'END'
  90 NEXT i
 END
 
 PRINT     
     -reset false
     -echo_input true
     -selected_out false
     END
     
 USER_GRAPH 1 H+s
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4034
Re: titration of clay minerals
« Reply #3 on: 02/02/23 04:20 »
There are a lot of issues with these files. Attention needs to be paid to the initial condition of the exchanger and surface. The surface should probably be defined in equilibrium with a solution. I've assumed the initial surface condition is in equilibrium with SOLUTION 1. It is probably also a good idea to use -donnan to balance the surface charge. Similarly, I have assumed the initial condition of the exchanger is that which would be in equilibrium with solution 1.

I have changed the script to write a file to scan a range of pH and then use INCLUDE$ to run that file. I have plotted only the changes in the surface composition (given the definitions of surface species). You can add additional plots to consider the compositions of the solution and the exchanger.

The file works, although I am not sure it is exactly the conceptual model that the original post intended. Hopefully, it is a good enough to show how the calculations work.

Code: [Select]
PHASES
Fix_pH
    H+ = H+
    log_k     0
CaCl2
    CaCl2 = Ca+2 + 2Cl-
    log_k     -20
SOLUTION_SPECIES
    Ca+2 + 2H2O = Ca(OH)2 + 2H+
    log_k     -24.17
SURFACE_MASTER_SPECIES
    Y             Y-0.5       
SURFACE_SPECIES
Y-0.5 = Y-0.5
    log_k     0
    -cd_music -0.5 0 0 0 0
H+ + Y-0.5 = YH+0.5
    log_k     4.5
    -cd_music 0.5 0 0 0 0
Cl- + H+ + Y-0.5 = YHCl-0.5
    log_k     -8
    -cd_music 0.5 -1 0 0 0
Ca+2 + 2Y-0.5 = Y2Ca+
    log_k     15
    -cd_music -1 2 0 0 0
EXCHANGE_SPECIES
H+ + X- = HX
    log_k     1
    -gamma    9 0
END
SOLUTION 1
Ca   0.001
Cl   0.002
-units mol/kgw
pe 0.2
END
EXCHANGE 1
X 0.0002625
-eq 1
END
SURFACE 1
    -sites DENSITY
    Y     4         18.92     0.15
    -capacitance 1.17   1.17
    -cd_music
    -eq 1
    -donnan
END
SOLUTION 0
SELECTED_OUTPUT 2
  -file scan_pH.pqi
USER_PUNCH 2
   10 FOR i = 4 TO 10 STEP 0.2
   20   s$ = s$ + 'USE solution 1' + EOL$
   30   s$ = s$ + 'EQUILIBRIUM_PHASES 1' + EOL$
   40   s$ = s$ + '  Fix_pH ' + TRIM(STR$(-i)) + ' Ca(OH)2 10' + EOL$
   50   s$ = s$ + '  CaCl2 0 10' + EOL$
   60   s$ = s$ + 'USE exchange 1' + EOL$
   70   s$ = s$ + 'USE surface 1' + EOL$
   80   s$ = s$ + 'END' + EOL$
   90 NEXT i
  100 PUNCH s$
END
PRINT     
     -selected_out false
END
USER_GRAPH 1 H+sorption on Syn
    -headings               pH Y-0.5 YH+0.5 YHCl-0.5 Y2Ca+
    -axis_titles            "pH" "Surface species, molality" ""
    -axis_scale x_axis      4 10 auto auto
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X -la("H+")
40 GRAPH_Y MOL("Y-0.5"), MOL("YH+0.5"), MOL("YHCl-0.5"), MOL("Y2Ca+")
  -end
INCLUDE$ scan_pH.pqi
END
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Surface Complexation »
  • titration of clay minerals
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2