PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • SELECTED_OUTPUT »
  • PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps  (Read 30599 times)

i_azharkhan

  • Top Contributor
  • Posts: 26
PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« on: 25/09/25 10:58 »
Hello everyone,

I am working on a research project about fluoride speciation, precipitation, and controlling factors (pH, Ca, Al, Mg, Fe, ionic strength) in mine drainage.
My supervisor instructed me to use PHREEQC, and I have 35 samples.
I don?t need to do lab work ? only simulation.

What I want to achieve

For each of the 35 samples, I want to:

1. Baseline speciation ? dominant fluoride species, saturation indices (fluorite, fluorapatite, calcite, gibbsite, ferrihydrite), ionic strength.
2. Sweeps to see what drives precipitation and controls fluoride:
->pH sweep
->Ca dose sweep (CaCl₂)
->Alum dose sweep (with Gibbsite allowed)
->Ferric dose sweep (with Ferrihydrite allowed)
->Mg dose sweep
->Ionic strength sweep (NaCl)

Each sweep should output results into a separate CSV (one file per sweep, with rows for each sample).

My starting data

SOLUTION_SPREAD (example)
Al    C(4)   Ca   F    K   Mg    Mn   N(5)   Na   pH   S(6)   Zn   Fe
mg/l  mg/l  mg/l mg/l mg/l mg/l mg/l mg/l  mg/l       mg/l   mg/l mg/l
252   17.63  350  228  8.45 487  17.27 24.6  60.8  4.48  3362   9.392  0.09
5.43  35.26  487  19.6 8.05 120  16.48 75.3  239   6.33  2018   4.064  0.46
1397  0.01   320  181  3.99 1240 36.95 14.3  9.25  3.01  14854 197.61 212
...

My attempt at an input file
TITLE === Load all samples ===
SOLUTION_SPREAD
    -units     mg/L
    -pH        pH
    -temp      25
    -water     1.0
    -solution  sample_id
    -columns   sample_id pH F Ca Mg Na K Al Fe(2) Fe(3) Mn N(5) C(4) S(6) Zn
    -file      samples.csv

USER_PUNCH
    -headings sample aCa aF I_strength
    10 PUNCH SOLN_NO, ACT("Ca+2"), ACT("F-"), IONIC_STRENGTH
END


Then for each sample (1?35), I repeated blocks like:


Baseline speciation

USE solution 1
SELECTED_OUTPUT
    -file baseline.csv
    -reset false
    -high_precision true
    -user_punch true
    -pH true
    -ionic_strength true
    -totals F Ca Mg Al Fe(2) Fe(3) S(6) C(4) Na K Mn Zn N(5)
    -activities Ca+2 F-
    -si Fluorite Fluorapatite Calcite Gibbsite Ferrihydrite
    -molalities F- HF CaF+ MgF+ AlF2+ AlF3 FeF2+ FeF+
END



pH sweep

USE solution 1
REACTION
    NaOH 1
    -steps 0 5e-4 1e-3 2e-3 3e-3
SELECTED_OUTPUT
    -file pH_sweep.csv
    -reset false
    -high_precision true
    -user_punch true
    -step true
    -pH true
    -totals F
    -si Fluorite Calcite Gibbsite Ferrihydrite
    -activities Ca+2 F-
END



Calcium sweep

USE solution 1
REACTION
    CaCl2 1
    -steps 0 5e-4 1e-3 2e-3 3e-3
SELECTED_OUTPUT
    -file Ca_sweep.csv
    -reset false
    -user_punch true
    -step true
    -pH true
    -totals F Ca
    -si Fluorite Calcite
    -activities Ca+2 F-
END



Alum sweep

USE solution 1
REACTION
    Al2(SO4)3:14H2O 1
    -steps 0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES
    Gibbsite 0 0
SELECTED_OUTPUT
    -file Alum_sweep.csv
    -reset false
    -user_punch true
    -step true
    -pH true
    -totals F Al
    -si Gibbsite Fluorite
END



Ferric sweep

USE solution 1
REACTION
    Fe2(SO4)3 1
    -steps 0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES
    Ferrihydrite 0 0
SELECTED_OUTPUT
    -file Ferric_sweep.csv
    -reset false
    -user_punch true
    -step true
    -pH true
    -totals F Fe(3)
    -si Ferrihydrite Fluorite
END



Mg sweep

USE solution 1
REACTION
    MgCl2 1
    -steps 0 5e-4 1e-3 2e-3
SELECTED_OUTPUT
    -file Mg_sweep.csv
    -reset false
    -user_punch true
    -step true
    -pH true
    -totals F Mg
    -si Fluorite
END




Ionic strength sweep

USE solution 1
REACTION
    NaCl 1
    -steps 0 5e-3 10e-3 20e-3 50e-3
SELECTED_OUTPUT
    -file IS_sweep.csv
    -reset false
    -user_punch true
    -step true
    -pH true
    -ionic_strength true
    -totals F Na Cl
    -si Fluorite
    -activities Ca+2 F-
END

My problem

The file does not run properly. I am confused about the correct structure:
-> Should I duplicate each block for all 35 samples (USE solution 1..35) inside the same input?
-> Is there a way to loop automatically over all solutions in SOLUTION_SPREAD instead of repeating?
-> Am I using REACTION and EQUILIBRIUM_PHASES correctly for these sweeps?
-> How can I make sure all samples append to the same CSV file with the sample number included?


My request

Please help me:
-> Correct/streamline this input so it runs for all 35 samples.
-> Confirm whether my approach to sweeps (pH, Ca, Al, Fe, Mg, ionic strength) is correct.
-> Suggest the best way to avoid duplicating 35 times if possible.

Thank you in advance!
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4318
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #1 on: 26/09/25 18:07 »
You probably want to use RUN_CELLS, which will allow you to run calculations for multiple solutions. By default, SOLUTION_SPREAD will number solutions 1 through n. RUN_CELLS; -cell 1-n will make a calculation with each of the solutions. It will react solution 1 with all of the reactants numbered 1; then solution 2 with all reactants numbered 2; etc. So you need to define reactants for each solution number. Reactants--you are using REACTION and EQUILIBRIUM_PHASES--persist until they are redefined or DELETEd. When you define EQUILIBRIUM_PHASES for the ferric sweep, but not for the Mg sweep, it is necessary to delete equilibrium phases so they do not participate in the Mg sweep. In all other cases, new definitions replace old definitions of reactants.

This script has only 2 solutions (that are the same) simply for demonstration. The solutions are never SAVEd, so they remain the same for the start of each calculation. The solution number is the second column of the selected output file. The TITLE is printed at the end of each selected-output line. The same set of columns is printed to the selected-output file for each calculation, so you should define all of the columns that you want in the SELECTED_OUTPUT and USER_PUNCH definitions at the beginning.


Code: [Select]
SELECTED_OUTPUT 1
    -file baseline.csv
    -reset false
    -state true
    -solution true
    -high_precision true
    -user_punch true
    -pH true
    -ionic_strength true
    -totals F Ca Mg Al Fe(2) Fe(3) S(6) C(4) Na K Mn Zn N(5)
    -activities Ca+2 F-
    -si Fluorite Fluorapatite Calcite Gibbsite Ferrihydrite
    -molalities F- HF CaF+ MgF+ AlF2+ AlF3 FeF2+ FeF+
USER_PUNCH 1
10 PUNCH TITLE
END
TITLE Initial solutions
SOLUTION 1-2
    temp      25
    pH        4.48
    pe        4
    redox     pe
    units     mg/l
    density   1
    Al        242
    C(4)      17.63
    Ca        359
    F         228
    Fe        0.09
    K         8.45
    Mg        487
    Mn        17.27
    N(5)      24.6
    Na        60.8
    S(6)      3362
    Zn        9.392
END
# pH sweep
TITLE pH sweep
REACTION 1-2
    NaOH 1
    0.0 5e-4 1e-3 2e-3 3e-3
RUN_CELLS
-cells 1-2
END
#Calcium sweep
TITLE Calcium sweep
REACTION 1-2
    CaCl2 1
    0 5e-4 1e-3 2e-3 3e-3
RUN_CELLS
-cells 1-2
END
#Al sweep
TITLE Al sweep
REACTION 1-2
    Al2(SO4)3:14H2O 1
    0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES 1-2
    Gibbsite 0 0
RUN_CELLS
-cells 1-2
END
#Ferric sweep
TITLE Ferric sweep
REACTION 1-2
    Fe2(SO4)3 1
    0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES 1-2
    Goethite 0 0
RUN_CELLS
-cells 1-2
END
DELETE
-equilibrium_phases 1-2
END
#Mg sweep
TITLE Mg sweep
USE solution 1
REACTION 1-2
    MgCl2 1
    0 5e-4 1e-3 2e-3
RUN_CELLS
-cells 1-2
END
#Ionic strength sweep
TITLE Ionic strength sweep
REACTION 1-2
    NaCl 1
    0 5e-3 10e-3 20e-3 50e-3
RUN_CELLS
-cells 1-2
END
Logged

i_azharkhan

  • Top Contributor
  • Posts: 26
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #2 on: 28/09/25 07:51 »
Thanks for the pointer to RUN_CELLS, which cleaned up the structure a lot. I'm still hitting one warning I can't shake:

Initial solution 1.
WARNING: USER_PUNCH: heading count does not match the number of calls to PUNCH.

Questions and fixes I tried

Is the correct string variable TITLE$ (with a dollar) instead of TITLE?
If I change to TITLE$, the counts should be 5 headings and 5 PUNCH items:

USER_PUNCH 1
    -headings sample title aCa aF I_strength
    10 PUNCH SOLN_NO, TITLE$, ACT("Ca+2"), ACT("F-"), IONIC_STRENGTH
END

Follow-up question

How should I correctly write the PRINT section so that I can also generate data for plots/figures (for example, SI vs pH curves, F speciation vs Ca dose, etc.)?

Right now, everything goes into one CSV via SELECTED_OUTPUT, which is fine for Excel or Python analysis. But if I want PHREEQC itself to produce tables that can be graphed directly (e.g., USER_GRAPH blocks or PRINT options), what is the best practice? Should I:

Use USER_GRAPH blocks tied to each sweep?
Or keep everything in SELECTED_OUTPUT and plot outside PHREEQC?

Thank you
« Last Edit: 28/09/25 07:59 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4318
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #3 on: 29/09/25 03:15 »
It is a warning, so the file will run. The following should add a heading to the title column.

Code: [Select]
USER_PUNCH 1
-heading Title
10 PUNCH TITLE

Just use USER_GRAPH with GRAPH_X and GRAPY_Y.
Logged

i_azharkhan

  • Top Contributor
  • Posts: 26
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #4 on: 30/09/25 16:52 »
Sir, thank you so much for your help. Sir, can you please explain USER_GRAPH a little bit? If possible, please provide an example for better understanding.
Thank you again.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4318
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #5 on: 30/09/25 23:47 »
That is what the manual with examples is for.

The manual is available from the help button from PhreeqcI or /doc directory for other Phreeqc programs. Exampes are available from the PFW tab in PhreeqcI and the examples directory.
Logged

i_azharkhan

  • Top Contributor
  • Posts: 26
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #6 on: 01/10/25 10:48 »
Sir, I take help from the example. And make 6 USER_GRAPH sections. But after running the input, I did not get any graph. Is it a problem with SELECTED_OUTPUT? Here are the 6 USER_GRAPH sections.

USER_GRAPH 1
    -headings               pH ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "pH" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "pH sweep - F and SI(Fluorite)"
    -axis_scale x_axis      2 11 auto auto
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  -LA("H+")                     
20 GRAPH_Y   TOT("F")*1000
30 GRAPH_SY  SI("Fluorite")               
  -end
    -active                 true

USER_GRAPH 2
    -headings               Ca_added ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Added Ca (mol/L as CaCl2)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ca sweep (CaCl2) - F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true

USER_GRAPH 3
    -headings               Alum_added ResidualF_mmol/kgw SI_Gibbsite SI_Fluorite
    -axis_titles            "Added alum (mol/L of Al2(SO4)3?14H2O)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Alum sweep - F, SI(Gibbsite), SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Gibbsite")
40 GRAPH_SY SI("Fluorite")
  -end
    -active                 true

USER_GRAPH 4
    -headings               Ferric_added ResidualF_mmol/kgw SI_Ferrihydrite SI_Fluorite
    -axis_titles            "Added Fe(III) (mol/L as Fe2(SO4)3)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ferric sweep - F, SI(Ferrihydrite), SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Ferrihydrite")
40 GRAPH_SY SI("Fluorite")
  -end
    -active                 true

USER_GRAPH 5
    -headings               Mg_added ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Added Mg (mol/L as MgCl2)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Mg sweep - F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  IONIC_STRENGTH
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true

USER_GRAPH 6
    -headings               IonicStrength ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Ionic strength (molal)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ionic strength sweep - F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  IONIC_STRENGTH
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END
« Last Edit: 01/10/25 14:40 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4318
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #7 on: 01/10/25 21:40 »
Start with one USER_GRAPH and whatever reaction calculation you are working on. Something like

SOLUTION 1
...
END
USE solution 1
REACTION 1
... in 10 steps
USER_GRAPH
...
END
Logged

i_azharkhan

  • Top Contributor
  • Posts: 26
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #8 on: 02/10/25 16:40 »
Sir, the USER_GRAPH generates plots, but the graphs don't make sense and show strange/unexpected patterns. Sir, what do I need to fix it? Please help me, sir. I can't attach the figures here, but if possible for you, I can share the whole input here, and you can have a look, please.

SOLUTION_SPREAD
   pH    Alkalinity     S(6)      Cl        F    N(5)    N(3)       P        K      Na      Ca       Mg      Al      Fe      Mn      Cu      Zn      Cd      Pb
 4.48          21.5     3362    8.66      228    24.6    0.08     0.1     8.45    60.8     350      487     252    0.09      17    4.50    9.00    0.01    0.01
 6.33          43.0     2018    8.03     19.6    75.3    0.08     0.1     8.05     239     487      120    5.43    0.46      16    0.10    4.00    0.01    0.01
 3.01             0    14854    17.3      181    14.3    0.08     0.1     3.99    9.25     320     1240    1397     212      36      10      19    0.01    0.01
 7.09           190     2272     474     0.21    13.7    0.08     0.1     8.10     391     860     12.4    0.12    0.01    0.44    0.01    0.01    0.01    0.01
 6.91          27.2     1711     419     0.43    63.6    0.08     0.1     7.26     384     566     11.0    0.02    0.01    0.19    0.01    0.01    0.01    0.01
 6.36           201     1653     904     0.24    7.48    0.08     0.1     5.63     453     714     59.0    0.05    0.01    1.24    0.01    0.01    0.01    0.01
    7             0     9905      14      149    15.1    0.08     0.1     1.73     7.1     254      898    1030    0.01     243      89     172    0.01    0.60
 7.54            27     14.1     1.2     0.39    18.5    0.08     0.1     0.96    2.32    15.4     2.12    0.14    0.05    0.01    0.01    0.01    0.01    0.01
 7.56            29       14     1.2     0.37    18.4    0.08     0.1     1.31    2.59    16.5     2.11    0.27    0.22    0.01    0.01    0.02    0.01    0.01
 7.18           126     1500      48     13.8    16.6    0.08     0.1    14.40    76.9     474      119     3.8      14       3    0.01    0.10    0.01    0.05
 7.08           232      112     4.8     0.68    11.4    0.08     0.1     2.98      61      68     6.75    0.32    0.65    0.10    0.01    0.04    0.01    0.50
 7.30           154     1470      19     1.43     3.7    0.08     0.1     15.5     154     634      222      34      70    1.70    0.01    0.02    0.01    0.01
 7.26           111      476    16.8      1.9      22    0.08     0.1     5.60      40     165       40    0.18    0.05    0.02    0.01    0.14    0.01    0.01
 7.17          99.6      101     7.4     0.14      87    0.08     0.1     2.30    8.56    83.1     15.6    0.25    0.08    0.13    0.01    0.02    0.01    0.02
 6.68          36.2      106    11.5     0.31     209    0.08     0.1     2.91      12     100     16.8    0.08    0.06    0.40    0.01    0.02    0.01    0.01
 7.35          29.4       44    3.68     0.36    15.3    0.08     0.1     1.82    3.93    28.8      3.9    0.05    0.03    0.01    0.01    0.01    0.01    0.01
 7.73          65.6       24    2.35     0.21     8.2    0.08     0.1     1.64    6.96    28.7      5.3       1    1.08    0.04    0.01    0.03    0.01    0.02
  7.2          72.4      830    11.4     2.09    12.1    0.08     0.1     4.27      39     237       72     1.4    2.05    1.80    0.01    0.06    0.01    0.12
 7.14          67.9     1380     8.2       21    32.8    0.08     0.1    10.90     226     343     58.7     5.7    5.30    8.40    0.01    0.30    0.01    0.05
 4.77          13.6     3098    13.2      103    36.3    0.08     0.1    14.40     203     514    341.0     102    0.35      25    1.10    2.20    0.01    0.01
  5.1          18.1     2651    12.8     67.4    38.9    0.08     0.1    14.20     200     520    262.0      63    0.26    13.1    0.60    1.50    0.01    0.01
    8           134     2650      21     14.6       4    0.08     0.1       11     248     454    340.0     0.8    0.52    0.02    0.01    0.01    0.01    0.01
 5.22          11.3      715     6.8     32.4    35.1    0.08     0.1     5.81      21     179     80.3      23    0.90      10    0.33    1.80    0.01    0.01
  6.5          32.8      125     9.2     1.85      15    0.08     0.1     3.67      10      47      9.7    2.20      13    1.50    0.01    2.10    0.01    0.01
 6.72          36.2       60     7.7     0.93    14.5    0.08     0.1     0.28       1       4      0.6     0.6    0.40    0.07    0.01    0.03    0.01    0.60
 7.37          54.2     1698     5.2     3.56     7.6    0.08     0.1     26.3      16     611       78     0.6    0.30    0.03    0.01    0.04    0.01    0.01
 7.75           235     4030    25.4    28.20     4.3    0.08     0.1     14.6     343     517      613     2.2    0.41      58    0.01    0.76    0.01    0.01
 6.98           302     3560    24.2     25.3     3.8    0.08     0.1     11.2     366     501      500     2.7    0.55      48    0.01    0.33    0.01    0.01
 2.98           0.0    19256    11.9      224    25.5    0.08     0.1     0.57    7.21     334     1775    1580    0.01      93     146     350    0.01    0.01
 5.12          23.2     1990     4.3     2.89     6.5    0.08     0.1     12.5    9.69     565      152    0.82    0.01    6.50    0.01    1.30    0.01    0.01

SELECTED_OUTPUT 1
    -file                 baseline.csv
    -high_precision       true
    -reset                false
    -state                true
    -solution             true
    -pH                   true
    -temperature          true
    -alkalinity           true
    -ionic_strength       true
    -totals               F  Ca  Mg  Al  Fe(2)  Fe(3)  S(6)
                          C(4)  Na  K  Mn  Zn  N(5)
    -molalities           F-  HF  CaF+  MgF+
                          AlF2+  AlF3  FeF2+  FeF+
    -activities           Ca+2  F-
    -saturation_indices   Fluorite  Fluorapatite  Calcite  Gibbsite
    -active               true
    -user_punch           true
USER_PUNCH 1
-heading Title
10 PUNCH TITLE
END

# pH sweep
TITLE pH sweep
REACTION 1-30
    NaOH 1
    0.0 5e-4 1e-3 2e-3 3e-3
RUN_CELLS
-cells 1-30

USER_GRAPH 1
    -headings               pH ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "pH" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "pH sweep ? F and SI(Fluorite)"
    -axis_scale x_axis      3 11 auto auto
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  -LA("H+")                     
20 GRAPH_Y   TOT("F")*1000                 
30 GRAPH_SY  SI("Fluorite")               
  -end
    -active                 true
END

#Calcium sweep
TITLE Calcium sweep
REACTION 1-30
    CaCl2 1
    0 5e-4 1e-3 2e-3 3e-3
RUN_CELLS
-cells 1-30

USER_GRAPH 2
    -headings               Ca_added ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Added Ca (mol/L as CaCl2)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ca sweep (CaCl2) ? F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN                           
20 GRAPH_Y  TOT("F")*1000                 
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END

#Al sweep
TITLE Al sweep
REACTION 1-30
    Al2(SO4)3:14H2O 1
    0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES 1-30
    Gibbsite 0 0
RUN_CELLS
-cells 1-30

USER_GRAPH 3
    -headings               Alum_added ResidualF_mmol/kgw SI_Gibbsite SI_Fluorite
    -axis_titles            "Added alum (mol/L of Al2(SO4)3?14H2O)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Alum sweep ? F, SI(Gibbsite), SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Gibbsite")
40 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END

#Ferric sweep
TITLE Ferric sweep
REACTION 1-30
    Fe2(SO4)3 1
    0 1e-4 5e-4 1e-3 2e-3
EQUILIBRIUM_PHASES 1-30
    Goethite 0 0
RUN_CELLS
-cells 1-30

DELETE
-equilibrium_phases 1-30
END

USER_GRAPH 4
    -headings               Ferric_added ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Added Fe(III) (mol/L as Fe2(SO4)3)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ferric sweep ? F, SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  RXN
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END

#Mg sweep
TITLE Mg sweep
USE solution 1
REACTION 1-30
    MgCl2 1
    0 5e-4 1e-3 2e-3
RUN_CELLS
-cells 1-30

USER_GRAPH 5
    -headings               Mg_added ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Added Mg (mol/L as MgCl2)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Mg sweep ? F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  IONIC_STRENGTH
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END

#Ionic strength sweep
TITLE Ionic strength sweep
REACTION 1-30
    NaCl 1
    0 5e-3 10e-3 20e-3 50e-3
RUN_CELLS
-cells 1-30

USER_GRAPH 6
    -headings               IonicStrength ResidualF_mmol/kgw SI_Fluorite
    -axis_titles            "Ionic strength (molal)" "Residual F (mmol/kgw)" "SI (right axis)"
    -chart_title            "Ionic strength sweep ? F and SI(Fluorite)"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 GRAPH_X  IONIC_STRENGTH
20 GRAPH_Y  TOT("F")*1000
30 GRAPH_SY SI("Fluorite")
  -end
    -active                 true
END
« Last Edit: 02/10/25 16:42 by i_azharkhan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4318
Re: PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
« Reply #9 on: 02/10/25 19:08 »
 No. It is time for you to work this out for yourself.

Start simple with something like one solution and one sweep. You can experiment to get to something that makes sense to you.

From now on you must use the # button above the text box to set off your code
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • SELECTED_OUTPUT »
  • PHREEQC input for 35 samples with fluoride speciation & precipitation sweeps
 

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