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 »
  • Processes »
  • Dissolution and precipitation »
  • Reaction-path calculations
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Reaction-path calculations  (Read 5766 times)

adrianosbz

  • Contributor
  • Posts: 7
Reaction-path calculations
« on: 21/03/15 23:10 »
Hi Everybody,
I have tried exhaustively to run de script referring to Simulation  6 in order to take hold of its after in my column experiment.

"Reaction step 1.

ERROR: Syntax_error : missing " or (
ERROR:  in BASIC line
 10  PLOT_XY LA("H4SiO4"), (LA("K+") -LA("H+")) \
ERROR: Fatal Basic error in USER_GRAPH."

However, it gets syntax error which I do not get to solve this problem. Could someone help me, please???
TITLE Simulation 6A.--React to phase boundaries.
SOLUTION 1   PURE WATER
pH   7.0   charge
temp   25.0
PHASES
Gibbsite
Al(OH)3 + 3 H+ = Al+3 + 3 H2O
log_k      8.049
delta_h      -22.792 kcal
Kaolinite
Al2Si2O5(OH)4 + 6 H+ = H2O + 2 H4SiO4 + 2 Al+3
log_k      5.708
delta_h      -35.306 kcal
K-mica
KAl3Si3O10(OH)2 + 10 H+ = 3 Al+3 + 3 H4SiO4 + K+
log_k      12.970
delta_h      -59.377 kcal
K-feldspar
KAlSi3O8 + 4 H2O + 4 H+ = Al+3 + 3 H4SiO4 + K+
log_k      0.875
delta_h      -12.467 kcal
SELECTED_OUTPUT
-file      ex6A-B.sel
-activities   K+ H+ H4SiO4
-si      Gibbsite Kaolinite K-mica K-feldspar
-equilibrium   Gibbsite Kaolinite K-mica K-feldspar
END
TITLE      Simulation 6A1.--Find amount of K-feldspar dissolved to reach gibbsite saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   KAlSi3O8      10.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   0.0
USER_GRAPH 1   Simulation 6
-headings 6A--Intersections
-chart_title "K-Feldspar Reaction Path"
-axis_titles "Log[H4SiO4]" "Log([K+] / [H+])"
-axis_scale x_axis -8.0 0.0 1 1
-axis_scale y_axis -1.0 8.0 1 1
10 PLOT_XY   LA("H4SiO4"), (LA("K+") -LA("H+")), color = Red, line_w = 0, \ symbol = Circle, symbol_size = 10
END
TITLE Simulation   6A2.--Find amount of K-feldspar dissolved to reach kaolinite saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0    KAlSi3O8 10.0
K-mica   0.0 0.0
K-feldspar   0.0 0.0
END
TITLE Simulation   6A3.--Find amount of K-feldspar dissolved to reach K-mica saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0 0.0
Kaolinite   0.0 0.0
K-mica   0.0   KAlSi3O8   10.0
K-feldspar   0.0   0.0
END
TITLE Simulation   6A4.--Find amount of K-feldspar dissolved to reach K-feldspar saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   KAlSi3O8   10.0
END
TITLE Simulation   6A5.--Find point with kaolinite present, but no gibbsite.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   KAlSi3O8   10.0
Kaolinite   0.0   1.0
END
TITLE Simulation   6A6.--Find point with K-mica present, but no kaolinite
USE solution 1
EQUILIBRIUM_PHASES 1
Kaolinite   0.0   KAlSi3O8   10.0
K-mica   0.0   1.0
END
TITLE Simulation   6B.--Path between phase boundaries.
USE solution 1
EQUILIBRIUM_PHASES 1
Kaolinite   0.0   0.0
Gibbsite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   0.0
REACTION 1
K-feldspar   1.0
0.04 0.08 0.16 0.32 0.64 1.0 2.0 4.0
8.0 16.0 32.0 64.0 100 200 umol
USER_GRAPH
-headings   6B--Increments
10 PLOT_XY LA("H4SiO4"),(LA("K+")-LA("H+")), color = Blue, line_w = 0, \
symbol = XCross, symbol_size = 7
END
TITLE Simulation   6C.--kinetic calculation
SOLUTION 1
-units mol/kgw
Al 1.e-13
K 1.e-13
Si 3.e-13
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
KINETICS 1
K-feldspar
# k0 * A/V = 1e-16 mol/cm2/s * (10% fsp, 0.1mm cubes) 136/cm = 136.e-13 mol/dm3/s
-parms   1.36e-11
-m0   2.16
-m   1.94
-step_divide   1e-6
-steps   1e2 1e3 1e4 1e5 1e6 1e7 1e8
#   -steps   1e2 1e3 1e4 1e5 63240.0 64950.0 1347610.0 1010300.0 45242800.0
INCREMENTAL_REACTIONS true
RATES
K-feldspar
-start
10 REM store the initial amount of K-feldspar
20 IF EXISTS(1) = 0 THEN PUT(M, 1)
30 REM calculate moles of reaction
40 SR_kfld = SR("K-feldspar")
50 moles = PARM(1) * (M/M0)^0.67 * (1 - SR_kfld) * TIME
60 REM The following is for printout of phase transitions
80 REM Start Gibbsite
90 if ABS(SI("Gibbsite")) > 1e-3 THEN GOTO 150
100 i = 2
110 GOSUB 1500
150 REM Start Gibbsite -> Kaolinite
160 if ABS(SI("Kaolinite")) > 1e-3 THEN GOTO 200
170 i = 3
180 GOSUB 1500
200 REM End Gibbsite -> Kaolinite
210 if ABS(SI("Kaolinite")) > 1e-3 OR EQUI("Gibbsite") > 0 THEN GOTO 250
220 i = 4
230 GOSUB 1500
250 REM Start Kaolinite -> K-mica
260 if ABS(SI("K-mica")) > 1e-3 THEN GOTO 300
270 i = 5
280 GOSUB 1500
300 REM End Kaolinite -> K-mica
310 if ABS(SI("K-mica")) > 1e-3 OR EQUI("Kaolinite") > 0 THEN GOTO 350
320 i = 6
330 GOSUB 1500
350 REM Start K-mica -> K-feldspar
360 if ABS(SI("K-feldspar")) > 1e-3 THEN GOTO 1000
370 i = 7
380 GOSUB 1500
1000 SAVE moles
1010 END
1500 REM subroutine to store data
1510 if GET(i) >= M THEN RETURN
1520 PUT(M, i)
1530 PUT(TOTAL_TIME, i, 1)
1540 PUT(LA("K+") -LA("H+"), i, 2)
1550 PUT(LA("H4SiO4"), i, 3)
1560 RETURN
-end
USER_PRINT
10 DATA   "A: Gibbsite ", "B: Gibbsite -> Kaolinite ", \
"C: Gibbsite -> Kaolinite ", "D: Kaolinite -> K-mica ", \
"E: Kaolinite -> K-mica ", "F: K-mica -> K-feldspar"
20 PRINT \
" Transition Time K-feldspar LA(K/H) LA(H4SiO4)"
30 PRINT " transfer"
40 PRINT " (umoles)"
50 FOR i = 2 TO 7
60 READ s$
70 IF EXISTS(i) THEN PRINT s$, GET(i,1), (GET(1) - GET(i))*1e6, GET(i,2), GET(i,3)
80 NEXT i
SELECTED_OUTPUT
-file   ex6C.sel
-reset   false
USER_PUNCH
-headings pH+log[K] log[H4SiO4]
10 PUNCH LA("K+")-LA("H+") LA("H4SiO4")
USER_GRAPH
-headings 6C--Kinetics
10 PLOT_XY LA("H4SiO4"),(LA("K+")-LA("H+")), color = Blue, line_w = 2, symbol = None
END
PRINT;   -user_print false
# --Plot the phase boundaries with USER_GRAPH..
PHASES
K_H; KH = K+ - H+; -no_check
USER_GRAPH
-initial_solutions true
10 PLOT_XY LA("H4SiO4"), SI("K_H"), color = Black, symbol = None
SOLUTION 1
pH 11; K 1 K_H 8; Al 1 Gibbsite; Si 1 K-mica
SOLUTION 2
pH 7; K 1 K-mica; Al 1 Gibbsite; Si 1 Kaolinite
SOLUTION 3
pH 7; K 1 K-mica; Al 1 K-feldspar; Si 1 Kaolinite
SOLUTION 4
pH 7; K 1 K_H -1; Al 1 Kaolinite; Si 1 K-feldspar
END
USER_GRAPH
10 PLOT_XY LA("H4SiO4"), SI("K_H"), color = Black, symbol = None
SOLUTION 1
pH 11; K 1 K_H 8; Al 1 K-feldspar; Si 1 K-mica
SOLUTION 2
pH 7; K 1 K-mica; Al 1 K-feldspar; Si 1 Kaolinite
SOLUTION 3
pH 7; K 1 K-mica; Al 1 Gibbsite; Si 1 Kaolinite
SOLUTION 4
pH 7; K 1 K_H -1; Al 1 Gibbsite; Si 1 Kaolinite
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Reaction-path calculations
« Reply #1 on: 22/03/15 01:55 »
A back slash ("\") is a line continuation indicator. It should be the last character on a line except for white space. It looks like there is a back slash in the middle of a line.

I am not sure that is the problem, but as a test, I would remove the back slash and simply put the entire statement on one line. You can also simply remove that line and make sure the script runs. If so, then perhaps there is a non-printing character that is causing the problem. Build the line up in pieces until you get something to work.

I just copied the ex6.pqi file from the installation directory and copied it into PhreeqcI and it ran without a problem. So that is another test you can try.
Logged

adrianosbz

  • Contributor
  • Posts: 7
Re: Reaction-path calculations
« Reply #2 on: 22/03/15 12:11 »
Ok, Mr. Parkhurst, I am going to try to run it this way. Thank you!
Logged

adrianosbz

  • Contributor
  • Posts: 7
Re: Reaction-path calculations
« Reply #3 on: 22/03/15 12:42 »
Dear Parkhurst,

I removed the back slashes, and ran the program, as you had suggested. And now it has arisen another problem:

Reaction step 1.

ERROR: Extra information on line
ERROR: Fatal Basic error in USER_GRAPH.

Here again, I request a help to solve this issue, please. I thank for all! Follow the last script:

TITLE Simulation 6A.--React to phase boundaries.
SOLUTION 1   PURE WATER
pH   7.0   charge
temp   25.0
PHASES
Gibbsite
Al(OH)3 + 3 H+ = Al+3 + 3 H2O
log_k      8.049
delta_h      -22.792 kcal
Kaolinite
Al2Si2O5(OH)4 + 6 H+ = H2O + 2 H4SiO4 + 2 Al+3
log_k      5.708
delta_h      -35.306 kcal
K-mica
KAl3Si3O10(OH)2 + 10 H+ = 3 Al+3 + 3 H4SiO4 + K+
log_k      12.970
delta_h      -59.377 kcal
K-feldspar
KAlSi3O8 + 4 H2O + 4 H+ = Al+3 + 3 H4SiO4 + K+
log_k      0.875
delta_h      -12.467 kcal
SELECTED_OUTPUT
-file      ex6A-B.sel
-activities   K+ H+ H4SiO4
-si      Gibbsite Kaolinite K-mica K-feldspar
-equilibrium   Gibbsite Kaolinite K-mica K-feldspar
END
TITLE      Simulation 6A1.--Find amount of K-feldspar dissolved to reach gibbsite saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   KAlSi3O8      10.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   0.0
USER_GRAPH 1   Simulation 6
-headings 6A--Intersections
-chart_title "K-Feldspar Reaction Path"
-axis_titles "Log[H4SiO4]" "Log([K+] / [H+])"
-axis_scale x_axis -8.0 0.0 1 1
-axis_scale y_axis -1.0 8.0 1 1
10 PLOT_XY   LA("H4SiO4"), (LA("K+") -LA("H+")), color = Red, line_w = 0, symbol = Circle, symbol_size = 10
END
TITLE Simulation   6A2.--Find amount of K-feldspar dissolved to reach kaolinite saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0    KAlSi3O8 10.0
K-mica   0.0 0.0
K-feldspar   0.0 0.0
END
TITLE Simulation   6A3.--Find amount of K-feldspar dissolved to reach K-mica saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0 0.0
Kaolinite   0.0 0.0
K-mica   0.0   KAlSi3O8   10.0
K-feldspar   0.0   0.0
END
TITLE Simulation   6A4.--Find amount of K-feldspar dissolved to reach K-feldspar saturation.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   KAlSi3O8   10.0
END
TITLE Simulation   6A5.--Find point with kaolinite present, but no gibbsite.
USE solution 1
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   KAlSi3O8   10.0
Kaolinite   0.0   1.0
END
TITLE Simulation   6A6.--Find point with K-mica present, but no kaolinite
USE solution 1
EQUILIBRIUM_PHASES 1
Kaolinite   0.0   KAlSi3O8   10.0
K-mica   0.0   1.0
END
TITLE Simulation   6B.--Path between phase boundaries.
USE solution 1
EQUILIBRIUM_PHASES 1
Kaolinite   0.0   0.0
Gibbsite   0.0   0.0
K-mica   0.0   0.0
K-feldspar   0.0   0.0
REACTION 1
K-feldspar   1.0
0.04 0.08 0.16 0.32 0.64 1.0 2.0 4.0
8.0 16.0 32.0 64.0 100 200 umol
USER_GRAPH
-headings   6B--Increments
10 PLOT_XY LA("H4SiO4"), (LA("K+")-LA("H+")), color = Blue, line_w = 0,
symbol = XCross, symbol_size = 7
END
TITLE Simulation   6C.--kinetic calculation
SOLUTION 1
-units mol/kgw
Al 1.e-13
K 1.e-13
Si 3.e-13
EQUILIBRIUM_PHASES 1
Gibbsite   0.0   0.0
Kaolinite   0.0   0.0
K-mica   0.0   0.0
KINETICS 1
K-feldspar
# k0 * A/V = 1e-16 mol/cm2/s * (10% fsp, 0.1mm cubes) 136/cm = 136.e-13 mol/dm3/s
-parms   1.36e-11
-m0   2.16
-m   1.94
-step_divide   1e-6
-steps   1e2 1e3 1e4 1e5 1e6 1e7 1e8
#   -steps   1e2 1e3 1e4 1e5 63240.0 64950.0 1347610.0 1010300.0 45242800.0
INCREMENTAL_REACTIONS true
RATES
K-feldspar
-start
10 REM store the initial amount of K-feldspar
20 IF EXISTS(1) = 0 THEN PUT(M, 1)
30 REM calculate moles of reaction
40 SR_kfld = SR("K-feldspar")
50 moles = PARM(1) * (M/M0)^0.67 * (1 - SR_kfld) * TIME
60 REM The following is for printout of phase transitions
80 REM Start Gibbsite
90 if ABS(SI("Gibbsite")) > 1e-3 THEN GOTO 150
100 i = 2
110 GOSUB 1500
150 REM Start Gibbsite -> Kaolinite
160 if ABS(SI("Kaolinite")) > 1e-3 THEN GOTO 200
170 i = 3
180 GOSUB 1500
200 REM End Gibbsite -> Kaolinite
210 if ABS(SI("Kaolinite")) > 1e-3 OR EQUI("Gibbsite") > 0 THEN GOTO 250
220 i = 4
230 GOSUB 1500
250 REM Start Kaolinite -> K-mica
260 if ABS(SI("K-mica")) > 1e-3 THEN GOTO 300
270 i = 5
280 GOSUB 1500
300 REM End Kaolinite -> K-mica
310 if ABS(SI("K-mica")) > 1e-3 OR EQUI("Kaolinite") > 0 THEN GOTO 350
320 i = 6
330 GOSUB 1500
350 REM Start K-mica -> K-feldspar
360 if ABS(SI("K-feldspar")) > 1e-3 THEN GOTO 1000
370 i = 7
380 GOSUB 1500
1000 SAVE moles
1010 END
1500 REM subroutine to store data
1510 if GET(i) >= M THEN RETURN
1520 PUT(M, i)
1530 PUT(TOTAL_TIME, i, 1)
1540 PUT(LA("K+") -LA("H+"), i, 2)
1550 PUT(LA("H4SiO4"), i, 3)
1560 RETURN
-end
USER_PRINT
10 DATA   "A: Gibbsite ", "B: Gibbsite -> Kaolinite ",
"C: Gibbsite -> Kaolinite ", "D: Kaolinite -> K-mica ",
"E: Kaolinite -> K-mica ", "F: K-mica -> K-feldspar"
20 PRINT
" Transition Time K-feldspar LA(K/H) LA(H4SiO4)"
30 PRINT " transfer"
40 PRINT " (umoles)"
50 FOR i = 2 TO 7
60 READ s$
70 IF EXISTS(i) THEN PRINT s$, GET(i,1), (GET(1) - GET(i))*1e6, GET(i,2), GET(i,3)
80 NEXT i
SELECTED_OUTPUT
-file   ex6C.sel
-reset   false
USER_PUNCH
-headings pH+log[K] log[H4SiO4]
10 PUNCH LA("K+")-LA("H+") LA("H4SiO4")
USER_GRAPH
-headings 6C--Kinetics
10 PLOT_XY LA("H4SiO4"),(LA("K+")-LA("H+")), color = Blue, line_w = 2, symbol = None
END
PRINT;   -user_print false
# --Plot the phase boundaries with USER_GRAPH..
PHASES
K_H; KH = K+ - H+; -no_check
USER_GRAPH
-initial_solutions true
10 PLOT_XY LA("H4SiO4"), SI("K_H"), color = Black, symbol = None
SOLUTION 1
pH 11; K 1 K_H 8; Al 1 Gibbsite; Si 1 K-mica
SOLUTION 2
pH 7; K 1 K-mica; Al 1 Gibbsite; Si 1 Kaolinite
SOLUTION 3
pH 7; K 1 K-mica; Al 1 K-feldspar; Si 1 Kaolinite
SOLUTION 4
pH 7; K 1 K_H -1; Al 1 Kaolinite; Si 1 K-feldspar
END
USER_GRAPH
10 PLOT_XY LA("H4SiO4"), SI("K_H"), color = Black, symbol = None
SOLUTION 1
pH 11; K 1 K_H 8; Al 1 K-feldspar; Si 1 K-mica
SOLUTION 2
pH 7; K 1 K-mica; Al 1 K-feldspar; Si 1 Kaolinite
SOLUTION 3
pH 7; K 1 K-mica; Al 1 Gibbsite; Si 1 Kaolinite
SOLUTION 4
pH 7; K 1 K_H -1; Al 1 Gibbsite; Si 1 Kaolinite
END


 
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Reaction-path calculations
« Reply #4 on: 22/03/15 16:52 »
When you have errors, you should do a little testing and debuggin yourself. The error message indicates a data block or line where the problem occurs. Remove data blocks or lines until the error does not occur, then try to figure out what is wrong with the data block or line. In this case, I think you will find input fragments that were previously concatenated with a back slash.

Alternatively, I suggest you retrieve the original example 6 from a location similar to one of the following:

C:\Program Files (x86)\USGS\Phreeqc Interactive 3.1.2-8538\examples
or
C:\Program Files (x86)\USGS\phreeqc-3.1.2-8538\examples

Logged

adrianosbz

  • Contributor
  • Posts: 7
Re: Reaction-path calculations
« Reply #5 on: 22/03/15 18:32 »
Thank you very much, Mr. Parkhurst, I will try to do yours suggestions. Give a return later!
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Dissolution and precipitation »
  • Reaction-path calculations
 

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