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 »
  • Reactive transport modelling »
  • Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Transport working on PHREEQC for window but not working on the NOTEPAD++ version  (Read 6040 times)

FlouretAlex

  • Top Contributor
  • Posts: 36
Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« on: 31/08/20 17:59 »
Hello every one,
I hade been running this script (see below) with "PHREEQC for window". Today I tried to run the same script with the "notepad++" version but it didn't work. And I don't know why this doesn't work.

Thank you for your help =)

The script used for both versions:


DATABASE   C:\Users\International\Documents\PhD\AlexF\Modelo alex\Fitted\000_Database_PHREEQC\amineDB.dat
########### I. Adsorption du Cs+   BATCH
Surface 0

 -sites_units density   # site concentration in sites/nm^2 ; SSA m2/g ;   ratio 19.73g/8e-3L
Illitex     1.78E-04   97   2474
Montx      1.79E-06   800   2474
Kaolinitex   3.05E-06   10   2474

Exchange 0
Illi   3.68E-02
Mont   1.07E-01
Kao   1.00E-03
end

# Equilibrage sol/solnut
Solution    0
 units mol/L
 pH   7.12
 Ca   1.91E-3
 Cl   3.8E-3
 K   9.53E-05
 Mg   6.91E-04
Use Surface 0
Use Exchange 0
EQUILIBRIUM_PHASES   0
Fix_H+ -7.12   NaOH 1
save surface 3
save exchange 3
end

#Spikage
Solution   3
units mol/L
pH    7.12
 Cl   1E-5
 K    9.53E-05
 Mg   6.91E-04
 Cs   3.46E-04
use surface 3 ;
use Exchange 3   ;
EQUILIBRIUM_PHASES   3
Fix_H+ -7.12 NaOH  1
end

 #II. Désorption du Cs+

#  t = 24jr = 2073600s ; Q= 0.0091 mL/min (rhizotests) , V= Sol sec* teneur_eau  =  19.72 * 0.4087 = 8.09 ml
# tps de renouvellement = V/Q = 14.82 h = 53347 s ; nbre volumes cellule = t/tps de R = 2073600/53347 =  38.87
# calcul dt ==>  MIX : fraction mélangée f_m = 0.5%  ; f_m = V x 0.05 = 8.09 * 0.05 =0.40  ;  dt = f_m/Q  = 0.40/0.0091 = 44.46 min  donc dt  =  2667 s
# time_step = 2667
# shift = t/dt = 2073600/ 2667 = 777



SOLUTION 0-1
 units mol/L
 pH   7.26
 Cl   1E-5
 K    9.53E-05
 Mg   6.91E-04

MIX 3
0 0.05
3 0.95
end


TRANSPORT
-cells    1
-lengths   0.01   # 1 cm sol
-shifts   777
-time_step   2667
-flow_direction     diffussion_only
-boundary_conditions    constant closed
-dispersivities     1
-diffusion_coefficient   2.3E-08
-stagnant    1
-punch_cells    3
-punch_frequency    1



USER_GRAPH
-headings q Cs_aq Cs_ads  SOCs XCs TOT_Cs
-chart_title " "
 -axis_scale x_axis
 -axis_scale y_axis
-initial_solutions false
-plot_concentration_vs time
-axis_titles "nbre volumes cellule" "concentrations (mol/l)" "Kd (L/Kg)"
-start
10 Msoil = 16.72/1000 # soil_masse(Kg)
20 Vwater = 6.86/1000 # volume batch (L)
30 MVw = Msoil/Vwater #Kg/L
40 VwM = Vwater/Msoil #L/Kg
50 Csini = sys("Cs") # (mol/L)
60 Csaq = tot("Cs") #(mol/L)
70 surfCs = (surf("Cs","Illitex")+ surf("Cs","Montx")+ surf("Cs","Kaolinitex"))#(mol/L)
80 exchCs = (mol("CsIlli")+ mol("CsMont")+ mol ("CsKao")) #(mol/L)
90 illCs = (surf("Cs","Illitex")+ mol("CsIlli")) #(mol/L)
100 montCs = (surf("Cs","Montx")+ mol("CsMont")) #(mol/L)
110 kaoCs = (surf("Cs","Kaolinitex")+ mol ("CsKao")) #(mol/L)
120 Csfix = surfCs + exchCs #(mol/L)
130 Kd = (Csfix/Csaq)*VwM #(L/Kg)
140 Kdsurf = (surfCs/Csaq)*VwM #(L/Kg)
150 Kdexch = (exchCs/Csaq)*VwM #(L/Kg)
160 Kdilli = (illCs/Csaq)*VwM #(L/Kg)
170 Kdmont = (montCs/Csaq)*VwM #(L/Kg)
180 Kdkao = (kaoCs/Csaq)*VwM #(L/Kg)
190 Cssorb = Csaq*Kd #(mol/Kg)
200 Cssurf = Csaq*Kdsurf #(mol/Kg)
210 Csexch = Csaq*Kdexch #(mol/Kg)
220 Csverif = Csaq + Cssorb*MVw #(mol/L)
230 dt=    2667

300 graph_x   dt*(step_no)/    53347   # = temps de renouvellement (h) ==>      14.82
310 graph_y   Csaq
320 graph_sy    Kd
330 graph_sy    Kdsurf
340 graph_sy    Kdexch

-end


SELECTED_OUTPUT
-reset                false
-file C:\Users\International\Documents\PhD\AlexF\Modelo alex\Fitted\RHIZOsol\RHIZO_soil.sel
-high_precision        true
 -step
-solution
USER_PUNCH
-headings q(nbre_volumes_de_cellulle) t(s)   logCsaq   logKd   Csini   Csaq   Kd   Kdsurf   Kdexch   Cssorb   Cssurf   Csexch   Csverif   illiKd   montKd   kaoKd
-start
10 dt = 3194
20 q =  dt*(step_no)/63872 # 63872 = temps de renouvellement = 17.74h
30 t =  dt*(step_no)
10 Msoil = 16.72/1000 # soil_masse(Kg)
20 Vwater = 6.86/1000 # volume batch (L)
30 MVw = Msoil/Vwater #Kg/L
40 VwM = Vwater/Msoil #L/Kg
50 Csini = sys("Cs") # (mol/L)
60 Csaq = tot("Cs") #(mol/L)
70 surfCs = (surf("Cs","Illitex")+ surf("Cs","Montx")+ surf("Cs","Kaolinitex"))#(mol/L)
80 exchCs = (mol("CsIlli")+ mol("CsMont")+ mol ("CsKao")) #(mol/L)
90 illCs = (surf("Cs","Illitex")+ mol("CsIlli")) #(mol/L)
100 montCs = (surf("Cs","Montx")+ mol("CsMont")) #(mol/L)
110 kaoCs = (surf("Cs","Kaolinitex")+ mol ("CsKao")) #(mol/L)
120 Csfix = surfCs + exchCs #(mol/L)
130 Kd = (Csfix/Csaq)*VwM #(L/Kg)
140 Kdsurf = (surfCs/Csaq)*VwM #(L/Kg)
150 Kdexch = (exchCs/Csaq)*VwM #(L/Kg)
160 Kdilli = (illCs/Csaq)*VwM #(L/Kg)
170 Kdmont = (montCs/Csaq)*VwM #(L/Kg)
180 Kdkao = (kaoCs/Csaq)*VwM #(L/Kg)
190 Cssorb = Csaq*Kd #(mol/Kg)
200 Cssurf = Csaq*Kdsurf #(mol/Kg)
210 Csexch = Csaq*Kdexch #(mol/Kg)
220 Csverif = Csaq + Cssorb*MVw #(mol/L)
230 punch q, t, log10(Csaq), log10(Kd), Csini, Csaq, Kd, Kdsurf, Kdexch, Cssorb, Cssurf, Csexch, Csverif, Kdilli, Kdmont, Kdkao

-end
END


Here the error message that the notepad ++ create when I run the script mentioned above

WARNING: Maximum iterations exceeded, 400

WARNING: Numerical method failed with this set of convergence parameters.

WARNING: The program has failed to converge to a numerical solution.

The following equations were not satisfied:
ERROR:                   Ca has not converged. Total: 1.910443e-03   Calculated: 1.910140e-03   Residual: 3.033434e-07

ERROR:                   Mg has not converged. Total: 6.911602e-04   Calculated: 6.910505e-04   Residual: 1.097436e-07

ERROR:                   Na has not converged. Total: 1.000000e+00   Calculated: 1.395015e-01   Residual: 8.604985e-01

ERROR:             Hydrogen Mass of hydrogen has not converged.    Residual: -8.604985e-01

ERROR:               Oxygen Mass of oxygen has not converged.    Residual: 8.604985e-01

ERROR:                 Illi Exchanger mass balance has not converged.    Residual: 2.699747e-08

ERROR:                 Mont Exchanger mass balance has not converged.    Residual: 7.989150e-07

ERROR:                  Kao Exchanger mass balance has not converged.    Residual: 2.613558e-10
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4211
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #1 on: 31/08/20 18:18 »
First, I'm not sure why you define MIX 3 when your TRANSPORT calculation has only 1 cell.

You'll need to attach your database (and your input file too would make it easier) and I'll take a look. The problem appears to be conversion of the numerical method. My first try would be to use

Code: [Select]
KNOBS
-step 5
-pe 2
 

but there are a lot of possibilities for the cause of the problem.
Logged

FlouretAlex

  • Top Contributor
  • Posts: 36
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #2 on: 01/09/20 08:43 »
Hello,
Thank you for your help, the "MIX 3" was a typo from me... You can find in attachment the database used for while running this script.
I also forgot to say that I already try to change the iteration step size with KNOBS.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4211
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #3 on: 01/09/20 18:36 »
Still not sure what you intended with cell 3 definitions of solutions, save, and mix.

I think the main issue is the initial state of the exchangers. I suggest you either (1) define the exchangers to be in equilibrium with a solution, -eq 0, for example, or (2) define the ions on the exchanger initially, say with Na as shown below (although you can define a mixture of exchanged ions if you want).

Not sure why, but sometimes the Fix_H+ gets confused and it is necessary to add -force, which changes the mathematical constraint from an inequality constraint to an equality constraint.

Code: [Select]
SOLUTION 0
    temp      25
    pH        7.12
    pe        4
    redox     pe
    units     mol/l
    density   1
    Ca        0.00191
    Cl        0.0038
    K         9.53e-05
    Mg        0.000691
    -water    1 # kg
END
EXCHANGE 0
    NaIlli  0.0368
    NaMont  0.107
    NaKao   0.001
    -eq 0
END
USE solution 0
USE exchange 0
EQUILIBRIUM_PHASES   0
Fix_H+ -7.12   NaOH 10
-force
END
Logged

FlouretAlex

  • Top Contributor
  • Posts: 36
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #4 on: 02/09/20 16:22 »
I will clarify myself.

What I intend is to model an experiment where an amount of soil (equilibrated with solution 0) was contaminated by spiking cesium into it (Solution 3).
Then this soil is put into a device where the contaminated soil is connected to a noncontaminated solution tank. This noncontaminated solution is in contact with the soil thus replace the water evaporated from the soil.
To represent this into PHREEQC I based my script with another script who represent CSFR experiment.

MIX and Transport parameters represent the evaporation rate measured during the experiment.
Till now the results were fine as I was able to found the concentration of cesium in the soil solution measured during the experiment based on my database using PHREEQC for window.

But now that I want to use the notepad++ version with the idea to model with PHREEPlot it seems that the way I model my experiment is not that good.....
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4211
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #5 on: 02/09/20 17:01 »
I was responding to the reason the calculations did not converge. It was caused by specifying exchangers with no cations. If your soil is equilibrated with SOLUTION 0 multiple times before the start of the experiment, then you can use -eq 0 in the EXCHANGE definition. If you simply mixed soil and solution 0, then the cations initially on the exhanger may be important. If you have an analysis of the water after exchange with solution 0, then I would use -eq with that analysis.

I think you should develop a working PHREEQC conceptual model before you start with PhreePlot. If you had a working model in Phreeqc for Windows, it should still work with Notepad++. For evaporation,  I would do the mix slightly differently. I would define pure water (say SOLUTION 100), uncontaminated solution (say SOLUTION 0), and your experimental cell (say SOLUTION 3), then I would use this definition:

Code: [Select]
MIX
100 -0.05
0      0.05
3      1.0
END

This way, you would retain all of the solutes, not just 95 percent at each evaporation.
Logged

FlouretAlex

  • Top Contributor
  • Posts: 36
Re: Transport working on PHREEQC for window but not working on the NOTEPAD++ version
« Reply #6 on: 03/09/20 10:31 »
Equilibration was before spiking by saturating the soil to be contaminated with solution 0 and then adding solution 3. Then the contaminated soil was kept at saturation for 2 weeks before use by adding time to time solution 0,  so I  don't know if my script is representing this in the right way.

Unfortunately, I do not have the pore water solution analysis after adding solution 0.


Adding a solution of pure water is a nice idea! I will implement this on my script.
Thank you for your help.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Reactive transport modelling »
  • Transport working on PHREEQC for window but not working on the NOTEPAD++ version
 

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