PhreeqcUsers Discussion Forum
Click here to donate to keep PhreeqcUsers open

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Mixing »
  • Gas mixing at fixed pH
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Gas mixing at fixed pH  (Read 1183 times)

Goldberg

  • Contributor
  • Posts: 4
Gas mixing at fixed pH
« on: April 22, 2020, 03:34:57 PM »
Dear PhreeqC Users,
I try to simulate a geothermal brine under certain pressure and a fixed pH value with a CO2 Phase to later simulate a bubbling.

Initially, I create my brine and merge it with my CO2 gas phase and adjust the pH value. My code looks as follows:

SOLUTION  1
-pressure 11
-temperature 55
Alkalinity 2.46 meq/L
pH 5.23
-units mg/L
Na 29600
K 3816
Ca 7254
Mg 99.4
Li 168
Sr 456
Cl 64900
Si 167 as SiO2

GAS_PHASE 1
-pressure 11
-temperature 55
CO2(g) 11

PHASES
Fix_pH
H+ = H+
log_k 0

EQUILIBRIUM_PHASES 1
Fix_pH -5.23 NH3

In the old PhreeqC version (Phreeqc Interactive 3.4.0-12927) this method works perfectly for receiving hte brine I want. In the current version (PHREEQC: version 3.6.3) it is not possible to include the CO2 and adjust the pH value at the same time. In this version at the given code only my pH value is adjusted without any change in the CO2 content.

I couldn't identify yet how to adjust my code to the new version and I am happy for any suggestions.

Best regards!
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2816
Re: Gas mixing at fixed pH
« Reply #1 on: April 22, 2020, 04:38:25 PM »
I don't think there should be any difference between the versions of PHREEQC. I think PHREEQC is doing the calculation that you specified.

You have specified a fixed-pressure gas phase with one component, CO2. So, the partial pressure of CO2 in the gas phase remains 11 atm (or the gas phase disappears); some CO2 moves from the gas phase to the solution, and the volume of gas decreases. Addition of CO2 tends to decrease the pH, so NH3 is added to maintain the specified pH value. Perhaps you could explain what you expected.

With a fixed-volume gas phase, the CO2 partial pressure would vary from 11, while the gas volume remained the same.

Using phreeqc.dat and NH3 could be problematic because NH3 will react with carbon, creating some CH4 and some N2(aq). Creating N2(aq) may not be realistic. If you use the database Amm.dat, and add Amm (equivalent of NH3), then you will avoid any redox reactions.

Logged

Goldberg

  • Contributor
  • Posts: 4
Re: Gas mixing at fixed pH
« Reply #2 on: April 22, 2020, 04:48:45 PM »
Dear Mr. Parkhurst,

thank you for the very quick response and the advices.

I expected the results as in the PhreeqC version 3.4.0-12927. In this version pH and CO2 content adapt simultaneously:

-----------------------------------------
Beginning of batch-reaction calculations.
-----------------------------------------

Reaction step 1.

Using solution 1.   
Using pure phase assemblage 1.   
Using gas phase 1.   

-----------------------------------Gas phase-----------------------------------

Total pressure: 11.00      atmospheres          (Peng-Robinson calculation)
    Gas volume:   6.33e-01 liters
  Molar volume:   2.34e+00 liters/mole
   P * Vm / RT:  0.95402  (Compressibility Factor Z)

                                                        Moles in gas
                                            ----------------------------------
Component         log P           P    phi     Initial       Final       Delta

CO2(g)             1.04   1.100e+01  0.955   4.282e-01   2.708e-01  -1.574e-01

-------------------------------Phase assemblage--------------------------------

                                                      Moles in assemblage
Phase               SI  log IAP  log K(T, P)   Initial       Final       Delta

Fix_pH           -5.23    -5.23      0.00
    NH3                is reactant       1.000e+01   9.948e+00  -5.230e-02




In the newer version with the identical code, only the pH adapts:





-----------------------------------------
Beginning of batch-reaction calculations.
-----------------------------------------

Reaction step 1.

Using solution 1.   
Using pure phase assemblage 1.   
Using gas phase 1.   

----------------Fixed-pressure gas phase 1 dissolved completely----------------

-------------------------------Phase assemblage--------------------------------

                                                      Moles in assemblage
Phase               SI  log IAP  log K(T, P)   Initial       Final       Delta

Fix_pH           -5.23    -5.23      0.00
    NH3                is reactant       1.000e+01   8.859e+00  -1.141e+00

-----------------------------Solution composition------------------------------



I could not figure out how to adapt my code in the newer version for receiving the same results and continue with it for further simulations
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2816
Re: Gas mixing at fixed pH
« Reply #3 on: April 22, 2020, 06:44:28 PM »
Both versions adapt both CO2 and NH3, it is just that in one, all of the CO2 in the gas phase dissolves. Perhaps you are using different databases? Here is my result with PhreeqcI 3.6.2.15100 using phreeqc.dat, input and output files attached. Isn't this the result you expected?

Code: [Select]
-----------------------------------Gas phase-----------------------------------

Total pressure: 11.00      atmospheres          (Peng-Robinson calculation)
    Gas volume:   6.33e-01 liters
  Molar volume:   2.34e+00 liters/mole
   P * Vm / RT:  0.95402  (Compressibility Factor Z)

                                                        Moles in gas
                                            ----------------------------------
Component         log P           P    phi     Initial       Final       Delta

CO2(g)             1.04   1.100e+01  0.955   4.282e-01   2.708e-01  -1.574e-01

-------------------------------Phase assemblage--------------------------------

                                                      Moles in assemblage
Phase               SI  log IAP  log K(T, P)   Initial       Final       Delta

Fix_pH           -5.23    -5.23      0.00
NH3                is reactant       1.000e+01   9.948e+00  -5.230e-02

Logged

Goldberg

  • Contributor
  • Posts: 4
Re: Gas mixing at fixed pH
« Reply #4 on: April 23, 2020, 08:11:11 AM »
I was using in both cases the same databases. But I now changed it to llnl and I receive in both cases the same results as expected. Thank you very much for your fast help!
Logged

MichaelZ20

  • Top Contributor
  • Posts: 105
Re: Gas mixing at fixed pH
« Reply #5 on: April 23, 2020, 08:21:03 AM »
The ionic strength of your solution is about 2. May it be better to use sit.dat?
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2816
Re: Gas mixing at fixed pH
« Reply #6 on: April 23, 2020, 03:31:47 PM »
If you attach your input, output, and database files that give the incorrect result with the latest version of PHREEQC, I would like to look at it.
Logged

Goldberg

  • Contributor
  • Posts: 4
Re: Gas mixing at fixed pH
« Reply #7 on: April 27, 2020, 09:49:27 AM »
Attached you can find the requested files!
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2816
Re: Gas mixing at fixed pH
« Reply #8 on: April 27, 2020, 02:54:13 PM »
Ah. It is related to the database. You are using PHREEQC.DAT from Tony Appelo's web site. It does not have N(-3) defined, instead, it uses Amm. So when you add NH3, it cannot exist in solution as NH3(aq), but must end up as NO3- or NO2-, with some unwanted redox reactions and pH effects.

With that database, you should add Amm instead of NH3 in the EQUILIBRIUM_PHASES definition:

Code: [Select]
EQUILIBRIUM_PHASES 1
Fix_pH -5.23 Amm

Unfortunately, the database phreeqc.dat from the USGS web site is different from Tony's PHREEQC.DAT. The USGS version does define N(-3) as a redox state of nitrogen, in which case your file would work correctly. The file Amm.dat in the USGS distribution is identical to Tony's PHREEQC.DAT.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Mixing »
  • Gas mixing at fixed pH
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2