Skip to content

PHREEQC-v3.8 to v-3.7#3

Open
SuixiongTay wants to merge 1 commit into
mainfrom
phreeqc3.8-to-3.7
Open

PHREEQC-v3.8 to v-3.7#3
SuixiongTay wants to merge 1 commit into
mainfrom
phreeqc3.8-to-3.7

Conversation

@SuixiongTay
Copy link
Copy Markdown
Collaborator

@SuixiongTay SuixiongTay commented Feb 11, 2026

Description

  • Left (red color): PHREEQC-v3.7
  • Right (green color): PHREEQC-v3.8

@SuixiongTay SuixiongTay changed the title phreeqc3.8to3.7 PHREEQC-v3.8 to v-3.7 Feb 11, 2026
Copy link
Copy Markdown

@rkingsbury rkingsbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks both for putting this together. I assume the right side (green) is v3.8?

Anyway, I went through the diff quickly and just highlighted some differences that I noticed. In general, the right version seems to have introduced a new method of calculating viscosity, and added some parameters for that. Also, I noticed that some of the log K values for aqueous complexes like NaSO4- changed.

Interestingly, I can't seem to find NaCl(aq) anywhere in either file. The native engine with our phreeqpython wrapper predicted a little bit of NaCl ion pairing, but I just realized that's because the native version uses llnl.dat by default. If instead I use the phreeqc engine, which uses phreeqc.dat:

from pyEQL import Solution
>>> s1 = Solution({"Na+": 0.5, "Cl-": 0.5}, units="mol/L")
>>> s1 = Solution({"Na+": 0.5, "Cl-": 0.5}, engine='phreeqc')
>>> s1.equilibrate()
>>> s1.components
{'H2O(aq)': 55.34457593619076, 'Na[+1]': 21.684602829814455, 'Cl[-1]': 14.061546723432981, 'H[+1]': 1.4403500703847783e-07, 'OH[-1]': 9.196276962193604e-08, 'NaOH(aq)': 1.935707352229342e-17, 'O2(aq)': 2.038896481967645e-27, 'H2(aq)': 1.1379335332851315e-36}

Then there is no NaCl(aq)

Based on this, I don't see any reason not to use the latest (3.8, or right hand side) phreeqc.dat. I don't know the motivations behind all of the changes, but I trust the PHREEQC developers, and in any case our job in pyEQL is mainly to provide a faithful representation of PHREEQC output.

Comment thread phreeqc_new.dat
Comment on lines +1192 to +1193
NaCl = Cl- + Na+
log_k 1.57
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both versions have the same Ksp for NaCl(s)

Comment thread phreeqc_new.dat
Comment on lines 90 to +98
Na+ = Na+
-gamma 4.0 0.075
-gamma 4.08 0.082 # halite solubility
-dw 1.33e-9 122 1.52 3.70
-Vm 2.28 -4.38 -4.1 -0.586 0.09 4 0.3 52 -3.33e-3 0.566 # ref. 1
# for calculating densities (rho) when I > 3...
# -Vm 2.28 -4.38 -4.1 -0.586 0.09 4 0.3 52 -3.33e-3 0.45
-gamma 4 0.075
-gamma 4.08 0.082 # halite solubility
-Vm 2.28 -4.38 -4.1 -0.586 0.09 4 0.3 52 -3.33e-3 0.566
# -Vm 2.28 -4.38 -4.1 -0.586 0.09 4 0.3 52 -3.33e-3 0.45 # for densities (rho) when I > 3.
-viscosity 0.1387 -8.66e-2 1.25e-2 1.45e-2 7.5e-3 1.062
-dw 1.33e-9 75 3.627 0 0.7037
K+ = K+
-gamma 3.5 0.015
-dw 1.96e-9 395 2.5 21
-Vm 3.322 -1.473 6.534 -2.712 9.06e-2 3.5 0 29.7 0 1 # ref. 1
-gamma 3.5 0.015
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Na+ and K+ Vm parameters look; just reorganized, dw values changes and viscosity terms were added

Comment thread phreeqc_new.dat
Comment on lines 138 to +143
Cl- = Cl-
-gamma 3.5 0.015
-gamma 3.63 0.017 # cf. pitzer.dat
-dw 2.03e-9 194 1.6 6.9
-Vm 4.465 4.801 4.325 -2.847 1.748 0 -0.331 20.16 0 1 # ref. 1
-gamma 3.5 0.015
-gamma 3.63 0.017 # cf. pitzer.dat
-Vm 4.465 4.801 4.325 -2.847 1.748 0 -0.331 20.16 0 1
-viscosity 0 0 0 0 0 0 1 # the reference solute
-dw 2.033e-9 216 3.16 0.2071 0.7432
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here; Vm same, dw modified a bit, viscosity added

Comment thread phreeqc_new.dat
Comment on lines -411 to -415
Na+ + CO3-2 = NaCO3-
-log_k 1.27
-delta_h 8.91 kcal
-dw 1.2e-9 0 1e-10 1e-10
-Vm 3.89 -8.23e-4 20 -9.44 3.02 9.05e-3 3.07 0 0.0233 1 # ref. 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that this complexed species seems to have been removed

Comment thread phreeqc_new.dat
Comment on lines +102 to +111
Mg+2 = Mg+2
-gamma 5.5 0.2
-Vm -1.41 -8.6 11.13 -2.39 1.332 5.5 1.29 -32.9 -5.86e-3 1
-viscosity 0.426 0 0 1.66e-3 4.32e-3 2.461
-dw 0.705e-9 -4 5.569 0 1.047
Ca+2 = Ca+2
-gamma 5 0.165
-Vm -0.3456 -7.252 6.149 -2.479 1.239 5 1.6 -57.1 -6.12e-3 1
-viscosity 0.359 -0.158 4.2e-2 1.5e-3 8.04e-3 2.3 # ref. 4, CaCl2 < 6 M
-dw 0.792e-9 34 5.411 0 1.046
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for Mg and Ca - they are now sorted differently, Vm just reorganized, dw parameters updated and viscosity added

Comment thread phreeqc_new.dat
Comment on lines +1583 to 1605
MEAN_GAMMAS
CaCl2 Ca+2 1 Cl- 2
CaSO4 Ca+2 1 SO4-2 1
CaCO3 Ca+2 1 CO3-2 1
Ca(OH)2 Ca+2 1 OH- 2
MgCl2 Mg+2 1 Cl- 2
MgSO4 Mg+2 1 SO4-2 1
MgCO3 Mg+2 1 CO3-2 1
Mg(OH)2 Mg+2 1 OH- 2
NaCl Na+ 1 Cl- 1
Na2SO4 Na+ 2 SO4-2 1
NaHCO3 Na+ 1 HCO3- 1
Na2CO3 Na+ 2 CO3-2 1
NaOH Na+ 1 OH- 1
KCl K+ 1 Cl- 1
K2SO4 K+ 2 SO4-2 1
HCO3 K+ 1 HCO3- 1
K2CO3 K+ 2 CO3-2 1
KOH K+ 1 OH- 1
HCl H+ 1 Cl- 1
H2SO4 H+ 2 SO4-2 1
HBr H+ 1 Br- 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a new section. I don't know exactly what it does, but assuming GAMMA is activity coefficient, I'm guessing this defines the stoichiometry for how to calculate mean ionic activity coefficient.

Comment thread phreeqc_new.dat
Comment on lines +1925 to +1963
# but are overwritten by the data block GAS_BINARY_PARAMETERS of this file.
# =============================================================================================
# The molar volumes of solids are entered with
# -Vm vm cm3/mol
# -Vm vm cm3/mol
# vm is the molar volume, cm3/mol (default), but dm3/mol and m3/mol are permitted.
# Data for minerals' vm (= MW (g/mol) / rho (g/cm3)) are defined using rho from
# Deer, Howie and Zussman, The rock-forming minerals, Longman.
# --------------------
# --------------------
# Temperature- and pressure-dependent volumina of aqueous species are calculated with a Redlich-
# type equation (cf. Redlich and Meyer, Chem. Rev. 64, 221), from parameters entered with
# -Vm a1 a2 a3 a4 W a0 i1 i2 i3 i4
# -Vm a1 a2 a3 a4 W a0 i1 i2 i3 i4
# The volume (cm3/mol) is
# Vm(T, pb, I) = 41.84 * (a1 * 0.1 + a2 * 100 / (2600 + pb) + a3 / (T - 228) +
# a4 * 1e4 / (2600 + pb) / (T - 228) - W * QBrn)
# + z^2 / 2 * Av * f(I^0.5)
# + (i1 + i2 / (T - 228) + i3 * (T - 228)) * I^i4
# a4 * 1e4 / (2600 + pb) / (T - 228) - W * QBrn)
# + z^2 / 2 * Av * f(I^0.5)
# + (i1 + i2 / (T - 228) + i3 * (T - 228)) * I^i4
# Volumina at I = 0 are obtained using supcrt92 formulas (Johnson et al., 1992, CG 18, 899).
# 41.84 transforms cal/bar/mol into cm3/mol.
# pb is pressure in bar.
# W * QBrn is the energy of solvation, calculated from W and the pressure dependence of the Born equation,
# W is fitted on measured solution densities.
# W is fitted on measured solution densities.
# z is charge of the solute species.
# Av is the Debye-Hückel limiting slope (DH_AV in PHREEQC basic).
# a0 is the ion-size parameter in the extended Debye-Hückel equation:
# f(I^0.5) = I^0.5 / (1 + a0 * DH_B * I^0.5),
# a0 = -gamma x for cations, = 0 for anions.
# f(I^0.5) = I^0.5 / (1 + a0 * DH_B * I^0.5),
# a0 = -gamma x for cations, = 0 for anions.
# For details, consult ref. 1.
# =============================================================================================
# The viscosity is calculated with a (modified) Jones-Dole equation:
# viscos / viscos_0 = 1 + A * Sum(0.5 z_i m_i) + fan * Sum(B_i m_i + D_i m_i n_i)
# Parameters are for calculating the B and D terms:
# -viscosity 9.35e-2 -8.31e-2 2.487e-2 4.49e-4 2.01e-2 1.570 0
# # b0 b1 b2 d1 d2 d3 tan
# z_i is absolute charge number, m_i is molality of i
# B_i = b0 + b1 exp(-b2 * tc)
# fan = (2 - tan V_i / V_Cl-), corrects for the volume of anions
# D_i = d1 * exp(-d2 tc)
# n_i = (I^d3 * (1 + fI) + ((z_i^2 + z_i) / 2 · m_i)^d3) / (2 + fI), fI is an ionic strength term.
# For details, consult ref. 4.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are useful details for explaining how molar volume and viscosity are calculated. The viscosity eq. appears to be new (ref 4)

Comment thread phreeqc_new.dat
Comment on lines 453 to +465
Na+ + HCO3- = NaHCO3
-log_k -0.25
-delta_h -1 kcal
-log_k -0.06; -delta_h 21 kJ
-gamma 0 0.2
-Vm 7.95 0 0 0 0.609
-viscosity -4e-2 -2.717 1.67e-5
-dw 6.73e-10
-Vm 0.431 # ref. 1
Na+ + SO4-2 = NaSO4-
-log_k 0.7
-delta_h 1.120 kcal
-gamma 5.4 0
-dw 1.33e-9 0 0.57 1e-10
-Vm 1e-5 16.4 -0.0678 -1.05 4.14 0 6.86 0 0.0242 0.53 # ref. 1
-gamma 5.5 0
-log_k 0.6; -delta_h -14.4 kJ
-analytical_expression 255.903 0.10057 0 -1.11138e2 -8.5983e5 # mirabilite/thenardite solubilities, 0 - 200 oC
-Vm 1.99 -10.78 21.88 -12.7 1.601 5 32.38 501 1.565e-2 0.2325
-viscosity 0.2 -5.93e-2 -4e-4 8.46e-3 1.78e-3 2.308 -0.208
-dw 1.13e-9 -23 8.5 0.392 0.521
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log K for both of these aqueous complexes has changed

Comment thread phreeqc_new.dat
Comment on lines +472 to +484
-Vm 2.7483 -1.0708 6.1709 -2.7347 -.03 # supcrt
K+ + HCO3- = KHCO3
-log_k -0.35; -delta_h 12 kJ
-gamma 0 9.4e-3
-Vm 9.48 0 0 0 -0.542
-viscosity 0.7 -1.289 9e-2
K+ + SO4-2 = KSO4-
-log_k 0.85
-delta_h 2.250 kcal
-analytical 3.106 0.0 -673.6
-gamma 5.4 0
-dw 1.5e-9 0 1e-10 1e10
-Vm 6.8 7.06 3.0 -2.07 1.1 0 0 0 0 1 # ref. 1
-gamma 5.4 0.19
-log_k 0.6; -delta_h -10.4 kJ
-analytical_expression -3.0246 9.986e-3 0 0 1.093e5 # arcanite solubility, 0 - 200 oC
-Vm 13.48 -18.03 61.74 -19.6 2.046 5.4 -17.32 0 0.1522 1.919
-viscosity -1 1.06 1e-4 -0.464 3.78e-2 0.539 -0.69
-dw 0.9e-9 63 8.48 0 1.8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These too

Comment thread phreeqc_new.dat
Comment on lines +227 to +232
-dw 5.13e-9
H+ + Cl- = HCl
-log_k -0.5
-analytical_expression 0.334 -2.684e-3 1.015 # from Pitzer.dat, up to 15 M HCl, 0 - 50°C
-gamma 0 0.4256
-viscosity 0.921 -0.765 8.32e-3 8.25e-4 2.53e-3 4.223
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have HCl(aq) complex, which I don't see in the older (left) version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants