Click here to donate to keep PhreeqcUsers open
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forum Home
Login
Register
PhreeqcUsers Discussion Forum
»
Processes
»
Mixing
»
Incremental mixing
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Incremental mixing (Read 3600 times)
Flopi
Top Contributor
Posts: 26
Incremental mixing
«
on:
November 25, 2016, 09:15:39 PM »
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: 3759
Re: Incremental mixing
«
Reply #1 on:
November 26, 2016, 01:30:51 AM »
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:
November 28, 2016, 08:06:28 PM »
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