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 »
  • BASIC functions »
  • Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH  (Read 2437 times)

MichaelZ20

  • Top Contributor
  • Posts: 162
Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH
« on: 04/01/20 16:55 »
Can somebody help to modify my code?
In its present form it does not take Ca for Fix_Ca from the SOLUTION_SPREAD.
Thank you in advance!
« Last Edit: 04/01/20 16:56 by MichaelZ20 »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4074
Re: Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH
« Reply #1 on: 04/01/20 22:22 »
If you use your Fix_Ca, then you are fixing the activity of the Ca+2 ion. So, it is inconsistent to use TOT("Ca"), which is the total molality of calcium; you are setting the activity of calcium ion to the original total concentration of calcium.

LA("Ca+2") would give the original log activity of Ca+2. Here is a modification of your code to use this value:

Code: [Select]
  40 PUNCH "Fix_Ca  ", LA("Ca+2"), "  CO2(g)" + EOL$

The attached file Phrqc1.pqi removes the loop on solutions (one simulation is written for each initial solution) and uses log activity of Ca+2.

My guess is that you would prefer to keep the total molality of calcium unchanged, and simply add or remove CO2 to get to calcite equilibrium. The attached file Phrqc3.pqi does this calculation. There are often two solutions to this problem, one that adds CO2 to reduce the pH to calcite equilibrium, and one that removes CO2 to produce a relatively high pH and low carbon concentration. The input file adds CO2 (pH decrease) if SI calcite > 0, otherwise CO2 will be removed (pH increase).

Logged

MichaelZ20

  • Top Contributor
  • Posts: 162
Re: Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH
« Reply #2 on: 05/01/20 18:24 »
Dear David, thank you for your help!
The second file solves my problem.
« Last Edit: 05/01/20 20:56 by MichaelZ20 »
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • BASIC functions »
  • Multiple Fix_Ca in EQUILIBRIUM_PHASES produced by USER_PUNCH
 

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