PhreeqcUsers Discussion Forum

Registrations currently disabled due to excessive spam. Please email phreeqcusers at gmail.com to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • need help fixing pH
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: need help fixing pH  (Read 14831 times)

wasylenki

  • Frequent Contributor
  • Posts: 11
need help fixing pH
« on: 15/01/15 16:45 »
Hello! This beginner needs help speciating a very simple solution with fixed pH, and reviewing previous posts on this topic hasn't helped.

I made a solution in the lab with 7.57e-7 mol/L Ni. The solution was equilibrated with the atmosphere. I added small increments of KOH until the pH was 8.2. Now I would like to know the speciation of Ni in there.

I tried the following input, but the pH shifted to 5.96:
 EQUILIBRIUM_PHASES

       CO2(g)    -3.5
       O2(g)   1.58
 SOLUTION 1 Water Composition for low ionic strength

        pH      8.3
        temp    22.0
      units mol/L
        Ni  7.57e-5


After reading previous posts in this forum, I modified my input to the lines below, but this resulted in an error: "Phase fix_H+ not found in database. Stopping."  (I am using the wateq4f database, because it has Ni complexation data in it, and it will also work for my high ionic strength solution with Ni, with which I want to compare this low ionic strength speciation.)

 PHASES
   fix_H+
   H+ = H+
   logK 0

EQUILIBRIUM_PHASES
   
       CO2(g)    -3.5
       O2(g)   1.58
   fix_pH -8.3. KOH 8.3
   

 SOLUTION 1 Water Composition for low ionic strength

        pH      8.3
        temp    22.0
      units mol/L
        Ni  7.57e-5
   
Does anyone know how I can write appropriate input for this solution so that pH is fixed? Thank you!!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #1 on: 15/01/15 17:53 »
You are inconsistent in the name given in the PHASES definition and the EQUILIBRIUM_PHASES definition. Use either fix_H+ or fix_pH.

Are you sure you want an O2(g) partial pressure of 10^1.58, about 40 atm? Atmospheric is 10^-0.7.

Another way to do the calculation without adding additional KOH to fix the pH is as follows:

SOLUTION 1 Water Composition for low ionic strength
    temp      22
    pH        8.3
    pe        4
    redox     pe
    units     mol/l
    density   1
    C        1   CO2(g) -3.5
    O(0)     1   O2(g)  1.58
    Ni        7.57e-05
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #2 on: 16/01/15 01:30 »
Thank you, dlparkhurst. I apologize for a couple of careless errors in my post; I was sloppy and too fast while copying bits of input files from previous posts in the forum and pasting into my own input files, and I failed to notice that my student had put in O2 at 1.58! I have used your suggestion at low and high ionic strength now, with O2 = -0.7, and my output now makes a lot of sense.
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #3 on: 21/01/15 16:42 »
Ok, I have spent some time with the PHREEQC manual now, and I think I am getting somewhere, but would be so appreciative of a quick check of my work and happy to add an acknowledgement to my papers to David Parkhurst or anyone else willing to help a bit.

I have four papers in the works in which my students and postdocs have measured either Ni or Zn stable isotope fractionation during adsorption reactions. We observe different fractionations at low and high ionic strength, and we're interested in knowing how the speciation of Ni or Zn in our low versus high ionic strength solutions contributes to the differences in isotope behavior. So I want to use PHREEQC to determine the proportions of various Ni or Zn species in our starting solutions, and I have the theoretically predicted isotope fractionations among these species from the work of Fujii et al. (2014, GCA) with which to assess this.

Our low ionic strength solutions are simply deionized water, adjusted to pH 8 with a tiny bit of KOH, and amended with a bit of Ni or Zn. The solution is in equilibrium with the atmosphere. At high ionic strength, we've made a mixture of the six most abundant salts in seawater in the correct proportions.

What I've done is to use the wateq4f database for both low and high ionic strength, because I'm hypothesizing that it's best to use the same database for direct comparison of the two solutions. (Does this make sense?) For Zn, I've added under the keyword PHASE the log_k for hydrozincite, because this was not in the database.

Could you check to make sure that my input is specifying what I think it is specifying? I've learned in the last two days that small errors can make big differences in speciation of Zn or Ni, and our isotope stories depend on getting this right to the extent that's possible! Please let me know if I have remaining errors to correct. I will attach the two output files of interest for Zn here. Thank you very much!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #4 on: 22/01/15 19:22 »
I won't check input files, but I will answer specific questions about input or output.
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #5 on: 23/01/15 15:24 »
Thanks, David.

My first specific question is whether my decision to use the wateq4f database for a direct comparison of low ionic strength and high ionic strength speciation of Zn is reasonable.

My second question is about the line in the output files that says "Percent error, 100*(Cat-|An|)/(Cat+|An|) ." What does this line mean? What percentage of the total ions are cations in excess of anions? How does this differ from electrical charge balance, which is found in the next line of the output? For high ionic strength, this percent error is very near zero, but at low ionic strength, it is -98.93%. Is that bad, such that I need to fix a problem in my input file? (This solution is water with pH fixed at 8.0 and Zn at 2 micromolar. In the lab I added a tiny bit of KOH to make the pH 8, but in my input file I just specified pH of 8.)

Thanks again for your help! --Laura
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #6 on: 23/01/15 22:11 »
The high ionic strength is about 0.8. This is about the upper limit of the ion association model, especially if the medium is not Na/Cl dominated. I would suggest comparing to the Pitzer model, but the pitzer.dat database does not include Zn. So yes, I think it is reasonable to use wateq4f.dat for the calculations.

The electrical charge (equivalents) is the sum of the charge on the cations minus the sum of the charge on the anions, Cat - |An| in the notation of the percent error line. Phreeqc calculates the percentage error as
100*(Cat-|An|)/(Cat+|An|). Some people divide by the average of the cations and anions, so that the denominator is ((Cat + |An|) / 2), which would give a larger percentage error.

-98% means you do not have any cations to balance the HCO3- in solution; the Zn and OH- concentrations are negligible by comparison. Depending on the cation, it could make a difference in your comparison because it may complex with HCO3- and CO3-2, which would shift the equilibria of Zn somewhat. I would add K to charge balance to see if it makes a difference.

SOLUTION
....
K   1  charge
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #7 on: 23/01/15 23:19 »
Thanks again!

Adding K to balance the HCO3 anions makes only a tiny shift in the Zn speciation, but I'm happy to have learned something about how that works.

I am now feeling confident that my Zn output makes sense for my system without any solid phases. But I'm also trying to speciate a dilute Zn solution that is in equilibrium with calcite (and atmosphere). So I've added Calcite 0 under EQUILIBRIUM_PHASES. But now the output shows an initial speciation and then the results of a batch reaction, presumably between the initial solution and an infinite amount of calcite. And the pH goes up to 9.1 instead of staying fixed at 8.2 as in the initial solution. I need to fix the pH at 8.2, but I don't know the correct way to let the program add acid or base to adjust the pH as we did in the lab experiment. I tried to do something similar to the following example from a previous forum topic on "approaches to estimating and fixing pH," but I keep crashing the program with some wrong syntax. Somehow I need to add Cl or Na to the system, just in the amount needed to add HCl or NaOH for correct pH, but I am failing to figure out how to implement that.

PHASES
   Fix_pH
   H+=H+
   logK 0

EQUILIBRIUM_PHASES
   Fix_pH -10 NaOH 10

I'm sorry to bother you with so many questions, and I will keep reading bits of the manual and examples in an attempt to learn more on my own. I certainly will add an acknowledgement in my paper in thanks for your help!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #8 on: 24/01/15 21:47 »
Seeems like you were on the right track to use Fix_pH (I used Fix_H+, but same idea) to specify pH 8.2. You may only need to add HCl, but here is a fancy way to add either HCl or NaOH, as needed, to achieve the desired pH. I also included atmospheric CO2(g). You can pick and choose what you need from the following script.

SOLUTION 1 Water Composition for low ionic strength
    temp      22
    pH        8
    pe        8.4
    redox     O(-2)/O(0)
    units     mol/l
    density   1
    C         1 CO2(g)     -3.5
    K         1 charge
    O(0)      1 O2(g)      -0.7
    Zn        2e-06
    -water    1 # kg
END
PHASES
Fix_H+
    H+ = H+
    log_k     0
USE solution 1
EQUILIBRIUM_PHASES 1
    CO2(g)    -3.5 10
    Calcite   0 10
    Fix_H+    -8.2 HCl       10
    Halite    -20 10
END
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #9 on: 26/01/15 18:03 »
Hey! Now the output is looking good in terms of pH and charge balance at both low and high ionic strength, with and without calcite! Thanks for your help.

So that I can do similar exercises for our other experimental systems, I want to make sure I understand well the syntax you used below and why it worked. Here's what I'm thinking:

(1) You put "K 1 charge" at low ionic strength, so that K could be added in whatever amount was necessary to balance the charge of the excess HCO3- anions. At high ionic strength I didn't need this, since my cations and anions pretty much balanced each other anyway.

(2) You put "Fix_H+ -8.2 HCl 10" so that HCl was used as a reactant in whatever amount was needed, max of 10 moles, to bring the pH to 8.2.

(3) You put "Halite -20 10" so that there would be a little Cl- available to make the HCl reactant. You made the target saturation index strongly negative so that only a little Cl- and Na+ could be there, just enough to provide the necessary Cl-. Since K is being used to balance charge, its concentration can be reduced in order to allow a little Na+ to be in solution.

(4) The HCl, Calcite, Halite, and HCl all have 10 moles as the amount, so that plenty of each is available, but only enough to satisfy pH and charge constraints will, in fact, be added to the solution.

Could you just let me know if I've understood correctly? I will try not to wait very long before trying some more of these, and I'll save this whole thread, so that I can solidify what I've learned. Many thanks again! --Laura
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #10 on: 26/01/15 18:49 »
All correct except number 3.

3) You put "Halite -20 10" so that there would be a little Cl- available to make the HCl reactant. You made the target saturation index strongly negative so that only a little Cl- and Na+ could be there, just enough to provide the necessary Cl-. Since K is being used to balance charge, its concentration can be reduced in order to allow a little Na+ to be in solution.

Adding the Halite equilibrium phase allows NaOH to be added instead of HCl if necessary to arrive at the specified pH.

If HCl is needed, HCl is added through the Fix_H+ reaction, and a tiny bit of NaCl dissolves to put enough Na+ in solution to have an SI of -20 for Halite.

If NaOH is needed, then NaCl dissolves and HCl is removed, leaving Na+ and OH- in solution. Concentration of Cl wil be quite small to obtain the -20 SI.

NaCl + H2O = Na+ + OH- + HCl(l)

The (l) simply indicates it is removed from solution.
Logged

wasylenki

  • Frequent Contributor
  • Posts: 11
Re: need help fixing pH
« Reply #11 on: 26/01/15 19:39 »
Got it! So these means the bases* are covered no matter which way the pH needs to be adjusted, and only a little Na+ or Cl- will end up in there to make that happen.

I will pay it forward by sharing all of your help with the graduate student in my department who first did the calculations in an attempt to help me, so that she might be able to do a better job with her own thesis calculations (in GWB, with a completely different application from what my group is doing). 

Best wishes,
--Laura

*No pun intended.
Logged

MichaelZ20

  • Top Contributor
  • Posts: 162
Re: need help fixing pH
« Reply #12 on: 23/12/21 22:00 »
Dear David,
Can you please explain why HCl is removed from the solution when NaCl hydrolysis takes place at fixing pH by  Halite -20 10 ?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4036
Re: need help fixing pH
« Reply #13 on: 24/12/21 00:30 »
First, let's assume you use Fix_H+ and HCl and you need to decrease the pH; acid--HCl--will simply be added to the solution. The concentration of Cl- will be significant (>1e-8), and assuming Na concentration is zero initially, NaCl will dissolve a tiny amount so that the product [Na+][Cl-] = 10^-20. [Na+] will be 1e-12 or smaller.

If the pH needs to increase and Cl is present in solution, HCl will be removed from the solution, which you could represent with the following reaction (again HCl(l) means it is removed from the solution):

Code: [Select]
H2O + Cl- = HCl(l) + OH-

Now, there can be a few problems with this reaction. First, it is hard to imagine physically removing HCl from solution. Moreover, the reaction is limited by the amount of Cl in solution; you can only take out as much Cl as is present initially, which may not be enough to adjust to the desired pH (PHREEQC will fail to converge). If there is no Cl (as in the example), it is not possible to increase the pH in this way at all. A way around the problem is to add the NaCl. It will allow adding NaOH when base is needed.

If you need to add NaOH to raise the pH, you can get the Na from NaCl. However, you do not want to add the Cl to solution, so the Fix_pH with HCl allows you to remove Cl. In general, you will need a significant amount of NaOH to fix the pH, so the Na concentration will be 1e-8 mol/kgw or greater, but with log K for NaCl of -20, the Cl- concentration will be 1e-12 or smaller.

Code: [Select]
solution + NaCl + H2O = solution + Na+ + OH- + HCl(l)

The dissolution of halite and removal of HCl don't make sense individually, but the net reaction is simply to add NaOH to raise the pH.
Logged

MichaelZ20

  • Top Contributor
  • Posts: 162
Re: need help fixing pH
« Reply #14 on: 24/12/21 06:28 »
Dear David,
Thank you for the explanation!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • need help fixing pH
 

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