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
»
Processes
»
Mixing
»
Problems simulating a reaction and after a mix step
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Problems simulating a reaction and after a mix step (Read 4921 times)
Snavea
Contributor
Posts: 5
Problems simulating a reaction and after a mix step
«
on:
24/03/15 16:00 »
Hi,
I would like to do a reaction usings steps and with the result of each step do a mix.
I have written this script:
REACTION 1
CaCl2 1 # Reactant, followed by stoichiometric coefficient
Br 0.001 # Tracer species
0.001 in 10 steps
use solution 2
Save solution 3
end
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
Gut then I only obtain one result instead of ten.
Can someone help me?
Thanks
Logged
dlparkhurst
Global Moderator
Posts: 4074
Re: Problems simulating a reaction and after a mix step
«
Reply #1 on:
24/03/15 16:47 »
Unfortunately, it is not possible to multiple MIX calculations with a single definition. Unlike REACTION, you must make each MIX explicitly.
I am not sure which solutions are supposed to be reacted and mixed, but here is an example of a couple of reaction and mix steps.
SOLUTION 1
SOLUTION 2
END
REACTION 1
CaCl2 1 # Reactant, followed by stoichiometric coefficient
Br 0.001 # Tracer species
0.0001
END
USE solution 2
USE reaction 1
SAVE solution 3
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
SAVE solution 2
END
USE solution 2
USE reaction 1
SAVE solution 3
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
save solution 2
END
Logged
Snavea
Contributor
Posts: 5
Re: Problems simulating a reaction and after a mix step
«
Reply #2 on:
26/03/15 14:50 »
Thanks dlparkhurst,
Following your example I jhave tried to do that:
REACTION 1
CaCl2 1 # Reactant, followed by stoichiometric coefficient
Br 0.001 # Tracer species
0.001
END
use solution 2
Save solution 3
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
save solution 4
END
Use solution 3
Use reaction 1
Save solution 3
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
save solution 5
END
Use solution 3
Use reaction 1
Save solution 3
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
3 0.75 # adds fraction 0.75 of solution 3
save solution 6
END
But the program gives me an error that solution 3 is not found.
Thanks a lot
Logged
dlparkhurst
Global Moderator
Posts: 4074
Re: Problems simulating a reaction and after a mix step
«
Reply #3 on:
26/03/15 15:41 »
A solution is SAVEd only after a reaction calculation, and a reaction calculation requires a SOLUTION and another reactant. So,
END
USE solution 2
SAVE solution 3
END
does not produce a reaction, and a solution is not saved.
Replace with
COPY solution 2 3
Logged
Snavea
Contributor
Posts: 5
Re: Problems simulating a reaction and after a mix step
«
Reply #4 on:
30/03/15 10:18 »
Thanks dlparkhurst.
Now I have another problem. I try to get the results in an output file but I only obtain the result of one of te silulations. I know that the problem is something related with the position of END in -selected output command but I can't find the solution. Can you help me?
Thanks in advance,
Snavea
SOLUTION 1 A
END
SOLUTION 2 B
END
REACTION 1
CaCl2 1 0.001# Reactant, followed by stoichiometric coefficient
USE solution 2
END
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
2 0.75 # adds fraction 0.75 of solution 2
SELECTED_OUTPUT
-file results.dat
-selected_out true
-pH true
-solution true
-distance false
-step false
-time false
-state false
-simulation true
-totals Ca Mg Na B
REACTION 2
CaCl2 1 0.0015# Reactant, followed by stoichiometric coefficient
USE solution 2
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
2 0.75 # adds fraction 0.75 of solution 2
REACTION 3
CaCl2 1 0.002# Reactant, followed by stoichiometric coefficient
USE solution 2
MIX 1
1 0.25 # takes fraction 0.25 of solution 1
2 0.75 # adds fraction 0.75 of solution 2
SELECTED_OUTPUT
-file Ofrea_4.dat
-selected_out true
-pH true
-solution true
-distance false
-step false
-time false
-state false
-simulation true
-totals Ca Mg Na B
-calculate_values SAR B_ppm
END
Logged
dlparkhurst
Global Moderator
Posts: 4074
Re: Problems simulating a reaction and after a mix step
«
Reply #5 on:
31/03/15 04:12 »
Put an END before REACTION 2 and before REACTION 3.
I am not sure you need two SELECTED_OUTPUT data blocks. If you keep only the first, you will get a line for each MIX calculation. I also do not think you need the "USE solution" (except the first one) if you are using MIX; the MIX takes precedence anyway.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
PhreeqcUsers Discussion Forum
»
Processes
»
Mixing
»
Problems simulating a reaction and after a mix step