PhreeqcUsers Discussion Forum

Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • co2(aq) and h2s
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: co2(aq) and h2s  (Read 2697 times)

Jowitawl

  • Frequent Contributor
  • Posts: 13
co2(aq) and h2s
« on: 27/05/24 16:00 »
Hello everyone,

i was wondering if someone could help me with initial solution data, precisely how to correctly implement them into PHREEQC program. my main problem is CO2 and H2S. I was given thermal fluids compositions samples, where for example CO2 = 26.2mg/kg, while my professor tells me that it is not totalDIC= CO2(aq) + HCO3 + CO3-2, it?s only CO2 pure gas phase in the water. Thereby i am struggling with figuring out how should i input this data. The same is actually with H2S, i have read about partial pressure adjustment, where it is possible to choose CO2(aq) or H2S and change its partial pressure for example in the EQUILIBRIUM_PHASES function, but i am later on equilibrating my model with the atmosphere. In solution input data C(4) element has a choice to set up a phase, so what if i type down c(4)=26.3 mg/kg and use CO2(g) in the phase in GENERAL SOLUTION input, and then the same with H2S will it be correctly applied input solution?

Thank you for your time!
Jowita
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #1 on: 27/05/24 16:21 »
How is CO2 measured? If the sample is acidified and then CO2 is measured, then the measurement would be total dissolved inorganic carbon, and it could be entered as C(4). If it is the same for H2S, then you would enter S(-2).

Logged

Jowitawl

  • Frequent Contributor
  • Posts: 13
Re: co2(aq) and h2s
« Reply #2 on: 27/05/24 16:59 »
then this is correct.

Thank you dr dlparkhurst for clarifying it for me!
Logged

Jowitawl

  • Frequent Contributor
  • Posts: 13
Re: co2(aq) and h2s
« Reply #3 on: 29/05/24 17:23 »
Dear dlparkhurst,

I ran into another issue with CO2 sample. When i put C(4)=26.2 mg/kgw into PHREEQC, the output data tells me that the molality is C(4)=0,000431, while (26.2mg/kg/1000)/44,001mol= 0,000598 mol/kg of CO2. How PHREEQC calculates this molality differently? I am using phreeqc.dat

Thank you!


Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #4 on: 29/05/24 20:26 »
The default gram formula weights for converting mass to moles is in the SOLUTION_MASTER_SPECIES data block of the database that you use.

For C(4) in phreeqc.dat, the gfw is calculated from the formula HCO3.

If you want to use CO2, one way to do it is the following:

Code: [Select]
SOLUTION
-units mg/kgw
C(4) 26.2 as CO2
Logged

Jowitawl

  • Frequent Contributor
  • Posts: 13
Re: co2(aq) and h2s
« Reply #5 on: 04/06/24 00:59 »
Thank you for last response! it was very helpful.
v
Although in the meantime i ran into another issue, the total alkalinity of the fluid composition doesn't match with the alkalinity which i calculated manually - 8.33e-03. PHREEQC tells me that total alkalinity is for example 3.710e-03 in minteq.4v.data. I have tried the other data base, and all results were around 3e-03. Do you know where can be the issue from?

Code: [Select]
PRINT
alkalinity
SOLUTION 1
temp      87.5
    pH        9.61
    pe        4
    redox     pe
    units     mg/kgw
    density   1
    Al        0.134
    B         0.013
    C         26.2 as CO2
    Ca        2.68
    Cl        25.6
    F         0.25
    Fe        0.023
    K         0.87
    Mg        0.01
    Na        38
    Oxg       300 ug/kgw
    S(-2)     0.02
    S(6)      12.2
    Si        81
    O(0)      0.3
    -water    1 # kg
USE SOLUTION 1
EQUILIBRIUM_PHASES 1
    CO2(g)    -3.376
REACTION_TEMPERATURE
25
SAVE SOLUTION 1
END


« Last Edit: 04/06/24 12:25 by Jowitawl »
Logged

Jowitawl

  • Frequent Contributor
  • Posts: 13
Re: co2(aq) and h2s
« Reply #6 on: 04/06/24 11:55 »
This is the other program calculations:

Code: [Select]
Chemical species in water - ppm and log mole                                      Water pH is  9.610
     H+               0.00   -9.590     Mg++             0.01   -6.404     Fe(OH)3          0.00  -11.430
     OH-              0.09   -5.294     NaCl             0.00   -7.594     Fe(OH)4-         0.00  -10.836
     H4SiO4         113.01   -2.930     KCl              0.00   -9.521     FeCl+            0.00  -10.513
     H3SiO4-         15.98   -3.775     NaSO4-           0.03   -6.677     FeCl2            0.00  -34.629
     H2SiO4--         0.04   -6.350     KSO4-            0.00   -7.966     FeCl++           0.00  -28.202
     NaH3SiO4         0.46   -5.412     CaSO4            0.06   -6.333     FeCl2+           0.00  -30.779
     H3BO3            0.03   -6.284     MgSO4            0.00   -8.514     FeCl3            0.00  -35.115
     H2BO3-           0.04   -6.166     CaCO3            0.20   -5.693     FeCl4-           0.00    0.000
     H2CO3            0.03   -6.379     MgCO3            0.00   -7.936     FeSO4            0.00   -8.284
     HCO3-           32.76   -3.270     CaHCO3+          0.01   -6.871     FeSO4+           0.00  -26.294
     CO3--            3.49   -4.235     MgHCO3+          0.00   -8.755     Al+++            0.00  -17.760
     H2S              0.00   -7.432     CaOH+            0.00   -8.454     AlOH++           0.00  -14.023
     HS-              0.19   -5.234     MgOH+            0.00   -9.765     Al(OH)2+         0.00  -10.417
     S--              0.00  -13.081     NH4OH            0.00    0.000     Al(OH)3          0.00   -7.515
     H2SO4            0.00  -24.928     NH4+             0.00    0.000     Al(OH)4-         0.47   -5.307
     HSO4-            0.00  -11.860     Fe++             0.02   -6.391     AlSO4+           0.00  -19.023
     SO4--           12.13   -3.899     Fe+++            0.00  -25.921     Al(SO4)2-        0.00  -21.156
     HF               0.00  -11.517     FeOH+            0.00   -9.496     AlF++            0.00  -15.816
     F-               0.25   -4.881     Fe(OH)2          0.00   -9.943     AlF2+            0.00  -15.200
     Cl-             25.60   -3.141     Fe(OH)3-         0.00  -15.559     AlF3             0.00  -16.063
     Na+             37.91   -2.783     Fe(OH)4--        0.00  -21.543     AlF4-            0.00  -18.553
     K+               0.87   -4.653     Fe(OH)++         0.00  -19.256     AlF5--           0.00  -22.011
     Ca++             2.57   -4.192
- this program doesnt give me the molality, so i had to calculate total alkalinity from log moles and using equation: totalA= H3SiO4- + HS-
+ HCO3- + 2*CO3- + H2BO3- + OH- HSO4-. The problem is that the logarithmic values differ in between both programs (PHREEQC vs WATCH isor). Therefore, when i tried to use totalAlkality equation with log moles values from PHREEQC, my totalAlkalinity was 2e-03.

Anyway, i tried to apply the output CO2 concentration (after equilibrating with the atmosphere) from PHREEQC into the other program and the results were different, hence i suspect that there is something wrong with aqua species distribution in PHREEQC.
« Last Edit: 04/06/24 16:19 by Jowitawl »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #7 on: 04/06/24 16:32 »
You can use PRINT; -alk to see the calculation of alkalinity by PHREEQC. We can disagree, but I think there is something wrong with your calculation.
Logged

ecsgsi

  • Contributor
  • Posts: 8
Re: co2(aq) and h2s
« Reply #8 on: 16/06/24 07:15 »
Hello Forum
I am completely new to PHREEQC and am trying my best to get my foothold through the very useful posts of this forum.
I have written an input file in which I attempt to plot the variation of Pb concentration with pH in a system where phosphate dosed water is in equilibrium with the mineral phases hydroxylpyromorphite, lead carbonate, and lead chloride.
I am unable to get a graph.
Can anyone help me by pointing the errors in my input file given below?
Thanks

TITLE EX2

SOLUTION 1
   units   mmol/L
        pH            8.0
   pe             3.9   

       Temperature       25.0
   
     Cl      2.25
     C(4)          2.20
     S(6)          0.52  as SO4
     Mg           1.6
     Ca           1.8
          P             0.01
       


PHASES
   Leadcarbonate
   PbCO3 = Pb+2 + CO3-2
   log_k   -7.24
   delta_h  0   
      New_Hxypyromorphite
      Pb5(PO4)3OH + H+ = 5Pb+2 + 3PO4-3 + H2O
      log_k = -80.77
      delta_h 8.6
       

pH_Fix
     H+ = H+
     log_k = 0       
         
EQUILIBRIUM_PHASES 1

    New_Hxypyromorphite     0.0      10.0
        Leadcarbonate           0.0      10.0
             
          
       pH_Fix    -8.0  HCl
               -force_equality
      
       
REACTION_TEMPERATURE 1
         25.0 75.0 in 51 steps

USER_GRAPH 1  Example 2
      -headings Lead pH
      -chart_title "Leadcarbonate Stability"   
         -axis_titles   ?pH? ?Pb, mmol/l?      
         -axis_scale x_axis   7 14 0 0
         -axis_scale y_axis   0 7 1
         -initial_solutions  true
         -connect simulations      true
         -plot_concentration_vs     x
      
  -start
     10   PLOT_XY TOT(?Pb"),("mmol/l?),LA(?H+?),color = Green \symbol =Square, symbol_size = 7, \ line_width = 1
   -end
USER_GRAPH 2
   -detach
USER_GRAPH 1
   -active

SELECTED_OUTPUT
   -file            Example2.sel
   -si         
 
END

Logged

davidsegura

  • Contributor
  • Posts: 6
Re: co2(aq) and h2s
« Reply #9 on: 16/06/24 09:21 »
Hi @ecsgsi

I suggest you make a new post as newcomers with the same question will find it more easily that way.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #10 on: 16/06/24 18:37 »
Here is my interpretation of what you say that you want to plot. Scanning in pH requires a separate calculation for each pH. It is easier to scan in temperature (REACTION_TEMPERATURE), but I don't think that is what you need.

Look at example 8 in the manual about the pH setting and using USER_PUNCH to write an input file for more detailed plotting.

Code: [Select]
PHASES
Leadcarbonate
    PbCO3 = CO3-2 + Pb+2
    log_k     -7.24
New_Hxypyromorphite
    Pb5(PO4)3OH + H+ = H2O + 3PO4-3 + 5Pb+2
    log_k     -80.77
    delta_h   8.6 kJ
pH_Fix
    H+ = H+
    log_k     0
NaCl
NaCl = Na+ + Cl-
log_k -20
END

SOLUTION 1
    temp      25
    pH        8
    pe        3.9
    redox     pe
    units     mmol/l
    density   1
    C(4)      2.2
    Ca        1.8
    Cl        2.25
    Mg        1.6
    P         0.01
    S(6)      0.52 as SO4
    -water    1 # kg
END
USER_GRAPH 1
    -headings               Pb_25C
    -axis_titles            "pH" "Pb, mmol/kgw" ""
    -chart_title            "Leadcarbonate Stability"
    -axis_scale x_axis      6 10 0 0
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10   PLOT_XY -LA("H+"), TOT("Pb")*1000, color = Green, symbol =Square, symbol_size = 7, line_width = 1
  -end
    -active                 true
END

USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -6 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
25.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -7 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
25.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -8 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
25.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -9 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
25.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -10 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
25.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -6 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
75.0
USER_GRAPH 1 
      -headings               Pb_75C 
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -7 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
75.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -8 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
75.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -9 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
75.0     
END
USE solution 1   
EQUILIBRIUM_PHASES 1
    Leadcarbonate 0 10
    New_Hxypyromorphite 0 10
    pH_Fix    -10 HCl       10
    NaCl 0 10
        -force_equality
REACTION_TEMPERATURE 1
75.0     
END
Logged

ecsgsi

  • Contributor
  • Posts: 8
Re: co2(aq) and h2s
« Reply #11 on: 16/06/24 20:27 »
Thanks, David
Logged

ecsgsi

  • Contributor
  • Posts: 8
Re: co2(aq) and h2s
« Reply #12 on: 09/08/24 06:57 »
Hi David
Pardon me for getting this so late.
In the code above, I find that without the NaCl phase, I cannot run the program.
Would you please explain why? Is it because of fixing the pH?

Thanks
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #13 on: 09/08/24 09:41 »
Using the NaCl phase is a bit of a trick. It automatically allows either HCl or NaOH to be added, as necessary, to fix the pH.

If you remove the NaCl phase you must manually add either HCl or NaOH in the pH_Fix definition for each pH, whichever is needed. I think in your case, you can change HCl to NaOH for each pH and remove the NaCl from the EQUILIBRIUM_PHASES data blocks.
Logged

ecsgsi

  • Contributor
  • Posts: 8
Re: co2(aq) and h2s
« Reply #14 on: 09/08/24 12:09 »
Thanks, again.
Is it just a theoretical construct?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 3996
Re: co2(aq) and h2s
« Reply #15 on: 09/08/24 14:28 »
No, it simply saves time. Otherwise, you may have to run a series of pHs, and iteratively determine whether acid or base is needed to achieve each pH.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • co2(aq) and h2s
 

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