Beginners > SELECTED_OUTPUT
Help! PHREEQC Output Incomplete for Fluoride Removal Study
i_azharkhan:
Hi PHREEQC community,
I'm a student working on my research titled "Study on Fluoride Species in its Precipitation Removal Process and Strengthening Strategies for Mine Drainage." I'm using PHREEQC to model fluoride speciation and precipitation in mine drainage, but I'm running into issues with incomplete output files. I'm hoping you experts can help me figure out what's wrong! I'm not super experienced with PHREEQC, so please bear with me if I missed something obvious.
What I'm Trying to Do
My sample is mine drainage with high fluoride (228 mg/L), aluminum (252 mg/L), and sulfate (3362 mg/L), among other ions (full data below). I'm using the wateq4f.dat database to:
Identify fluoride species (e.g., F⁻, AlFₓ, CaF⁺).
Simulate precipitation with Ca(OH)₂ and Al₂(SO₄)₃ (0.001, 0.005, 0.01 moles).
Test pH adjustment (4.5 to 8) to optimize fluoride removal.
Check saturation indices (SI) for Fluorite (CaF₂), Gibbsite (Al(OH)₃), and Barite (BaSO₄).
I want to see how much fluoride I can remove as CaF₂ and find the best conditions (pH, reagent dose) for my mine drainage treatment study.
My Sample Data
Here's the composition of Sample 1 (all in mg/L, pH 4.48, pe 4.90, temp 25C):
F⁻: 228
Al: 252
Ca2⁺: 350
Mg2⁺: 487
Na⁺: 60.8
K⁺: 8.45
SO₄2⁻: 3362
Cl⁻: 8.66
HCO₃⁻: 21.5
NO₃⁻: 24.6
Sr2⁺: 1.88
Ba2⁺: 0.03
Fe: 0.09
Mn: 17
Zn: 1
Cu: 9
Ni: 5
Cd: 0.02
Pb: 0.01
My PHREEQC Input
I wrote an input file to model speciation, precipitation, and pH effects. Here's the full code:
DATABASE wateq4f.dat
TITLE Fluoride Speciation and Precipitation in Mine Drainage Sample 1
# Define mine drainage solution
SOLUTION 1 Mine Drainage Sample 1
temp 25
pH 4.48
pe 4.90
units mg/L
F 228
Al 252
Ca 350
Mg 487
Na 60.8
K 8.45
S(6) 3362
Cl 8.66
C(4) 21.5
N(5) 24.6
Sr 1.88
Ba 0.03
Fe 0.09
Mn 17
Zn 1
Cu 9
Ni 5
Cd 0.02
Pb 0.01
-water 1
# Speciation analysis
SELECTED_OUTPUT 1
-file fluoride_speciation_sample1.csv
-reset false
-solution
-pH
-pe
-totals F Al Ca Mg
-molalities F- AlF+2 AlF2+1 AlF3 AlF4-1 CaF+ MgF+
-saturation_indices Fluorite Gibbsite Barite
# Ca(OH)2 precipitation
REACTION 1
Ca(OH)2 0.001 0.005 0.01
3 steps
EQUILIBRIUM_PHASES 1
Fluorite 0 0
Gibbsite 0 0
Barite 0 0
SELECTED_OUTPUT 2
-file ca_precipitation_sample1.csv
-reset false
-solution
-pH
-pe
-totals F
-saturation_indices Fluorite Gibbsite Barite
-equilibrium_phases Fluorite Gibbsite Barite
# Al2(SO4)3 precipitation
SOLUTION 2
temp 25
pH 4.48
pe 4.90
units mg/L
F 228
Al 252
Ca 350
Mg 487
Na 60.8
K 8.45
S(6) 3362
Cl 8.66
C(4) 21.5
N(5) 24.6
Sr 1.88
Ba 0.03
Fe 0.09
Mn 17
Zn 1
Cu 9
Ni 5
Cd 0.02
Pb 0.01
-water 1
REACTION 2
Al2(SO4)3 0.001 0.005 0.01
3 steps
EQUILIBRIUM_PHASES 2
Fluorite 0 0
Gibbsite 0 0
Barite 0 0
SELECTED_OUTPUT 3
-file al_precipitation_sample1.csv
-reset false
-solution
-pH
-pe
-totals F
-saturation_indices Fluorite Gibbsite Barite
-equilibrium_phases Fluorite Gibbsite Barite
# pH adjustment
SOLUTION 3
temp 25
pH 4.48
pe 4.90
units mg/L
F 228
Al 252
Ca 350
Mg 487
Na 60.8
K 8.45
S(6) 3362
Cl 8.66
C(4) 21.5
N(5) 24.6
Sr 1.88
Ba 0.03
Fe 0.09
Mn 17
Zn 1
Cu 9
Ni 5
Cd 0.02
Pb 0.01
-water 1
REACTION 3
NaOH 0.01
0.01 moles in 10 steps
EQUILIBRIUM_PHASES 3
Fluorite 0 0
Gibbsite 0 0
Barite 0 0
SELECTED_OUTPUT 4
-file ph_adjustment_sample1.csv
-reset false
-solution
-pH
-pe
-totals F
-saturation_indices Fluorite Gibbsite Barite
-equilibrium_phases Fluorite Gibbsite Barite
END
The Problem
When I ran this in PHREEQC, the output files are incomplete. I expected:
fluoride_speciation_sample1.csv: Speciation at pH 4.48.
ca_precipitation_sample1.csv: F⁻ removal for 3 Ca(OH)₂ doses (0.001, 0.005, 0.01 moles).
al_precipitation_sample1.csv: F⁻ removal for 3 Al₂(SO₄)₃ doses.
ph_adjustment_sample1.csv: F⁻ removal for 10 pH steps (~4.5 to 8).
But the CSVs only show:
Initial condition (pH 4.48, F⁻ = 228 mg/L, no precipitation).
One step (pH 5.17851, F⁻ = 128 mg/L, 44% removal, Fluorite/Gibbsite precipitation).
Al₂(SO₄)₃ output is identical to Ca(OH)₂.
pH adjustment only shows one step instead of 10.
What I Got So Far
From the partial output:
At pH 4.48, AlF₂⁺ (~32.7%) and AlF₃ (~1.4%) dominate due to high Al (252 mg/L). Free F⁻ is low (0.046%), so CaF₂ doesn?t form (SI = -2.8).
At pH 5.17851, F⁻ drops to 128 mg/L (44% removal) with Ca(OH)₂, forming CaF₂ (2.6458e-03 mol) and Gibbsite (6.6490e-03 mol). SI = 0 for both.
Al₂(SO₄)₃ and pH adjustment CSVs show the same results, which seems wrong.
I think PHREEQC stopped early, or I messed up the input syntax. Maybe the high ion concentrations (e.g., 3362 mg/L SO₄?⁻) caused convergence issues? Or did I format the REACTION or SELECTED_OUTPUT blocks wrong?
My Questions
Why are my outputs incomplete (only one step instead of 3 doses or 10 pH steps)?
Why do Al₂(SO₄)₃ and pH adjustment CSVs show the same results as Ca(OH)₂?
Is my input file correct for testing multiple reagent doses and pH steps?
Could high SO₄2⁻ or Al cause convergence problems? How do I fix this?
Any tips to ensure all steps are output correctly in the CSVs?
Thank You
dlparkhurst:
You need to use END statements to define your reactions.
Only one of the numbered reaction entities SOLUTION, REACTION, EQUILIBRIUM_PHASES, and others will be used in a reaction calculation, where a reaction calculation is defined by the data blocks between END statements.
The simplest approach is to define every reactant data block followed by an END. You can then use USE statements to define your reaction explicitly.
END
USE solution 1
USE reaction 1
USE equilibrium_phases 1
END
i_azharkhan:
Respected Sir,
I have made changes. And I modified my input, but it doesn't show anything in the graph. I don't understand where I should make mistakes. I saw my input again and again but don't know what problem is in it. Can you please have another look and fix it? It will be much appreciated.
Thank you.
My input:
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
SELECTED_OUTPUT 1
-file fluoride_speciation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F Al Ca Mg
-molalities F- AlF+2 AlF2+ AlF3
AlF4- CaF+ MgF+
-saturation_indices Fluorite Gibbsite Barite
REACTION 1
Ca(OH)2 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 1
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 2
-file ca_precipitation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 1
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-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 pH
20 graph_y TOT("F") * 19000
-end
-active true
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 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
REACTION 2
Al2(SO4)3 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 2
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 3
-file al_precipitation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 2
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-chart_title "Fluoride Removal with Al2(SO4)3 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 pH
20 graph_y TOT("F") * 19000
-end
-active true
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 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
REACTION 3
NaOH 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 3
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 4
-file ph_adjustment_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 3
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-chart_title "Fluoride Removal with pH Adjustment"
-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 pH
20 graph_y TOT("F") * 19000
-end
-active true
END
dlparkhurst:
There is no Basic function pH. Look in the documentation of The Basic Interpreter for available functions.
--- 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
SELECTED_OUTPUT 1
-file fluoride_speciation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F Al Ca Mg
-molalities F- AlF+2 AlF2+ AlF3
AlF4- CaF+ MgF+
-saturation_indices Fluorite Gibbsite Barite
REACTION 1
Ca(OH)2 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 1
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 2
-file ca_precipitation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 1
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-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 -LA("H+")
20 graph_y TOT("F") * 19000
-end
-active true
END
--- End code ---
i_azharkhan:
Thank you very much for your support. I truly appreciate the help I've received so far. However, I'm still facing some issues with my model output and would like to kindly request your guidance again.
I'm currently working on modeling fluoride removal and analyzing its behavior under varying pH and chemical dosages. When I run my input, I receive three graphs, but all three display "Total Fluoride vs. pH," with the red line remaining at zero and showing no variation. This doesn't reflect the behavior I'm trying to study. And in simulation 1 it shows "WARNING: Did not find species, CaF+."
Here's what I actually want for each of the graphs:
1. Graph 1:
X-axis: NaOH addition
Left Y-axis: Fluoride Removal (%) - red line
Right Y-axis: pH (range 2 to 8) - green line
2. Graph 2:
X-axis: Al₂(SO₄)₃ addition
Left Y-axis: Fluoride Removal (%) - red line
Right Y-axis: pH (range 2 to 8) - green line
3. Graph 3:
X-axis: Ca(OH)₂ addition
Left Y-axis: Fluoride Removal (%) - red line
Right Y-axis: pH (range 2 to 8) - green line
I believe the issue lies in my use of the USER_GRAPH sections, where I may have incorrectly defined the axes or variables. As a new user, I may be missing something basic. I would be very grateful if you could help me correct the USER_GRAPH blocks to achieve the desired output. I?ll share again my new input file below for reference.
Thank you so much again for your time and kind support. Your guidance is highly appreciated.
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
SELECTED_OUTPUT 1
-file fluoride_speciation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F Al Ca Mg
-molalities F- AlF+2 AlF2+ AlF3
AlF4- CaF+ MgF+
-saturation_indices Fluorite Gibbsite Barite
REACTION 1
Ca(OH)2 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 1
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 2
-file ca_precipitation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 1
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-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 pH
20 graph_y TOT("F") * 19000
-end
-active true
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 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
REACTION 2
Al2(SO4)3 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 2
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 3
-file al_precipitation_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 2
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-chart_title "Fluoride Removal with Al2(SO4)3 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 pH
20 graph_y TOT("F") * 19000
-end
-active true
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 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
REACTION 3
NaOH 1
0.1 moles in 10 steps
EQUILIBRIUM_PHASES 3
Barite 0 0
Fluorite 0 0
Gibbsite 0 0
SELECTED_OUTPUT 4
-file ph_adjustment_sample1.csv
-reset false
-solution true
-pH true
-pe true
-totals F
-equilibrium_phases Fluorite Gibbsite Barite
-saturation_indices Fluorite Gibbsite Barite
USER_GRAPH 3
-headings pH F_total
-axis_titles "pH" "Total Fluoride (mg/L)" ""
-chart_title "Fluoride Removal with pH Adjustment"
-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 pH
20 graph_y TOT("F") * 19000
-end
-active true
END
Navigation
[0] Message Index
[#] Next page
Go to full version