PhreeqcUsers Discussion Forum
Click here to donate to keep PhreeqcUsers open

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • first steps
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: first steps  (Read 179 times)

INZILLO

  • Frequent Contributor
  • Posts: 10
first steps
« on: January 17, 2023, 09:08:45 PM »
Hello everybody.
I've been using PHREEQC for a short time and I don't know how to continue my work.
Starting from my solution with ionic concentrations, I need to know which salts I will have in order to reproduce my brine in the laboratory.
How can I proceed?
Another question, can I leave pe=4 or is it very wrong?
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #1 on: January 18, 2023, 12:49:23 AM »
It sounds like you want to generate a recipe for making a specific brine composition. You want the amounts of a set of salts that when dissolved approximate the brine. If this is the case, you can define a set of salts and use INVERSE_MODELING to determine one or more sets of salts and their amounts that would make the brine.

The pe only affects redox elements that are defined by total amounts rather than individual redox states--for example when Fe is defined rather than Fe(2) and (or) Fe(3). Usually, the choice of pe will not affect the major elements of a brine.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #2 on: January 18, 2023, 09:22:20 AM »
fully correct answer. is the database to use ptfizer?
Do you have any practical examples to show me?
thank you very much dear, very kind
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #3 on: January 18, 2023, 09:49:36 AM »
I have read the Phreeqc guide specifically the examples 16,17,18. You need 2 solutions to mix but I only have one, what do I use as a second solution?
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #4 on: January 18, 2023, 04:32:57 PM »
You should check your analysis and units. I'm not sure it is possible to have those concentrations of H(0) [H2(aq)] and O(0) [O2(aq)].

Here is a script that generates a recipe for Black Sea seawater. You can adjust for your brine to use salts that are easily available, stable, and easily weighed.

Engage brain. What is that second solution?

Code: [Select]
SOLUTION 1
pH 7 charge
SOLUTION 2  Black Sea water
        units   mg/L
        density 1.014
        pH      8.0     # estimated
        Ca      233
        Mg      679
        Na      5820
        K       193
        S(6)    1460
        Cl      10340
        Br      35
        C       1       CO2(g) -3.5
END
PHASES
MgCl2
MgCl2 = Mg+2 + 2Cl-

CaCl2
CaCl2 = Ca+2 + 2Cl-

Na2CO3
Na2CO3 = 2Na+ + CO3-2

Na2SO4
Na2SO4 = 2Na+ + SO4-2

NaBr
NaBr = Na+ + Br-

KBr
KBr = K+ + Br-

HCl
HCl = H+ + Cl-

NaOH
NaOH = Na+ + OH-

INVERSE_MODELING
-solution 1 2
-phases
Halite dis
Sylvite dis
MgCl2 dis
CaCl2 dis
Na2SO4 dis
Na2CO3 dis
HCl  dis
NaBr dis
KBr  dis
END
USE solution 1
REACTION
         Halite      2.219e-01     
        Sylvite      4.960e-03     
          MgCl2      2.807e-02     
          CaCl2      5.841e-03     
         Na2SO4      1.527e-02     
         Na2CO3      7.375e-04     
            HCl      7.149e-04     
           NaBr      4.401e-04     
1 mol
USER_PRINT
5  PRINT "         Salt        Grams"
10 PRINT "         Halite  ",      2.219e-01*GFW("NaCl") 
20 PRINT "        Sylvite  ",      4.960e-03*GFW("KCl")       
30 PRINT "          MgCl2  ",      2.807e-02*GFW("MgCl2")       
40 PRINT "          CaCl2  ",      5.841e-03*GFW("CaCl2")       
50 PRINT "         Na2SO4  ",      1.527e-02*GFW("Na2SO4")       
60 PRINT "         Na2CO3  ",      7.375e-04*GFW("Na2CO3")       
70 PRINT "           NaBr  ",      4.401e-04*GFW("NaBr")
80 PRINT "            HCl     7.149e-04 L of 1N HCl"   
END

Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #5 on: January 18, 2023, 04:58:29 PM »
I try to explain as best I can.
In the meantime, thank you for your availability, it is excellent.
I have the ionic composition of my brine with the relative concentrations.
From the concentration of the single ions I would like to have the composition of the salts to be used for artificial reproduction.
But I don't have a second solution to mix.
I am attaching the correct data.
 
temp 25
pH 7.47
pe 4
redox pe
units g/l
density 1.1
Cl 47.7
K 1.47
Mg 6.45
Na 38.19
S 3.39
water 1 # kg


I tried to do the simulation with the inverse modeling but it gave me an error.
I tell her the steps I take maybe she can help me.

1. do inverse modeling
2.I insert in options the range and delete a water mineral
3. solution No. 1 end final
4. Insert the ionic concentration in balance
5. insert the phases
6. run
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #6 on: January 18, 2023, 07:26:18 PM »
You have a second solution. You would use it when you followed a recipe.

Further, I gave you a working example that has two solutions. Start by modifying the solution in the example.
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #7 on: January 19, 2023, 05:41:20 PM »
You are close. I think you just need a little base (NaOH) to make the right pH (other cases might need HCl). Note that the inverse procedure adjusts the initial solution to charge balance. So, by inserting the mole transfers from INVERSE_MODELING into REACTION, the resulting solution is slightly different than the original solution 2. If you charge balance SOLUTION 2, say by using "Cl 47.7 charge", then the match between the REACTION solution and SOLUTION 2 should be exact.

There is not an automatic way to define REACTION based on the INVERSE_MODELING results, you have to do some cutting and pasting.


Code: [Select]
SOLUTION 1 soluzione 1
    pH        7 charge
SOLUTION 2 soluzione 2
    temp      25
    pH        7.57
    pe        4
    redox     pe
    units     g/l
    density   1.08
    Na        25.46
    Cl        47.7
    K         0.98
    Mg        4.3
    S(6)      2.26
end
PHASES
MgCl2
    MgCl2 = 2Cl- + Mg+2
    log_k     0
NaCl
    NaCl = Cl- + Na+
    log_k     0
KCl
    KCl = Cl- + K+
    log_k     0

MgSO4
    MgSO4 = Mg+2 + SO4-2
    log_k     0

HCl
    HCl = H+ + Cl-

NaOH
    NaOH = Na+ + OH-
INVERSE_MODELING 1
    -solutions      1        2
    -uncertainty    0.05     0.05
    -phases
        MgCl2             dis
        MgSO4             dis
        Sylvite           dis
        Halite            dis
        NaOH              dis
    -tolerance         1e-10
    -mineral_water     false
end
USE solution 1
REACTION 1
          MgCl2      1.534e-01
          MgSO4      2.354e-02
        Sylvite      2.508e-02
         Halite      1.082e+00
           NaOH      1.165e-05   
    1 moles in 1 steps
END
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #8 on: January 20, 2023, 09:29:59 AM »
Thank you so much, you are awesome.

Two further questions.
1-Can I use the same standard approach for other brine even hypersalted, always using NaOH and HCl to correct the pH?
2-If you wanted to add MgCl2 : 6H2O e
MgSO4 :7H2O?

Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #9 on: January 20, 2023, 03:47:08 PM »
Yes, the same approach should work for other concentrated solutions, although you may run into convergence problems with the SOLUTION calculation if the concentrations are extremely high.

You can define waters of hydration in a mineral using a colon (:6H2O); you will need to include the water in the reaction for PHASES (see Gypsum as an example). However, I would define     -mineral_water     true, which means that the water from the minerals will be included in the mole-balance calculation. In that case, you should pay attention to the mixing fraction of solution 1 in the inverse model. Assuming you start with a kilogram of pure water, the mixing fraction will be the kilograms of water needed in the recipe.

Note also, that for units of g/L and large concentrations for the SOLUTION 2 definition, the density of the solution is critical for PHREEQC's conversion of units to mol/kg water.

Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #10 on: January 20, 2023, 04:07:04 PM »
Thank you so much.

Do you happen to have any examples with hydrated salts?
With a simulation of a process similar to the previous one?

The only thing I didn't understand is, where can I get the values ​​of the correct "relative stoichiometry" in REACTION, since if it is wrong the concentration of salts will not be real.


INVERSE_MODELING 1
    -solutions      1        2
    -uncertainty    0.05     0.05
    -phases
        MgCl2             dis
        MgSO4             dis
        Sylvite           dis
        Halite            dis
        NaOH              dis
    -tolerance         1e-10
    -mineral_water     false
end
USE solution 1
REACTION 1
         MgCl2     [ 1.534e-01            |
         MgSO4    [ 2.354e-02            |
         Sylvite      [2.508e-02           |   -----------------> the values ​​I mean are these, referring to the example you sent me
         Halite      [1.082e+00           |
         NaOH    [ 1.165e-05             |
    1 moles in 1 steps


Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #11 on: January 20, 2023, 05:04:33 PM »
Have you looked at the output for INVERSE_MODELING? Using the input file from a couple of posts ago, you will find these lines in the output:

Code: [Select]
Solution fractions:                   Minimum        Maximum
   Solution   1      1.000e+00      0.000e+00      0.000e+00
   Solution   2      1.000e+00      0.000e+00      0.000e+00

Phase mole transfers:                 Minimum        Maximum   Formula             (Approximate SI in solution 1, 2 at 298 K,   1 atm)
          MgCl2      1.534e-01      0.000e+00      0.000e+00   MgCl2                      (      , -1.44)
          MgSO4      2.354e-02      0.000e+00      0.000e+00   MgSO4                      (      , -4.25)
        Sylvite      2.508e-02      0.000e+00      0.000e+00   KCl                        (      , -2.84)
         Halite      1.082e+00      0.000e+00      0.000e+00   NaCl                       (      , -1.74)
           NaOH      1.165e-05      0.000e+00      0.000e+00   NaOH   

These are the values that are used in REACTION. Note that you should change the input file to -mineral_water true if you use hydrated salts.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #12 on: January 21, 2023, 03:45:06 PM »
Thank you so much.

In the file from a couple of posts ago that you send me, the values of Reaction

They are the ones you sent me, I didn't understand where to find them for the next simulations or in any case if I have to calculate them.
Can you help me?
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #13 on: January 21, 2023, 04:00:55 PM »
Enough, look at the output of this file! The moles of each reactant are calculated by INVERSE_MODELING in this file. You are nearly out of questions.

The REACTION calculation is not required. I added it to show that the original solution was indeed created by adding the calculated moles of reaction from inverse modeling to pure water.

Code: [Select]
SOLUTION 1 soluzione 1
    pH        7 charge
SOLUTION 2 soluzione 2
    temp      25
    pH        7.57
    pe        4
    redox     pe
    units     g/l
    density   1.08
    Na        25.46
    Cl        47.7
    K         0.98
    Mg        4.3
    S(6)      2.26
end
PHASES
MgCl2
    MgCl2 = 2Cl- + Mg+2
    log_k     0
NaCl
    NaCl = Cl- + Na+
    log_k     0
KCl
    KCl = Cl- + K+
    log_k     0

MgSO4
    MgSO4 = Mg+2 + SO4-2
    log_k     0

HCl
    HCl = H+ + Cl-

NaOH
    NaOH = Na+ + OH-
INVERSE_MODELING 1
    -solutions      1        2
    -uncertainty    0.05     0.05
    -phases
        MgCl2             dis
        MgSO4             dis
        Sylvite           dis
        Halite            dis
        NaOH              dis
    -tolerance         1e-10
    -mineral_water     false
end
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #14 on: January 25, 2023, 06:15:57 PM »
how can I solve this problem?
-----
Beginning of inverse modeling 1 calculations.
---------------------------------------------

Using Cl1 standard precision optimization routine.

Post_mortem examination of inverse modeling:

   ERROR: inequality not satisfied for Br(-1) eps+, 3.503504e-02
   ERROR: inequality not satisfied for Fe(3) eps-, 8.175979e-04

Summary of inverse modeling:

   Number of models found: 0
   Number of minimal models found: 0
   Number of infeasible sets of phases saved: 1
   Number of calls to cl1: 3
------------------
End of simulation.
------------------

------------------------------------
Reading input data for simulation 3.





this is the final part of a simulation output for the reconstruction of a very concentrated Brine, salinity as (NaCl) 200.000 mg/l.

« Last Edit: January 26, 2023, 10:15:02 AM by INZILLO »
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2728
Re: first steps
« Reply #15 on: January 25, 2023, 09:00:13 PM »
Consider whether you really care about Br and Fe. Fe is usually a small concentration, and you problem may be in how you defined redox in your SOLUTION. My guess is that Fe is Fe(2) in SOLUTION and Fe(3) in your minerals, in which case you need an Fe(2) salt to account for the Fe. Don't know about Br, but try adding NaBr as another mineral.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 10
Re: first steps
« Reply #16 on: January 26, 2023, 10:17:30 AM »
Thanks a lot, I fixed it and it works.
In another brine I have Acetate and I can't find phases to match, I should have CH3COONa but it doesn't work.
Some advice?
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • PHREEQC basics »
  • first steps
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2