Computing aqueous properties#

Written by Allan Leal (ETH Zurich) on Jan 4th, 2022

Attention

Always make sure you are using the latest version of Reaktoro. Otherwise, some new features documented on this website will not work on your machine and you may receive unintuitive errors. Follow these update instructions to get the latest version of Reaktoro!

If you are interested in aqueous solutions of electrolytes, you are probably wondering why there are no methods in the ChemicalProps class to obtain pH, pE, Eh, ionic strength, molalities, and other aqueous properties.

ChemicalProps is a class that stores general thermodynamic and chemical properties for systems, their phases and species. Reaktoro does not assume that you always have an aqueous phase in your chemical system. So it wouldn’t make sense to have specific aqueous properties on ChemicalProps.

Reaktoro has what you want though: the AqueousProps class. We demonstrate its use below:

from reaktoro import *

db = PhreeqcDatabase("phreeqc.dat")

solution = AqueousPhase(speciate("H O Na Cl C Ca Si"))
solution.set(ActivityModelPhreeqc(db))

gases = GaseousPhase("CO2(g) H2O(g)")
gases.set(ActivityModelPengRobinsonPhreeqcOriginal())

minerals = MineralPhases()

system = ChemicalSystem(db, solution, gases, minerals)

state = ChemicalState(system)
state.temperature(60.0, "celsius")
state.pressure(15.0, "atm")
state.set("H2O"    , 1.0, "kg")
state.set("Na+"    , 1.0, "mol")
state.set("Cl-"    , 1.0, "mol")
state.set("CO2"    , 0.7, "mol")
state.set("Calcite", 1.0, "g")
state.set("Quartz" , 1.0, "g")

equilibrate(state)

aprops = AqueousProps(state)

print(aprops)
+---------------------------------+-------------+-------+
| Property                        |       Value |  Unit |
+---------------------------------+-------------+-------+
| Temperature                     |    333.1500 |     K |
| Pressure                        |     15.1988 |   bar |
| Ionic Strength (Effective)      |      1.0263 | molal |
| Ionic Strength (Stoichiometric) |      1.0292 | molal |
| pH                              |      4.9672 |       |
| pE                              |     -0.5651 |       |
| Eh                              |     -0.0374 |     V |
| Charge Molality                 | -1.9248e-16 | molal |
| Element Molality:               |             |       |
| :: C                            |  2.0389e-01 | molal |
| :: Na                           |  1.0003e+00 | molal |
| :: Si                           |  2.2235e-04 | molal |
| :: Cl                           |  1.0003e+00 | molal |
| :: Ca                           |  9.9941e-03 | molal |
| Species Molality:               |             |       |
| :: CO3-2                        |  4.3269e-07 | molal |
| :: H+                           |  1.4768e-05 | molal |
| :: CO2                          |  1.8001e-01 | molal |
| :: (CO2)2                       |  1.9416e-03 | molal |
| :: HCO3-                        |  1.6590e-02 | molal |
| :: CH4                          |  1.0003e-16 | molal |
| :: Ca+2                         |  9.4207e-03 | molal |
| :: CaCO3                        |  5.2884e-07 | molal |
| :: CaHCO3+                      |  5.7286e-04 | molal |
| :: CaOH+                        |  3.9812e-11 | molal |
| :: Cl-                          |  1.0003e+00 | molal |
| :: H2                           |  1.0003e-16 | molal |
| :: H4SiO4                       |  2.2233e-04 | molal |
| :: H2SiO4-2                     |  2.5663e-15 | molal |
| :: H3SiO4-                      |  1.7851e-08 | molal |
| :: Na+                          |  9.9748e-01 | molal |
| :: NaCO3-                       |  5.8529e-06 | molal |
| :: NaHCO3                       |  2.8267e-03 | molal |
| :: OH-                          |  1.5597e-08 | molal |
| :: NaOH                         |  1.0003e-16 | molal |
| :: O2                           |  1.0003e-16 | molal |
| Saturation Indices:             |             |       |
| :: CH4(g)                       |    -14.0800 |     - |
| :: CO2(g)                       |      0.0000 |     - |
| :: H2(g)                        |    -10.1324 |     - |
| :: H2O(g)                       |      0.0000 |     - |
| :: O2(g)                        |    -56.2345 |     - |
| :: Aragonite :: CaCO3           |     -1.1975 |     - |
| :: Calcite :: CaCO3             |     -0.9592 |     - |
| :: Chalcedony :: SiO2           |     -0.3316 |     - |
| :: Halite :: NaCl               |     -1.9764 |     - |
| :: Quartz :: SiO2               |      0.0000 |     - |
| :: SiO2(a)                      |     -1.0599 |     - |
| Saturation Ratios:              |             |       |
| :: CH4(g)                       |  8.3173e-15 |     - |
| :: CO2(g)                       |  1.0000e+00 |     - |
| :: H2(g)                        |  7.3718e-11 |     - |
| :: H2O(g)                       |  1.0000e+00 |     - |
| :: O2(g)                        |  5.8283e-57 |     - |
| :: Aragonite :: CaCO3           |  6.3461e-02 |     - |
| :: Calcite :: CaCO3             |  1.0986e-01 |     - |
| :: Chalcedony :: SiO2           |  4.6607e-01 |     - |
| :: Halite :: NaCl               |  1.0558e-02 |     - |
| :: Quartz :: SiO2               |  1.0000e+00 |     - |
| :: SiO2(a)                      |  8.7114e-02 |     - |
+---------------------------------+-------------+-------+

Let’s now use some methods from class AqueousProps to retrieve some specific aqueous properties:

print("pH                              :", aprops.pH())
print("pE                              :", aprops.pE())
print("Eh                              :", aprops.Eh()                         , "V")
print("IONIC STRENGTH (EFFECTIVE)      :", aprops.ionicStrengthEffective()     , "molal")
print("IONIC STRENGTH (STOICHIOMETRIC) :", aprops.ionicStrengthStoichiometric(), "molal")
print("MOLALITY OF ELEMENT C           :", aprops.elementMolality("C")         , "molal")
print("MOLALITY OF ELEMENT Ca          :", aprops.elementMolality("Ca")        , "molal")
print("MOLALITY OF AQUEOUS SPECIES CO2 :", aprops.speciesMolality("CO2")       , "molal")
print("MOLALITY OF AQUEOUS SPECIES Na+ :", aprops.speciesMolality("Na+")       , "molal")
pH                              : 4.96716
pE                              : -0.565128
Eh                              : -0.0373573 V
IONIC STRENGTH (EFFECTIVE)      : 1.02633 molal
IONIC STRENGTH (STOICHIOMETRIC) : 1.02916 molal
MOLALITY OF ELEMENT C           : 0.203888 molal
MOLALITY OF ELEMENT Ca          : 0.00999407 molal
MOLALITY OF AQUEOUS SPECIES CO2 : 0.180009 molal
MOLALITY OF AQUEOUS SPECIES Na+ : 0.997485 molal

Tip

Access the link AqueousProps to find out all methods available in class AqueousProps to get the exact data you need!