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 506 times)

INZILLO

  • Frequent Contributor
  • Posts: 16
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: 2823
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: 16
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: 16
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: 2823
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: 16
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: 2823
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: 2823
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: 16
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: 2823
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: 16
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: 2823
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: 16
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: 2823
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: 16
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: 2823
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: 16
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

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #17 on: February 01, 2023, 12:41:12 AM »
Somehow my post was lost.

To model Acetate you need to define an element in SOLUTION_MASTER_SPECIES; I'd use Acetate (llnl.dat already has a definition in SOLUTION_MASTER_SPECIES), you need to define Acetate- in SOLUTION_SPECIES, and NaAcetate in PHASES. Then you can include NaAcetate as a phase in INVERSE_MODELING.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #18 on: February 06, 2023, 02:04:17 PM »

 Hello mister David.
 this is the input of example.17 .
some things are not clear to me.
In solution 1 and 2 the volume of water remains the same, I think it is given by the fact that the concentration of the ions is simply increased.Furthermore, in solution 2 we have Ca=0 as it will already be precipitated.
I have a question to ask you.
I would like to do evaporation simulations in order to understand at what concentrations the different salts precipitate.
Ex: (initial) Ca = 180 mg/L precipitates at 600 (g/L) etc [always within saline solutions ] if not possible as single ions also as phases.
What should I do?
Proceed by step?
Concentrate once, twice, three times?






SOLUTION 1 Black Sea water
    temp      25
    pH        8
    pe        4
    redox     pe
    units     mg/l
    density   1.014
    Br        35
    C         1 CO2(g)     -3.5
    Ca        233
    Cl        10340
    K         193
    Mg        679
    Na        5820
    S(6)      1460
    -water    1 # kg

SOLUTION 2 Composition during halite precipitation
    temp      25
    pH        5
    pe        4
    redox     pe
    units     mg/l
    density   1.271
    Br        2670
    C         1 CO2(g)     -3.5
    Ca        0
    Cl        187900
    K         15800
    Mg        50500
    Na        55200
    S(6)      76200
    -water    1 # kg
INVERSE_MODELING
-solution 1 2
-uncertainties .025
-range
-balances
Br
K
Mg
-phases
H2O(g) pre
Calcite pre
CO2(g) pre
Gypsum pre
Halite pre
Glauberite pre
Polyhalite pre
END
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #19 on: February 07, 2023, 04:02:32 AM »
Here is an excerpt of the output. It indicates that you start with a solution with 88.15 kg water and end with a solution with 1 kilogram of water.

Code: [Select]
Solution fractions:                   Minimum        Maximum
   Solution   1      8.815e+01      8.780e+01      8.815e+01
   Solution   2      1.000e+00      1.000e+00      1.000e+00

Phase mole transfers:                 Minimum        Maximum   Formula             (Approximate SI in solution 1, 2 at 298 K,   1 atm)
         H2O(g)     -4.837e+03     -4.817e+03     -4.817e+03   H2O                        ( -1.51, -1.67)
        Calcite     -3.350e-02     -3.434e-02     -3.253e-02   CaCO3                      ( -0.09,      )
         CO2(g)     -3.151e-02     -3.397e-02     -2.893e-02   CO2                        ( -3.50, -3.50)
         Gypsum     -4.814e-01     -4.951e-01     -4.658e-01   CaSO4:2H2O                 ( -0.93,      )
         Halite     -1.975e+01     -2.033e+01     -1.902e+01   NaCl     
         

And evaporation sequence is calculated in example 17.       
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #20 on: February 08, 2023, 05:31:28 PM »
Can this standard be used for other Brines?
I find myself in the condition where there are no lithium phases available, how can you implement it?
Furthermore, I don't have a clear understanding of how to set the REACTION values ​​in my case.







EQUILIBRIUM_PHASES
# carbonates...
CO2(g) -3.5 10; Calcite 0 0
# sulfates...
Gypsum 0 0; Anhydrite 0 0; Glauberite 0 0; Polyhalite 0 0
Epsomite 0 0; Kieserite 0 0; Hexahydrite 0 0
# chlorides...
Halite 0 0; Bischofite 0 0; Carnallite 0 0
USER_GRAPH Example 17B
-head H2O Na K Mg Ca Cl SO4 Calcite Gypsum Anhydrite Halite\
Glauberite Polyhalite
-init false
-axis_scale x_axis 0 100
-axis_scale y_axis -5 1. 1
-axis_scale sy_axis -5 10 5 100
-axis_titles "Concentration factor" "Log(Molality)" "Log(Moles of solid)"
-chart_title "Evaporating Black Sea water"
-start
10 graph_x 1 / tot("water")
20 graph_y log10(tot("Na")), log10(tot("K")), log10(tot("Mg")), log10(tot("Ca")),\
log10(tot("Cl")), log10(tot("S"))
30 if equi("Calcite") > 1e-5 then graph_sy log10(equi("Calcite")) else graph_sy -5
35 if equi("Gypsum") > 1e-5 then graph_sy log10(equi("Gypsum")) else graph_sy -5
40 if equi("Anhydrite") > 1e-5 then graph_sy log10(equi("Anhydrite")) else graph_sy -5
50 if equi("Halite") > 1e-5 then graph_sy log10(equi("Halite")) else graph_sy -5
60 if equi("Glauberite") > 1e-5 then graph_sy log10(equi("Glauberite")) else graph_sy -5
70 if equi("Polyhalite") > 1e-5 then graph_sy log10(equi("Polyhalite")) else graph_sy -5
80 if STEP_NO > 20 THEN PRINT "x", "Na", "K", "Mg", "Ca", "Cl", "S"
90 if STEP_NO > 20 THEN PRINT 1 / tot("water"), (tot("Na")), (tot("K")), (tot("Mg")),\
(tot("Ca")), (tot("Cl")), (tot("S"))
-end
REACTION
H2O -1; 0 36 3*4 6*1 2*0.25 0.176 4*0.05 5*0.03
INCREMENTAL_REACTIONS true
END
« Last Edit: February 08, 2023, 08:20:41 PM by INZILLO »
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #21 on: February 08, 2023, 06:58:41 PM »
Define lithium phases with PHASES. Some are available in other databases.

You can experiment with REACTION.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #22 on: February 26, 2023, 11:25:23 AM »
Hi Mr. David.
Reading example 17, I understand that you have set up the modeling as if you already knew which phases would precipitate by specifying the moles that precipitate per kg of water.
If I don't know at all which phases precipitate, can I roughly reconstruct a graph with the phases that will precipitate, for example with a loss of 50 liters of water?
example:
solution 1 (I put the initial compositions)
solution 2
(the solutions concentrated 50 times)
inverse modelling
(I insert the precipitation of the phases)
?
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #23 on: February 26, 2023, 02:40:18 PM »
You should remove water sequentially from your solution and look at the positive saturation indices of the minerals (probably using pitzer.dat). Assuming they are plausible to precipitate, include them in EQUILIBIUM_PHASES. You can also include a set of phases (with zero moles each) that you think might precipitate and PHREEQC will determine which ones actually do precipitate. I would include all of the phases from example 17 for starters.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #24 on: March 06, 2023, 05:15:26 PM »
Hi Mister David.
I'm running simulations to predict the possible phases that can precipitate concentrating a brine.

I am following 2 steps :

1- From my solution I remove water step by step of 10% at a time (in order to control (S.I) of the phases
[whit this Kayword- SOLUTION-REACTION]

2- whit the phases that have a positive S.I,  I make a new simulation by setting the phases that precipitate (equilibrium phases) by subtracting water (reaction) and I create a graph to understand the moles that precipitate based on the concentration factor.

it seems to work well, the only problem is that it causes me to precipitate only one phase and there should be another since it has an S.I = 6.
What do you suggest me?


Logged

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #25 on: March 07, 2023, 04:37:23 PM »
If you include the phase in EQUILIBRIUM_PHASES with zero moles, it will either precipitate or be undersaturated in the reaction solution because other phases are more stable.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #26 on: March 07, 2023, 04:51:22 PM »
Thank you very much,
I thought that given a positive (S.I.) it should precipitate. Is it a reliable model even for high salinity? as (NaCl) 300000 mg/l

Thanks in advance, always excellent
Logged

dlparkhurst

  • Top Contributor
  • Posts: 2823
Re: first steps
« Reply #27 on: March 08, 2023, 03:08:11 PM »
The calculation finds the thermodynamically most stable assemblage. Aragonite and Calcite are both CaCO3. Both may be supersaturated in a solution, but PHREEQC will usually precipitate calcite because when it is in equilibrium with calcite the solution is usually undersaturated with aragonite. Said another way, converting aragonite to calcite minimizes the free energy.

All I will say is that the Pitzer approach is more accurate at high ionic strength than the ion-association models and the SIT approach, and it has been fit to high ionic strengths of electrolyte solutions.
Logged

INZILLO

  • Frequent Contributor
  • Posts: 16
Re: first steps
« Reply #28 on: March 11, 2023, 04:45:56 PM »
Thank you very much.
Always kind
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