PhreeqcUsers Discussion Forum

Beginners => PHREEQC basics => Topic started by: m.gamrani on May 13, 2020, 05:31:05 PM

Title: DOC-
Post by: m.gamrani on May 13, 2020, 05:31:05 PM
Hello
I have a problem in the introduction of organic carbon dissolved at negative load (COD-) I tried to use humic acids but phreeqc does not understand HA_OH.

I put at your disposal my script.

I use the data.base llnl

#TITLE REVERSE MODELLING l'obtention de l'eau saline basique à partir d'une solution de rivière,"évaporation"

SOLUTION_MASTER_SPECIES
Si SiO2 0 SiO2 28.0843

HA_OH

SOLUTION_SPECIES
SiO2 + 2H2O = H3SiO4- + H+
       -log_k  -9.83; -delta_h 6.12 kcal
       -analytic   -302.3724   -0.050698   15669.69    108.18466 -1119669.0
       -Vm  7.94  1.0881  5.3224  -2.8240  1.4767 # supcrt + H2O in a1

SiO2 + 2H2O  = H2SiO4-2 + 2 H+
       -log_k  -23.0;  -delta_h 17.6 kcal
       -analytic   -294.0184   -0.072650   11204.49    108.18466 -1119669.0

H3SiO4- = HSiO3- + H2O
     -log_k -50


       

HA_OH = Soil_OH   
       log_k  0.00   
       
HA_OH = HA_O- + H+   
       log_k  -4.00   
       
Ag+ + HA_O- = HA_OAg
        log_k   0.73

Na+ + HA_O- = HA_ONa
        log_k   -0.18

Mn+2 + HA_O- = HA_OMn+
        log_k   1.4

Fe+2 + HA_O- = HA_OFe+
        log_k   1.4

Fe+3 +  HA_O- = HA_OFe+2
        log_k   3.21

Fe+3 + 2HA_O- = HA_O2Fe+
        log_k   6.5

Fe+3 + 3HA_O- = HA_O3Fe
        log_k   8.3

Cu+2 + HA_O- = HA_OCu+
        log_k   2.21

Cu+2 + 2HA_O- = HA_O2Cu
        log_k   3.63
       
Cu+2 + 3HA_O- = HA_O3Cu-
        log_k   3.1
       
Cu+2 + 4HA_O- = HA_O4Cu-2
        log_k   2.9

Ca+2 + HA_O- = HA_O2Ca+
        log_k   1.18

Al+3 +  HA_O- = HA_OAl+2
        log_k   4.3



PRINT; -reset true; inverse true

SOLUTION 1 #eau de rivière non salée
Units mmol/L
      pH 6.4
      C(4) 0.103
      Acetate- 30
      F 0.01
      Cl 0.026
      Br 0.001
      S(6) 0.039
      Ca 0.065
      Mg 0.026
      Na 0.052
      K 0.058
      Si 0.204
      Al 0.0011
      Fe 0.0005
     -water 1 # kg


EQUILIBRIUM_PHASES
CO2(g) -3.5

SAVE Solution 1
END

SOLUTION 2 #saline
Units mmol/L
      pH 9.64
      C(4) 67.6
      F 0.42
      Cl 66.6
      Br 0.11
      S(6) 0.48
      Ca 0.81
      Mg 0.16
      Na 140.6
      K 24.2
      Si 107.9
      Al 0.154
      Fe 0.166
     -water 1 # kg
   HA_OH   30

EQUILIBRIUM_PHASES
      CO2(g) -3.5

SAVE Solution 2
END

INVERSE_MODELING 1
-solution 1 2    #on cherche la solution 2 a partir du solution 1
-phases
       SiO2(am)
       Calcite
       Dolomite     #Mg-Calcite
       Nahcolite
       stevensite   #Smectite trioctaédrique
       Fe-Kaolinite
       Goethite
       water

-balances
      Cl 0.5 #50% d'incertitude
      Na 0.5 #50% d'incertitude
      S(6) 1 #100% d'incertitude
      Br 1 #100% d'incertitude
      Alkalinity 1 #100% d'incertitude
      F 1
      K 0.5
-uncertainties 1
-range true
-tolerance 1e-10
-mineral_water     true
-minimal #modèle minimal

PHASES
water
   H2O = H2O
   log_K 0

Stevensite
Ca0.15Na0.33Mg2.485Fe0.2Si4O10 (OH) 2 + 6H + = \
0.15Ca + 2 + 0.33Na + + 2.485Mg + 2 + 0.2Fe + 2 + 4SiO2 + 4H2O
log_k 25.45

Fe-Kaolinite
Al1.9Fe0.1Si2O5(OH)4 + 6H+ = 1.9Al+3 + 0.1Fe+3 + 2SiO2 + 5H2
     log_k 6.471

END

Title: Re: DOC-
Post by: dlparkhurst on May 13, 2020, 06:01:27 PM
I am not sure you should redefine the Si aqueous species. See https://phreeqcusers.org/index.php/topic,1479.msg4679.html#msg4679 for a short discussion.

As for the organic acid definition, PHREEQC assumes  the formulas for "elements" begin with a capital letter with zero or more lower case letters. So HA is interpreted as H (hydrogen) and A (undefined). If you use Ha for the organic acid formula, then you should be able to define its aqueous species.
Title: Re: DOC-
Post by: m.gamrani on May 16, 2020, 01:48:51 AM
I thank you sir for your answer but I see that phreeqc is unable to understand Ha_oh as humic acid, I ask you if you can direct me towards a method to introduce these humic acids.
knowing that I tried to use the acetate but it gives a rocking problem.

you will find attached my script :
i use LLnL data.base.

Code: [Select]
TITLE REVERSE MODELLING l'obtention de l'eau saline basique à partir d'une solution de rivière,"évaporation"

SOLUTION_MASTER_SPECIES
Si SiO2 0 SiO2 28.0843

Acetate     Acetate- 1      59.05   59.05


SOLUTION_SPECIES
SiO2 + 2H2O = H3SiO4- + H+
       -log_k  -9.83; -delta_h 6.12 kcal
       -analytic   -302.3724   -0.050698   15669.69    108.18466 -1119669.0
       -Vm  7.94  1.0881  5.3224  -2.8240  1.4767 # supcrt + H2O in a1

SiO2 + 2H2O  = H2SiO4-2 + 2 H+
       -log_k  -23.0;  -delta_h 17.6 kcal
       -analytic   -294.0184   -0.072650   11204.49    108.18466 -1119669.0

H3SiO4- = HSiO3- + H2O
     -log_k -50
     

Acetate- + H+ = HAcetate
        log_k   4.76
        delta_h 0       kcal
        -gamma  0       0.06

Acetate- = Acetate-
        log_k   0

Acetate- = CH3COO-

Ag+ + Acetate- = AgAcetate
        log_k   0.73

Na+ + Acetate- = NaAcetate
        log_k   -0.18



Mn+2 + Acetate- = MnAcetate+
        log_k   1.4

Fe+2 + Acetate- = FeAcetate+
        log_k   1.4

Fe+3 + Acetate- = FeAcetate+2
        log_k   3.21

Fe+3 + 2Acetate- = FeAcetate2+
        log_k   6.5

Fe+3 + 3Acetate- = FeAcetate3
        log_k   8.3

Cu+2 + Acetate- = CuAcetate-
        log_k   2.21
Cu+2 + 2Acetate- = CuAcetate2
        log_k   3.63
       
Cu+2 + 3Acetate- = CuAcetate3-
        log_k   3.1
       
Cu+2 + 4Acetate- = CuAcetate4-2
        log_k   2.9

Ca+2 + Acetate- = CaAcetate+
        log_k   1.18

PRINT; -reset true; inverse true

SOLUTION 1 #eau de rivière non salée
Units mmol/L
      pH 6.4
      C(4) 0.103
      Acetate- 30
      F 0.01
      Cl 0.026
      Br 0.001
      S(6) 0.039
      Ca 0.065
      Mg 0.026
      Na 0.052
      K 0.058
      Si 0.204
      Al 0.0011
      Fe 0.0005
     -water 1 # kg


EQUILIBRIUM_PHASES
CO2(g) -3.5

SAVE Solution 1
END

SOLUTION 2 #saline
Units mmol/L
      pH 9.64
      C(4) 67.6
      F 0.42
      Cl 66.6
      Br 0.11
      S(6) 0.48
      Ca 0.81
      Mg 0.16
      Na 140.6
      K 24.2
      Si 107.9
      Al 0.154
      Fe 0.166
     -water 1 # kg
Acetate- 30

EQUILIBRIUM_PHASES
      CO2(g) -3.5

SAVE Solution 2
END

INVERSE_MODELING 1
-solution 1 2    #on cherche la solution 2 a partir du solution 1
-phases
       SiO2(am)
       Calcite
       Dolomite     #Mg-Calcite
       Nahcolite
       stevensite   #Smectite trioctaédrique
       Fe-Kaolinite
       Goethite
       water

-balances
      Cl 0.5 #50% d'incertitude
      Na 0.5 #50% d'incertitude
      S(6) 1 #100% d'incertitude
      Br 1 #100% d'incertitude
      Alkalinity 1 #100% d'incertitude
      F 1
      K 0.5
-uncertainties 1
-range true
-tolerance 1e-10
-mineral_water     true
-minimal #modèle minimal

PHASES
water
   H2O = H2O
   log_K 0

Stevensite
Ca0.15Na0.33Mg2.485Fe0.2Si4O10 (OH) 2 + 6H + = \
0.15Ca + 2 + 0.33Na + + 2.485Mg + 2 + 0.2Fe + 2 + 4SiO2 + 4H2O
log_k 25.45

Fe-Kaolinite
Al1.9Fe0.1Si2O5(OH)4 + 6H+ = 1.9Al+3 + 0.1Fe+3 + 2SiO2 + 5H2O
     log_k 6.471

END
Title: Re: DOC-
Post by: dlparkhurst on May 16, 2020, 02:49:30 AM
Acetate is an organic acid. It is defined in llnl.dat, but you have redefined it in your input file. It behaves like an organic acid and ligand. If you do not like the results, it must be that you don't like the concentrations you have defined or the equilibrium constants for your reactions.

You have complete control to define whatever acid and constants that you want. Here is the start of a new organic acid definition. I am not sure what it is that you want.

Code: [Select]
SOLUTION_MASTER_SPECIES
    Ha            HaOH             0     Ha              100
SOLUTION_SPECIES
HaOH = HaOH
log_k 0

HaOH = HaO- + H+
log_k -7
END
SOLUTION
pH 7
Ha 1
END
Title: Re: DOC-
Post by: m.gamrani on May 16, 2020, 07:35:16 PM
Thank you, sir. It’s really generous of you to answer my questions.
Thank you very much, sir.
I’ve had a lot of information from you.