PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Mixing »
  • Incremental mixing
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Incremental mixing  (Read 12553 times)

Flopi

  • Top Contributor
  • Posts: 26
Incremental mixing
« on: 25/11/16 21:15 »
Hello,
I'm quite new to Phreeqc so the answer might be obvious...

I am studying the effect of mixing of two solution on the different equilibriums. Currently my solution is to copy paste the block :
MIX
     1     0.2
     2     0.8
EQUILIBRIUM_PHASES
    barite    0.8    10
    pyrite       0    10
END

The only problem is that when I want to change the equilibrium saturation of barite, or if I want to add another mineral, I have to do it to all the blocks (and I have quite a lot).
Is there a way to create a loop, or to store the saturation indexes in a variable a do something like that ?

for i = 1 to 20
MIX
      1   0.05 * i
      2   1-0.05 * i
EQUILIBRIUM_PHASES
barite x y
pyrite a b
END

Thank you for your suggestions,

Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Incremental mixing
« Reply #1 on: 26/11/16 01:30 »
No, there is no looping capability for mix.

You have a few choices:

(1) You can generate the input file in Excel or a scripting language, and then run it.

(2) You can program the input in USER_PUNCH and then use INSERT$ to run the generated file. See example 8 (or 21).

or

(3) You can use IPhreeqc in a scripting or programming language. IPhreeqcCOM will work with Visual Basic in Excel, Matlab, or Python. IPhreeqc can be compiled into C, C++, or Fortran.
Logged

Flopi

  • Top Contributor
  • Posts: 26
Re: Incremental mixing
« Reply #2 on: 28/11/16 20:06 »
Hello,
Thank you for the quick answer. I used Python to generate the input file. Works perfectly. I join the .py file if anybody is interested.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Mixing »
  • Incremental mixing
 

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