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 »
  • Beginners »
  • SELECTED_OUTPUT »
  • Help! PHREEQC Output Incomplete for Fluoride Removal Study
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Help! PHREEQC Output Incomplete for Fluoride Removal Study  (Read 693 times)

i_azharkhan

  • Frequent Contributor
  • Posts: 10
Help! PHREEQC Output Incomplete for Fluoride Removal Study
« on: 11/06/25 10:43 »
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
« Last Edit: 11/06/25 10:53 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #1 on: 11/06/25 15:09 »
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

Logged

i_azharkhan

  • Frequent Contributor
  • Posts: 10
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #2 on: 13/06/25 07:49 »
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
« Last Edit: 13/06/25 09:28 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #3 on: 13/06/25 13:16 »
There is no Basic function pH. Look in the documentation of The Basic Interpreter for available functions.

Code: [Select]
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
Logged

i_azharkhan

  • Frequent Contributor
  • Posts: 10
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #4 on: 13/06/25 15:30 »
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
« Last Edit: 13/06/25 15:32 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #5 on: 13/06/25 15:59 »
Why do you have this line? I just told you there is no Basic function pH.

Code: [Select]
10 graph_x pH

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.
Logged

i_azharkhan

  • Frequent Contributor
  • Posts: 10
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #6 on: 14/06/25 09:20 »
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.
« Last Edit: 14/06/25 09:56 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #7 on: 14/06/25 13:01 »
Code: [Select]
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
Logged

i_azharkhan

  • Frequent Contributor
  • Posts: 10
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #8 on: 16/06/25 08:50 »
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.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4069
Re: Help! PHREEQC Output Incomplete for Fluoride Removal Study
« Reply #9 on: 16/06/25 19:05 »
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: [Select]
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

Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • SELECTED_OUTPUT »
  • Help! PHREEQC Output Incomplete for Fluoride Removal Study
 

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