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 »
  • Dissolution and precipitation »
  • formation water
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: formation water  (Read 4462 times)

ehsan

  • Top Contributor
  • Posts: 41
formation water
« on: 25/07/21 16:04 »
hello dears
How do I simulate a water formation in which my solution is non-electrolyte?
Code: [Select]
PHASES
     H2S(g)
     H2S  =  H+ + HS-
     log_k    -7.97
     -delta_h   9.1
     # -analytic -9.7354e+001 -3.1576e-002 1.8285e+003 3.7440e+001 2.8560e+001
     -T_c  373.2
     -P_c  88.2
     #-Omega 0.1
     SELECTED_OUTPUT 2; -file  output; -reset  false
     USER_PUNCH 2
     10 s$ = s$ + STR$(PR_PHI("H2S(g)")) + STR$(GAMMA("HS-"))  + STR$(GAMMA("H2S")) + STR$(tot("S(-2)"))  + STR$(SI("H2S(g)"))
     20 PUNCH s$
     SOLUTION 1
     -temp 50
     -units mg/l
     Ca 4454.5163
     Mg 1534.8663
     Na 10203.8046
     K  1398.1534
     Cl 38452.7359
     S(-2)     1    H2S(g) 0
     SELECTED_OUTPUT 1; -reset false; -file H2S_50
     USER_PUNCH 1
     1 i = 75.1267
     10 s$ = s$ + 'USE solution 1' + EOL$
     20 s$ = s$ + 'EQUILIBRIUM_PHASES 1'+ EOL$
     30 s$ = s$ + 'H2S(g)'+ STR$(LOG10(i))+' 10 '+ EOL$
     40 s$ = s$ +'END'+ EOL$
     50 PUNCH s$
     END
     SELECTED_OUTPUT 1; -active false
     INCLUDE$ H2S_50
     END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #1 on: 25/07/21 20:03 »
I have no idea what your question is; PHREEQC only applies to aqueous solutions. The SOLUTION definition is an aqueous solution composed mostly of ions (electrolytes). H2S(aq) is an uncharged aqueous species, which in ion-association models (phreeqc.dat) is often assigned an ionic-strength dependent activity coefficient. By default it is 0.1*Ionic_strength, but the coefficient can be assigned in a SOLUTION_SPECIES definition.
« Last Edit: 26/07/21 15:27 by dlparkhurst »
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #2 on: 26/07/21 05:50 »
excuse me sir
Ca 4454.5163
Mg 1534.8663
Na 10203.8046
K  1398.1534
Cl 38452.7359
These are hypothetical values.
When I solved these ions in water, does the solution charge? If the solution becomes charged, how can I neutralize it?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #3 on: 26/07/21 15:47 »
If you run the following script

Code: [Select]
SOLUTION
-units ppm
Ca 4454.5163
Mg 1534.8663
Na 10203.8046
K  1398.1534
Cl 38452.7359
END

The output file will give the charge imbalance of the solution, calculated by summing z(i)*m(i) over all aqueous species, where z(i) is the charge on the species and m(i) is the molality. The equation for percent error is shown below.

Code: [Select]
                  Electrical balance (eq)  =  -2.717e-01
 Percent error, 100*(Cat-|An|)/(Cat+|An|)  = -14.20


If you do not charge balance the solution, then PHREEQC will carry the charge imbalance through the calculations as if some inert ion were present. Accounting for the charge imbalance is necessary because a charge-balance equation is included in the set of equations that is used to solve every reaction calculation.

You can charge balance the solution by specifying "charge" for an element or pH; the concentration or pH will be adjusted to produce a charge-balanced solution. For example,

Code: [Select]
Cl 38452.7359 charge

will change the Cl concentration from 1.149e+00 to 8.774e-01 mol/kgw to produce very small values for the "Electrical balance" and "Percent error".
Logged

ehsan

  • Top Contributor
  • Posts: 41
co2 equilibrium
« Reply #4 on: 21/08/21 17:53 »
hello dear
excuse me
i have a problem
why my code doesn't accurate result
Code: [Select]
PHASES
CO2(g)
     CO2=CO2
log_k -1.468
-T_c  304.2
-P_c   72.86
-Omega 0.2236
-analytic   10.5624  -2.3547e-2  -3972.8  0  5.8746e5  1.9194e-5
PRINT; -reset false
SOLUTION 1
SELECTED_OUTPUT; -reset false; -file co2_50.prn
USER_PUNCH
  1 sc$ = chr$(59)
 10 for i = 1.1 to 520 step 20
 20   punch 'SOLUTION 1' + sc$ + ' -temp 50' + sc$ + '-pressure ' + str$(i) + EOL$ + 'EQUILIBRIUM_PHASES' + sc$ + 'Calcite 1' + sc$ + ' CO2(g) ' + str$(log10(i)) + EOL$ + 'END' + EOL$
 30 next i
END


PRINT; -reset false; -echo_input true; -selected_out false
USER_GRAPH
 -chart_title "Using: EQUILIBRIUM_PHASES"
 -plot_csv_file CO2_CaCl2_measurement_1MOL_CaCl2.tsv
 -axis_titles "Pressure / atm" "CO2 / (mol/kgw)"
 -axis_scale x_axis 0 500
 -axis_scale y_axis 0 2
 10 x = PR_P("CO2(g)")
 20 graph_x x
 30 graph_y tot("C(4)")
 -end
INCLUDE$ co2_50.prn
END

SOLUTION
PRINT; -selected_out true
SELECTED_OUTPUT; file co2_100.prn
USER_PUNCH
  1 sc$ = chr$(59)
 10 for i = 1.1 to 520 step 20
 20   punch 'SOLUTION 1' + sc$ ' -temp 100' + sc$ + '-pressure ' + str$(i) + EOL$ + 'EQUILIBRIUM_PHASES' + sc$ + 'Calcite 1' + sc$ + ' CO2(g) ' + str$(log10(i)) + EOL$ + 'END' + EOL$
 30 next i
USER_GRAPH
 -connect_simulations false
END

PRINT; -selected_out false
SELECTED_OUTPUT
USER_GRAPH
 -connect_simulations true
INCLUDE$ co2_100.prn
END

SOLUTION
PRINT; -selected_out true
SELECTED_OUTPUT; file co2_150.prn
USER_PUNCH
  1 sc$ = chr$(59)
 10 for i = 1.1 to 520 step 20
 20   punch 'SOLUTION 1' + sc$ + ' -temp 150' + sc$ + '-pressure ' + str$(i) + EOL$ + 'EQUILIBRIUM_PHASES' + sc$ + 'Calcite 1' + sc$ + ' CO2(g) ' + str$(log10(i)) + EOL$ + 'END' + EOL$
 30 next i
USER_GRAPH
 -connect_simulations false
END

PRINT; -selected_out false
SELECTED_OUTPUT
USER_GRAPH
 -connect_simulations true
INCLUDE$ co2_150.prn
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #5 on: 21/08/21 20:51 »
I am pretty sure you are using the wrong solutions. Your solution is pure water reacting with EQUILIBRIUM_PHASES, and your EQUILIBRIUM_PHASES are defined as

Code: [Select]
EQUILIBRIUM_PHASES
Calcite 1 10
CO2(g) p 10

where p is the log10 pressure of CO2(g). So, there are 10 moles of calcite and 10 moles of CO2 that are available to react. The resulting solutions have the correct CO2(g) partial pressure, but the Ca concentration is variable, and probably less than 0.1 mol/kgw. The saturation index for calcite will be 1, or 10 times supersaturated. The Cl concentration is 0.

Please do not set "PRINT; -reset false", especially if you do not understand the results. Look at the output!

I believe your data is for solutions of 1 mol/kgw CaCl2, for which this would be the appropriate definition for 50 C:

Code: [Select]
USER_PUNCH 1
 1 sc$ = chr$(59)
10 for i = 1.1 to 520 step 20
20 s$ = s$ + "SOLUTION 1" + sc$ + ' -temp 50' + sc$ + '-pressure ' + str$(i) + EOL$
30 s$ = s$ + "-units mol/kgw" + sc$ + "Ca 1" + sc$ + "Cl 2" + EOL$
40 s$ = s$ + 'EQUILIBRIUM_PHASES' + sc$ + ' CO2(g) ' + str$(log10(i)) + EOL$ 
50 s$ = s$ + 'END' + EOL$
60 next i
70 PUNCH s$
END

I believe calcite will always be undersaturated in these simulations, so it does not need to be included in EQUILIBRIUM_PHASES, but you could add the following line to the EQUILIBRIUM_PHASES definition to allow calcite to precipitate if it is supersaturated:

Code: [Select]
Calcite 0 0
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #6 on: 22/08/21 22:06 »
thanks Dr. David
and I have a question.
I am working on a project to dissolve carbon dioxide in groundwater and my code is as follows.
I wanted to know if I did the steps correctly or not?
Code: [Select]
SOLUTION 1
     -pressure 325.8895
     -temp 135.8688
     -units mol/kgw
     Ca 0.082207
     Mg 0.0068278
     Cl 0.17807
EQUILIBRIUM_PHASES 1
    Sylvite   0 1
    Halite    0 1
SAVE solution 1
SELECTED_OUTPUT 2; -file  output; -reset  false;-pH  true;-pe  true;-ionic_strength  true
USER_PUNCH 2
     10 s$ = s$ + STR$(PR_PHI("CO2(g)")) + STR$(GAMMA("HCO3-")) + STR$(GAMMA("CO2")) + STR$(tot("C(4)"))
     20 PUNCH s$
PHASES
     CO2(g)
     CO2 = CO2
     -log_k -1.468
     -delta_h -4.776 kcal
     -analytic   10.5624  -2.3547e-2  -3972.8  0  5.8746e5  1.9194e-5
     -T_c  304.2 # critical T, K
     -P_c   72.86 # critical P, atm
SELECTED_OUTPUT 1; -reset false; -file CO2_50
USER_PUNCH 1
     1 i  = 325.8895
     10 s$ = s$ + 'USE solution 1' + EOL$
     20 s$ = s$ + 'EQUILIBRIUM_PHASES 1'+ EOL$
     30 s$ = s$ + 'CO2(g) '+ STR$(LOG10(i))+' 10 '+ EOL$
     40 s$ = s$ + 'END'+ EOL$
     50 PUNCH s$
END
SELECTED_OUTPUT 1; -active false
INCLUDE$ CO2_50
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #7 on: 23/08/21 00:14 »
You will have to decide whether you did it correctly because I do not know what you are trying to do. Don't forget to look at the output.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #8 on: 20/09/21 07:47 »
Hi dears
I have a question
How can to use mole fraction feature in the phreeqc app?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #9 on: 21/09/21 01:21 »
You are not giving any context. The most obvious use of mole fractions is MIX. Check out the manual.

The same mixing formulation is also available with SOLUTION_MIX, EQUILIBRIUM_PHASES_MIX, SURFACE_MIX, etc.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #10 on: 25/09/21 10:01 »
excuse me Dr.
I want mole fraction for output result
for example I need solubility CO2 mole fraction in water for output result.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #11 on: 25/09/21 16:14 »
Mole fraction of CO2 relative to what? Water, other gases, all moles in solution? Moles of CO2 per moles of all solutes and water does not seem a very useful quantity.

You need to use SELECTED_OUTPUT and USER_PUNCH, or USER_PRINT to calculate the quantity that you want. See the section on the Basic Interpreter in the manual for functions that will help. For example, MOL("CO2") is the concentration of CO2(aq) in moles per kilogram water.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #12 on: 26/09/21 11:41 »
for all moles in solution
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #13 on: 26/09/21 17:26 »
Look at SYS.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #14 on: 28/09/21 09:31 »
thanks Dr.

I have another question,
Which part can I change the constants of Henry's law in the phreeqc keyword?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #15 on: 28/09/21 14:56 »
Which keyword do you think?
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #16 on: 30/09/21 07:31 »
I don't know Dr.
I want to change the henry law constant but i don't know where i can change it? if use henry law for gas solubility in water

This part of output, How is it calculated? (co2 in gas phase)
Code: [Select]
CO2             8.888e-01   1.202e+00    -0.051     0.080     0.131     41.09
« Last Edit: 30/09/21 07:41 by ehsan »
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #17 on: 30/09/21 14:53 »
You should reread this thread of the forum.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #18 on: 30/09/21 17:53 »
The answer to your Henry's law question is in this thread.

Your last post that gives a single line without context is only related to the Henry's law constant if CO2(g) is in EQUILIBRIUM_PHASES. On closer inspection, it comes from the Distribution of Species, so it is giving concentration and activity information about CO2(aq), not CO2(g).
« Last Edit: 30/09/21 17:58 by dlparkhurst »
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #19 on: 01/10/21 14:07 »
I understood your explanation, but my question is that when CO2 Will be solved in water, a little of them Soluble molecularly so this dissolution is calculated with henry's law, then i want to change the henry's constant.
Which keyword or part of keyword is related to Henry's law that i change its henry's constant?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #20 on: 01/10/21 15:33 »
It is in the code of this thread. What do you think the value of the Henry's law constant should be? Find code that has a similar number. Searching the database for CO2 might be an idea. Reading the manual would be a remote possibility.
« Last Edit: 01/10/21 15:43 by dlparkhurst »
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #21 on: 09/10/21 09:04 »
Hello Dr.
I have a suggestion for SOLUTION_SPECIES keyword in part of -analytical ( for phreeqc database), When I use that amount, prediction of solubility H2S in water and brine be better
Code: [Select]
-analytical  -11.17  0.02386  3271.0
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #22 on: 09/10/21 18:32 »
I do not have a doctorate, so no Dr. please.

The latest phreeqc.dat and Amm.dat databases have the following definition for H2S

Code: [Select]
HS- + H+ = H2S
-log_k 6.994
-delta_h -5.30 kcal
-analytical  -11.17  0.02386  3279.0
-dw 2.1e-9
        -Vm  1.39  28.3  0  -7.22  -0.59 # ref. 1 + Hnedkovsky et al., 1996, JCT 28, 125

I don't see how a fourth significant figure change of one coefficient of the analytical expression to the following

Code: [Select]
-analytical  -11.17  0.02386  3271.0

makes a significant difference.

If you publish a paper on solubility, then we would consider your results, but we are not going to change the database based on an undocumented forum post. You are welcome to use whatever data you deem reasonable, but you would need to document and justify it in any publication.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #23 on: 11/10/21 11:19 »
When I use this parameter for 2 papers, the result is better
These are paper
https://doi.org/10.1021/ef070040p
https://doi.org/10.1016/j.chemgeo.2020.119816

and my code is
Code: [Select]
PHASES
SOLUTION_SPECIES
HS- + H+ = H2S
-analytical  -11.17  0.02386  3271.0
USER_GRAPH
    -plot_csv_file Experiment_H2S_NaCl_1.csv
    -axis_titles "Pressure / atm" "H2S / (mol/kgw)" " phi_H2S"
    -axis_scale x_axis aoto auto
    -initial_solutions true
   -start
    10 x = PR_P("H2S(g)")
    20 graph_x x # tot("Na")
    30 graph_y tot("S(-2)")
    40 graph_sy PR_phi("H2S(g)") #mol("H2S") / tot("S")
   -end
SOLUTION 1
    temp      30
    units     mol/kgw
    Cl        1
    Na        1
 SELECTED_OUTPUT 2; -file  output; -reset  false
USER_PUNCH 1
    10 FOR i = 1.1 TO 220 STEP 5 # {do something} NEXT i i = 1.1 to 220 step 5
    20 s$ = s$ + 'USE solution 1' + EOL$
    30 s$ = s$ + 'EQUILIBRIUM_PHASES 1' + EOL$
    40 s$ = s$ + 'H2S(g) ' + STR$(LOG10(i)) + ' 10' +  EOL$
    50 s$ = s$ + 'END' + EOL$
    60 NEXT i
    70 PUNCH s$
END
SELECTED_OUTPUT 1; -active false
INCLUDE$ H2S_30.PRN
END
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #24 on: 11/10/21 19:04 »
I am sure the data from Jiang were used in fitting the log Ks in the databases phreeqc.dat and Amm.dat. I suspect the difference is that the fit included all temperatures and pressures. Did you fit only one pressure? I am sure you could get a better fit with slightly different parameters  if the data were restricted to a single pressure. Even so, the solubilities are the same with either set of parameters.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #25 on: 12/10/21 09:13 »
I'm sure the phreeqc parameters are good and you are very helpful to me and thank you very much for your guidance.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #26 on: 12/10/21 17:00 »
Here are files that simulate the entire Jiang, 2020 data set. The "Amm" refers to Amm.dat, but it should be the same with phreeqc.dat.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #27 on: 17/10/21 13:03 »
Thanks Mr. David
i have a question
Carbon dioxide gamma in the formula in the Attachment image to calculate the equilibrium constant in the dissolution of carbon dioxide in brine and pure water How to calculate in Phreeqc?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #28 on: 17/10/21 17:47 »
Time to learn to use the manual; you are making me peckish. SOLUTION_SPECIES or PITZER.
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #29 on: 18/10/21 07:17 »
I'm sorry, I do not mean to upset you. I explained solution_spacies to my teacher, but he said that the formula was not in it.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #30 on: 18/10/21 16:02 »
Distrust authority. It most certainly is in the manual.

Line 5 in the SOLUTION_SPECIES description is -gamma. The explanation for line 5 in the manual gives the formulas for activity coefficient equations for ion-association models.

Two parameters can be defined: a and b. a has no effect when z = 0, so the equation for an uncharged species is

Code: [Select]
log10(gamma) = b*I

where gamma is activity coefficient and I is ionic strength. By default b = 0.1 for uncharged species.

Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #31 on: 19/10/21 16:25 »
thanks a lot Mr. David
You are right, I had misunderstood it, Now I read carefully and realized.
« Last Edit: 19/10/21 16:29 by ehsan »
Logged

ehsan

  • Top Contributor
  • Posts: 41
Re: formation water
« Reply #32 on: 05/11/21 08:54 »
Hi David
How is the binary interaction(Kij) for mixture of multi-component entered in the PHREEQC?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4072
Re: formation water
« Reply #33 on: 05/11/21 14:43 »
There are a few binary parameters for gases (is this what you are talking about?) hard-coded in the method calc_PR, which I have already posted and I assume you have studied.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Processes »
  • Dissolution and precipitation »
  • formation water
 

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