PhreeqcUsers Discussion Forum

Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • The operation result of copying Instance 9 is incorrect
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: The operation result of copying Instance 9 is incorrect  (Read 295 times)

yisongxu

  • Frequent Contributor
  • Posts: 10
The operation result of copying Instance 9 is incorrect
« on: 08/05/25 11:03 »
I want to learn the oxidation of iron through Example 9. However, when I copied the code and ran it in the software, I got Fe3+ as 100% and Fe2+ as 0. This result is different from that of the instance. May I ask where the problem lies.
Code: [Select]
Table 28. Partial input file for example 9.
 TITLE Example 9.--Kinetically controlled oxidation of ferrous 
                  iron. Decoupled valence states of iron.
SOLUTION_MASTER_SPECIES
Fe_di              Fe_di+2    0.0     Fe_di              55.847
Fe_tri             Fe_tri+3   0.0     Fe_tri             55.847
SOLUTION_SPECIES
Fe_di+2 = Fe_di+2
        log_k   0.0
Fe_tri+3 = Fe_tri+3
        log_k   0.0
Fe_di+2 + H2O = Fe_diOH+ + H+
        log_k   -9.5
        delta_h 13.20   kcal
Fe_tri+3 + H2O = Fe_triOH+2 + H+
        log_k   -2.19
        delta_h 10.4    kcal
PHASES
Goethite
        Fe_triOOH + 3 H+ = Fe_tri+3 + 2 H2O
        log_k   -1.0
END
SOLUTION 1
        pH  7.0
        pe 10.0  O2(g) -0.67
        Fe_di  0.1
        Na  10.
        Cl  10.  charge
EQUILIBRIUM_PHASES 1
        O2(g)           -0.67
RATES
Fe_di_ox
  -start
  10  Fe_di = TOT("Fe_di")
  20  if (Fe_di <= 0) then goto 200
  30  p_o2 = SR("O2(g)")
  40  moles = (2.91e-9 + 1.33e12 * (ACT("OH-"))^2 * p_o2) * Fe_di * TIME
  200 SAVE moles
  -end
KINETICS 1
Fe_di_ox
        -formula  Fe_di  -1.0  Fe_tri  1.0
        -steps 100 400 3100 10800 21600 5.04e4 8.64e4 1.728e5 1.728e5 1.728e5 1.728e5 
        -step_divide 1e-4
INCREMENTAL_REACTIONS true
SELECTED_OUTPUT
        -file ex9.sel
        -reset false
USER_PUNCH
        -headings Days  Fe(2)  Fe(3)  pH  si_goethite
  10 PUNCH SIM_TIME / 3600 / 24, TOT("Fe_di")*1e6, TOT("Fe_tri")*1e6, -LA("H+"),\
SI("Goethite")
USER_GRAPH Example 9
        -headings _time_ Fe(2) Fe(3) pH
        -chart_title "Oxidation of Ferrous Iron"
        -axis_titles "Time, in days" "Micromole per kilogram water" "pH"
        -axis_scale secondary_y_axis 4.0 7.0 1.0 0.5
  -start
  10 GRAPH_X TOTAL_TIME / 3600 / 24 
  20 GRAPH_Y TOT("Fe_di")*1e6, TOT("Fe_tri")*1e6
 
  30 GRAPH_SY -LA("H+")
  -end
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4000
Re: The operation result of copying Instance 9 is incorrect
« Reply #1 on: 08/05/25 15:10 »
You do not have the complete input. Some of the definitions were left out of the manual for brevity. The complete file is available in the "examples" directory of the installation, or in the PfW tab of PhreeqcI. I reproduce it here:

Code: [Select]
TITLE Example 9.--Kinetically controlled oxidation of ferrous
                  iron. Decoupled valence states of iron.
SOLUTION_MASTER_SPECIES
Fe_di              Fe_di+2    0.0     Fe_di              55.847
Fe_tri             Fe_tri+3   0.0     Fe_tri             55.847
SOLUTION_SPECIES
Fe_di+2 = Fe_di+2
        log_k   0.0
Fe_tri+3 = Fe_tri+3
        log_k   0.0
#
# Fe+2 species
#
Fe_di+2 + H2O = Fe_diOH+ + H+
        log_k   -9.5
        delta_h 13.20   kcal
#
#... and also other Fe+2 species
#
Fe_di+2 + Cl- = Fe_diCl+
        log_k   0.14
Fe_di+2 + CO3-2 = Fe_diCO3
        log_k   4.38
Fe_di+2 + HCO3- = Fe_diHCO3+
        log_k   2.0
Fe_di+2 + SO4-2 = Fe_diSO4
        log_k   2.25
        delta_h 3.230   kcal
Fe_di+2 + HSO4- = Fe_diHSO4+
        log_k   1.08
Fe_di+2 + 2HS- = Fe_di(HS)2
        log_k   8.95
Fe_di+2 + 3HS- = Fe_di(HS)3-
        log_k   10.987
Fe_di+2 + HPO4-2 = Fe_diHPO4
        log_k   3.6
Fe_di+2 + H2PO4- = Fe_diH2PO4+
        log_k   2.7
Fe_di+2 + F- = Fe_diF+
        log_k   1.0
#
# Fe+3 species
#
Fe_tri+3 + H2O = Fe_triOH+2 + H+
        log_k   -2.19
        delta_h 10.4    kcal
#
#... and also other Fe+3 species
#
Fe_tri+3 + 2 H2O = Fe_tri(OH)2+ + 2 H+
        log_k   -5.67
        delta_h 17.1    kcal
Fe_tri+3 + 3 H2O = Fe_tri(OH)3 + 3 H+
        log_k   -12.56
        delta_h 24.8    kcal
Fe_tri+3 + 4 H2O = Fe_tri(OH)4- + 4 H+
        log_k   -21.6
        delta_h 31.9    kcal
2 Fe_tri+3 + 2 H2O = Fe_tri2(OH)2+4 + 2 H+
        log_k   -2.95
        delta_h 13.5    kcal
3 Fe_tri+3 + 4 H2O = Fe_tri3(OH)4+5 + 4 H+
        log_k   -6.3
        delta_h 14.3    kcal
Fe_tri+3 + Cl- = Fe_triCl+2
        log_k   1.48
        delta_h 5.6     kcal
Fe_tri+3 + 2 Cl- = Fe_triCl2+
        log_k   2.13
Fe_tri+3 + 3 Cl- = Fe_triCl3
        log_k   1.13
Fe_tri+3 + SO4-2 = Fe_triSO4+
        log_k   4.04
        delta_h 3.91    kcal
Fe_tri+3 + HSO4- = Fe_triHSO4+2
        log_k   2.48
Fe_tri+3 + 2 SO4-2 = Fe_tri(SO4)2-
        log_k   5.38
        delta_h 4.60    kcal
Fe_tri+3 + HPO4-2 = Fe_triHPO4+
        log_k   5.43
        delta_h 5.76    kcal
Fe_tri+3 + H2PO4- = Fe_triH2PO4+2
        log_k   5.43
Fe_tri+3 + F- = Fe_triF+2
        log_k   6.2
        delta_h 2.7     kcal
Fe_tri+3 + 2 F- = Fe_triF2+
        log_k   10.8
        delta_h 4.8     kcal
Fe_tri+3 + 3 F- = Fe_triF3
        log_k   14.0
        delta_h 5.4     kcal
PHASES
Goethite
        Fe_triOOH + 3 H+ = Fe_tri+3 + 2 H2O
        log_k   -1.0
END
SOLUTION 1
        pH  7.0
        pe 10.0  O2(g) -0.67
        Fe_di  0.1
        Na  10.
        Cl  10.  charge
EQUILIBRIUM_PHASES 1
        O2(g)           -0.67
RATES
Fe_di_ox
  -start
  10  Fe_di = TOT("Fe_di")
  20  if (Fe_di <= 0) then goto 200
  30  p_o2 = SR("O2(g)")
  40  moles = (2.91e-9 + 1.33e12 * (ACT("OH-"))^2 * p_o2) * Fe_di * TIME
  200 SAVE moles
  -end
KINETICS 1
Fe_di_ox
        -formula  Fe_di  -1.0  Fe_tri  1.0
        -steps 100 400 3100 10800 21600 5.04e4 8.64e4 1.728e5 1.728e5 1.728e5 1.728e5
        -step_divide 1e-4
INCREMENTAL_REACTIONS true
SELECTED_OUTPUT
        -file ex9.sel
        -reset false
USER_PUNCH
        -headings Days  Fe(2)  Fe(3)  pH  si_goethite
  10 PUNCH SIM_TIME / 3600 / 24, TOT("Fe_di")*1e6, TOT("Fe_tri")*1e6, -LA("H+"), \
           SI("Goethite")
USER_GRAPH Example 9
        -headings _time_ Fe(2) Fe(3) pH
        -chart_title "Oxidation of Ferrous Iron"
        -axis_titles "Time, in days" "Micromole per kilogram water" "pH"
        -axis_scale secondary_y_axis 4.0 7.0 1.0 0.5
  -start
  10 GRAPH_X TOTAL_TIME / 3600 / 24
  20 GRAPH_Y TOT("Fe_tri")*1e6, TOT("Fe_di")*1e6
  30 GRAPH_SY -LA("H+")
  -end
END


Logged

yisongxu

  • Frequent Contributor
  • Posts: 10
Re: The operation result of copying Instance 9 is incorrect
« Reply #2 on: 14/05/25 08:35 »
Thank you for your guidance.
I still have some questions
1、But I don't understand that there are no S and P in the reaction solution. Then why add Fe and the reaction of SO4-2 and HPO4-2 in SOLUTION_SPECIES? Deleting them seems to have no effect on the result.If there are no these elements in my solution, can I not add their reaction with Fe?
2、Is the decrease of Fe2+ in the solution indicated by the "-" at the beginning of each step? For example, does the "-start" in Is the decrease of Fe2+ in the solution indicated by the "-" at the beginning of each step?  For example, "-start" in the code after the example.  Do all the "-" in "-formula", "-steps", "-step_divide", etc. indicate reduction?
3、In the KINETICS 1 Fe_di_ox -formula, the overall reaction kinetics is described as Fe2+ + H+ + 0.25 O2 = Fe3+ +0.5 H2O. Does this only represent the oxidation between Fe2+ and Fe3+? Isn't oxidation described through the Goethite by PHASES?
Code: [Select]
RATES
Fe_di_ox
  -start
  10  Fe_di = TOT("Fe_di")
  20  if (Fe_di <= 0) then goto 200
  30  p_o2 = SR("O2(g)")
  40  moles = (2.91e-9 + 1.33e12 * (ACT("OH-"))^2 * p_o2) * Fe_di * TIME
  200 SAVE moles
  -end
KINETICS 1
Fe_di_ox
        -formula  Fe_di  -1.0  Fe_tri  1.0
        -steps 100 400 3100 10800 21600 5.04e4 8.64e4 1.728e5 1.728e5 1.728e5 1.728e5
        -step_divide 1e-4
INCREMENTAL_REACTIONS true
SELECTED_OUTPUT
        -file ex9.sel
        -reset false
USER_PUNCH
        -headings Days  Fe(2)  Fe(3)  pH  si_goethite
  10 PUNCH SIM_TIME / 3600 / 24, TOT("Fe_di")*1e6, TOT("Fe_tri")*1e6, -LA("H+"), \
           SI("Goethite")
USER_GRAPH Example 9
        -headings _time_ Fe(2) Fe(3) pH
        -chart_title "Oxidation of Ferrous Iron"
        -axis_titles "Time, in days" "Micromole per kilogram water" "pH"
        -axis_scale secondary_y_axis 4.0 7.0 1.0 0.5
  -start
  10 GRAPH_X TOTAL_TIME / 3600 / 24
  20 GRAPH_Y TOT("Fe_di")*1e6, TOT("Fe_tri")*1e6
  30 GRAPH_SY -LA("H+")
  -end
END
« Last Edit: 14/05/25 09:56 by yisongxu »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4000
Re: The operation result of copying Instance 9 is incorrect
« Reply #3 on: 14/05/25 14:12 »
1. The additional definitions are included for completeness.

2. The hyphens in -formula, -step_divide, and -steps are strictly indicators of input options. It is simply part of the formatting of PHREEQC input. It in no way indicates a negative value. or reduction.

3. The kinetics formula indicates the change in concentrations of the "elements" Fe_di and Fe_tri; Fe_di is removed from solution and Fe_tri is added to solution. PHREEQC then calculates equilibrium for the system. If you include Goethite (defined in terms of Fe_tri+3) in EQUILIBRIUM_PHASES, then equilibrium with goethite will be part of the equilibrium calculation.
Logged

yisongxu

  • Frequent Contributor
  • Posts: 10
Re: The operation result of copying Instance 9 is incorrect
« Reply #4 on: 18/05/25 03:15 »
Dear dlparkhurst, under your guidance, I have completed several examples in the manual. I want to simulate the continuous addition of NaOH in the FeCl2 solution and study the changes of iron ore phase through the changes of pH and FeⅡ/FeⅢ. But could you offer me an idea on how to achieve the goal of constantly adding NaOH in the software?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4000
Re: The operation result of copying Instance 9 is incorrect
« Reply #5 on: 18/05/25 19:02 »
You can add NaOH in multiple steps with REACTION.

Code: [Select]
REACTION 1
NaOH 1
2.0 in 10 steps

This data block will add NaOH in increments of 0.2 moles to a total of 2.0 moles added.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • The operation result of copying Instance 9 is incorrect
 

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