PhreeqcUsers Discussion Forum

Beginners => PHREEQC Basics => Topic started by: CharlesAshes on May 29, 2018, 02:28:22 PM

Title: Fixing_pe at several values using User_Punch
Post by: CharlesAshes on May 29, 2018, 02:28:22 PM
Dear PHREEQC users,

I have been trying to use user_punch to calculate the effect of pe on my solution.
I have done this by analogy to Example 8 (Zinc adsorption). When I look at the output file I do see the right input for my for loop but it does not trigger the amount of simulations as does happen in example 8. I would be very grateful if someone were to be able to help me with this problem.
GAS_PHASE
    -fixed_pressure
    -pressure 1
    -volume 1
    -temperature 25
    N2(g)     0.78
    O2(g)     0.21
SOLUTION 1
    temp      25
    pH        8.2
    pe     -5
    redox     pe
    units     mmol/kgw
    density   1
    Alkalinity 0.21 eq/kgw
    Ca        8.8
    Cu        0.024
    Fe        3.5
    K         2.6
    Mg        4.2
    Mn        0.13
    Na        9.7
    P         13.9
    S         5.9
    Zn        0.22
    -water    1 # kg
PHASES
Fix_pe
e- = e-
log_K 0.0
END

SELECTED_OUTPUT
    -file                 selected_output_1.sel
    -reset                false
    -state                true
    -solution             true
    -pH                   true
    -pe                   true
    -charge_balance       true
    -totals               P  S(6)  S  Fe  Fe(2)
    -molalities           Hfo_wH2PO4  Hfo_wHPO4-
    -equilibrium_phases   Vivianite  Pyrite  MnHPO4   Hydroxyapatite
    -active               true

USER_PUNCH
    -headings
    -start
 10 For i= -7 to 5 STEP 1
 20 a$=EOL$+"USE solution 1"+CHR$(59)+"USE GAS_PHASE"+EOL$
 30 a$=a$+"EQUILIBRIUM_PHASES 1"+EOL$
 40 a$=a$+"Fe(OH)3(a) 0 0 precipitate_only"+EOL$
 60 a$=a$+"Mn3(PO4)2 0 0 precipitate_only"+EOL$
 70 a$=a$+"MnHPO4 0 0 precipitate_only"+EOL$
 80 a$=a$+"Pyrite 0 0 precipitate_only"+EOL$
 90 a$=a$+"Vivianite 0 0 precipitate_only"+EOL$
100 a$=a$+"Fix_pe"+ STR$(i)+CHR$(32)+"O2"+EOL$
110 a$=a$+"SURFACE"+ EOL$
120 a$=a$+"Hfo_sOH Fe(OH)3(a)      equilibrium_phase 0.000795 600"+EOL$
130 a$=a$+"Hfo_wOH Fe(OH)3(a)      equilibrium_phase 0.00318"+EOL$
140 a$=a$+"END"+EOL$
150 PUNCH a$
160 NEXT i
    -end
END

Thanks in advance
Charles
Title: Re: Fixing_pe at several values using User_Punch
Post by: dlparkhurst on May 29, 2018, 10:28:31 PM
Let's skip the fix_pe part and start with your initial solution definition and GAS_PHASE reaction.

The pe of the SOLUTION affects the distribution of Fe, Cu, Mn, and S among redox states.

At pH 8, all the Fe is probably Fe(2) because Fe(3) readily precipitates and will have negligible concentration. Cu will be distributed between Cu(1) and Cu(2) depending on the pH, but is probably Cu(2). Mn is probably Mn(2), and S is probably sulfate (very seldom is total S analyzed). So, my suggestion is to add the redox states rather than the total elements.

Note you have defined 210 meq/kgw of Alkalinity which is orders of magnitude greater than the other concentrations.

So look more carefully at your solution speciation results.

When you react with the GAS_PHASE, or any other reaction calculation, the solution will react to redox equilibrium. So the Fe, Cu, Mn, and S will react to redox equilibrium, but also the O2 and N2 in the gas phase will react to form nitric acid. This last reaction is probably not what you want. In addition, you have defined an arbitrary 1 liter of gas initially (with specified pressures of O2 and N2), which I don't think has any particular physical significance. If you want equilibrium with atmospheric O2, define O(0) 1 O2(g) -0.7 in the SOLUTION definition, or use O2(g) in an equilibrium phase. Use the former if you want to have DO in the system before redox equilibrium, use the latter if you want to have equilibrium with the atmosphere after redox equilibrium. I don't think you want to use N2(g) in either case because normally N2 is assumed to be inert. Either remove it, or use Ntg (phreeqc.dat or Amm.dat), which cannot react with O2 or any other redox process.

As for your pe fixing loop, run the extremes by hand and look carefully at your results to decide if that is what you really want to do. Note that at pH 8, the stability field of water runs from (guessing) -7 to 13, and you will have negligible DO at any pe less than about 12 (again a guess).