Computing aqueous properties

Computing aqueous properties

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

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.setActivityModel(ActivityModelPitzerHMW())

gases = GaseousPhase("CO2(g) H2O(g)")
gases.setActivityModel(ActivityModelPengRobinson())

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.9176 |       |
| pE                                |    -0.5028 |       |
| Eh                                |    -0.0332 |     V |
| Element Molality:                 |            |       |
| :: C                              | 2.1424e-01 | molal |
| :: Na                             | 1.0004e+00 | molal |
| :: Si                             | 2.8155e-04 | molal |
| :: Cl                             | 1.0004e+00 | molal |
| :: Ca                             | 9.9945e-03 | molal |
| Species Molality:                 |            |       |
| :: CO3-2                          | 6.4481e-07 | molal |
| :: H+                             | 1.5051e-05 | molal |
| :: CO2                            | 1.9424e-01 | molal |
| :: (CO2)2                         | 1.0004e-16 | molal |
| :: HCO3-                          | 1.6442e-02 | molal |
| :: CH4                            | 1.0004e-16 | molal |
| :: Ca+2                           | 9.4377e-03 | molal |
| :: CaCO3                          | 3.9717e-07 | molal |
| :: CaHCO3+                        | 5.5643e-04 | molal |
| :: CaOH+                          | 4.6059e-11 | molal |
| :: Cl-                            | 1.0004e+00 | molal |
| :: H2                             | 1.0004e-16 | molal |
| :: H4SiO4                         | 2.8153e-04 | molal |
| :: H2SiO4-2                       | 1.1055e-14 | molal |
| :: H3SiO4-                        | 2.0567e-08 | molal |
| :: Na+                            | 9.9737e-01 | molal |
| :: NaCO3-                         | 7.5617e-06 | molal |
| :: NaHCO3                         | 2.9885e-03 | molal |
| :: OH-                            | 1.3304e-08 | molal |
| :: NaOH                           | 1.0004e-16 | molal |
| :: O2                             | 1.0004e-16 | molal |
| Saturation Indices (log base 10): |            |       |
| :: H2(g)                          |   -10.1580 |     - |
| :: O2(g)                          |   -56.1834 |     - |
| :: CH4(g)                         |   -14.1826 |     - |
| :: H2O(g)                         |     0.0000 |     - |
| :: CO2(g)                         |     0.0000 |     - |
| :: Aragonite :: CaCO3             |    -1.4245 |     - |
| :: Chalcedony :: SiO2             |    -0.3316 |     - |
| :: Halite :: NaCl                 |    -1.9594 |     - |
| :: Calcite :: CaCO3               |    -1.3039 |     - |
| :: Quartz :: SiO2                 |     0.0000 |     - |
| :: SiO2(a)                        |    -1.0599 |     - |
+-----------------------------------+------------+-------+

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.91762
pE                              : -0.502784
Eh                              : -0.0332361 V
IONIC STRENGTH (EFFECTIVE)      : 1.02625 molal
IONIC STRENGTH (STOICHIOMETRIC) : 1.02924 molal
MOLALITY OF ELEMENT C           : 0.21424 molal
MOLALITY OF ELEMENT Ca          : 0.00999453 molal
MOLALITY OF AQUEOUS SPECIES CO2 : 0.194244 molal
MOLALITY OF AQUEOUS SPECIES Na+ : 0.997367 molal

Tip

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