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 »
  • Surface Complexation »
  • PEST-PHREEQC Parameter Optimization
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: PEST-PHREEQC Parameter Optimization  (Read 1886 times)

Francis Adu

  • Contributor
  • Posts: 8
PEST-PHREEQC Parameter Optimization
« on: 07/09/22 13:21 »
Dear All,

I am trying to use PEST to estimate equilibrium constants for uranium adsorption on two surfaces (aluminum and silicon oxides). I have prepared the pest control, template, and instruction files as given below and checked the errors, and found none. I used the SCEUA_P executable for the optimization process and the following error is recorded (Error reading model output file(s): cannot open model output file uranium_new.txt). I have tried all means I cant find solution to this. I would be glad if someone could help me out.
Thank you and looking forward to hearing from you all.
Below are my scripts

-------------------------------------------------------------------------------------------
Template file

ptf @
TITLE uranium Pest
PHASES 1

    fix_pH
    H+ = H+
    log_k     0

 fix_pe
    e- = e-
    log_k     0
   - no_check

SURFACE_MASTER_SPECIES 1
       Surf_al  Surf_alOH
       Surf_si  Surf_siOH

SURFACE_SPECIES 1
Surf_alOH = Surf_alOH
log_k 0.0   
-no_check
Surf_alOH + H+ = Surf_alOH2+
log_k      @k1                    @

Surf_alOH = Surf_alO- + H+
log_k      @k2                    @

Surf_alOH + UO2+2 = Surf_alOUO2+ + H+
log_k      @k3                    @

Surf_alOH + 2UO2+2 + CO3-2 + 3H2O = Surf_alO(UO2)2CO3(OH)3-2 + 4H+
 log_k     @k4                    @

Surf_siOH = Surf_siOH
 log_k     @k5                    @

Surf_siOH + H+ = Surf_siOH2+
 log_k     @k6                    @

Surf_siOH = Surf_siO- + H+
 log_k     @k7                    @

Surf_siOH + UO2+2 = Surf_siOUO2+ + H+
log_k      @k8                    @

Surf_siOH + UO2OH+ = Surf_siOUO2OH + H+
 log_k     @k9                    @

Surf_siOH + UO2(CO3)3-4 = Surf_siOHUO2(CO3)3-4
 log_k     @k10                  @

Surf_siOH + UO2(OH)3- = Surf_siOHUO2(OH)3-
 log_k     @k11                  @
 

SURFACE 1
Surf_alOH  9.213e-5  83.8  2
Surf_siOH  9.99e-5


SOLUTION 1
    temp      20
    pH        2
    pe        4
    redox     pe
    units     mmol/l
    density   1
    C(4)      1
    Cl        10
    Na        11
    U         250 ug/L
    -water    1 # kg
END



SELECTED_OUTPUT 1
    -file                 uranium_new.txt
    -high_precision       true
    -reset                false
 
USER_PUNCH 1
    -headings
    -start
10 q_sorb = mol("Surf_alO(UO2)2CO3(OH)3-2")+mol("Surf_alOUO2+")+mol("Surf_siOHUO2(OH)3-")+mol("Surf_siOUO2OH")+mol("Surf_siOHUO2(CO3)3-4")+mol("Surf_siOUO2+")
20 punch q_sorb/1.051e-06*100
    -end
 USER_GRAPH 1
    -axis_titles            "pH" "% Removal" ""
    -chart_title            "Removal of U"
    -initial_solutions      false
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 q_sorb = mol("Surf_alO(UO2)2CO3(OH)3-2")+mol("Surf_alOUO2+")+mol("Surf_siOHUO2(OH)3-")+mol("Surf_siOUO2OH")+mol("Surf_siOHUO2(CO3)3-4")+mol("Surf_siOUO2+")
20 PLOT_XY -LA("H+"),q_sorb/1.051e-06*100, symbol = star, color = blue, symbol_size = 7
  -end
    -active                 true


USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -2.0 NaOH      10
END


USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -4.0 NaOH      10
END
 
USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -6.0 NaOH      10
END
 
USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -8.0 NaOH      10
END
 
USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -10.0 NaOH      10
END
USE solution 1
USE surface 1
 
EQUILIBRIUM_PHASES 1
   
    fix_pH    -12.0 NaOH      10
END
 ---------------------------------------------------------------
Pest control file

pcf
* control data
restart estimation
11 6 1 0 1
# no of parameters,observations, group parameters, prior infos , groups
1 1 single point 1 0 0
# no of template files, no of instruction files, a character variable which must be single or double, ….
10.0 2.0 0.3 0.03 10
3.0 3.0 0.001
0.1
30 0.001 3 3 0.01 3
1 1 1

* parameter groups
k1 relative 1e-2 0.000001 switch 2 parabolic

* parameter data
k1 none relative 12.3 3.0 50 k1 1.0 0.0 1
#param_name,type, initial, min, max, ..….
k2 none relative -13.16 -20.0 20 k1 1.0 0.0 1
k3 none relative 7.51 1.0 30 k1 1.0 0.0 1
k4 none relative 0.99 0.50 30 k1 1.0 0.0 1
k5 none relative 0.99 0.50 30 k1 1.0 0.0 1
k6 none relative -0.95 -1.50 30 k1 1.0 0.0 1
k7 none relative -6.95 -10.50 30 k1 1.0 0.0 1
k8 none relative 4.06 1.0 30 k1 1.0 0.0 1
k9 none relative 7.5 1.0 30 k1 1.0 0.0 1
k10 none relative 8.0 1.0 30 k1 1.0 0.0 1
k11 none relative 6.90 1.0 30 k1 1.0 0.0 1

* observation groups
group_1

* observation data
c1 2.21 1 group_1  # obs_name, value, weight, group no
c2 85.10 1 group_1
c3 99.60 1 group_1
c4 99.70 1 group_1
c5 99.30 1 group_1
c6 99.50 1 group_1


* model command line
C:\Users\hv1641\Desktop\uranium\case\phreeqc-3.7.3-15968-x64.msi C:\Users\hv1641\Desktop\uranium\case\uranium.phrq uranium_new.txt C:\Users\hv1641\Desktop\uranium\case\wateq4f.dat

* model input/output
uranium.tpl  uranium.phrq
uranium.ins  uranium_new.txt

* prior information


-----------------------------------------------
Instruction file
pif @
l1 [c1]1:25
l1 [c2]1:25
l1 [c3]1:25
l1 [c4]1:25
l1 [c5]1:25
l1 [c6]1:25


Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4034
Re: PEST-PHREEQC Parameter Optimization
« Reply #1 on: 08/09/22 00:13 »
First, I'm not sure if you have installed PHREEQC correctly. phreeqc-3.7.3-15968-x64.msi is not the PHREEQC executable, it is an installer file. You need to execute phreeqc-3.7.3-15968-x64.msi and click through the screens. When you are done, PHREEQC will be installed on your computer. By default it is installed in the directory C:\Program Files\USGS\phreeqc-3.7.3-15968-x64. The executable file you want to use with PEST is C:\Program Files\USGS\phreeqc-3.7.3-15968-x64\bin\Release\phreeqc.exe, which does not have the graphing capabilities (USER_GRAPH definitions will be ignored). I think if you use the graphing version (C:\Program Files\USGS\phreeqc-3.7.3-15968-x64\bin\ClrRelease\phreeqc.exe), PEST may stop each time a graph is produced, which would be problematic when PEST is running PHREEQC many, many times.

I think the command line would be something like the following:

"C:\Program Files\USGS\phreeqc-3.7.3-15968-x64\bin\Release\phreeqc.exe" C:\Users\hv1641\Desktop\uranium\case\uranium.phrq

You would not put the selected output file uranium_new.txt as a command argument; it is defined in the SELECTED_OUTPUT data block.

I would also put the following line

Code: [Select]
DATABASE C:\Users\hv1641\Desktop\uranium\case\wateq4f.dat

As the first line of your template file after "ptf @".

If you want to use the database file in the command line, the command line would be something like this:

Code: [Select]
"C:\Program Files\USGS\phreeqc-3.7.3-15968-x64\bin\Release\phreeqc.exe" C:\Users\hv1641\Desktop\uranium\case\uranium.phrq  C:\Users\hv1641\Desktop\uranium\case\uranium.phrq.out C:\Users\hv1641\Desktop\uranium\case\wateq4f.dat

You defined, but did not use the phase "fix_pe". I do not think you should use this phase. If you want to control the pe, it is better to fix the partial pressure of oxygen (the phase O2(g)).

You may have trouble fixing the pH only by reacting NaOH. If the program fails to reach a specified low pH, you may need to use the technique shown in example 8 to add either acid or base to maintain the pH.




Logged

Francis Adu

  • Contributor
  • Posts: 8
Re: PEST-PHREEQC Parameter Optimization
« Reply #2 on: 08/09/22 19:21 »
Dear dlparkhurst,
Thank you very much for your reply. This is very helpful and I have been able to work around it based on your comments.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Surface Complexation »
  • PEST-PHREEQC Parameter Optimization
 

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