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 »
  • Inverse modelling »
  • Combination of INVERSE_MODELING and MIX
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Combination of INVERSE_MODELING and MIX  (Read 1606 times)

ViktoriaRfq

  • Contributor
  • Posts: 4
Combination of INVERSE_MODELING and MIX
« on: 07/06/23 10:10 »
Hello everyone,

I'm working on a quite simple problem but cannot get to model it correctly in PHREEQC.

I want to find out the composition of a water x that turns the defined solution 1 into solution 2. So to say 1 + x = 2.
I also know, that solution 1 accounts to around 40% of solution 2. So to say 0.4 Sol 1 + 0.6 Sol x = Sol 2.


I'm not getting the input right. Here's what I wrote:

TITLE   composition of the seeped water between Gesenk 2. Sohle and Mundloch  TSS                                       
#wateq4f.dat                                          
                                       
                                          
SOLUTION_SPREAD                                          
                                          
units mmol/L                                          
                                          
Number   temp   pH   pe   Al   Ca   Fe   K   Mg   Na   S(-2)   C(4)   S(6)   As   description
                                          
1   10.8   6.94   7.6   0.008895478   1.848802395   0.006803939   0.104859335   0.662278898   0.701609395   7.79788E-05   1.606994172   1.509479531   0.003336893   #ED-U-3_Ge2_unf_Nov22
2   11.1   6.83   8.8   0.002965159   0.696107784   0.003043868   0.062148338   0.246400658   0.678990866   7.79788E-05   0.782681099   0.499689776   0.004271223   #ED-O-5-STO-TSS_unf_Nov22
                                          
INVERSE_MODELING   1                                       
   -solutions   1   2                                 
   -uncertainty                                       
   -balances                                       
      Al                                    
      Ca                                    
      Fe                                             
      K                                    
      Mg                                    
      Na                                    
      C(4)                                    
      S(6)                                    
      As                                    
                                          
                                          
                                          
   -phases                                       
      Fe(OH)3(a)                                              
      Scorodite                                    
      Magnesite                                    
      Calcite                                    
      Dolomite                                    
      Gypsum                                    
      Al(OH)3(a)                                    
      Gibbsite                                    
      Siderite                                    
      Jarosite(ss)                                    
      Jarosite-K                                    
   -range                                       
                                          
SAVE   solution    3                                    
END                                          
                                          
TITLE   adjustment of the ratio 40:60                                       
MIX   1                                       
   1   0.4                                    
   3   0.6                                    
SAVE   solution   4                                    
                                          
                                          
                                          
                                          
                                          
                                          
                                          
SELECTED_OUTPUT                                          
-file IM und MIX.xls                                          
-reset false                                          
-percent_error                                          
-solution   4                                       
-pH                                          
-pe                                          
-molalities   CO2   HCO3-                                    
-totals   As   As(5)   As(3)   Fe   Fe(3)   Fe(2)   Al   Ca   Mg   Na   K   C(+4)   Cl   S(+6)
-saturation_indices   Fe(OH)3(a)             Scorodite   Magnesite   Calcite   Dolomite   Gypsum   Al(OH)3(a)   Gibbsite   Siderite   Jarosite(ss)   Jarosite-K         
END                                          
                                          
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4034
Re: Combination of INVERSE_MODELING and MIX
« Reply #1 on: 07/06/23 19:24 »
First, the charge balances on your solutions are not great 10 to 17 percent error, so you are starting out with a lot of uncertainty.

Second, unless you have more constraints, there is no way to sort out unknown solution composition from mineral reaction.

Here is a calculation that uses solution 1, the unknown solution 2, to make solution 3, with mixing fractions approximately 0.4 and 0.6. Br was added to produce the mixing fractions. Solution 2 was given the composition of solution 3, but was given 100% uncertainties. Thus, concentrations could range anywhere from twice solution 3 to zero. Inverse modeling will then pick concentrations for solution 2 that allow for mixing of solution 1 with solution 2, while producing charge balance in solution 2.

I am not sure if this calculation is helpful, but maybe it gives you some ideas on how to proceed. There are too many degrees of freedom to make any definitive statements.

Code: [Select]
SOLUTION_SPREAD
    -units    mmol/l
 Number temp    pH   pe           Al           Ca           Fe            K           Mg           Na     S(-2)         C(4)         S(6)           As   Br
      1 10.8 6.94 7.6 0.008895478 1.848802395 0.006803939 0.104859335 0.662278898 0.701609395 7.80E-05 1.606994172 1.509479531 0.003336893    0
      2 11.1 6.83 8.8 0.002965159 0.696107784 0.003043868 0.062148338 0.246400658 0.678990866 7.80E-05 0.782681099 0.499689776 0.004271223 1.0
      3 11.1 6.83 8.8 0.002965159 0.696107784 0.003043868 0.062148338 0.246400658 0.678990866 7.80E-05 0.782681099 0.499689776 0.004271223 0.6
END
                                     
INVERSE_MODELING   1                                       
   -solutions   1   2   3                             
   -uncertainty  0.2 1.0 0.2                                     
   -balances                                       
      Al                                   
      Ca                                   
      Fe                                             
      K                                   
      Mg                                   
      Na                                   
      C                                   
      S                                   
      As                                   
      Br 0.05 0.05 0.05
pH 0.05 1 0.05                                   
                                   
   -phases                                       
      Fe(OH)3(a)                                             
      Scorodite                                   
      Magnesite                                   
      Calcite                                   
      Dolomite                                   
      Gypsum                                   
      Al(OH)3(a)                                   
      Gibbsite                                   
      Siderite                                   
      Jarosite(ss)                                   
      Jarosite-K                                   
-minimal                                                                       
END                                         
                                         
                               

Logged

ViktoriaRfq

  • Contributor
  • Posts: 4
Re: Combination of INVERSE_MODELING and MIX
« Reply #2 on: 08/06/23 07:34 »
Thank you for that brilliant idea.

Later on yesterday, I managed to model on my own (without the mixing) after adjusting the uncertainty to 0.2 for solution 1 and 0.3 for solution 2 (due to the high CBE... these are mine waters so higher CBEs are not unusual). PHREEQC offered 160 possible scenarios :-D

Thank you for your time, this was very helpful.
Greetings from Freiberg.

Quote from: dlparkhurst on 07/06/23 19:24
First, the charge balances on your solutions are not great 10 to 17 percent error, so you are starting out with a lot of uncertainty.

Second, unless you have more constraints, there is no way to sort out unknown solution composition from mineral reaction.

Here is a calculation that uses solution 1, the unknown solution 2, to make solution 3, with mixing fractions approximately 0.4 and 0.6. Br was added to produce the mixing fractions. Solution 2 was given the composition of solution 3, but was given 100% uncertainties. Thus, concentrations could range anywhere from twice solution 3 to zero. Inverse modeling will then pick concentrations for solution 2 that allow for mixing of solution 1 with solution 2, while producing charge balance in solution 2.

I am not sure if this calculation is helpful, but maybe it gives you some ideas on how to proceed. There are too many degrees of freedom to make any definitive statements.

Code: [Select]
SOLUTION_SPREAD
    -units    mmol/l
 Number temp    pH   pe           Al           Ca           Fe            K           Mg           Na     S(-2)         C(4)         S(6)           As   Br
      1 10.8 6.94 7.6 0.008895478 1.848802395 0.006803939 0.104859335 0.662278898 0.701609395 7.80E-05 1.606994172 1.509479531 0.003336893    0
      2 11.1 6.83 8.8 0.002965159 0.696107784 0.003043868 0.062148338 0.246400658 0.678990866 7.80E-05 0.782681099 0.499689776 0.004271223 1.0
      3 11.1 6.83 8.8 0.002965159 0.696107784 0.003043868 0.062148338 0.246400658 0.678990866 7.80E-05 0.782681099 0.499689776 0.004271223 0.6
END
                                     
INVERSE_MODELING   1                                       
   -solutions   1   2   3                             
   -uncertainty  0.2 1.0 0.2                                     
   -balances                                       
      Al                                   
      Ca                                   
      Fe                                             
      K                                   
      Mg                                   
      Na                                   
      C                                   
      S                                   
      As                                   
      Br 0.05 0.05 0.05
pH 0.05 1 0.05                                   
                                   
   -phases                                       
      Fe(OH)3(a)                                             
      Scorodite                                   
      Magnesite                                   
      Calcite                                   
      Dolomite                                   
      Gypsum                                   
      Al(OH)3(a)                                   
      Gibbsite                                   
      Siderite                                   
      Jarosite(ss)                                   
      Jarosite-K                                   
-minimal                                                                       
END                                         
                                         
                               
Logged

ViktoriaRfq

  • Contributor
  • Posts: 4
Re: Combination of INVERSE_MODELING and MIX
« Reply #3 on: 10/06/23 12:34 »
Dear David,
is there some other way to include the mixing fractions? If I use the Br, PHREEQC does not output any simulation. If I remove it, I get 66 simulations. Among these, the most "suitable" are simulations suggesting 15% of solution 1 or 18% of solution 2 - so not really close to the 40%.

My updated code:
Code: [Select]
TITLE composition of the seeped water between Gesenk 2. Sohle and Mundloch TSS
#wateq4f.dat

#KNOBS
#solution 1, unknown solution 2 and solution 3 with mixing fractions app. 0.4 and 0.6 (Br added to produce the fractions). Solution 2 given the composition od solution 3 but with 1.0 uncertainty (concentrations could range anywhere from twice solution 3 to zero. inverse modeling will pick the concentration for solution 2 that allow for mixing of solution 1 with solution 2 while producing charge balance in solution 2.
#-uncertainity default (0.05) wenn charge balance error um die 10%, uncertainty 0.1 wählen
# the "minimal" indicator gives fewer mnodels at the cost of greater "sums of residuals" … sums of residuals - how much the data has been fudged; residual 1.0 means that one analytical datum has been changed by ist maximum uncertainty
#alle Werte von AG BBW gemessen
#<LOD-Werte =0.5 LOD gesetzt
#TIC als C(4)
#S(6) aus Photometrie
#Fluorwerte mit Fit-Funktion berechnet
#Cu, Ni, S(-2) aus dem Input gelöscht


SOLUTION_SPREAD

units mmol/L
Number temp pH pe Al Ba Ca Fe K Li Mg Mn Na Si Sr Zn Cl C(4) S(6) N(5) As F

1 10.80 6.94 7.60 0.00889548 0.00014565 1.85 0.00680394 0.10485934 0.01008646 0.6622789 0.0076447 0.7016094 0.22961908 0.00182607 0.00290609 0.79541929 1.61 1.51 0.01784822 0.00333689 0.48952521
2 11.10 6.83 8.80 0.00296516 0.00021847 0.69610778 0.00304387 0.06214834 0.00288184 0.24640066 0.00091008 0.67899087 0.17230331 0.00102716 0.00038238 0.75028912 0.7826811 0.49968978 0.17348469 0.00427122 0.10527424
3 11.10 6.83 8.80 0.00296516 0.00021847 0.69610778 0.00304387 0.06214834 0.00288184 0.24640066 0.00091008 0.67899087 0.17230331 0.00102716 0.00038238 0.75028912 0.7826811 0.49968978 0.17348469 0.00427122 0.10527424




INVERSE_MODELING 1
-solutions 1 2 3
-uncertainty 0.2 1 0.2
-balances Al
Ba
Ca
Fe
K
Li
Mg
Mn
Na
Si
Sr
Zn
Cl
C(4)
S(6)
N(5)
As
F
Br 0.05 0.05 0.05
pH 0.05 1 0.05

-phases
Fe(OH)3(a)         
Scorodite
Magnesite
Calcite
Dolomite
Gypsum
Al(OH)3(a)
Gibbsite
Siderite
Jarosite(ss)
Jarosite-K
CaX2
MgX2
NaX




SELECTED_OUTPUT
-file zusitzendes wasser inverse modeling.xls
-inverse_modeling true

END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4034
Re: Combination of INVERSE_MODELING and MIX
« Reply #4 on: 10/06/23 14:44 »
You can change the Br concentration in solution 3, or increase the Be uncertainty. But it sounds like you already know what you want.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Inverse modelling »
  • Combination of INVERSE_MODELING and MIX
 

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