Beginners > SELECTED_OUTPUT
Help! PHREEQC Output Incomplete for Fluoride Removal Study
dlparkhurst:
Why do you have this line? I just told you there is no Basic function pH.
--- Code: ---10 graph_x pH
--- End code ---
Why should I respond if you don't pay attention to what I write?
Try again. Give a revised script for one graph, not three, and use the # button above the text box to set off your script.
i_azharkhan:
Thank you for your response and pointing that out.
You're right 10 graph_x pH would not work in this case, and I did not include that in my script. Instead, I've tried using:
10 GRAPH_SY -LA("H+")
to get pH on the secondary Y-axis, but unfortunately the graph still shows zero and doesn't reflect any variation in pH or fluoride removal. The red line stays flat, and I'm not sure if this is due to how I'm calculating removal percentage or how I've set up the axes.
I'd really appreciate any insight into why it might be plotting zeros, even though the speciation and pH should be changing across the simulations. Perhaps I'm missing something in how the USER_GRAPH block reads the simulation results?
Thank you again for your time and help.
dlparkhurst:
--- Code: ---TITLE Fluoride Speciation and Precipitation in Mine Drainage Sample 1
SOLUTION 1
temp 25
pH 4.48
pe 4.9
redox pe
units mg/l
density 1
Al 252
Ba 0.03
C(4) 21.5
Ca 350
Cd 0.02
Cl 8.66
Cu 9
F 228
Fe 0.09
K 8.45
Mg 487
Mn 17
N(5) 24.6
Na 60.8
Ni 5
Pb 0.01
S(6) 3362
Sr 1.88
Zn 1
-water 1 # kg
USER_PRINT
10 if (GET(1) = 0) THEN PUT(TOT("F"), 1)
END
USE solution 1
REACTION 1
Ca(OH)2 1
0.02 moles in 40 steps
EQUILIBRIUM_PHASES 1
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
USER_GRAPH 1
-headings rxn %_removal pH
-axis_titles "Ca(OH)2 added, moles" "% removal" "pH"
-chart_title "Fluoride Removal with Ca(OH)2 Addition"
#-axis_scale x_axis 4 8 0.5 0.5
#-axis_scale y_axis 0 250 50 50
-initial_solutions false
-connect_simulations true
-plot_concentration_vs x
-start
10 graph_x rxn
20 GRAPH_Y (GET(1) - TOT("F"))/GET(1)*100
30 GRAPH_SY -LA("H+")
-end
-active true
END
--- End code ---
i_azharkhan:
Thank you so much, respected sir, for the PHREEQC input file.
Thank you very much for kindly sharing the PHREEQC input file with me. I truly appreciate your support; it has been very helpful in guiding my understanding of the modeling process.
I would like to ask for a bit of clarification: can this input file be used to model all the samples if I run them together, or would I need to modify it for each individual sample?
Thank you again for your time and generosity. I?m grateful for the opportunity to learn from your work.
dlparkhurst:
It could be best and easiest if you simply edit a file for each solution.
You have the most flexibility if you use IPhreeqc with a scripting or programming language to automate many runs.
It is possible, but clunky, to use SELECTED_OUTPUT and USER_PUNCH to write a script for repetitive calculations. I am attaching an example, but you are on your own to decide if you want to understand and use this approach. I am not planning to give any more guidance.
--- Code: ---TITLE Fluoride Speciation and Precipitation in Mine Drainage Sample 1
USER_PRINT
10 if (GET(cell_no) = 0) THEN PUT(TOT("F"), cell_no)
END
REACTION 1
Ca(OH)2 1
0.02 moles in 40 steps
END
EQUILIBRIUM_PHASES 1
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
END
SOLUTION 1
temp 25
pH 4.48
pe 4.9
redox pe
units mg/l
density 1
Al 252
Ba 0.03
C(4) 21.5
Ca 350
Cd 0.02
Cl 8.66
Cu 9
F 228
Fe 0.09
K 8.45
Mg 487
Mn 17
N(5) 24.6
Na 60.8
Ni 5
Pb 0.01
S(6) 3362
Sr 1.88
Zn 1
-water 1 # kg
SELECTED_OUTPUT 100
-file repetitive.pqi
USER_PUNCH 100
10 FOR i = 1 TO 3
20 s$ = s$ + "USE solution " + str$(i) + EOL$
30 s$ = s$ + "USE equilibrium_phases 1" + EOL$
40 s$ = s$ + "USE reaction 1" + EOL$
50 s$ = s$ + "USER_GRAPH " + str$(i) + EOL$
60 s$ = s$ + "-headings rxn %_removal pH" + EOL$
70 s$ = s$ + '-axis_titles "Ca(OH)2 added, moles" "% removal" "pH"' + EOL$
80 s$ = s$ + '-chart_title "Ca(OH)2 addition: Solution ' + trim(Str$(i)) + EOL$
90 s$ = s$ + ' -connect_simulations true' + EOL$
100 s$ = s$ + ' -plot_concentration_vs x' + EOL$
110 s$ = s$ + ' -start' + EOL$
120 s$ = s$ + '10 graph_x rxn' + EOL$
130 s$ = s$ + '20 GRAPH_Y (GET(cell_no) - TOT("F"))/GET(cell_no)*100' + EOL$
140 s$ = s$ + '30 GRAPH_SY -LA("H+")' + EOL$
150 s$ = s$ + ' -end ' + EOL$
160 s$ = s$ + 'END' + EOL$
170 s$ = s$ + 'USER_GRAPH ' + STR$(i) + EOL$
180 s$ = s$ + ' active false' + EOL$
190 s$ = s$ + 'END' + EOL$
200 NEXT i
300 PUNCH s$
310 END
END
SELECTED_OUTPUT 100
-active false
END
SOLUTION 2
temp 25
pH 4.48
pe 4.9
redox pe
units mg/l
density 1
Al 252
Ba 0.03
C(4) 21.5
Ca 350
Cd 0.02
Cl 8.66
Cu 9
F 114 #228
Fe 0.09
K 8.45
Mg 487
Mn 17
N(5) 24.6
Na 60.8
Ni 5
Pb 0.01
S(6) 3362
Sr 1.88
Zn 1
-water 1 # kg
END
SOLUTION 3
temp 25
pH 4.48
pe 4.9
redox pe
units mg/l
density 1
Al 252
Ba 0.03
C(4) 21.5
Ca 350
Cd 0.02
Cl 8.66
Cu 9
F 72 #228
Fe 0.09
K 8.45
Mg 487
Mn 17
N(5) 24.6
Na 60.8
Ni 5
Pb 0.01
S(6) 3362
Sr 1.88
Zn 1
-water 1 # kg
END
INCLUDE$ repetitive.pqi
END
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version